diff --git a/common/character_interactions/00_adoption.txt b/common/character_interactions/00_adoption.txt new file mode 100644 index 00000000..9c70ee27 --- /dev/null +++ b/common/character_interactions/00_adoption.txt @@ -0,0 +1,828 @@ +#Interactions relating to the head of the dynasty + +adopt_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + interface_priority = 60 + + desc = adopt_interaction_desc + use_diplomatic_range = yes + + is_shown = { + OR = { + # Cultures that default with this tradition should still be able to adopt + scope:actor.culture = { has_cultural_parameter = allows_adoption } + NOT = { + has_game_rule = no_adoption + } + } + NOT = { + scope:recipient = scope:actor + } + scope:actor = { + is_adult = yes + OR = { + # Compassionate people like adopting + has_trait = compassionate + # Game rule as an overriding factor + has_game_rule = adoption_always_allowed + # You have no kids and your fertility is low + AND = { + any_child = { + count < 1 + } + fertility <= low_fertility + } + # You are married to a same-sex partner + AND = { + is_married = yes + # People in bisexual polygamous spheres are not valid for this + NOT = { + OR = { + AND = { + any_consort = { + is_female = yes + } + is_male = yes + } + AND = { + any_consort = { + is_male = yes + } + is_female = yes + } + } + } + } + # You are unmarried and uninterested in having biological children + AND = { + is_married = no + OR = { + has_sexuality = asexual + has_sexuality = homosexual + } + } + # You have a cultrad that lets you adopt + culture = { has_cultural_parameter = allows_adoption } + } + OR = { + # You are unmarried + is_married = no + # You are the dominant partner in at least one of your marriages + AND = { + is_female = yes + matrilinear_marriage = yes + } + AND = { + is_male = yes + matrilinear_marriage = no + } + # Your marriage is same-sex + NOT = { + OR = { + AND = { + any_consort = { + is_female = yes + } + is_male = yes + } + AND = { + any_consort = { + is_male = yes + } + is_female = yes + } + } + } + } + } + scope:recipient = { + # Children only + is_adult = no + # Landless only (ruler used to catch edge-cases of landless HoF children) + is_ruler = no + # Don't get imprisoned children and so on + is_available = yes + # None of their close relatives are rulers + NOT = { + any_close_or_extended_family_member = { is_ruler = yes } + } + # They don't already belong to your house + NOT = { house = scope:actor.house } + # Don't adopt your own grandkids + NOT = { + any_ancestor = { + this = scope:actor + } + } + # Don't steal the King of France's great nephew + NOT = { + any_liege_or_above = { + prev.dynasty = dynasty + } + } + } + } + + is_valid = {} + + is_valid_showing_failures_only = {} + + 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 + scope:recipient.top_liege = scope:actor.top_liege + } + flag = influence_send_option + localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE + } + send_options_exclusive = no + + on_accept = { + show_as_tooltip = { + adopt_effect = { + CHILD = scope:recipient + ADOPTER = scope:actor + } + } + hidden_effect = { + scope:actor = { trigger_event = adoption.0001 } + } + } + + cost = { + renown = { + value = { + add = medium_dynasty_prestige_value + if = { # Free for free adoption + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + if = { # Free for same-sex couples + limit = { + scope:actor = { + OR = { + AND = { + any_consort = { + is_female = yes + } + is_female = yes + } + AND = { + any_consort = { + is_male = yes + } + is_male = yes + } + } + } + } + multiply = 0 + } + } + } + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + } + } + piety = { + value = { + add = medium_piety_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + # No piety cost for adopting a righteous-faith child + if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value < faith_astray_level + } + } + } + multiply = 0 + } + else_if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value > faith_astray_level + } + } + } + add = minor_piety_value + } + else_if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value > faith_hostile_level + } + } + } + add = medium_piety_value + } + } + } + influence = { + value = 0 + if = { + limit = { scope:influence_send_option = yes } + add = scope:actor.medium_influence_value + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + } + + ai_potential = { + any_child = { + count < 2 + } + OR = { + fertility <= low_fertility + AND = { + is_male = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_female = yes + } + } + } + AND = { + is_female = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_male = yes + } + } + } + } + } + + ai_targets = { + ai_recipients = courtiers + ai_recipients = guests + # Friends, wards, etc. + ai_recipients = scripted_relations + max = 20 + } + + ai_accept = { + base = 0 + modifier = { # My parents are alive + add = -15 + desc = parents_are_alive_tt + OR = { + father ?= { is_alive = yes } + mother ?= { is_alive = yes } + } + } + modifier = { # I hate my mother + add = 10 + desc = i_hate_my_mother_tt + exists = mother + mother = { is_alive = yes } + opinion = { + value <= medium_negative_opinion + target = mother + } + } + modifier = { # I hate my father + add = 10 + desc = i_hate_my_father_tt + exists = father + father = { is_alive = yes } + opinion = { + value <= medium_negative_opinion + target = father + } + } + modifier = { # I like my mother + add = -10 + desc = i_like_my_mother_tt + exists = mother + mother = { is_alive = yes } + opinion = { + value >= medium_positive_opinion + target = mother + } + } + modifier = { # I like my father + add = -10 + desc = i_like_my_father_tt + exists = father + father = { is_alive = yes } + opinion = { + value >= medium_positive_opinion + target = father + } + } + modifier = { # I like you + add = { + value = 5 + if = { + limit = { + opinion = { + value >= high_positive_opinion + target = scope:actor + } + } + add = 10 + } + if = { + limit = { + opinion = { + value >= very_high_positive_opinion + target = scope:actor + } + } + add = 10 + } + } + desc = i_like_you_tt + opinion = { + value >= medium_positive_opinion + target = scope:actor + } + } + modifier = { # You're my friend :) + add = 10 + desc = youre_my_friend_tt + has_relation_friend = scope:actor + } + modifier = { # You're my guardian + add = 10 + desc = youre_my_guardian_tt + has_relation_guardian = scope:actor + } + modifier = { # I have no mother + add = 5 + desc = i_want_a_mother_tt + scope:actor = { is_female = yes } + OR = { + NOT = { exists = mother } + mother = { is_alive = no } + } + } + modifier = { # I have no father + add = 5 + desc = i_want_a_father_tt + scope:actor = { is_male = yes } + OR = { + NOT = { exists = father } + father = { is_alive = no } + } + } + modifier = { # I am a noble! + add = -15 + desc = i_am_noble_tt + has_no_particular_noble_roots_trigger = no + } + modifier = { # We are so alike ^^ + add = { + value = 5 + if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 2 + } + } + multiply = 2 + } + else_if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 3 + } + } + multiply = 3 + } + else_if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 4 + } + } + multiply = 4 + } + } + desc = we_are_alike_tt + number_of_personality_traits_in_common = { + target = scope:actor + value >= 1 + } + } + modifier = { # Yo, you're offering me a place in a landed house? Sick. + add = 10 + desc = ambition_tt + has_trait = ambitious + } + modifier = { + add = 25 + scope:influence_send_option = yes + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + + ai_frequency = 120 + + ai_will_do = { + base = 50 + + modifier = { # I am childless and my marriage will never produce heirs + add = 100 + scope:actor = { + any_child = { + count < 1 + } + OR = { + fertility <= low_fertility + AND = { + is_male = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_female = yes + } + } + } + AND = { + is_female = yes + NOT = { + any_spouse = { + fertility > low_fertility + is_male = yes + } + } + } + } + } + } + + modifier = { # I am kind and the child is an orphan + add = 100 + scope:actor = { + ai_compassion >= high_positive_compassion + } + NOT = { + exists = scope:recipient.mother + exists = scope:recipient.father + } + } + + modifier = { # Traits in common + add = 25 + scope:actor = { + number_of_personality_traits_in_common = { + target = scope:recipient + value = 1 + } + } + } + + modifier = { # Traits in common + add = 25 + scope:actor = { + number_of_personality_traits_in_common = { + target = scope:recipient + value = 2 + } + } + } + + modifier = { # Traits in common + add = 25 + scope:actor = { + number_of_personality_traits_in_common = { + target = scope:recipient + value = 3 + } + } + } + + modifier = { # My culture is into adoption + add = 25 + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + + modifier = { # I like the kid + add = 25 + scope:actor = { + opinion = { + value >= medium_positive_opinion + target = scope:recipient + } + } + } + + modifier = { # The kid is my friend uwu + add = 25 + scope:actor = { + has_relation_friend = scope:recipient + } + } + + modifier = { # The kid is my ward + add = 25 + scope:actor = { + has_relation_guardian = scope:recipient + } + } + + modifier = { # I care about bloodlines and dynasties and whatnot + add = -25 + scope:actor = { + NOR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + has_trait = humble + has_trait = callous + } + } + } + + modifier = { # I will not adopt filthy filthy heretics + factor = 0 + faith = { + faith_hostility_level = { + target = scope:recipient.faith + value >= faith_astray_level + } + } + } + } +} + +adventurer_adopt_interaction = { + icon = icon_adopt_house_member + category = interaction_category_diplomacy + interface_priority = 60 + cooldown = { years = 2 } + + desc = adventurer_adopt_interaction_desc + use_diplomatic_range = yes + + is_shown = { + scope:actor = { is_landless_adventurer = yes } + scope:recipient = { + is_ruler = no + # They don't already belong to your dynasty + NOT = { dynasty = scope:actor.dynasty } + } + } + + is_valid = {} + + is_valid_showing_failures_only = { + # Don't get imprisoned children and so on + scope:recipient = { + is_available = yes + is_courtier_of = scope:actor + opinion = { + value >= 40 # sync with define:NDomicile|TEMPERAMENT_THRESHOLD_HIGH + target = scope:actor + } + has_no_particular_noble_roots_trigger = yes + } + scope:recipient = { + NOT = { has_trait = devoted } + } + scope:recipient = { + NOT = { has_trait = gallivanter } + } + } + + on_accept = { + show_as_tooltip = { + adventurer_adopt_effect = { + CHILD = scope:recipient + ADOPTER = scope:actor + } + scope:actor = { set_designated_heir = scope:recipient } + } + hidden_effect = { + scope:actor = { trigger_event = adoption.0002 } + } + } + + cost = { + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + } + } + } + + ai_accept = { + base = 0 + modifier = { # My parents are alive + add = -15 + desc = parents_are_alive_tt + OR = { + father ?= { is_alive = yes } + mother ?= { is_alive = yes } + } + } + modifier = { # I hate my mother + add = 10 + desc = i_hate_my_mother_tt + exists = mother + mother = { is_alive = yes } + opinion = { + value <= medium_negative_opinion + target = mother + } + } + modifier = { # I hate my father + add = 10 + desc = i_hate_my_father_tt + exists = father + father = { is_alive = yes } + opinion = { + value <= medium_negative_opinion + target = father + } + } + modifier = { # I like my mother + add = -10 + desc = i_like_my_mother_tt + exists = mother + mother = { is_alive = yes } + opinion = { + value >= medium_positive_opinion + target = mother + } + } + modifier = { # I like my father + add = -10 + desc = i_like_my_father_tt + exists = father + father = { is_alive = yes } + opinion = { + value >= medium_positive_opinion + target = father + } + } + modifier = { # I like you + add = { + value = 5 + if = { + limit = { + opinion = { + value >= high_positive_opinion + target = scope:actor + } + } + add = 10 + } + if = { + limit = { + opinion = { + value >= very_high_positive_opinion + target = scope:actor + } + } + add = 10 + } + } + desc = i_like_you_tt + opinion = { + value >= medium_positive_opinion + target = scope:actor + } + } + modifier = { # You're my friend :) + add = 10 + desc = youre_my_friend_tt + has_relation_friend = scope:actor + } + modifier = { # You're my guardian + add = 10 + desc = youre_my_guardian_tt + has_relation_guardian = scope:actor + } + modifier = { # I have no mother + add = 5 + desc = i_want_a_mother_tt + scope:actor = { is_female = yes } + OR = { + NOT = { exists = mother } + mother = { is_alive = no } + } + } + modifier = { # I have no father + add = 5 + desc = i_want_a_father_tt + scope:actor = { is_male = yes } + OR = { + NOT = { exists = father } + father = { is_alive = no } + } + } + modifier = { # I am a noble! + add = -15 + desc = i_am_noble_tt + has_no_particular_noble_roots_trigger = no + } + modifier = { # We are so alike ^^ + add = { + value = 5 + if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 2 + } + } + multiply = 2 + } + else_if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 3 + } + } + multiply = 3 + } + else_if = { + limit = { + number_of_personality_traits_in_common = { + target = scope:actor + value = 4 + } + } + multiply = 4 + } + } + desc = we_are_alike_tt + number_of_personality_traits_in_common = { + target = scope:actor + value >= 1 + } + } + modifier = { # Yo, you're offering me a place in a landed house? Sick. + add = 10 + desc = ambition_tt + has_trait = ambitious + } + } +} diff --git a/common/character_interactions/00_alliance.txt b/common/character_interactions/00_alliance.txt new file mode 100644 index 00000000..cd303f59 --- /dev/null +++ b/common/character_interactions/00_alliance.txt @@ -0,0 +1,3441 @@ +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 + } + } + 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 = { #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 = { + 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 = { NOT = { 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 War Leaders can call allies + scope:actor = { + custom_description = { + text = must_be_war_leader + any_character_war = { + is_war_leader = scope:actor + } + } + } + + # Cannot call the same character multiple times + scope:actor = { + 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 + } + } + } + } + + can_potentially_call_ally_trigger = { + WARRIOR = scope:actor + JOINER = scope:recipient + } + + # Cannot call a character of the "wrong" religion to a Great Holy War + scope:actor = { + trigger_if = { + limit = { + NOT = { 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_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 + } + } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = call_ally.0001 + } + scope:target = { + if = { + limit = { + is_religious_war = yes + scope:recipient = { + any_active_accolade = { + has_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 = { + has_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 = { + has_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 = { + has_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 = { + add_prestige_experience = major_prestige_loss + } + } + else = { + scope:actor = { + add_opinion = { + modifier = rejected_call_to_defensive_war + target = scope:recipient + } + } + scope:recipient = { + add_prestige_experience = massive_prestige_loss + } + } + 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 + } + } + + 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 = { ai_has_conqueror_personality = yes } + } + + 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 + } + + 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 } + } + NOT = { + 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 + is_independent_ruler = no + 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 + is_independent_ruler = no + has_royal_court = no + exists = liege.liege + liege = { + is_independent_ruler = no + 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 + is_independent_ruler = no + has_royal_court = no + exists = liege.liege + exists = liege.liege.liege + liege = { + is_independent_ruler = no + has_royal_court = no + } + liege.liege = { + is_independent_ruler = no + 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 + is_independent_ruler = no + has_royal_court = no + exists = liege.liege + exists = liege.liege.liege + exists = liege.liege.liege.liege + liege = { + is_independent_ruler = no + has_royal_court = no + } + liege.liege = { + is_independent_ruler = no + has_royal_court = no + } + liege.liege.liege = { + is_independent_ruler = no + 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 + } + NOT = { + 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 + is_independent_ruler = no + 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 + is_independent_ruler = no + has_royal_court = no + exists = liege.liege + liege = { + is_independent_ruler = no + 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 + is_independent_ruler = no + has_royal_court = no + exists = liege.liege + exists = liege.liege.liege + liege = { + is_independent_ruler = no + has_royal_court = no + } + liege.liege = { + is_independent_ruler = no + 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 + is_independent_ruler = no + has_royal_court = no + exists = liege.liege + exists = liege.liege.liege + exists = liege.liege.liege.liege + liege = { + is_independent_ruler = no + has_royal_court = no + } + liege.liege = { + is_independent_ruler = no + has_royal_court = no + } + liege.liege.liege = { + is_independent_ruler = no + 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 + NOT = { 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 + } + + 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 + } + 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 + } + 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 + } + 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 + } + + 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 + } + } +} + +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 = { + NOT = { 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 + } + } + } + + 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 + } + } + scope:recipient = { is_busy_in_events_localised = yes } + custom_description = { + text = "has_already_rejected_renegotiation" + subject = scope:recipient + NOT = { + scope:actor = { + has_opinion_modifier = { + modifier = refused_alliance_opinion + target = scope:recipient + } + } + } + } + } + + is_valid = { #To give some clarity to the tooltip that states "blood ties" + + 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 } + #childhood friendship with hostage event, where they swear to be friends forever + scope:actor = { + hostage_oath_of_friendship_trigger = yes + } + + + 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 + #Ruler's child/parent/sibling/grandchild/grandparent/uncle/aunt/niece/nephew is married to other ruler. + scope:actor = { + hostage_oath_of_friendship_trigger = yes + } + } + } + } + + 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_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 } + NOT = { scope:actor.dynasty = scope:recipient.dynasty } + scope:actor.dynasty = { dynasty_prestige_level = 0 } + } + modifier = { + desc = AI_DYNASTY_PRESTIGE_REASON + scope:actor = { has_dynasty = yes } + NOT = { 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 = { + NOT = { + 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 = { + tier = 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 = { + existing_feud_against_target_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 + } + } + NAND = { + 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 + } + } + NAND = { + 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 + } + } + } + + 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 = 72 + + 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 = { + NOT = { this = scope:actor } + NOT = { is_allied_to = scope:actor } + 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 } + is_ruler = yes + primary_title.tier > tier_barony + } + scope:actor = { + has_perk = defensive_negotiations_perk + is_landless_adventurer = no + NOT = { # 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 = { + + 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 + } + + scope:recipient = { is_busy_in_events_localised = yes } + + 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 } + NOT = { scope:actor.dynasty = scope:recipient.dynasty } + scope:actor.dynasty = { dynasty_prestige_level = 0 } + } + modifier = { + desc = AI_DYNASTY_PRESTIGE_REASON + scope:actor = { has_dynasty = yes } + NOT = { 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 = { + NOT = { + 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 = { + tier = 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 = { + existing_feud_against_target_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 = 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 + + 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) + 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 + } + } + } + } + + # recipient is ally or defending against a holy war + trigger_else_if = { + limit = { + scope:actor = { + NOT = { target_is_liege_or_above = scope:recipient } + } + } + trigger_if = { + limit = { + scope:actor = { is_landless_adventurer = yes } + } + # 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 + } + 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 = { + is_landless_adventurer = yes + } + 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 = { + exists = scope:target + scope:target = { + + # recipient is war leader + is_war_leader = scope:recipient + + #allow laamp_join_war_contract to bypass the requirements + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + } + # 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 = { + exists = holder + 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 = { + title = 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 + } + # ...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 = { + has_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 = { + has_accolade_parameter = acclaimed_knight_piety_from_battle_high + } + } + } + scope:actor = { + add_piety = major_piety_gain + } + } + } + scope:actor = { + stress_impact = { + craven = medium_stress_impact_gain + shy = minor_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 = { + NOT = { house = scope:actor.house } + } + } + AND = { + primary_defender = scope:recipient + scope:recipient.house = scope:actor.house + primary_attacker = { + NOT = { 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 + } +} diff --git a/common/character_interactions/00_artifact_interactions.txt b/common/character_interactions/00_artifact_interactions.txt new file mode 100644 index 00000000..d0f2de95 --- /dev/null +++ b/common/character_interactions/00_artifact_interactions.txt @@ -0,0 +1,4374 @@ +# Give away an artifact to improve relations +gift_artifact_interaction = { + category = interaction_category_friendly + common_interaction = yes + interface_priority = 60 + desc = gift_artifact_interaction_desc + icon = artisan_inspiration + + target_type = artifact + target_filter = actor_artifacts + + greeting = positive + notification_text = GIFT_ARTIFACT_PROPOSAL + + answer_accept_key = GIFT_ARTIFACT_ACCEPT + answer_reject_key = GIFT_ARTIFACT_REJECT + + ai_targets = { + ai_recipients = scripted_relations + ai_recipients = liege + ai_recipients = spouses + ai_recipients = vassals + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + max = 10 + } + ai_targets = { + ai_recipients = family + ai_recipients = children + ai_recipients = dynasty + max = 20 + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 84 + + can_be_picked_artifact = { + trigger_if = { + limit = { + scope:actor = { + is_ai = no + } + } + scope:target = { + is_equipped = no + } + } + scope:actor = { + any_character_artifact = { + this = scope:target + } + } + #Artifacts locked from being giftable by a variable + scope:target = { + NOR = { + has_variable = 1025_treasure_map + has_variable = ungiftable + } + } + } + + + #You can't give yourself a gift, even if it should count as self-care + is_shown = { + NOT = { + scope:recipient = scope:actor + } + scope:actor = { + has_any_artifact = yes + } + } + + is_valid_showing_failures_only = { + # needs to have an artifact to give away + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + is_imprisoned = no + trigger_if = { + limit = { + is_ai = no + } + custom_description = { + text = "any_unequipped_artifact_tt" + any_character_artifact = { + is_equipped = no + } + } + } + } + trigger_if = { + limit = { + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + } + custom_description = { + text = "gift_artifact_dynasty_banner_head_tt" + scope:recipient = scope:target.var:banner_dynasty.dynast + } + } + } + + on_accept = { + # Warning for multiple gifts + if = { + limit = { + scope:recipient = { + has_opinion_modifier = { + target = scope:actor + modifier = gift_artifact_opinion + } + } + } + custom_tooltip = ALREADY_SENT_GIFT_WARNING + } + # Struggle Catalyst + if = { # Struggle Catalyst + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + 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 + activate_struggle_catalyst = { + catalyst = catalyst_gift_independent_ruler + character = scope:actor + } + } + } + } + } + else_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 } + } + } + } + } + + scope:target = { + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 1 + } + set_variable = { name = gifted_artifact value = yes days = 9125 } + } + 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 + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = gift_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + scope:recipient = { + if = { + limit = { scope:target = { can_be_claimed_by = scope:recipient } } + if = { + limit = { any_personal_claimed_artifact = { this = scope:target } } + show_as_tooltip = { remove_personal_artifact_claim = scope:target } + } + else = { show_as_tooltip = { house = { remove_house_artifact_claim = scope:target } } } + } + } + + scope:target = { set_owner = scope:recipient } + + + if = { + limit = { + scope:target = { is_unique = yes } + } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = major_stress_impact_gain + generous = major_stress_impact_loss + } + } + else_if = {# Unity goes here, too! + limit = { scope:target = { rarity = masterwork } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = minor_stress_impact_gain + generous = minor_stress_impact_loss + } + } + else_if = { + limit = { scope:target = { rarity = famed } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + } + } + else_if = { + limit = { scope:target = { rarity = illustrious } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + stress_impact = { + greedy = major_stress_impact_gain + generous = major_stress_impact_loss + } + } + if = { + limit = { scope:recipient = { is_ai = yes } } + reverse_add_opinion = { + target = scope:recipient + modifier = gift_artifact_opinion + opinion = gift_artifact_opinion + } + } + #FP3 Tenet Communal Possessions Perk - piety gain for gift giving. + if = { + limit = { + scope:actor = { + faith = { + has_doctrine_parameter = piety_from_gifts_active + } + } + } + scope:actor = { + if = { + limit = { #the better the artifact, the more piety you gain + scope:target = { rarity = illustrious } + } + add_piety = massive_piety_gain + } + else_if = { + limit = { + scope:target = { rarity = famed } + } + add_piety = major_piety_gain + } + else_if = { + limit = { + scope:target = { rarity = masterwork } + } + add_piety = medium_piety_gain + } + else = { + add_piety = minor_piety_gain + } + } + } + } + + # Warning for low opinion gain + if = { + limit = { + scope:target = { artifact_durability <= define:NInventory|ARTIFACT_LOW_DURABILITY } + } + custom_tooltip = artifact_gift_low_durability_tt + } + if = { + limit = { + scope:target = { artifact_durability <= define:NInventory|ARTIFACT_VERY_LOW_DURABILITY } + } + custom_tooltip = artifact_gift_very_low_durability_tt + } + if = { + limit = { + scope:target = { + OR = { + AND = { + has_variable = banner_house + NOT = { var:banner_house = scope:recipient.house } + } + AND = { + has_variable = banner_dynasty + NOT = { var:banner_dynasty = scope:recipient.dynasty } + } + } + } + } + custom_tooltip = artifact_gift_useless_banner_tt + } + else_if = { + limit = { + scope:recipient = { + NOR = { + can_equip_artifact = scope:target + can_benefit_from_artifact = scope:target + } + } + } + custom_tooltip = artifact_gift_useless_tt + } + else_if = { + limit = { + scope:recipient = { + NOT = { can_equip_artifact = scope:target } + } + } + custom_tooltip = artifact_gift_equip_tt + } + else_if = { + limit = { + scope:recipient = { + NOT = { can_benefit_from_artifact = scope:target } + } + } + custom_tooltip = artifact_gift_benefit_tt + } + if = { + limit = { scope:recipient.liege = scope:actor } + custom_tooltip = artifact_gift_vassal_tt + } + if = { + limit = { scope:recipient = scope:actor.faith.religious_head } + custom_tooltip = artifact_gift_religious_head_tt + } + } + scope:recipient = { + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = gift_artifact_interaction_notification + left_icon = scope:actor + right_icon = scope:target + + show_as_tooltip = { + scope:target = { set_owner = scope:recipient } + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = gift_artifact_opinion + opinion = gift_artifact_opinion + } + } + + # Unity stuff, scales with tier # If we're a clan this interaction affects unity + if = { # In a better world, this would be a switch + limit = { scope:target = { rarity = Masterwork } } # todo_cd_polish, make the UI show this before you gift + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + else_if = { + limit = { scope:target = { rarity = Famed } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + else_if = { + limit = { scope:target = { rarity = Illustrious } } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = major_unity_gain + DESC = clan_unity_given_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + } + } + if = { + limit = { + is_ruler = no + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = primary_armament + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = armor + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = armor + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = armor + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = regalia + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = regalia + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + trigger_if = { + limit = { + scope:target = { + artifact_slot_type = helmet + } + } + OR = { + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + } + } + AND = { + scope:target = { + rarity = illustrious + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOT = { + rarity = illustrious + } + } + } + AND = { + scope:target = { + rarity = famed + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOR = { + rarity = illustrious + rarity = famed + } + } + } + AND = { + scope:target = { + rarity = masterwork + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + } + AND = { + scope:target = { + rarity = common + } + any_equipped_character_artifact = { + artifact_slot_type = helmet + NOR = { + rarity = illustrious + rarity = famed + rarity = masterwork + rarity = common + } + } + } + } + } + } + scope:target = { + equip_artifact_to_owner_replace = yes + } + } + } + } + } + + auto_accept = 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 } + NOT = { scope:target.var:banner_dynasty = scope:recipient.dynasty } + } + trigger_else = { + NOT = { scope:target.var:banner_house = scope:recipient.house } + } + desc = ARTIFACT_USELESS_BANNER_REASON + } + # Struggle motive + modifier = { + desc = AI_STRUGGLE_INTENT + scope:recipient = { + is_independent_ruler = yes + 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 + } + } + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + ai_potential = { + has_any_artifact = yes + trigger_if = { + limit = { + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + scope:recipient = scope:target.var:banner_dynasty.dynast + } + NOT = { + scope:actor = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } + } + trigger_else = { + is_adult = yes + ai_greed <= high_positive_ai_value + # the AI shouldn't give away equipped artifacts + has_any_unequipped_artifact = yes + + NOT = { + has_trait = greedy + } + } + } + + ai_min_reply_days = 0 + ai_max_reply_days = 0 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + is_close_or_extended_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + + AND = { + ai_greed <= low_negative_ai_value + OR = { # Lieges/vassals, within realm + is_vassal_of = scope:actor + target_is_vassal_or_below = scope:actor + } + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + } + } + } + + scope:target = { + is_equipped = no + } + + scope:recipient = { + OR = { + AND = { # Players like nice gifts + scope:target = { + OR = { + rarity = famed + rarity = illustrious + } + } + is_ai = no + } + AND = { # Might as well give Court Artifacts to their liege if they cant use them themselves + has_royal_court = yes + has_dlc_feature = court_artifacts + target_is_vassal_or_below = scope:actor + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + } + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + scope:actor = { + any_equipped_character_artifact = { + artifact_slot_type = armor + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = armor + } + } + } + AND = { + can_equip_artifact = scope:target # To avoid gifting old children's toys to adults... + can_benefit_from_artifact = scope:target + scope:target = { + artifact_slot_type = miscellaneous + } + scope:actor = { + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + any_equipped_character_artifact = { + count < 4 + artifact_slot_type = miscellaneous + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = throne + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + artifact_slot_type = throne + } + } + } + NOT = { + any_equipped_character_artifact = { + artifact_slot_type = throne + } + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = wall_big + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + } + any_equipped_character_artifact = { + count < 3 + artifact_slot_type = wall_big + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = wall_small + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + } + any_equipped_character_artifact = { + count < 3 + artifact_slot_type = wall_small + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = sculpture + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + } + any_equipped_character_artifact = { + count < 2 + artifact_slot_type = sculpture + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = book + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + } + any_equipped_character_artifact = { + count < 2 + artifact_slot_type = book + } + } + AND = { + has_royal_court = yes + scope:target = { + artifact_slot_type = pedestal + } + scope:actor = { + OR = { + has_royal_court = no + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + any_equipped_character_artifact = { + count < 4 + artifact_slot_type = pedestal + } + } + } + } + } + + # Struggle + modifier = { + scope:recipient = { + is_independent_ruler = yes + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_gift_independent_ruler + } + has_character_flag = agenda_towards_escalation + } + } + add = -100 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_gift_independent_ruler + } + } + } + add = 200 + } + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 2 + scope:recipient = { + is_ai = no + } + } + + modifier = { + factor = 0.25 + scope:recipient = { + highest_held_title_tier = tier_barony + } + } + + modifier = { # Unlanded characters do not equip artifacts, no point in giving them artifacts + factor = 0 + scope:recipient = { + is_ruler = no + } + } + + modifier = { + factor = 0 + scope:recipient = { + has_relation_rival = scope:actor + } + } + + modifier = { + factor = 0 + scope:target = { + has_variable = cursed_artifact + } + } + + modifier = { + factor = 0 + scope:target = { + is_equipped = yes + } + } + + modifier = { + factor = 0 + scope:target = { + has_variable = gifted_artifact + } + } + + modifier = { # So that the AI doesn't give player toys + factor = 0 + scope:recipient = { + is_ai = no + NOT = { + can_equip_artifact = scope:target + } + } + } + + modifier = { + factor = 0 + scope:target = { exists = var:relic_religion} + scope:actor = { + has_religion = scope:target.var:relic_religion + } + } + + modifier = { + factor = 0 + OR = { + exists = scope:target.var:banner_house + exists = scope:target.var:banner_dynasty + } + scope:recipient = { + NOT = { + can_benefit_from_artifact = scope:target + } + } + } + + modifier = { + add = 100 + exists = scope:target.var:banner_dynasty + exists = scope:recipient.dynasty + scope:recipient = scope:target.var:banner_dynasty.dynast + NOT = { + scope:actor = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } + } + } +} + +# Demand an artifact you have a claim on +demand_artifact_interaction = { + category = interaction_category_diplomacy + common_interaction = yes + interface_priority = 60 + use_diplomatic_range = yes + desc = demand_artifact_interaction_desc + icon = artisan_inspiration + + target_type = artifact + target_filter = recipient_artifacts_claimable + + greeting = negative + notification_text = DEMAND_ARTIFACT_PROPOSAL + + answer_accept_key = DEMAND_ARTIFACT_ACCEPT + answer_reject_key = DEMAND_ARTIFACT_REJECT + + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 60 + + is_shown = { + NOT = { + scope:recipient = scope:actor + } + + custom_description = { + text = "demand_artifact_interaction_valid_tt_1" + scope:recipient = { + # needs to have an artifact we can claim + any_character_artifact = { + can_be_claimed_by = scope:actor + } + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + + scope:recipient = { is_busy_in_events_localised = yes } + + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + } + + trigger_if = { + limit = { + scope:actor = { + has_variable = demanded_this_artifact_interaction_recently + } + } + custom_description = { + text = "demand_artifact_interaction_is_valid_tt_2" + exists = scope:demanded_artifact + scope:actor = { + has_variable = demanded_this_artifact_interaction_recently + var:demanded_this_artifact_interaction_recently = scope:demanded_artifact + } + } + } + scope:actor = { is_imprisoned = no } + } + + on_accept = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + scope:target = { + set_owner = scope:actor + } + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = insult_opinion + opinion = -10 + } + } + if = { + limit = { + scope:recipient = { + can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } + } + } + scope:recipient = { + set_relation_potential_rival = scope:actor + } + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = pleased_opinion + opinion = 30 + } + } + } + + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_demanded_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope: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 = 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" + + send_options_exclusive = no + + ai_accept = { + base = 0 + modifier = { + add = -50 + desc = ARTIFACT_REASON + } + modifier = { + add = 70 + scope:actor.max_military_strength > scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_STRONGER_REASON + } + modifier = { + add = -70 + scope:actor.max_military_strength < scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_WEAKER_REASON + } + modifier = { + add = -50 + scope:target = { can_be_claimed_by = scope:recipient } + desc = ARTIFACT_CLAIM_REASON + } + modifier = { + add = { + value = ai_boldness + multiply = -1 + divide = 2 + } + NOT = { ai_boldness = 0 } + desc = ARTIFACT_BOLDNESS_REASON + } + modifier = { + add = -50 + scope:actor = { + has_relation_rival = scope:recipient + } + desc = ARTIFACT_RIVAL_REASON + } + modifier = { + add = -80 + scope:actor = { + has_relation_nemesis = scope:recipient + } + desc = ARTIFACT_NEMESIS_REASON + } + modifier = { + add = 50 + scope:recipient = { + target_is_liege_or_above = scope:actor + } + desc = ARTIFACT_LIEGE_REASON + } + modifier = { + scope:hook = yes + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { VALUE = 100 } + } + + ai_potential = { + is_adult = yes + is_at_war = no + ai_greed >= low_negative_ai_value + has_outstanding_artifact_claims = yes + } + + on_decline = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + custom_tooltip = demand_artifact_interaction_notification_refused + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = insult_opinion + opinion = -10 + } + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = refusal_opinion + opinion = -10 + } + } + } + } + + ai_min_reply_days = 7 + ai_max_reply_days = 14 + + ai_will_do = { + base = 100 + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + + modifier = { + add = 50 + has_relation_rival = scope:recipient + } + modifier = { + add = 80 + has_relation_nemesis = scope:recipient + } + modifier = { + add = -50 + target_is_liege_or_above = scope:recipient + } + # Recipient is flaunting their artifacts and needs to be taken down a peg - from hold_court.3080 + modifier = { + scope:recipient = { + OR = { + has_character_modifier = petition_event_artifact_exhibition_for_prestige + has_character_modifier = petition_event_artifact_exhibition_for_gold + } + } + add = 35 + } + modifier = { # An Intimidated character is very unlikely to raise their hand + add = -25 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 1 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + modifier = { # A Cowed character will never take this interaction + factor = 0 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 2 + } + } + } + modifier = { # The AI doesn't demand from players they like + factor = 0 + scope:recipient = { + is_ai = no + } + scope:actor = { + OR = { + has_relation_friend = scope:recipient + has_relation_lover = scope:recipient + opinion = { + target = scope:recipient + value >= high_positive_opinion + } + } + } + } + modifier = { # The AI doesn't demand from players that have refused already + factor = 0 + scope:recipient = { + is_ai = no + } + scope:actor = { + has_opinion_modifier = { + target = scope:recipient + modifier = refusal_opinion + } + } + } + modifier = { # Only the House Head will demand house claimed artifacts from existing House members + factor = 0 + exists = scope:actor.house.house_head + exists = scope:recipient.house + scope:actor.house.house_head = scope:actor + scope:actor.house = scope:recipient.house + + NOT = { + any_personal_claimed_artifact = { + this = scope:target + } + } + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + ai_greed <= high_positive_ai_value + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = miscellaneous + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + AND = { + scope:target = { + artifact_slot_type = throne + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = wall_big + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + AND = { + scope:target = { + artifact_slot_type = wall_small + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + AND = { + scope:target = { + artifact_slot_type = sculpture + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + AND = { + scope:target = { + artifact_slot_type = book + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + AND = { + scope:target = { + artifact_slot_type = pedestal + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + } + factor = 0 + } + } +} + +# Challenge someone to a non-lethal duel for an artifact you have a claim on +challenge_for_artifact_interaction = { + icon = icon_combat + interface_priority = 30 + common_interaction = yes + category = interaction_category_hostile + ai_maybe = yes + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + use_diplomatic_range = yes + can_send_despite_rejection = yes + desc = challenge_for_artifact_interaction_desc + + target_type = artifact + target_filter = recipient_artifacts_claimable + + greeting = negative + notification_text = REQUEST_ARTIFACT_COMBAT_TEXT + + answer_accept_key = REQUEST_ARTIFACT_COMBAT_ACCEPT + answer_reject_key = REQUEST_ARTIFACT_COMBAT_REJECT + + is_shown = { + # Can't duel yourself. + NOT = { scope:actor = scope:recipient } + custom_description = { + text = "challenge_for_artifact_interaction_valid_tt_1" + scope:recipient = { + # needs to have an artifact we can claim + any_character_artifact = { + can_be_claimed_by = scope:actor + } + } + } + } + + is_valid_showing_failures_only = { + rival_single_combat_shown_and_not_invalid_trigger = yes + scope:recipient = { can_start_single_combat_trigger = yes } + scope:recipient = { + custom_description = { + text = fp1_tbc_recipient_banned_from_combat + can_start_single_combat_banned_checks_trigger = no + } + } + scope:recipient = { is_imprisoned = no } + scope:actor = { is_imprisoned = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + is_highlighted = { + rival_single_combat_shown_and_not_invalid_trigger = yes + # Scope:recipient must be able to fight personally. + scope:recipient = { can_start_single_combat_trigger = yes } + # Scope:recipient must not be banned from single combat. + scope:recipient = { can_start_single_combat_banned_checks_trigger = no } + scope:recipient = { is_imprisoned = no } + scope:actor = { is_imprisoned = no } + } + + cost = { prestige = challenge_for_artifact_prestige_cost_value } + cooldown = { years = 2 } + cooldown_against_recipient = { years = 5 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + scope:actor = { + remove_character_flag = flag_hostile_actions_disabled_delay + } + # Set up the bout immediately. + ## First inform. + scope:actor = { + custom_tooltip = challenge_to_single_combat_interaction.enter_non_lethal_bout.tt + custom_tooltip = challenge_to_artifact_combat_interaction_victor_gets.tt + custom_tooltip = challenge_to_artifact_combat_interaction_loser_gets.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = artifact.2001 + INVALIDATION_EVENT = fp1_tbc.0021 + } + + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = major_unity_loss + DESC = clan_unity_challenge_artifact.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_challenge_artifact_refusal.desc + REVERSE_NON_HOUSE_TARGET = no + } + + # Scope:recipient declines processing. + scope:actor = { + # Inform them of the decline & scope:recipient loses some prestige. + send_interface_toast = { + type = event_toast_effect_neutral + title = challenge_to_single_combat_interaction.challenge_rejected.t + left_icon = scope:recipient + right_icon = scope:actor + scope:recipient = { + add_prestige = { + value = 0 + subtract = challenge_for_artifact_prestige_cost_value + } + } + show_as_tooltip = { + add_prestige = challenge_for_artifact_prestige_cost_value + } + } + hidden_effect = { + add_prestige_no_experience = challenge_for_artifact_prestige_cost_value + # Cooldown is removed. + remove_interaction_cooldown = challenge_for_artifact_interaction + } + # Clear up hostile actions flag. + if = { + limit = { + has_character_flag = flag_hostile_actions_disabled_delay + } + remove_character_flag = flag_hostile_actions_disabled_delay + } + } + } + + auto_accept = no + + ai_accept = { + base = 50 # Try to make it 0 for most interactions + + # Relative fighting ability. + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:actor.prowess < scope:recipient.prowess + add = { + value = scope:recipient.prowess + subtract = scope:actor.prowess + multiply = 2 + } + } + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:recipient.prowess < scope:actor.prowess + add = { + value = scope:actor.prowess + subtract = scope:recipient.prowess + multiply = -2 + } + } + # Weight up for personality values. + ai_value_modifier = { + who = scope:recipient + ai_boldness = 1 + ai_vengefulness = 0.75 + ai_honor = 0.5 + ai_rationality = -0.25 + ai_greed = -0.5 + } + # Apply tier differences. + ## King -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value >= 4 + } + } + add = 15 + } + ## Duke -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 3 + } + } + add = 10 + } + ## Count -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 2 + } + } + add = 5 + } + ## King <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -2 + } + } + add = -20 + } + ## Duke <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -3 + } + } + add = -30 + } + ## Count <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value <= -4 + } + } + add = -40 + } + # Rival modifier + modifier = { + desc = offer_vassalization_interaction_aibehavior_rival_tt + trigger = { + scope:recipient = { + has_relation_rival = scope:actor + } + } + add = 30 + } + # Nemesis modifier + modifier = { + desc = offer_vassalization_interaction_aibehavior_nemesis_tt + trigger = { + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + add = 50 + } + # Prestige too low to decline + modifier = { + desc = cannot_afford_prestige_loss_tt + trigger = { scope:recipient.prestige < challenge_for_artifact_prestige_limit_value } # 1/3rd of potential loss + add = 30 + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + } + + # AI + ai_potential = { + NOT = { has_trait = craven } + is_imprisoned = no + can_start_single_combat_trigger = yes + ai_greed >= low_negative_ai_value + has_outstanding_artifact_claims = yes + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = scripted_relations + } + + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_frequency = 60 + + ai_will_do = { + base = -50 + + # Factor for personality (excluding realism). + modifier = { + add = ai_boldness + } + modifier = { + ai_vengefulness > 0 + add = ai_vengefulness + } + modifier = { + add = { + value = ai_compassion + multiply = -0.25 + } + } + # Don't challenge your spouse, unless they're your nemesis. + modifier = { + scope:recipient = { + is_spouse_of = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge people hopelessly out of your league unless you're really, really not seeing things clearly. + modifier = { + scope:actor = { + prowess_diff = { + target = scope:recipient + value <= -15 + } + ai_rationality >= high_negative_ai_value + } + add = -1000 + } + # Don't challenge your liege - it's really bad form - unless you are REALLY motivated + modifier = { + scope:actor = { + is_vassal_of = scope:recipient + } + add = -100 + } + # Challenge them if they are your rival + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = 30 + } + # Totally challenge them if they are your nemesis! + modifier = { + scope:actor = { + has_relation_nemesis = scope:recipient + } + add = 50 + } + # Recipient is flaunting their artifacts and needs to be taken down a peg - from hold_court.3080 + modifier = { + scope:recipient = { + OR = { + has_character_modifier = petition_event_artifact_exhibition_for_prestige + has_character_modifier = petition_event_artifact_exhibition_for_gold + } + } + add = 35 + } + modifier = { # An Intimidated character is very unlikely to raise their hand + add = -25 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 1 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + + modifier = { # A Cowed character will never take this interaction + factor = 0 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 2 + } + } + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + ai_greed <= high_positive_ai_value + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = miscellaneous + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + AND = { + scope:target = { + artifact_slot_type = throne + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = wall_big + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + AND = { + scope:target = { + artifact_slot_type = wall_small + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + AND = { + scope:target = { + artifact_slot_type = sculpture + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + AND = { + scope:target = { + artifact_slot_type = book + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + AND = { + scope:target = { + artifact_slot_type = pedestal + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + } + factor = 0 + } + } +} + +#Steal an artifact that you have a claim on +start_stealing_back_artifact = { + icon = icon_scheme_steal_back_artifact + interface_priority = 70 + category = interaction_category_hostile + common_interaction = yes + + send_name = START_SCHEME + + scheme = steal_back_artifact + ignores_pending_interaction_block = yes + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + NOR = { + scope:recipient = scope:actor + scope:recipient = { is_imprisoned_by = scope:actor } + } + OR = { + scope:recipient = { + # needs to have an artifact we can claim + any_character_artifact = { + can_be_claimed_by = scope:actor + } + } + scope:actor = { + OR = { + employs_court_position = master_thief_camp_officer + any_character_active_contract = { + has_task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + } + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + trigger_if = { + limit = { + scope:actor = { + any_character_artifact = { + scope:actor = { has_artifact_claim = prev } + } + } + } + + custom_description = { + text = steal_back_artifact_can_start_scheme + subject = scope:actor + object = scope:recipient + scope:actor = { + can_start_scheme = { + type = steal_back_artifact + target_character = scope:recipient + } + } + } + } + trigger_if = { + limit = { + scope:actor = { + NOR = { + employs_court_position = master_thief_camp_officer + any_character_task_contract = { + has_task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + } + } + } + custom_description = { + text = steal_back_artifact_must_have_claim_blocker + subject = scope:actor + object = scope:recipient + + scope:recipient = { + any_character_artifact = { + scope:actor = { + has_artifact_claim = prev + } + } + } + } + } + custom_description = { + object = scope:recipient + text = you_have_been_caught_trying_to_steal_artifact_from_target + scope:recipient = { + NOT = { + has_opinion_modifier = { + target = scope:actor + modifier = attempted_to_steal_artifact_from_me + } + } + } + } + + custom_description = { + object = scope:recipient + text = you_have_recently_stolen_artifact_from_target + scope:recipient = { + NOT = { + has_opinion_modifier = { + target = scope:actor + modifier = stole_artifact_from_me + } + } + } + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = steal_back_artifact + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_steal_back_artifact_approved + } + } + can_be_picked_artifact = { + trigger_if = { + limit = { + scope:actor = { + NOR = { + employs_court_position = master_thief_camp_officer + any_character_active_contract = { + has_task_contract_type = laamp_steal_artifact_contract + var:task_contract_object ?= scope:target + } + } + } + } + scope:actor = { + has_artifact_claim = scope:target + } + } + } + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Balanced agents. + send_option = { + flag = agent_focus_balance + current_description = start_stealing_back_artifact.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_stealing_back_artifact.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_stealing_back_artifact.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = start_stealing_back_artifact.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + stress_impact = { + vengeful = medium_stress_impact_loss + honest = minor_stress_impact_gain + just = minor_stress_impact_loss + } + } + hidden_effect = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_stealing_back_artifact_notification + + left_icon = scope:actor + right_icon = scope:recipient + + if = { + limit = { + any_character_active_contract = { + has_task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + } + random_character_active_contract = { + limit = { + has_task_contract_type = laamp_steal_artifact_contract + var:task_contract_target ?= scope:recipient + } + save_scope_as = scheme_contract + } + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + AGENT_3 = agent_thug + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Speed. + AGENT_1 = agent_infiltrator + AGENT_2 = agent_infiltrator + AGENT_3 = agent_footpad + # Success. + AGENT_4 = agent_thief + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_alibi + AGENT_3 = agent_decoy + # Success. + AGENT_4 = agent_thief + # Speed. + AGENT_5 = agent_infiltrator + } + } + # Balanced. + else = { + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + TASK_CONTRACT = scope:scheme_contract + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + } + else = { + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + AGENT_3 = agent_thug + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + 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_thief + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_alibi + AGENT_3 = agent_decoy + # Success. + AGENT_4 = agent_thief + # Speed. + AGENT_5 = agent_infiltrator + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = steal_back_artifact + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_thief + AGENT_2 = agent_thief + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + } + scope:new_scheme ?= { + set_variable = { + name = target_artifact + value = scope:target + } + } + show_as_tooltip = { + stress_impact = { + vengeful = medium_stress_impact_loss + honest = minor_stress_impact_gain + just = minor_stress_impact_loss + } + } + } + } + } + } + + # AI + ai_potential = { + is_imprisoned = no + ai_greed >= low_negative_ai_value + intrigue >= low_skill_rating + has_outstanding_artifact_claims = yes + NOT = { + any_scheme = { + OR = { + scheme_type = murder + scheme_type = abduct + scheme_type = claim_throne + scheme_type = fabricate_hook + scheme_type = steal_back_artifact + } + } + } + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = scripted_relations + } + + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_frequency = 60 + + ai_will_do = { + base = -30 + # Factor for personality (excluding realism). + modifier = { + add = { + value = ai_boldness + multiply = -1 + } + } + modifier = { + ai_vengefulness > 0 + add = ai_vengefulness + } + modifier = { + add = { + value = ai_compassion + multiply = -0.25 + } + } + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = 60 + } + modifier = { + scope:actor = { + has_relation_nemesis = scope:recipient + } + add = 150 + } + # Recipient is flaunting their artifacts and needs to be taken down a peg - from hold_court.3080 + modifier = { + scope:recipient = { + OR = { + has_character_modifier = petition_event_artifact_exhibition_for_prestige + has_character_modifier = petition_event_artifact_exhibition_for_gold + } + } + add = 35 + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + ai_greed <= high_positive_ai_value + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + modifier = { + scope:recipient = { + OR = { + AND = { + scope:target = { + artifact_slot_type = primary_armament + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = primary_armament + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = regalia + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = regalia + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = helmet + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = helmet + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = armor + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = armor + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = miscellaneous + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = miscellaneous + } + } + AND = { + scope:target = { + artifact_slot_type = throne + } + OR = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = illustrious + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = famed + } + scope:target = { + OR = { + rarity = famed + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = masterwork + } + scope:target = { + OR = { + rarity = masterwork + rarity = common + } + } + } + AND = { + any_equipped_character_artifact = { + artifact_slot_type = throne + rarity = common + } + scope:target = { + rarity = common + } + } + } + } + AND = { + scope:target = { + artifact_slot_type = wall_big + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_big + } + } + AND = { + scope:target = { + artifact_slot_type = wall_small + rarity = common + } + any_equipped_character_artifact = { + count >= 3 + artifact_slot_type = wall_small + } + } + AND = { + scope:target = { + artifact_slot_type = sculpture + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = sculpture + } + } + AND = { + scope:target = { + artifact_slot_type = book + rarity = common + } + any_equipped_character_artifact = { + count >= 2 + artifact_slot_type = book + } + } + AND = { + scope:target = { + artifact_slot_type = pedestal + rarity = common + } + any_equipped_character_artifact = { + count >= 4 + artifact_slot_type = pedestal + } + } + } + } + factor = 0 + } + start_hostile_scheme_ai_base_modifiers = yes # At the end so Cowed can block it completely + } + + auto_accept = yes +} + +buy_artifact_claim = { + category = interaction_category_diplomacy + common_interaction = yes + ignores_pending_interaction_block = yes + icon = artisan_inspiration + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + # interaction locked behind Accomplished Forger perk from the Diplomacy lifestyle + scope:actor = { + has_perk = accomplished_forger_perk + is_landless_adventurer = no + } + NOR = { + # Can't buy from yourself + scope:recipient = scope:actor + # Can't buy from one of your prisoners + scope:recipient = { is_imprisoned_by = scope:actor } + } + scope:recipient = { + in_diplomatic_range = scope:actor + any_character_artifact = { + exists = this + scope:actor = { + NOT = { has_personal_artifact_claim = prev } + } + NOR = { + # maybe? nah. we can't. + has_variable = pope_hat + # This is the only way I have found to exclude dynastic banners + artifact_type = wall_big + } + } + } + } + + can_be_picked = { + scope:target = { + NOR = { + # can't already have a claim on the artifact + scope:actor = { has_personal_artifact_claim = prev } + # no pope hats or dynastic banners + has_variable = pope_hat + artifact_type = wall_big + } + } + } + + is_valid_showing_failures_only = { + # Can't buy an artifact claim against yourself or one of your prisoners + NOR = { + scope:recipient = scope:actor + scope:recipient = { is_imprisoned_by = scope:actor } + } + scope:recipient = { + # needs to have an artifact + any_character_artifact = { + exists = this + # actor can't already have a claim on said artifact + scope:actor = { + NOT = { has_personal_artifact_claim = prev } + } + } + is_busy_in_events_localised = yes + } + + # Claim costs are calculated with scripted values located 00_lifestyle_values. The piety interaction costs copy those used for the regular Buy Claim interaciton and the prestige costs are calculated according to the same method. + + # Checks to determine piety cost for Religious Artifacts + trigger_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = common } + } + scope:actor = { piety >= minor_buy_claim_piety_value } + } + trigger_else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = masterwork } + } + scope:actor = { piety >= medium_buy_claim_piety_value } + } + trigger_else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = famed } + } + scope:actor = { piety >= major_buy_claim_piety_value } + } + trigger_else = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = illustrious } + } + scope:actor = { piety >= massive_buy_claim_piety_value } + } + + # Checks to determine prestige cost for regular artifacts + trigger_if = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = common } + } + scope:actor = { prestige >= minor_buy_claim_prestige_value } + } + trigger_else_if = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = masterwork } + } + scope:actor = { prestige >= medium_buy_claim_prestige_value } + } + trigger_else_if = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = famed } + } + scope:actor = { prestige >= major_buy_claim_prestige_value } + } + trigger_else = { + limit = { + exists = scope:target + NOT = { exists = scope:target.var:relic } + scope:target = { rarity = illustrious } + } + scope:actor = { prestige >= massive_buy_claim_prestige_value } + } + } + + desc = buy_artifact_claim_desc + + auto_accept = yes + + on_accept = { + # If it's a religous artifact... + if = { + limit = { + exists = scope:target.var:relic + } + # Toast to the actor + scope:actor = { + send_interface_toast = { + type = event_artifact_good + title = bought_artifact_claim.t + left_icon = scope:recipient + right_icon = scope:target + # Determine piety cost + if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = common } + } + scope:actor = { add_piety = minor_buy_claim_piety_loss } + } + else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = masterwork } + } + scope:actor = { add_piety = medium_buy_claim_piety_loss } + } + else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = famed } + } + scope:actor = { add_piety = major_buy_claim_piety_loss } + } + else_if = { + limit = { + exists = scope:target.var:relic + scope:target = { rarity = illustrious } + } + scope:actor = { add_piety = massive_buy_claim_piety_loss } + } + add_personal_artifact_claim = scope:target + } + } + # Toast to the recipient + scope:recipient = { + send_interface_message = { + type = event_artifact_bad_text + title = sold_artifact_claim.t + desc = sold_artifact_claim.desc + left_icon = scope:actor + right_icon = scope:target + } + } + } + # If it's not a religous artifact... + else = { + scope:actor = { + send_interface_toast = { + type = event_artifact_bad + title = bought_artifact_claim.t + left_icon = scope:recipient + right_icon = scope:target + # Determine prestige cost + if = { + limit = { + exists = scope:target + scope:target = { rarity = common } + } + scope:actor = { add_prestige = minor_buy_claim_prestige_loss } + } + else_if = { + limit = { + exists = scope:target + scope:target = { rarity = masterwork } + } + scope:actor = { add_prestige = medium_buy_claim_prestige_loss } + } + else_if = { + limit = { + exists = scope:target + scope:target = { rarity = famed } + } + scope:actor = { add_prestige = major_buy_claim_prestige_loss } + } + else_if = { + limit = { + exists = scope:target + scope:target = { rarity = illustrious } + } + scope:actor = { add_prestige = massive_buy_claim_prestige_loss} + } + add_personal_artifact_claim = scope:target + } + } + + scope:recipient = { + send_interface_message = { + type = event_artifact_bad_text + title = sold_artifact_claim.t + desc = sold_artifact_claim.desc + left_icon = scope:actor + right_icon = scope:target + } + } + } + scope:actor = { + stress_impact = { + just = medium_stress_impact_gain + honest = medium_stress_impact_gain + } + } + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = claimed_my_artifact_opinion + opinion = -40 + } + # Recipient grows closer to forming a rivalry with the actor + if = { + limit = { + can_set_relation_potential_rival_trigger = { + CHARACTER = scope:actor + } + } + set_relation_potential_rival = scope:actor + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_bought_artifact_claim.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI STUFF + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + # Only want AI to target neighbors + ai_recipients = neighboring_rulers + ai_recipients = nearby_domicile_owners + } + + ai_frequency = 30 + + ai_potential = { + # The basic requirements + is_imprisoned = no + is_playable_character = yes + is_available_ai_adult = yes + + # They must be well supplied + prestige > major_prestige_value + piety > major_piety_value + + # Only really greedy AI characters get to use this + ai_greed >= high_positive_ai_value + } + + ai_will_do = { + base = 30 + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + # Make it more likely for AI characters to buy claims if they have a royal court + modifier = { + scope:actor = { + has_royal_court = yes + has_dlc_feature = court_artifacts + } + factor = 2 + } + + # Prevent AI from buying artifact claims for court artifacts if they don't have a royal court + modifier = { + scope:actor = { + has_royal_court = no + } + scope:target = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = book + artifact_slot_type = pedestal + } + } + factor = 0 + } + + # AI won't buy claims on artifacts owned by their lovers or friends + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor +# is_close_or_extended_family_of = scope:actor + } + } + factor = 0 + } + } +} + +# Demand an artifact you have a claim on +demand_dynasty_banner_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + common_interaction = yes + interface_priority = 60 + use_diplomatic_range = yes + desc = demand_dynasty_banner_interaction_desc + + target_type = artifact + target_filter = recipient_artifacts + + greeting = negative + notification_text = DEMAND_ARTIFACT_PROPOSAL + + answer_accept_key = DEMAND_ARTIFACT_ACCEPT + answer_reject_key = DEMAND_ARTIFACT_REJECT + + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = nearby_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 60 + + is_shown = { + NOT = { + scope:recipient = scope:actor + } + NOT = { #Landless have no court in which to display such a banner, and no real authority over a landed relative + scope:actor = { government_has_flag = government_is_landless_adventurer } + } + exists = scope:actor.dynasty + exists = scope:recipient.dynasty + scope:recipient.dynasty = scope:actor.dynasty + scope:recipient = { + # needs to have a banner of our dynasty + any_character_artifact = { + AND = { + exists = var:banner_dynasty + var:banner_dynasty = scope:recipient.dynasty + var:banner_dynasty.dynast = scope:actor + } + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + + scope:recipient = { is_busy_in_events_localised = yes } + + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + is_imprisoned = no + } + trigger_if = { + limit = { exists = scope:target } + custom_description = { + text = "demand_dynasty_banner_artifact_tt" + exists = scope:target.var:banner_dynasty + scope:target.var:banner_dynasty = scope:recipient.dynasty + scope:actor = scope:target.var:banner_dynasty.dynast + } + } + } + + on_accept = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + scope:target = { + set_owner = scope:actor + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = pleased_opinion + opinion = 30 + } + } + } + + # 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_received_banner.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + scope:target = { + save_scope_as = demanded_artifact + } + if = { + limit = { + exists = scope:demanded_artifact + } + scope:actor = { + set_variable = { + name = demanded_this_artifact_interaction_recently + value = scope:demanded_artifact + years = 5 + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = demand_artifact_interaction_notification + left_icon = scope:recipient + right_icon = scope:target + custom_tooltip = demand_artifact_interaction_notification_refused + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = insult_opinion + opinion = -10 + } + } + } + } + if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = refusal_opinion + opinion = -10 + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_refused_banner.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope: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 = 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" + + send_options_exclusive = no + + ai_accept = { + base = 100 + modifier = { + add = 70 + scope:actor.max_military_strength > scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_STRONGER_REASON + } + modifier = { + add = -70 + scope:actor.max_military_strength < scope:recipient.max_military_strength + desc = ARTIFACT_MILITARY_WEAKER_REASON + } + modifier = { + add = { + value = ai_boldness + multiply = -1 + divide = 2 + } + NOT = { ai_boldness = 0 } + desc = ARTIFACT_BOLDNESS_REASON + } + modifier = { + add = -50 + scope:actor = { + has_relation_rival = scope:recipient + } + desc = ARTIFACT_RIVAL_REASON + } + modifier = { + add = -80 + scope:actor = { + has_relation_nemesis = scope:recipient + } + desc = ARTIFACT_NEMESIS_REASON + } + modifier = { + add = 50 + scope:recipient = { + target_is_liege_or_above = scope:actor + } + desc = ARTIFACT_LIEGE_REASON + } + modifier = { + scope:hook = yes + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + ai_potential = { + is_adult = yes + is_at_war = no + ai_greed >= low_negative_ai_value + has_outstanding_artifact_claims = yes + } + + + + ai_min_reply_days = 7 + ai_max_reply_days = 14 + + ai_will_do = { + base = 100 + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + + modifier = { + add = 50 + has_relation_rival = scope:recipient + } + modifier = { + add = 80 + has_relation_nemesis = scope:recipient + } + modifier = { + add = 50 + target_is_liege_or_above = scope:recipient + } + modifier = { # An Intimidated character is very unlikely to raise their hand + add = -25 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 1 + } + } + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + modifier = { # A Cowed character will never take this interaction + factor = 0 + scope:actor = { + has_dread_level_towards = { + target = scope:recipient + level = 2 + } + } + } + modifier = { + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + } + } + factor = 0 + } + } +} + +# Destroy Artifact +destroy_artifact_interaction = { + interface_priority = 30 + common_interaction = yes + icon = artifact + category = interaction_category_friendly + desc = destroy_artifact_interaction_desc + icon = artifact + + target_type = artifact + target_filter = actor_artifacts + + ai_targets = { + ai_recipients = self + } + + # You can only destroy your own artifacts + is_shown = { + scope:recipient = scope:actor + scope:actor = { + has_any_artifact = yes + } + } + + can_be_picked_artifact = { + custom_tooltip = { + text = artifact_is_related_to_contract_tt + NOT = { + scope:target = { has_variable = 1025_treasure_map } + } + } + } + + has_valid_target_showing_failures_only = { + trigger_if = { + limit = { + NOT = { + scope:recipient.faith = { has_doctrine_parameter = destroying_artifacts_is_pious } + } + } + custom_tooltip = { + text = artifact_is_rarer_than_masterwork_tt + OR = { + scope:target = { rarity = common } + scope:target = { rarity = masterwork } + } + } + } + trigger_if = { + limit = { + NOR = { + scope:target = { rarity = common } + scope:target = { rarity = masterwork } + } + } + custom_tooltip = { + text = destroying_artifacts_is_not_pious_tt + scope:recipient.faith = { has_doctrine_parameter = destroying_artifacts_is_pious } + } + } + scope:actor = { + trigger_if = { + limit = { is_landless_adventurer = yes } + employs_court_position = armorer_camp_officer + } + } + } + + on_accept = { + destroy_artifact_aniconist_effect = { + ARTIFACT = scope:target + DESTROYER = scope:actor + GIVE_GOLD = yes + PIETY_BY_DEFAULT = no + } + } + + ai_frequency = 24 + + ai_potential = { + OR = { + faith = { # Aniconists will always want to destroy artifacts + has_doctrine_parameter = destroying_artifacts_is_pious + } + gold <= minor_gold_value # Poor rulers will consider getting rid of their trash for gold + AND = { # Economic boom personalities will bolster their treasury by getting rid of trash more often + gold <= medium_gold_value + ai_has_economical_boom_personality = yes + } + any_character_artifact = { # All rulers want to get rid of actively detrimental trash + has_variable = unwanted_artifact + } + } + } + + ai_will_do = { + base = 0 + modifier = { # Rulers will always destroy unwanted artifacts + add = 100 + scope:target = { + has_variable = unwanted_artifact + } + } + modifier = { # Rulers will consider destroying trash artifacts if they're poor + add = 100 + scope:target = { + has_variable = ai_to_ai_destroy_in_sieges + } + } + modifier = { # AI rulers will destroy common unequipped artifacts if money is low + add = 100 + OR = { + gold <= minor_gold_value # Poor rulers will consider getting rid of their trash for gold + AND = { # Economic boom personalities will bolster their treasury by getting rid of trash more often + gold <= medium_gold_value + ai_has_economical_boom_personality = yes + } + } + scope:target = { + rarity = common + is_equipped = no + } + } + modifier = { # AI rulers will destroy all unequipped artifacts to get out of debt + add = 100 + gold <= 0 + scope:target = { + is_equipped = no + } + } + modifier = { # Common artifact trinkets on their last legs can be considered for destruction if money is low + add = 100 + OR = { + gold <= minor_gold_value # Poor rulers will consider getting rid of their trash for gold + AND = { # Economic boom personalities will bolster their treasury by getting rid of trash more often + gold <= medium_gold_value + ai_has_economical_boom_personality = yes + } + } + scope:target = { + rarity = common + artifact_slot_type = miscellaneous + artifact_durability <= define:NInventory|ARTIFACT_LOW_DURABILITY + } + } + modifier = { # Aniconists destroy most things + add = 100 + faith = { + has_doctrine_parameter = destroying_artifacts_is_pious + } + OR = { # This errors in the ai_potential so it's been moved here + has_trait = zealous + scope:target = { is_equipped = no } + scope:target = { exists = var:relic } + } + # The logic below relies on the idea that they have the destroying_artifacts_is_pious doctrine parameter. If the restrictions are loosened, these triggers should be updated + NOR = { + has_trait = cynical + AND = { + has_trait = greedy + NOT = { has_trait = zealous } + } + } + OR = { + has_trait = zealous # Destroy all the artifacts + any_character_artifact = { + is_equipped = no + } + any_character_artifact = { + exists = var:relic + } + } + } + } +} diff --git a/common/character_interactions/00_blackmail_interactions.txt b/common/character_interactions/00_blackmail_interactions.txt new file mode 100644 index 00000000..18c3f75e --- /dev/null +++ b/common/character_interactions/00_blackmail_interactions.txt @@ -0,0 +1,518 @@ +blackmail_interaction = { + category = interaction_category_hostile + common_interaction = yes + interface = blackmail + popup_on_receive = yes + icon = secret + + ai_maybe = yes + + desc = blackmail_interaction_desc + + on_decline_summary = blackmail_decline_summary + + is_shown = { + scope:recipient = { + NOT = { this = scope:actor } + age > 10 + } + scope:recipient = { + any_secret = { + is_known_by = scope:actor + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_busy_in_events_localised = yes + } + #Not at war with them + NOT = { + scope:actor = { is_at_war_with = scope:recipient } + } + #Already have a strong hook + custom_description = { + text = "already_strong_hook" + subject = scope:actor + object = scope:recipient + NOT = { + scope:actor = { has_strong_hook = scope:recipient } + } + } + #No appropriate secret + custom_description = { + scope:recipient = { + any_secret = { + is_blackmailable_secret_trigger = { + BLACKMAILER = scope:actor + PARTICIPANT = scope:recipient + } + } + } + text = "no_blackmailable_secret" + } + } + + is_highlighted = { + scope:recipient = { + any_secret = { + is_known_by = scope:actor + is_blackmailable_secret_trigger = { BLACKMAILER = scope:actor PARTICIPANT = scope:recipient } + } + } + scope:actor = { + NOR = { + has_hook_of_type = { + target = scope:recipient + type = weak_blackmail_hook + } + has_hook_of_type = { + target = scope:recipient + type = strong_blackmail_hook + } + } + } + } + + has_valid_target_showing_failures_only = { + exists = scope:target + scope:target = { + is_known_by = scope:actor + is_blackmailable_secret_trigger = { BLACKMAILER = scope:actor PARTICIPANT = scope:recipient } + } + } + + + can_send = { + custom_description = { # Exploit prevention + text = "has_sent_interaction_already" + subject = scope:recipient + scope:actor = { + NOT = { exists = var:currently_blackmailing } + } + } + } + + on_send = { + hidden_effect = { + # Block sending another interaction while rejection event is active + scope:actor = { + set_variable = { + name = currently_blackmailing + value = scope:recipient + days = 30 + } + } + scope:target = { + if = { + limit = { + exists = secret_target + } + secret_target = { + save_scope_as = secret_target + } + } + if = { + limit = { + secret_type = secret_disputed_heritage + } + secret_target.father = { + save_scope_as = father + } + secret_target.real_father = { + save_scope_as = real_father + } + } + if = { + limit = { + scope:target = { + secret_type = secret_disputed_heritage + } + } + secret_target.father = { + save_scope_as = father + } + secret_target.real_father = { + save_scope_as = real_father + } + } + } + } + } + + on_accept = { + scope:actor = { + remove_variable = currently_blackmailing + play_music_cue = mx_cue_murder + } + blackmail_interaction_effect = yes #Adds strong or weak hook + opinion penalty + + # 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_blackmail.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + #Return event about exposing the secret + #AI will always expose + if = { + limit = { + scope:actor = { is_ai = no } + } + scope:recipient = { + custom_tooltip = BLACKMAIL_INTERACTION_HUMAN_TT + } + } + show_as_tooltip = { + if = { + limit = { exists = scope:secret } + scope:secret = { + expose_secret = scope:actor + } + } + if = { + limit = { exists = scope:target } + scope:target = { + expose_secret = scope:actor + } + } + } + scope:actor = { trigger_event = blackmail.0001 } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_blackmail.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_blocked_effect = { + scope:actor = { remove_variable = currently_blackmailing } + } + + ai_accept = { + base = 0 + modifier = { + add = 80 + desc = BLACKMAIL_INTERACTION_BASE_ACCEPTANCE + } + modifier = { + add = -20 + scope:recipient = { + has_trait = brave + } + desc = BLACKMAIL_INTERACTION_BRAVE_ACCEPTANCE + } + modifier = { + add = -20 + scope:recipient = { + has_trait = arrogant + } + desc = BLACKMAIL_INTERACTION_ARROGANT_ACCEPTANCE + } + modifier = { + add = 10 + scope:recipient = { + has_trait = craven + } + desc = BLACKMAIL_INTERACTION_CRAVEN_ACCEPTANCE + } + modifier = { + add = 50 + scope:recipient = { + has_trait = paranoid + } + desc = BLACKMAIL_INTERACTION_PARANOID_ACCEPTANCE + } + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 25 + } + + opinion_modifier = { + trigger = { + scope:recipient = { + opinion = { + target = scope:actor + value < 0 + } + } + } + opinion_target = scope:recipient + who = scope:actor + multiplier = 0.3 + desc = BLACKMAIL_INTERACTION_OPINION_ACCEPTANCE + } + modifier = { + add = -20 + scope:recipient = { + has_opinion_modifier = { + target = scope:actor + modifier = trust_opinion + value < 0 + } + } + desc = BLACKMAIL_INTERACTION_DISTRUST_ACCEPTANCE + } + modifier = { + add = 30 + any_secret = { + is_known_by = scope:actor + is_criminal_for = scope:recipient + } + desc = BLACKMAIL_MAJOR_SECRET_ACCEPTANCE + } + + + modifier = { + add = intimidated_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + desc = INTIMIDATED_REASON + } + modifier = { + add = cowed_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + desc = COWED_REASON + } + } + + ai_min_reply_days = 1 + ai_max_reply_days = 5 + + notification_text = { + triggered_desc = { + trigger = { + scope:actor = { + opinion = { + target = scope:recipient + value > 0 + } + } + } + desc = BLACKMAIL_NOTIFICATION_OPENING + } + first_valid = { + triggered_desc = { + trigger = { scope:target = { secret_type = secret_deviant } } + desc = BLACKMAIL_NOTIFICATION_SECRET_DEVIANT + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_homosexual } } + desc = BLACKMAIL_NOTIFICATION_SECRET_HOMOSEXUAL + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_murder } } + desc = BLACKMAIL_NOTIFICATION_SECRET_MURDER + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_murder_attempt } } + desc = BLACKMAIL_NOTIFICATION_SECRET_MURDER_ATTEMPT + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_cannibal } } + desc = BLACKMAIL_NOTIFICATION_SECRET_CANNIBAL + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_lover } } + desc = BLACKMAIL_NOTIFICATION_SECRET_LOVER + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_non_believer } } + desc = BLACKMAIL_NOTIFICATION_SECRET_NON_BELIEVER + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_incest } } + desc = BLACKMAIL_NOTIFICATION_SECRET_INCEST + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_witch } } + desc = BLACKMAIL_NOTIFICATION_SECRET_WITCH + } + triggered_desc = { + trigger = { scope:target = { secret_type = secret_crypto_religionist } } + desc = BLACKMAIL_NOTIFICATION_SECRET_CRYPTO_RELIGIONIST + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_disputed_heritage + secret_target.real_father = scope:actor + secret_target.mother = scope:recipient + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_ILLEGITIMATE_CHILD_ACTOR + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_disputed_heritage + secret_target.mother = scope:recipient + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_ILLEGITIMATE_CHILD_OTHER + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_disputed_heritage + secret_target.real_father = scope:actor + secret_target = { + OR = { + this = scope:recipient + is_twin_of = scope:recipient + } + } + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_ILLEGITIMATE_CHILD_TARGET_ACTOR + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_disputed_heritage + secret_target = { + OR = { + this = scope:recipient + is_twin_of = scope:recipient + } + } + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_ILLEGITIMATE_CHILD_TARGET_OTHER + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_unmarried_illegitimate_child + secret_target.real_father = scope:actor + secret_target.mother = scope:recipient + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_UNMARRIED_ILLEGITIMATE_CHILD_ACTOR + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_unmarried_illegitimate_child + secret_target.mother = scope:recipient + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_UNMARRIED_ILLEGITIMATE_CHILD_OTHER + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_unmarried_illegitimate_child + secret_target.real_father = scope:actor + secret_target = { + OR = { + this = scope:recipient + is_twin_of = scope:recipient + } + } + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_UNMARRIED_ILLEGITIMATE_CHILD_TARGET_ACTOR + } + triggered_desc = { + trigger = { + scope:target = { + secret_type = secret_unmarried_illegitimate_child + secret_target = { + OR = { + this = scope:recipient + is_twin_of = scope:recipient + } + } + } + } + desc = BLACKMAIL_NOTIFICATION_SECRET_UNMARRIED_ILLEGITIMATE_CHILD_TARGET_OTHER + } + + desc = BLACKMAIL_NOTIFICATION_SECRET_FALLBACK + } + desc = BLACKMAIL_NOTIFICATION_THREAT + } + + # AI + + ai_targets = { + ai_recipients = known_secrets + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_frequency = 6 + + ai_will_do = { + base = 100 + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0 + scope:actor.ai_honor >= 75 + } + + modifier = { + factor = 0.1 + scope:actor.ai_honor >= 30 + } + + modifier = { + factor = 0 + scope:actor.ai_honor >= -30 + scope:recipient = { + has_relation_lover = scope:actor + } + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + has_relation_soulmate = scope:actor + } + } + } + } + + ai_set_target = { + scope:recipient = { + random_secret = { + limit = { + is_known_by = scope:actor + is_blackmailable_secret_trigger = { BLACKMAILER = scope:actor PARTICIPANT = scope:recipient } + } + save_scope_as = target + } + } + } +} + diff --git a/common/character_interactions/00_ce1_interactions.txt b/common/character_interactions/00_ce1_interactions.txt new file mode 100644 index 00000000..82085c27 --- /dev/null +++ b/common/character_interactions/00_ce1_interactions.txt @@ -0,0 +1,353 @@ +# 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 + NOT = { scope:actor = scope:recipient } + scope:recipient = { + is_landed = yes + age >= 12 + is_physically_able = yes + } + } + + 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 = { always = scope:hook } + scope:actor = { + use_hook = scope:recipient + } + } + if = { + limit = { always = scope:gold_cost } + scope:actor = { + 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 = 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 new file mode 100644 index 00000000..941a14e4 --- /dev/null +++ b/common/character_interactions/00_character_interactions.txt @@ -0,0 +1,2188 @@ +# Add general actions here, if any. + +offer_vassalization_interaction = { + category = interaction_category_vassal + icon = icon_vassal + + desc = offer_vassalization_interaction_desc + + ai_targets = { + ai_recipients = neighboring_rulers + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 12 + + is_shown = { + scope:actor = { + is_landed = yes + } + scope:recipient = { + NOT = { this = scope:actor } + is_playable_character = yes + is_independent_ruler = yes + highest_held_title_tier < scope:actor.highest_held_title_tier + NOT = { government_has_flag = cannot_be_vassal_or_liege } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_at_war = no + + custom_description = { + text = was_recently_granted_independence + NOT = { + has_opinion_modifier = { + modifier = granted_independence_opinion + target = scope:actor + } + } + } + } + } + + greeting = positive + notification_text = OFFER_VASSALIZATION_INTERACTION_NOTIFICATION + + cost = { + influence = { + value = 0 + if = { + limit = { scope:influence_send_option = yes } + add = scope:actor.medium_influence_value + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + } + + ai_min_reply_days = 5 + ai_max_reply_days = 10 + + ai_accept = { + base = -50 + # MAIN + # Heretic/Infidel modifier. + # Tier difference modifier. + # Dejure modifier. + # Distant/Remote Realm modifier. + # Military power difference modifier. + + # MINOR + # Rivalry modifier. + # Same Dynasty modifier. + # Cultural/Cultural Group modifiers. + # Ageism modifier vs kids. + # Ruler Legitimacy modifier. + # Claimant modifier. + # FP3 Piety Level modifier. + + # OPINION SCALES + # Dread + # Compare Opinion modifier. + + # PERKS + modifier = { # Perk boost + desc = offer_vassalization_true_ruler_perk_tt + trigger = { + scope:actor = { has_perk = true_ruler_perk } + } + add = true_ruler_value + } + modifier = { # Education 5 boost + desc = offer_vassalization_education_diplomacy_5_tt + trigger = { + scope:actor = { has_trait_with_flag = offer_vassalisation_25 } + } + add = 25 + } + + # EVENTS - temporary bonuses gained by events + modifier = { + desc = event_bonus_to_vassal_accept_tt + trigger = { + scope:actor = { has_character_modifier = event_bonus_to_vassal_accept } + } + add = 20 + } + + + # STRUGGLES - bonus gained by successful Sway scheme during the Persian Struggle + modifier = { + desc = fp3_persian_struggle_previously_swayed_tt + trigger = { + scope:recipient = { + has_opinion_modifier = { + modifier = scheme_sway_and_compelled_to_submit_opinion + target = scope:actor + } + } + } + add = 20 + } + + modifier = { + desc = fp3_rekindler_of_iran_modifier_reason + trigger = { + AND = { + scope:actor = { dynasty ?={ has_dynasty_modifier = fp3_rekindler_of_iran_modifier } } + scope:recipient = { culture = { has_cultural_pillar = heritage_iranian } } + } + } + add = 20 + } + + + modifier = { # Cultural Acceptance + add = offer_vassalage_acceptance_value + desc = cultural_acceptance_interaction_reason + trigger = { + scope:actor = { + NOT = { has_same_culture_as = scope:recipient } + culture = { + cultural_acceptance = { target = scope:recipient.culture value <= 90 } + } + } + } + } + + # MAIN + modifier = { #Different faith, no pluralism. + desc = offer_vassalization_interaction_aibehavior_differentfaith_tt + trigger = { + scope:recipient = { + NOR = { #Of two different faiths AND the potential vassal's faith is not pluralistic. + faith = scope:actor.faith + faith = { has_doctrine = doctrine_pluralism_pluralistic } + } + } + } + add = { + value = -40 + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_hostile_level + } + } + } + add = -40 + } + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_evil_level + } + } + } + add = -40 + } + } + } + + modifier = { #Different faith, pluralism. + desc = offer_vassalization_interaction_aibehavior_differentfaith_tt + trigger = { + scope:recipient = { + NOT = { + faith = scope:actor.faith + } + NOT = { + scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } + } + faith = { has_doctrine = doctrine_pluralism_pluralistic } + } + } + add = { + value = -20 + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_hostile_level + } + } + } + add = -20 + } + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_evil_level + } + } + } + add = -20 + } + } + } + + modifier = { #Different faith, both have pluralism. + desc = offer_vassalization_interaction_aibehavior_differentfaith_tt + trigger = { + scope:recipient = { + NOT = { + faith = scope:actor.faith + } + scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } + faith = { has_doctrine = doctrine_pluralism_pluralistic } + } + } + add = { + value = -10 + 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 = -10 + } + } + } + modifier = { #I am a King! + desc = offer_vassalization_interaction_aibehavior_amkingtier_tt + trigger = { + scope:recipient = { highest_held_title_tier = tier_kingdom } + } + add = { + value = -50 + if = { + limit = { + scope:recipient = { + OR = { + government_has_flag = government_is_republic + government_has_flag = government_is_theocracy + } + } + } + add = -50 + } + if = { + limit = { + scope:recipient.sub_realm_size >= 5 + } + add = -50 + } + if = { + limit = { + scope:recipient.sub_realm_size >= 10 + } + add = -100 + } + } + } + modifier = { #We just fought against each other. + desc = offer_vassalization_interaction_aibehavior_recent_war_tt + trigger = { + scope:recipient = { + any_truce_holder = { + this = scope:actor + } + } + # Ensure the truce wasn't purchased and is indeed from a war + scope:actor = { + NOT = { + has_purchased_truce_with_char = { TARGET = scope:recipient } + } + } + } + add = -50 + } + modifier = { #I fought an independence war against you. + desc = offer_vassalization_interaction_aibehavior_independence_war_tt + trigger = { + scope:recipient = { + exists = var:independence_war_former_liege + var:independence_war_former_liege = scope:actor + } + } + add = -200 + } + modifier = { # I am Tribal and you are not + desc = interaction_tribal_vs_nontribal + trigger = { + scope:recipient = { + government_has_flag = government_is_tribal + } + scope:actor = { + NOT = { government_has_flag = government_is_tribal } + } + } + add = -20 + } + modifier = { # You are Tribal and I am not + desc = interaction_nontribal_vs_tribal + trigger = { + scope:actor = { + government_has_flag = government_is_tribal + } + scope:recipient = { + NOT = { government_has_flag = government_is_tribal } + } + } + add = -20 + } + modifier = { # Isolationist tradition + desc = isolationist_reason + trigger = { + NOT = { + scope:actor.culture = scope:recipient.culture + } + scope:recipient.culture = { + has_cultural_tradition = tradition_isolationist + } + } + add = -20 + } + modifier = { #Bankrupt + desc = bankrupt_reason + trigger = { + scope:actor.gold <= -1 + } + add = -100 + } + modifier = { #Wide difference in rank + desc = offer_vassalization_interaction_aibehavior_widetitletier_tt + trigger = { + scope:actor = { + tier_difference = { + target = scope:recipient + value > 1 + } + } + } + add = 10 + } + modifier = { # Allied + desc = offer_vassalization_interaction_aibehavior_allied_tt + trigger = { + scope:recipient = { + is_allied_to = scope:actor + } + } + add = 20 + } + modifier = { # Is the Rightful Liege of recipient + desc = offer_vassalization_interaction_aibehavior_rightfulliegetitleholder_tt + trigger = { + scope:actor = { is_rightful_liege_of = scope:recipient } + } + add = 20 + } + modifier = { #Is not the Rightful Liege of recipient + desc = offer_vassalization_interaction_aibehavior_not_rightfulliegetitleholder_tt + trigger = { + NOT = { + scope:actor = { is_rightful_liege_of = scope:recipient } + } + } + add = -20 + } + modifier = { # Encircled + desc = offer_vassalization_interaction_aibehavior_encircled_tt + trigger = { + scope:recipient = { + NOT = { + any_neighboring_top_liege_realm_owner = { + NOT = { + this = scope:actor + } + } + } + NOT = { + any_realm_county = { + is_coastal_county = yes + } + } + } + } + add = 20 + } + modifier = { #Distant Realm — Overseas Connection + desc = offer_vassalization_interaction_aibehavior_distantrealm_tt + trigger = { + scope:actor = { + character_is_realm_neighbor = scope:recipient + NOT = { #Ibiza should want to be a vassal of Mallorca, etc. + character_is_land_realm_neighbor = scope:recipient + scope:actor = { is_rightful_liege_of = scope:recipient } + } + } + } + add = -100 + } + modifier = { #Distant Realm — No Connection + desc = offer_vassalization_interaction_aibehavior_distantrealm_tt + trigger = { + scope:actor = { + NOT = { + character_is_realm_neighbor = scope:recipient + } + } + scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value < 200000 } } + } + add = -250 + } + modifier = { #Remote Realm. + desc = offer_vassalization_interaction_aibehavior_remoterealm_tt + trigger = { + scope:actor = { + NOT = { + character_is_realm_neighbor = scope:recipient + } + } + scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value >= 200000 } } + } + add = -500 + } + modifier = { + desc = offer_vassalization_interaction_aibehavior_power_tt + add = { + value = 1 + subtract = { + value = scope:recipient.max_military_strength # Intended for recipient to use max, to avoid having vassalizations become too easy for weakened realms + divide = { value = scope:actor.current_military_strength min = 1 } + } + multiply = 20 + ceiling = yes + } + } + modifier = { + desc = offer_vassalization_interaction_aibehavior_vassal_opinion_tt + trigger = { + scope:actor = { + number_of_powerful_vassals >= 1 + } + } + + add = { + value = 0 + scope:actor = { + every_powerful_vassal = { + if = { + limit = { + save_temporary_opinion_value_as = { + name = vassal_opinion + target = scope:actor + } + } + add = scope:vassal_opinion + } + } + + if = { + limit = { + number_of_powerful_vassals > 0 + } + divide = number_of_powerful_vassals + } + else = { + divide = 5 + } + } + + divide = 5 + } + } + + # MINOR + modifier = { #Friend modifier. + desc = offer_vassalization_interaction_aibehavior_friend_tt + trigger = { + scope:recipient = { + has_relation_friend = scope:actor + NOT = { has_relation_best_friend = scope:actor } + } + } + add = 10 + } + modifier = { #Best Friend modifier. + desc = offer_vassalization_interaction_aibehavior_best_friend_tt + trigger = { + scope:recipient = { + has_relation_best_friend = scope:actor + } + } + add = 20 + } + modifier = { #Lover modifier. + desc = interaction_lover + trigger = { + scope:recipient = { + has_relation_lover = scope:actor + NOT = { has_relation_soulmate = scope:actor } + } + } + add = 10 + } + modifier = { #Soulmate modifier. + desc = interaction_soulmate + trigger = { + scope:recipient = { + has_relation_soulmate = scope:actor + } + } + add = 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 = -100 + } + modifier = { #Nemesis modifier. + desc = offer_vassalization_interaction_aibehavior_nemesis_tt + trigger = { + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + add = -1000 + } + modifier = { #Same Dynasty modifier. + desc = offer_vassalization_interaction_aibehavior_dynasty_tt + trigger = { + scope:recipient = { + dynasty = scope:actor.dynasty + } + } + add = 5 + } + + modifier = { # Same language + add = 5 + desc = speaks_same_language_interaction_reason + trigger = { + scope:actor = { + knows_language_of_culture = scope:recipient.culture + } + } + } + + modifier = { # Iberian Struggle, less likely for outsiders to vassalize inside + add = -35 + desc = iberian_struggle_reason_reason + trigger = { + scope:actor = { + NOT = { + any_character_struggle = { is_struggle_type = iberian_struggle } + } + } + scope:recipient = { + any_character_struggle = { is_struggle_type = iberian_struggle } + } + } + } + + modifier = { #Ageism modifier vs kids. + desc = offer_vassalization_interaction_aibehavior_child_tt + trigger = { + scope:actor = { + age < 12 + } + scope:recipient = { + age > 16 + } + } + add = -5 + } + modifier = { #Illegitimacy modifier. + desc = offer_vassalization_interaction_aibehavior_illegitimate_tt + trigger = { + OR = { + AND = { + scope:actor = { + has_trait = bastard + } + scope:recipient = { + faith = { NOT = { has_doctrine = doctrine_bastardry_none } } + } + } + has_trait = denounced + has_trait = disinherited + } + } + add = -10 + } + + modifier = { #Claimant modifier. + desc = offer_vassalization_interaction_aibehavior_claimant_tt + trigger = { + scope:actor.primary_title = { + scope:recipient = { + has_claim_on = prev + } + } + } + add = -20 + } + + modifier = { # Ambitious + desc = TAKE_THE_VOWS_AMBITIOUS + trigger = { + scope:recipient = { + has_trait = ambitious + } + } + add = -20 + } + + modifier = { # Paranoid + desc = INTERACTION_PARANOID + trigger = { + scope:recipient = { + has_trait = paranoid + } + } + add = -20 + } + + modifier = { # Arrogant + desc = INTERACTION_ARROGANT + trigger = { + scope:recipient = { + has_trait = arrogant + } + } + add = -20 + } + + modifier = { # Fickle + desc = INTERACTION_FICKLE + trigger = { + scope:recipient = { + has_trait = fickle + } + } + add = -10 + } + + modifier = { # Stubborn + desc = INTERACTION_STUBBORN + trigger = { + scope:recipient = { + has_trait = stubborn + } + } + add = -10 + } + + modifier = { # Trusting + desc = TAKE_THE_VOWS_TRUSTING + trigger = { + scope:recipient = { + has_trait = trusting + } + } + add = 5 + } + + modifier = { # Content + desc = INTERACTION_CONTENT + trigger = { + scope:recipient = { + has_trait = content + } + } + add = 5 + } + + modifier = { # FP3 modifier. + desc = GENERIC_YOUR_PIETY_LEVEL_MODIFIER + trigger = { scope:actor = { any_character_struggle = { has_struggle_phase_parameter = piety_level_affects_vassalage_acceptance } } } + add = { + value = { + value = scope:actor.piety_level + subtract = low_piety_level + } + multiply = 10 + } + } + + # OPINION INFLUENCE + modifier = { + add = intimidated_external_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + desc = INTIMIDATED_REASON + } + modifier = { + add = cowed_external_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + desc = COWED_REASON + } + opinion_modifier = { #Compare Opinion modifier - Clans care more about opinion + trigger = { + scope:actor = { + government_has_flag = government_is_clan + } + scope:recipient = { + government_has_flag = government_is_clan + } + } + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.7 + } + opinion_modifier = { #Compare Opinion modifier. + trigger = { + OR = { + scope:actor = { + NOT = { government_has_flag = government_is_clan } + } + scope:recipient = { + NOT = { government_has_flag = government_is_clan } + } + } + } + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.35 + } + + # DIPLOMATIC COURT GRANDEUR BONUS + modifier = { + trigger = { + scope:actor = { + has_royal_court = yes + has_dlc_feature = royal_court + has_court_type = court_diplomatic + court_grandeur_current_level >= 1 + } + } + add = { + value = scope:actor.court_grandeur_current + if = { + limit = { # Reduce the bonus if you are below your expected level + scope:actor = { + court_grandeur_current_level < court_grandeur_minimum_expected_level + } + } + multiply = 0.15 + } + else = { + multiply = 0.3 + } + } + desc = DIPLOMATIC_COURT_ACCEPTANCE_INCREASE_REASON + } + + # CONTRACT OPTIONS + modifier = { + add = 60 + scope:recipient = { government_has_flag = government_is_feudal } + scope:religious_exemption = yes + desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON + } + modifier = { + add = 30 + scope:recipient = { government_has_flag = government_is_clan } + scope:religious_exemption_clan = yes + desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON + } + modifier = { + add = 30 + scope:recipient = { government_has_flag = government_is_feudal } + scope:low_obligations = yes + desc = CONTRACT_LOW_TAXES_REASON + } + modifier = { + add = -40 + scope:recipient = { government_has_flag = government_is_feudal } + scope:high_obligations = yes + desc = CONTRACT_HIGH_TAXES_REASON + } + + # INSPECTION BONUSES + modifier = { + desc = "INSPECTION_REASON" + add = 5 + scope:recipient = { + has_variable_list = lesser_inspection_bonus + is_target_in_variable_list = { + name = lesser_inspection_bonus + target = scope:actor + } + } + } + modifier = { + desc = "INSPECTION_REASON" + add = 10 + scope:recipient = { + has_variable_list = inspection_bonus + is_target_in_variable_list = { + name = inspection_bonus + target = scope:actor + } + } + } + modifier = { + desc = "INSPECTION_REASON_REWARD" + add = 10 + scope:recipient = { + has_variable_list = inspection_reward + is_target_in_variable_list = { + name = inspection_reward + target = scope:actor + } + } + } + modifier = { + desc = "INSPECTION_REASON_REWARD_FOCUSED" + add = 10 + scope:actor = { has_character_modifier = inspection_reward_focused_vassal_acceptance } + } + + # LOW LEGITIMACY + modifier = { + desc = "LOW_LEGITIMACY_REASON" + add = -25 + scope:actor = { + has_legitimacy_flag = reduced_vassalization_acceptance + } + } + modifier = { + desc = "LOW_LEGITIMACY_REASON" + add = -50 + scope:actor = { + has_legitimacy_flag = very_reduced_vassalization_acceptance + } + } + modifier = { + desc = "LOW_LEGITIMACY_REASON" + add = -75 + scope:actor = { + has_legitimacy_flag = massively_reduced_vassalization_acceptance + } + } + + # HIGH LEGITIMACY + modifier = { + desc = "HIGH_LEGITIMACY_REASON" + add = 25 + scope:actor = { + has_legitimacy_flag = increased_vassalization_acceptance + } + } + modifier = { + desc = "HIGH_LEGITIMACY_REASON" + add = 50 + scope:actor = { + has_legitimacy_flag = very_increased_vassalization_acceptance + } + } + modifier = { + desc = "HIGH_LEGITIMACY_REASON" + add = 75 + scope:actor = { + has_legitimacy_flag = extra_increased_vassalization_acceptance + } + } + + # INFLUENCE + modifier = { + add = 25 + scope:influence_send_option = yes + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + + #HISTORICALLY ADMIN PEOPLES WANT TO BE ADMIN + modifier = { + add = 30 + scope:actor = { + government_has_flag = government_is_administrative + } + scope:recipient = { + culture = { + OR = { + this = culture:greek + any_parent_culture_or_above = { + this = culture:greek + } + this = culture:han + any_parent_culture_or_above = { + this = culture:han + } + } + } + } + + desc = "HISTORICAL_ADMIN_REASON" + } + + modifier = { # AI-only weights, keep the pope from vassalizing too fast + trigger = { + exists = faith:catholic.religious_head + faith:catholic.religious_head = scope:actor + scope:actor = { is_ai = yes } + } + add = -50 + } + + #ALL these modifiers are also used in impress_intent_vassalization_acceptance_value, keep them synced + } + + # Low starting obligations + send_option = { + is_shown = { + scope:recipient = { + government_has_flag = government_is_feudal + } + } + flag = low_obligations + localization = low_obligations + } + + # Medium starting obligations + send_option = { + is_shown = { + scope:recipient = { + government_has_flag = government_is_feudal + } + } + flag = normal_obligations # If selected then scope:flag_name will be set to yes + localization = normal_obligations # Loc_key for option label + starts_enabled = { always = yes } # Trigger for whether this should be on when the window opens. If not defined, defaults to off + + } + + # High starting obligations + send_option = { + is_shown = { + scope:recipient = { + government_has_flag = government_is_feudal + } + } + flag = high_obligations # If selected then scope:flag_name will be set to yes + localization = high_obligations # Loc_key for option label + } + + # Low starting obligations + religious exemption + send_option = { + is_shown = { + scope:recipient = { + government_has_flag = government_is_feudal + } + } + is_valid = { + NOT = { scope:recipient.faith = scope:actor.faith } + } + flag = religious_exemption + localization = religious_exemption + } + + # Religious exemption, for clans + send_option = { + is_shown = { + scope:recipient = { + government_has_flag = government_is_clan + } + } + is_valid = { + NOT = { scope:recipient.faith = scope:actor.faith } + } + flag = religious_exemption_clan + localization = religious_exemption + } + + # Nothing, for clans + send_option = { + is_shown = { + scope:recipient = { + government_has_flag = government_is_clan + } + } + is_valid = { + always = yes + } + flag = no_exemption_clan + localization = no_exemption + } + + send_option = { # EP3 Influence + is_shown = { + scope:actor = { + government_has_flag = government_has_influence + } + } + is_valid = { + scope:actor = { influence >= medium_influence_value } + } + flag = influence_send_option + localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE + } + + send_options_exclusive = yes + + on_accept = { + offer_vassalization_interaction_effect = yes + scope:actor = { + trigger_event = char_interaction.0001 + + ## Remove bonus, it's been used + if = { + limit = { has_character_modifier = event_bonus_to_vassal_accept } + remove_character_modifier = event_bonus_to_vassal_accept + } + + if = { # FP3 + limit = { any_character_struggle = { has_struggle_phase_parameter = offer_vassalization_removes_disloyalty } } + scope:recipient = { remove_trait = disloyal } + } + } + } + + on_decline = { + scope:actor = { + trigger_event = char_interaction.0002 + } + } + + ai_potential = { + is_adult = yes + is_independent_ruler = yes + highest_held_title_tier > tier_county + } + + ai_will_do = { + base = 100 + + # AI prefers to receive higher obligations from their vassals when possible. + modifier = { + add = 2 + scope:low_obligations = yes + } + + modifier = { + add = 3 + scope:normal_obligations = yes + } + + modifier = { + add = 4 + scope:high_obligations = yes + } + + # Cynical rulers are happy to offer religious protection to potential vassals, but only when it makes them accept a vassalization offer they would otherwise refuse. + # Zealous rulers become increasingly reluctant to offer religious protection, as they want to enforce religious homogeneity in their realm. + modifier = { + add = { + value = ai_zeal + multiply = -2 + max = 1 + } + scope:religious_exemption = yes + } + + + modifier = { # If the recipient is a player, do not bother sending + factor = 0 + scope:recipient = { + is_ai = no + } + } + } +} + +offer_fealty_interaction = { + category = interaction_category_vassal + icon = icon_liege + + desc = offer_fealty_interaction_desc + + is_shown = { + scope:recipient = { + NOT = { this = scope:actor } + is_landed = yes + is_independent_ruler = yes # Target has to be independent + } + scope:actor.highest_held_title_tier < scope:recipient.highest_held_title_tier + scope:actor = { + is_landed = yes + is_independent_ruler = yes # You have to be independent - This check exists to prevent a lot of edge-cases where you can change liege + NOT = { government_has_flag = cannot_be_vassal_or_liege } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_imprisoned = no + is_at_war = no + } + scope:recipient = { + custom_description = { + text = "offer_fealty_neighboring_condition" + subject = scope:recipient + OR = { + any_neighboring_and_across_water_top_liege_realm_owner = { this = scope:actor } + any_held_title = { + is_de_jure_liege_or_above_target = scope:actor.capital_barony + } + } + } + #making sure that if this gov types got land you won't be able to swear fealty to them + NOR = { + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_holy_order + government_has_flag = government_is_mercenary + } + } + } + + greeting = positive + notification_text = OFFER_FEALTY_INTERACTION_NOTIFICATION + + ai_min_reply_days = 5 + ai_max_reply_days = 10 + + ai_accept = { + base = 50 + # MAIN + # Heretic/Infidel modifier. + # Tier difference modifier. + # Dejure modifier. + # Distant/Remote Realm modifier. + + # MINOR + # Rivalry modifier. + # Same Dynasty modifier. + # Cultural/Cultural Group modifiers. + # Claimant modifier. + + # OPINION SCALES + # Personality modifier. + # Compare Opinion modifier. + + modifier = { # Different faith, no pluralism. + 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 + } + } + } + + modifier = { # I am a King! + desc = offer_fealty_interaction_aibehavior_amkingtier_tt + trigger = { + scope:actor = { highest_held_title_tier = tier_kingdom } + } + add = -10 + } + 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 = { # They are my Rightful Liege + desc = offer_vassalization_interaction_aibehavior_rightfulvassaltitleholder_tt + trigger = { + scope:recipient = { is_rightful_liege_of = scope:actor } + } + add = 25 + } + 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 < 200000 } } + } + 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 >= 200000 } } + } + 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 = -30 + } + modifier = { # Same Dynasty modifier. + desc = offer_vassalization_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 = { 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 = { # Claimant modifier. + desc = offer_vassalization_interaction_aibehavior_claimant_tt + trigger = { + scope:actor.primary_title = { + scope:recipient = { + has_claim_on = prev + } + } + } + add = -15 + } + + # PERSONALITY + ai_value_modifier = { + ai_greed = 0.75 + min = 0 + } + + # OPINION INFLUENCE + opinion_modifier = { # Compare Opinion modifier. + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + } + + # CONTRACT OPTIONS + modifier = { + add = { + value = -10 + if = { + limit = { scope:recipient = { has_trait = zealous } } + add = -30 + } + else_if = { + limit = { scope:recipient = { has_trait = cynical } } + add = 30 + } + } + scope:actor = { government_has_flag = government_is_feudal } + scope:religious_taxation = yes + desc = CONTRACT_RELIGIOUS_TAXATION_REASON + } + modifier = { + add = -40 + scope:actor = { government_has_flag = government_is_feudal } + scope:low_obligations = yes + desc = CONTRACT_LOW_TAXES_REASON + } + modifier = { + add = 40 + scope:actor = { government_has_flag = government_is_feudal } + scope:high_obligations = yes + desc = CONTRACT_HIGH_TAXES_REASON + } + modifier = { + add = { + value = -10 + if = { + limit = { scope:recipient = { has_trait = zealous } } + add = -30 + } + else_if = { + limit = { scope:recipient = { has_trait = cynical } } + add = 30 + } + } + scope:actor = { government_has_flag = government_is_clan } + scope:religious_exemption_clan = yes + desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON + } + # EP3 + modifier = { # cowed from an emperor's impressive visit + add = 10 + desc = speaks_same_language_interaction_reason + trigger = { + scope:actor = { + knows_language_of_culture = scope:recipient.culture + } + } + } + } + + # Low starting obligations + send_option = { + is_shown = { + scope:actor = { + government_has_flag = government_is_feudal + } + } + flag = low_obligations + localization = low_obligations + } + + # Medium starting obligations + send_option = { + is_shown = { + scope:actor = { + government_has_flag = government_is_feudal + } + } + flag = normal_obligations + localization = normal_obligations + starts_enabled = { always = yes } + + } + + # High starting obligations + send_option = { + is_shown = { + scope:actor = { + government_has_flag = government_is_feudal + } + } + flag = high_obligations + localization = high_obligations + } + + # Medium-high starting obligations + religious protection + send_option = { + is_shown = { + scope:actor = { + government_has_flag = government_is_feudal + } + } + is_valid = { + NOT = { scope:recipient.faith = scope:actor.faith } + } + flag = religious_taxation + localization = religious_taxation + } + + # Religious exemption, for clans + send_option = { + is_shown = { + scope:actor = { + government_has_flag = government_is_clan + } + } + is_valid = { + NOT = { scope:recipient.faith = scope:actor.faith } + } + flag = religious_exemption_clan + localization = religious_exemption + } + + # Nothing, for clans + send_option = { + is_shown = { + scope:actor = { + government_has_flag = government_is_clan + } + } + is_valid = { + always = yes + } + flag = no_exemption_clan + localization = no_exemption + } + + send_options_exclusive = yes + + on_accept = { + offer_fealty_interaction_effect = yes + + scope:actor = { + trigger_event = char_interaction.0010 + if = { + limit = { + government_has_flag = government_is_administrative + scope:recipient = { NOT = { government_has_flag = government_is_administrative } } + } + custom_tooltip = will_change_from_administrative_tt + custom_tooltip = will_lose_administrative_government_type_tt + } + } + scope:recipient = { + if = { + limit = { + has_imprisonment_reason = scope:actor + } + consume_imprisonment_reasons = scope:actor + } + if = { + limit = { + has_revoke_title_reason = scope:actor + } + consume_revoke_title_reason = scope:actor + } + if = { + limit = { + has_banish_reason = scope:actor + } + consume_banish_reasons = scope:actor + } + if = { + limit = { + has_execute_reason = scope:actor + } + consume_execute_reasons = scope:actor + } + } + } + + on_decline = { + scope:actor = { + trigger_event = char_interaction.0011 + } + } +} + +force_vote_in_succession_election_interaction = { + category = interaction_category_uncategorized + hidden = yes + special_interaction = force_vote_in_succession_election + icon = scroll_scales + + greeting = positive + notification_text = FORCE_VOTE_INTERACTION_NOTIFICATION + force_notification = yes + + desc = force_vote_in_succession_election_interaction_desc + + auto_accept = yes + + is_valid_showing_failures_only = { + custom_description = { + text = must_have_usable_hook_blocker + subject = scope:actor + object = scope:recipient + + scope:actor = { + has_usable_hook = scope:recipient + } + } + } + + extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" + + on_accept = { + scope:actor = { + send_interface_message = { + type = event_title_good + title = force_vote_in_succession_election_interaction + right_icon = scope:recipient + + show_as_tooltip = { + scope:actor = { + use_hook = scope:recipient + custom_tooltip = msg_force_vote_in_succession_election_message + } + } + } + hidden_effect = { + 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 = minor_unity_gain + DESC = clan_unity_voted.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} + +set_primary_spouse_interaction = { + category = interaction_category_diplomacy + desc = set_primary_spouse_interaction_desc + icon = icon_marriage + + auto_accept = yes + + is_shown = { + scope:actor = { + is_spouse_of = scope:recipient + } + NOT = { + scope:actor.primary_spouse = scope:recipient + } + } + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { + NOT = { + has_trait = incapable + } + } + } + + on_accept = { + scope:actor.primary_spouse = { + if = { + limit = { + has_opinion_modifier = { + target = scope:actor + modifier = spouse_made_primary_opinion + } + } + remove_opinion = { + modifier = spouse_made_primary_opinion + target = scope:actor + } + } + add_opinion = { + target = scope:actor + modifier = spouse_made_secondary_opinion + } + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_bad + title = set_primary_spouse_interaction_toast + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = set_primary_spouse_interaction_toast_removed + } + } + } + scope:actor = { + set_primary_spouse = scope:recipient + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = set_primary_spouse_interaction_toast + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = set_primary_spouse_interaction_toast_changed + } + } + } + scope:recipient = { + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_good + title = set_primary_spouse_interaction_toast + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = set_primary_spouse_interaction_toast_added + } + } + + if = { + limit = { + has_opinion_modifier = { + target = scope:actor + modifier = spouse_made_secondary_opinion + } + } + remove_opinion = { + modifier = spouse_made_secondary_opinion + target = scope:actor + } + } + add_opinion = { + target = scope:actor + modifier = spouse_made_primary_opinion + } + } + } + + ai_targets = { + ai_recipients = spouses + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 72 + + ai_potential = { + any_spouse = { + count >= 2 + } + } + + ai_will_do = { + base = 100 + + modifier = { #AI only does it if current primary_spouse is hated and another spouse is preferred. + factor = 0 + NOT = { + scope:actor = { + opinion = { + target = scope:actor.primary_spouse + value < -50 + } + opinion = { + target = scope:recipient + value >= 50 + } + } + } + } + } +} + +grant_independence_interaction = { + category = interaction_category_vassal + force_notification = yes + greeting = positive + notification_text = GRANT_INDEPENDENCE_INTERACTION_NOTIFICATION + icon = independence + + desc = grant_independence_interaction_desc + + is_shown = { + scope:recipient = { + is_vassal_of = scope:actor + } + NOT = { scope:recipient = scope:actor } + } + + is_valid_showing_failures_only = { + NOT = { scope:actor = { is_at_war_with = scope:recipient } } + scope:actor = { + is_independent_ruler = yes + NOT = { + is_at_war = yes + } + } + custom_description = { + text = is_at_war_with_another_vassal + object = scope:recipient + NOT = { + scope:actor = { + any_vassal_or_below = { + is_at_war_with = scope:recipient + } + } + } + } + custom_description = { + text = is_de_jure_vassal_check + object = scope:recipient + + trigger_if = { # Admin rulers can grant tribal vassals independence regardless of de jure + limit = { + scope:actor = { government_has_flag = government_is_administrative } + scope:recipient = { government_has_flag = government_is_tribal } + } + # Always possible + } + trigger_else = { + NOT = { #Cannot be used against de jure vassals + scope:recipient.primary_title = { + any_this_title_or_de_jure_above = { + holder = scope:actor + } + } + } + } + + } + custom_tooltip = { + text = can_only_remove_diarch_by_elevating_them.tt + NOT = { scope:recipient ?= scope:actor.diarch } + } + } + + auto_accept = yes + + on_accept = { + scope:actor = { + stress_impact = { + ambitious = medium_stress_impact_gain + arrogant = minor_stress_impact_gain + greedy = minor_stress_impact_gain + } + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_vassal_independence_interaction_toast + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_vassal_independence_interaction_toast_desc + + # Struggle Parameter + if = { + limit = { + exists = dynasty + NOT = { + any_held_title = { + is_de_jure_liege_or_above_target = scope:recipient.primary_title + } + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = granting_independence_to_non_dejure_gives_renown + } + } + dynasty = { + add_dynasty_prestige = medium_dynasty_prestige_value + } + } + } + } + } + + scope:recipient = { + #Send notifications + if = { + limit = { + any_liege_or_above = { + is_ai = no + NOT = { this = scope:actor } + } + } + every_liege_or_above = { + limit = { + is_ai = no + NOT = { this = scope:actor } + } + trigger_event = vassal_interaction.0023 + } + } + if = { + limit = { + any_liege_or_above = { + any_vassal = { + is_ai = no + NOR = { + this = scope:recipient + this = scope:actor + } + } + } + } + every_liege_or_above = { + limit = { + any_vassal = { + is_ai = no + NOR = { + this = scope:recipient + this = scope:actor + } + } + } + every_vassal = { + limit = { + is_ai = no + NOT = { this = scope:recipient } + } + trigger_event = { + id = vassal_interaction.0022 + days = 3 + } + } + } + } + + add_opinion = { + target = scope:actor + modifier = granted_independence_opinion + } + + add_truce_both_ways = { + character = scope:actor + days = 3650 + name = TRUCE_GRANT_INDEPENDENCE + } + + 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 + } + + # Struggle Catalysts. + scope:actor = { + if = { + limit = { + catalyst_gave_independence_to_powerful_diff_faith_culture_vassal_preliminary_trigger = { + CHAR1 = scope:actor + CHAR2 = scope:recipient + } + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:recipient + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + CHAR = scope:recipient + } + } + activate_struggle_catalyst = { + catalyst = catalyst_gave_independence_to_powerful_diff_faith_culture_vassal + character = scope:actor + } + } + } + + if = { + limit = { + NOT = { + any_held_title = { + is_de_jure_liege_or_above_target = scope:recipient.primary_title + } + } + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_independence_from_non_dejure_vassal + CHAR = scope:recipient + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_independence_from_non_dejure_vassal + CHAR = scope:recipient + } + } + activate_struggle_catalyst = { + catalyst = catalyst_independence_from_non_dejure_vassal + character = scope:actor + } + } + } + } + + # Grant independence to non de_jure + + + # 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_grant_independence.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_will_do = { + base = 0 #The AI should never do this! + + # Except in the context of Struggle + modifier = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + NOT = { + any_held_title = { + is_de_jure_liege_or_above_target = scope:recipient.primary_title + } + } + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_independence_from_non_dejure_vassal + } + has_character_flag = agenda_towards_escalation + } + } + add = -50 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_independence_from_non_dejure_vassal + } + } + } + add = 100 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 10 + } + } +} + +expose_secret_interaction = { + interface_priority = 120 + common_interaction = no + category = interaction_category_hostile + interface = blackmail + icon = secret + + desc = expose_secret_interaction_desc + + is_shown = { + scope:recipient = { + any_secret = { + is_known_by = scope:actor + } + NOT = { this = scope:actor } + age > 10 + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + } + + on_accept = { + } + + auto_accept = yes + + ai_will_do = { + base = 0 + + # Struggle + modifier = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + is_important_or_vip_struggle_character = yes + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_reveal_secret_important + } + has_character_flag = agenda_towards_escalation + } + } + add = 200 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_reveal_secret_important + } + } + } + add = -100 + } + } + } + modifier = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + has_trait = fp3_struggle_supporter + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_reveal_secret_supporter + } + has_trait = fp3_struggle_detractor + } + } + add = 200 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_reveal_secret_supporter + } + } + } + add = -100 + } + } + } + modifier = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + has_trait = fp3_struggle_detractor + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_reveal_secret_detractor + } + has_trait = fp3_struggle_supporter + } + } + add = 200 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_reveal_secret_detractor + } + } + } + add = -100 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + } +} diff --git a/common/character_interactions/00_choose_favorite_interaction.txt b/common/character_interactions/00_choose_favorite_interaction.txt new file mode 100644 index 00000000..73aa41fb --- /dev/null +++ b/common/character_interactions/00_choose_favorite_interaction.txt @@ -0,0 +1,170 @@ +# Pick a favorite child to pre-select when choosing your destiny +choose_favorite_interaction = { + category = interaction_category_friendly + icon = designate_favorite + + desc = choose_favorite_interaction_desc + + is_shown = { + scope:actor = { is_ai = no } + scope:recipient.dynasty = scope:actor.dynasty + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + scope:actor = { is_alive = yes } + scope:recipient = { is_favorite_child = no } + scope:recipient = { + custom_tooltip = { + text = cant_be_another_player_tt + is_ai = yes + } + custom_tooltip = { + text = must_be_direct_descendant_tt + OR = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + } + custom_tooltip = { + text = favorite_child_must_be_in_good_health_tt + NOR = { + has_trait = incapable + health <= 2.5 + } + } + custom_tooltip = { + text = cant_be_hostage_tt + is_hostage = no + } + custom_tooltip = { + text = cant_already_be_your_heir + NOT = { + this = scope:actor.player_heir + } + } + custom_tooltip = { + text = no_republic_or_theocracy_tt + NOR = { + government_has_flag = government_is_republic + government_has_flag = government_is_theocracy + } + } + trigger_if = { + limit = { + is_ruler = yes + } + custom_tooltip = { + text = not_baron_holy_order_merc_tt + highest_held_title_tier >= tier_county + primary_title = { + is_mercenary_company = no + is_holy_order = no + } + } + } + } + } + + on_auto_accept = { + scope:recipient = { + send_interface_message = { + title = choose_favorite_interaction_notification + left_icon = scope:actor + show_as_tooltip = { + scope:actor = { + set_relation_favorite_child = { reason = favorite_child_chosen target = scope:recipient } + } + } + } + } + } + + on_accept = { + assign_favourite_child_effect = { + ACTOR = scope:actor + RECIPIENT = scope:recipient + } + } + + auto_accept = yes +} + +remove_favorite_interaction = { + category = interaction_category_friendly + icon = designate_favorite + + desc = remove_favorite_interaction_desc + + is_shown = { + scope:actor = { is_ai = no } + scope:recipient.dynasty = scope:actor.dynasty + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + scope:actor = { is_alive = yes } + scope:recipient = { is_favorite_child = yes } + } + + on_auto_accept = { + scope:recipient = { + send_interface_message = { + title = remove_favorite_interaction_notification + left_icon = scope:actor + show_as_tooltip = { + scope:actor = { + remove_relation_favorite_child = scope:recipient + } + } + } + } + } + + on_accept = { + scope:actor = { + random_relation = { + type = favorite_child + save_scope_as = current_favorite + } + send_interface_toast = { + title = remove_favorite_interaction_notification + left_icon = scope:actor + right_icon = scope:recipient + if = { + limit = { + exists = scope:current_favorite + } + remove_relation_favorite_child = scope:current_favorite + scope:current_favorite = { + add_opinion = { + target = scope:actor + modifier = no_more_favorite_opinion + } + } + } + custom_tooltip = remove_favorite_interaction_notification.tt + } + hidden_effect = { + every_close_or_extended_family_member = { + limit = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + add_opinion = { + target = scope:actor + modifier = no_more_favorite_opinion + } + add_opinion = { + target = scope:recipient + modifier = no_more_favorite_opinion + } + } + } + } + } + + auto_accept = yes +} diff --git a/common/character_interactions/00_court_amenities_interactions.txt b/common/character_interactions/00_court_amenities_interactions.txt new file mode 100644 index 00000000..cdbcd67f --- /dev/null +++ b/common/character_interactions/00_court_amenities_interactions.txt @@ -0,0 +1,122 @@ +#Accuse of violating sumptuary laws +#by James Beaumont + +sumptuary_law_debate_interaction = { + category = interaction_category_hostile + interface_priority = 20 + desc = sumptuary_law_debate_interaction_desc + icon = weaver_inspiration + + is_shown = { + scope:actor = { + has_royal_court = yes + has_dlc_feature = royal_court + amenity_level = { + type = court_fashion + value <= 2 + } + } + NOT = { scope:actor = scope:recipient } + scope:recipient = { + # Character is either not a priest/zealous class of a naked priest faith or doesn't belong to a naked priest faith + OR = { + faith = { NOT = { has_doctrine_parameter = naked_priests_active } } + NOR = { + ai_zeal >= 50 + has_trait = devoted + has_trait = zealous + government_has_flag = government_is_theocracy + has_council_position = councillor_court_chaplain + } + } + # They are in your realm to some capacity + OR = { + liege = scope:actor #You may debate with direct vassals and courtiers. + host = scope:actor #You may debate guests + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + } + scope:recipient = { + # Friends don't accuse friends of fashion crimes + NOT = { + has_friendly_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + custom_description = { + text = sumptuary_debate_has_been_debated + object = scope:recipient + scope:recipient = { + NOT = { has_character_modifier = used_sumptuary_debate_modifier } #To prevent back and forth & back-to-back challenges + NOT = { has_character_modifier = sumptuary_debated_modifier } + } + } + custom_description = { + text = sumptuary_debate_timing + scope:actor = { + NOT = { has_character_modifier = used_sumptuary_debate_modifier } + } + } + scope:recipient = { + is_adult = yes + } + scope:recipient = { + NOT = { has_strong_hook = scope:actor } + } + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + } + } + + auto_accept = yes + + on_accept = { + hidden_effect = { + scope:actor = { + add_character_modifier = { + modifier = used_sumptuary_debate_modifier + years = 2 + } + } + scope:recipient = { + trigger_event = { + id = court_amenities_interactions.0001 + days = 1 + } + add_character_modifier = { + modifier = sumptuary_debated_modifier + years = 10 + } + } + } + custom_tooltip = sumptuary_debate_interaction.tt_modifiers + scope:actor = { + stress_impact = { + arbitrary = minor_stress_impact_loss + just = minor_stress_impact_gain + } + custom_tooltip = sumptuary_debate_interaction.tt_winnings_actor + } + scope:recipient = { + custom_tooltip = sumptuary_debate_interaction.tt_winnings_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_sumptuary_law.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} diff --git a/common/character_interactions/00_courtier_and_guest_interactions.txt b/common/character_interactions/00_courtier_and_guest_interactions.txt new file mode 100644 index 00000000..3e788ad8 --- /dev/null +++ b/common/character_interactions/00_courtier_and_guest_interactions.txt @@ -0,0 +1,1173 @@ +recruit_guest_interaction = { + category = interaction_category_vassal + icon = guest + common_interaction = yes + + special_ai_interaction = recruit_courtier + + desc = recruit_guest_interaction_desc + + should_use_extra_icon = { + NOT = { scope:recipient = { is_close_family_of = scope:actor } } + scope:actor = { has_usable_hook = scope:recipient } + } + extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:recipient = { is_pool_guest_of = scope:actor } + scope:actor = { + is_ruler = yes + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_ruler = no + } + trigger_if = { + limit = { + NOR = { + scope:recipient = { is_close_family_of = scope:actor } # Close family members are free + scope:actor = { has_usable_hook = scope:recipient } # Using a hook makes it free + } + } + scope:actor = { + gold >= scope:recipient.recruit_guest_interaction_cost + } + } + } + + can_send = { + # check if we're using the hook (is_valid_showing_failures_only checks only if we have a hook), else we need to be able to afford it + trigger_if = { + limit = { + NOR = { + AND = { exists = scope:hook always = scope:hook } + scope:recipient = { is_close_family_of = scope:actor } + } + scope:actor = { has_usable_hook = scope:recipient } # without this the is_valid_showing_failures_only above shows the same error + } + scope:actor = { + gold >= scope:recipient.recruit_guest_interaction_cost + } + } + } + + send_options_exclusive = no + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = hook + localization = SCHEME_HOOK + } + 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 >= minor_influence_value } + } + flag = influence_send_option + localization = INFLUENCE_SEND_OPTION + } + + on_accept = { + scope:recipient = { + every_traveling_family_member = { + add_to_temporary_list = recruiting_family + } + } + + if = { + limit = { scope:recipient = { is_close_family_of = scope:actor } } # Close family members are free + # do nothing + } + else_if = { + limit = { always = scope:hook } + scope:actor = { use_hook = scope:recipient } + } + else_if = { + limit = { always = scope:influence_send_option } + scope:actor = { change_influence = minor_influence_loss } + } + else = { + scope:recipient = { + save_temporary_scope_as = most_expensive_person + + every_in_list = { + list = recruiting_family + + if = { + limit = { this.individual_recruit_guest_interaction_cost >= scope:most_expensive_person.individual_recruit_guest_interaction_cost } + save_temporary_scope_as = most_expensive_person + } + } + } + + scope:actor = { + pay_short_term_gold = { + target = scope:most_expensive_person + gold = scope:most_expensive_person.recruit_guest_interaction_cost_with_list #This value needs a list with the name "recruiting_family" + } + } + } + + + + scope:actor = { + send_interface_message = { + type = event_generic_neutral + title = msg_recruited_guest_to_court_interaction_title + right_icon = scope:recipient + stress_impact = { + shy = minor_stress_impact_gain + paranoid = minor_stress_impact_gain + } + every_in_list = { + list = recruiting_family + scope:actor = { + add_courtier ?= prev + } + remove_variable = last_visited_ruler # Even though it times out automatically, removing it here saves cycles for performance. + add_opinion = { + target = scope:actor + opinion = 50 + modifier = grateful_opinion + } + } + } + } + } + + auto_accept = yes + + # AI + ai_targets = { + ai_recipients = guests + } + ai_frequency = 12 + + ai_potential = { + is_at_war = no # Try to avoid wasting your war chest! + ai_has_conqueror_personality = no + short_term_gold >= yearly_character_income + any_courtier_or_guest = { + is_alive = yes + count <= 30 + } + ai_should_focus_on_building_in_their_capital = no + } + + ai_will_do = { + base = 0 + + #Lacking councillors + compare_modifier = { + trigger = { + scope:actor = { + NOT = { exists = cp:councillor_chancellor } + } + scope:recipient = { + OR = { + AND = { + is_male = yes + scope:actor = { faith_dominant_gender_male_or_equal = yes } + } + AND = { + is_female = yes + scope:actor = { faith_dominant_gender_female_or_equal = yes } + } + } + } + } + target = scope:recipient + value = diplomacy + offset = { + value = 0 + subtract = decent_skill_rating + } + } + compare_modifier = { + trigger = { + scope:actor = { + NOT = { exists = cp:councillor_marshal } + } + scope:recipient = { + OR = { + AND = { + is_male = yes + scope:actor = { faith_dominant_gender_male_or_equal = yes } + } + AND = { + is_female = yes + scope:actor = { faith_dominant_gender_female_or_equal = yes } + } + } + } + } + target = scope:recipient + value = martial + offset = { + value = 0 + subtract = decent_skill_rating + } + } + compare_modifier = { + trigger = { + scope:actor = { + NOT = { exists = cp:councillor_steward } + } + scope:recipient = { + OR = { + AND = { + is_male = yes + scope:actor = { faith_dominant_gender_male_or_equal = yes } + } + AND = { + is_female = yes + scope:actor = { faith_dominant_gender_female_or_equal = yes } + } + } + } + } + target = scope:recipient + value = stewardship + offset = { + value = 0 + subtract = decent_skill_rating + } + } + compare_modifier = { + trigger = { scope:actor = { NOT = { exists = cp:councillor_spymaster } } } + target = scope:recipient + value = intrigue + offset = { + value = 0 + subtract = decent_skill_rating + } + } + + #Lacking court physician + compare_modifier = { + trigger = { + scope:actor = { court_physician_available_trigger = no } + scope:recipient = { + would_be_valid_for_court_position = { + employer = scope:actor + court_position = court_physician_court_position + } + } + } + target = scope:recipient + value = learning + offset = { + value = 0 + subtract = decent_skill_rating + } + } + + #Lacking knights + compare_modifier = { + trigger = { + scope:recipient.prowess >= decent_skill_rating + scope:recipient = { + can_be_knight_trigger = { ARMY_OWNER = scope:actor } + } + scope:actor = { + OR = { + number_of_knights < max_number_of_knights + any_knight = { + prowess < decent_skill_rating + } + } + } + } + target = scope:recipient + value = prowess + offset = { + value = 0 + subtract = decent_skill_rating + } + } + + + #Vested interest + modifier = { + add = 20 + scope:recipient = { + OR = { + has_relation_lover = scope:actor + has_relation_friend = scope:actor + has_secret_relation_lover = scope:actor + has_relation_soulmate = scope:actor + has_relation_best_friend = scope:actor + is_child_of = scope:actor + } + } + } + + + #Claimants + modifier = { + scope:recipient = { + any_claim = { + neighboring_useful_courtier_or_guest_claim_trigger = { RULER = scope:actor } + } + } + add = { + value = 0 + if = { + limit = { + scope:recipient = { + any_claim = { + neighboring_useful_courtier_or_guest_claim_trigger = { RULER = scope:actor } + tier >= tier_duchy + } + } + } + add = 40 + } + else = { + add = 30 + } + } + } + + # Make it all more likely + modifier = { + factor = 4 + } + + # The AI will always use a hook if it can + modifier = { + scope:hook = yes + add = 1 + } + } +} + +kick_from_court_interaction = { + category = interaction_category_vassal + icon = guest + + + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:recipient = { is_foreign_court_or_pool_guest = yes } } + desc = kick_from_court_interaction_desc_guest + } + desc = kick_from_court_interaction_desc + } + } + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:recipient = { + OR = { + is_courtier_of = scope:actor + is_pool_guest_of = scope:actor + } + bp2_valid_for_standard_interactions_trigger = yes + } + } + + cost = { + prestige = { + if = { + limit = { + scope:actor = { is_landless_adventurer = yes } + } + value = minor_prestige_value + } + else_if = { + limit = { + scope:recipient = { + any_traveling_family_member = { + count = all + is_lowborn = yes + } + } + } + value = minor_prestige_value + } + else = { + value = medium_prestige_value + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + kick_from_court_validity_trigger = yes + + custom_description = { + text = "kick_from_court_interaction_travelling_family_invalid" + subject = scope:recipient + NOT = { + any_traveling_family_member = { + NOT = { this = scope:recipient } + kick_from_court_validity_trigger = no + } + } + } + } + } + + on_accept = { + scope:actor = { + stress_impact = { + gregarious = minor_stress_impact_gain + } + + hidden_effect = { + send_interface_message = { + type = event_generic_neutral + title = msg_kicked_courtier_from_court_interaction_title + + right_icon = scope:recipient + + show_as_tooltip = { + scope:actor = { + remove_courtier_or_guest = scope:recipient + } + } + + #Remove them as guardian/ward for any courtier + 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 + } + } + scope:recipient = { trigger_event = char_interaction.0090 } + } + if = { + limit = { + any_courtier = { + has_relation_ward = scope:recipient + } + } + random_courtier = { + limit = { + has_relation_ward = scope:recipient + } + save_scope_as = 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 + } + } + } + } + } + } + + #To be able to send a cohesive interface message AND show a good tooltip + show_as_tooltip = { + #Remove them as guardian for any child + 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 + } + } + } + + #Remove them as ward of any courtier + if = { + limit = { + any_courtier = { + has_relation_ward = scope:recipient + } + } + random_courtier = { + limit = { + has_relation_ward = scope:recipient + } + save_scope_as = guardian + remove_guardian_effect = { + GUARDIAN = scope:guardian + WARD = scope:recipient + RETURN_WARD = yes + HIDE_OPINION = no + } + } + } + } + } + + scope:recipient = { + every_traveling_family_member = { + add_to_temporary_list = kicked_family + } + } + + every_in_list = { + list = kicked_family + #Kicks, adds opinions, adds people to kicked_relatives_list + kick_from_court_interaction_effect = yes + } + + if = { + limit = { + any_in_list = { + list = kicked_relatives_list + is_alive = yes + } + } + every_in_list = { + list = kicked_relatives_list + custom = all_close_family_members_of_kicked_characters + add_opinion = { + modifier = kicked_relative_from_court + target = scope:actor + } + } + } + + employed_booner_invalidation_effect = { EMPLOYEE = scope:recipient LIEGE = scope:actor } + } + + auto_accept = yes +} + +invite_to_court_interaction = { + category = interaction_category_vassal + icon = guest + + desc = invite_to_court_interaction_desc + + is_shown = { + scope:recipient = { + NOR = { + is_courtier_of = scope:actor + is_foreign_court_guest = yes + AND = { + exists = host + host = scope:actor + } + is_ruler = yes + } + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + scope:recipient = { + OR = { + NOT = { exists = liege } + NOT = { has_variable = invite_to_court_cooldown } + } + } + text = INVITE_TO_COURT_COOLDOWN + } + can_recruit_character_to_court_trigger = { + RECRUITER = scope:actor + RECRUITEE = scope:recipient + } + } + + #Pay som gold to persuade a wandering character to come to your court + send_option = { + is_shown = { + exists = scope:recipient + } + flag = cover_travel_expenses + localization = COVER_TRAVEL_EXPENSES + } + 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 + scope:recipient.top_liege = scope:actor.top_liege + } + flag = influence_send_option + localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE + } + 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 + + 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 = { + hidden_effect = { + scope:recipient = { + set_variable = { + name = invite_to_court_cooldown + years = 5 + } + } + + if = { + limit = { + exists = scope:recipient.liege + } + scope:recipient.liege = { + send_interface_message = { + type = event_generic_neutral + title = msg_courtier_left_court_interaction_title + + right_icon = scope:recipient + + show_as_tooltip = { + remove_courtier_or_guest = scope:recipient + } + } + } + } + } + + scope:actor = { + send_interface_message = { + type = event_generic_neutral + title = invite_to_court_interaction_notification + right_icon = scope:recipient + + scope:recipient = { + every_traveling_family_member = { + scope:actor = { add_courtier = prev } + hidden_effect = { + return_to_court = yes + } + } + } + + if = { + limit = { always = scope:hook } + scope:actor = { + use_hook = scope:recipient + } + } + } + } + + + if = { + limit = { always = scope:cover_travel_expenses } + scope:actor = { + pay_short_term_gold = { + gold = { + value = bribe_value + multiply = 0.5 + } + target = scope:recipient + } + stress_impact = { + greedy = minor_stress_impact_gain + } + } + } + } + + ai_accept = { + base = -50 + + #Opinions + opinion_modifier = { + trigger = { + exists = liege + is_courtier_of = liege + } + opinion_target = liege + multiplier = -0.5 + step = 5 + max = 25 + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + step = 5 + max = 25 + } + + # Stooge modifier + modifier = { + scope:recipient = { has_variable = non_recruitable_var } + scope:recipient.var:non_recruitable_var = scope:actor + add = -200 + desc = AI_STOOGE + } + + #Current roles + modifier = { + is_knight = yes + add = -20 + desc = AI_MY_LIEGES_KNIGHT + } + modifier = { + is_commanding_army = yes + add = -30 + desc = AI_MY_LIEGES_COMMANDER + } + modifier = { + is_councillor = yes + add = -40 + desc = AI_ON_THE_COUNCIL + } + + modifier = { + trigger = { scope:recipient = { has_court_position = court_physician_court_position } } + add = -20 + desc = AI_COURT_PHYSICIAN + } + + #Relations & relatives (with actor) + modifier = { + has_relation_lover = scope:actor + add = 100 + desc = AI_YOUR_LOVER + } + + modifier = { + has_relation_friend = scope:actor + add = 75 + desc = AI_YOUR_FRIEND + } + + modifier = { + is_child_of = scope:actor + add = 160 + desc = AI_YOUR_CHILD + } + + modifier = { + this.dynasty.dynast = scope:actor + add = 30 + desc = AI_YOU_ARE_THE_DYNAST + } + + modifier = { + this.house.house_head = scope:actor + add = 60 + desc = AI_YOU_ARE_THE_HOUSE_HEAD + } + + modifier = { + this.top_liege = scope:actor + add = 60 + desc = AI_YOU_ARE_THE_SOVEREIGN + } + + modifier = { + NOT = { is_child_of = scope:actor } + NOT = { is_close_family_of = scope:actor } + is_extended_family_of = scope:actor + add = 30 + desc = AI_YOUR_RELATIVE + } + + modifier = { + NOT = { is_child_of = scope:actor } + is_close_family_of = scope:actor + add = 75 + desc = AI_YOUR_RELATIVE + } + + modifier = { + is_spouse_of = scope:actor + add = 160 + desc = AI_YOUR_SPOUSE + } + + #Relations & relatives (with host) + modifier = { + exists = liege + has_relation_lover = liege + add = -100 + desc = AI_THEIR_LOVER + } + + modifier = { + exists = liege + has_relation_friend = liege + add = -75 + desc = AI_THEIR_FRIEND + } + + modifier = { + exists = liege + is_child_of = liege + add = -160 + desc = AI_THEIR_CHILD + } + + modifier = { + exists = liege + NOT = { is_child_of = liege } + is_close_family_of = liege + add = -75 + desc = AI_THEIR_RELATIVE + } + + #Family (at location) + modifier = { + exists = location + any_consort_not_in_traveling_family_trigger = yes + desc = AI_LEAVING_MY_SPOUSE + add = -100 + } + + modifier = { + exists = location + any_child_not_in_traveling_family_trigger = yes + desc = AI_LEAVING_MY_CHILD + add = -100 + } + + modifier = { + add = -50 + desc = AI_MARRIED_MATRILINIALLY + is_married = yes + is_male = yes + any_spouse = { + matrilinear_marriage = yes + host = scope:recipient.host + } + } + + modifier = { + add = -50 + desc = AI_MARRIED_PATRILINIALLY + is_married = yes + is_female = yes + any_spouse = { + patrilinear_marriage = yes + host = scope:recipient.host + } + } + + modifier = { + add = -50 + desc = AI_INSPIRED + exists = inspiration + inspiration = { + NOT = { + exists = inspiration_sponsor + } + } + } + + modifier = { + add = -500 + desc = AI_SPONSORED_INSPIRATION + exists = inspiration + inspiration = { + exists = inspiration_sponsor + } + } + + modifier = { + add = -500 + desc = AI_WANDERLUST + is_child_of = scope:actor + has_character_modifier = lust_for_adventure + } + + modifier = { + add = -180 + desc = ELUDING_CASTRATOR + is_adult = no + any_memory = { + has_memory_type = family_castration_fled_memory + memory_participant:castrator ?= { + this = scope:actor + } + } + } + + modifier = { + liege ?= { is_landed = yes } + scope:actor = { is_landed = no } + add = -50 + desc = AI_MY_LIEGE_IS_LANDED + } + + #Wandering characters (who aren't doing anything else) + modifier = { + add = { + value = 10 + add = scope:actor.diplomacy + + if = { + limit = { + faith = scope:actor.faith + } + add = 10 + } + else_if = { + limit = { + faith = { #Same religion - But faith should not be considered Hostile or Evil + religion = scope:actor.faith.religion + faith_hostility_level = { + target = scope:actor.faith + value < 2 + } + } + } + add = 5 + } + if = { + limit = { + culture = scope:actor.culture + } + add = 10 + } + else_if = { + limit = { + culture = { + has_same_culture_heritage = scope:actor.culture + } + } + add = 5 + } + if = { + limit = { + OR = { + has_trait = content + has_trait = lazy + has_trait = trusting + } + } + add = 10 + } + } + desc = AI_CAN_BE_PERSUADED_TO_STAY + + is_pool_guest = no + location.province_owner = { + OR = { + any_liege_or_above = { this = scope:actor } + this = scope:actor + } + } + NOR = { + has_relation_rival = scope:actor + exists = liege + is_child_of = scope:actor + has_character_modifier = lust_for_adventure + } + } + + modifier = { + add = { + value = 20 + if = { + limit = { + has_trait = greedy + } + multiply = 1.5 + } + else_if = { + limit = { + has_trait = generous + } + multiply = 0.5 + } + } + scope:cover_travel_expenses = yes + desc = AI_TRAVEL_EXPENSES + } + + # Amenities impact + ## Actor's amenities increases acceptance + modifier = { + add = { + value = 10 + if = { + limit = { + scope:actor = { + has_royal_court = yes + has_dlc_feature = royal_court + amenity_level = { type = court_lodging_standards value >= high_amenity_level } + } + } + add = 10 + } + if = { + limit = { + scope:actor = { + amenity_level = { type = court_lodging_standards value >= very_high_amenity_level } + } + } + add = 10 + } + if = { + limit = { + scope:actor = { + amenity_level = { type = court_lodging_standards value >= max_amenity_level } + } + } + add = 20 + } + } + desc = AI_COURT_LODGING_STANDARDS_QUALITY + scope:actor = { + has_royal_court = yes + has_dlc_feature = royal_court + amenity_level = { type = court_lodging_standards value >= medium_amenity_level } + } + } + ## Target's liege amenities decreases acceptance + modifier = { + add = { + value = -10 + if = { + limit = { + liege = { + amenity_level = { type = court_lodging_standards value >= high_amenity_level } + } + } + add = -10 + } + if = { + limit = { + liege = { + amenity_level = { type = court_lodging_standards value >= very_high_amenity_level } + } + } + add = -10 + } + if = { + limit = { + liege = { + amenity_level = { type = court_lodging_standards value >= max_amenity_level } + } + } + add = -20 + } + } + desc = AI_LIEGE_COURT_LODGING_STANDARDS_QUALITY + exists = liege + is_courtier_of = liege + liege = { + has_royal_court = yes + has_dlc_feature = royal_court + amenity_level = { type = court_lodging_standards value >= medium_amenity_level } + } + } + + modifier = { + add = { + value = scope:actor.house.house_unity_value + multiply = 0.5 + } + desc = AI_HOUSE_UNITY + scope:actor = { government_has_flag = government_is_clan } + exists = house + exists = scope:actor.house + house = scope:actor.house + house = { + OR = { + has_house_unity_stage = harmonious + has_house_unity_stage = friendly + } + } + } + + modifier = { + add = 25 + scope:influence_send_option = yes + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + + modifier = { + add = -1000 + desc = MALUS_TO_RECRUITMENT_FOR_IMPERIAL_EUNUCHS + scope:recipient = { + is_eunuch_trigger = yes + liege = { + government_allows = administrative + primary_title.tier = tier_empire + culture = { has_cultural_parameter = can_appoint_chief_eunuch } + } + } + } + + # Event modifiers + + # El Cid + modifier = { + has_variable = cid_1010_no_invite_var + var:cid_1010_no_invite_var = scope:actor + add = -200 + desc = cid_1010_no_invite_var_desc + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + } + } +} diff --git a/common/character_interactions/00_culture_interactions.txt b/common/character_interactions/00_culture_interactions.txt new file mode 100644 index 00000000..e32d7750 --- /dev/null +++ b/common/character_interactions/00_culture_interactions.txt @@ -0,0 +1,385 @@ +# Interaction used to convert people when you hybridize or diverge culture +# Note that it will only be applied to vassals of the parent culture(s) +# Acceptance is checked *before* culture conversion happens so that it'll be correct in the UI +# This has the culture traits available in the traits list: +# modifier = { +# add = 10 +# desc = TEST +# culture_pillar:ethos_bellicose = { is_in_list = traits } +# } + +request_culture_conversion_interaction = { + category = interaction_category_religion + special_interaction = request_culture_conversion_interaction + popup_on_receive = yes + + desc = ask_for_conversion_interaction_desc + + hidden = yes + + is_shown = { + NOT = { scope:actor.culture = scope:recipient.culture } + scope:recipient.liege = scope:actor + } + + is_valid_showing_failures_only = { + } + + ai_accept = { + base = -10 + opinion_modifier = { + opinion_target = scope:actor + who = scope:recipient + multiplier = 1 + } + + modifier = { + desc = ASK_FOR_CONVERSION_SAME_CULTURE_PRESTIGE_LEVEL + add = { + value = 10 + multiply = scope:actor.prestige_level + } + scope:actor.prestige_level > 0 + scope:recipient.culture = scope:actor.culture + } + + modifier = { + desc = ASK_FOR_CONVERSION_RECIPIENT_DIPLOMACY + add = { + value = scope:actor.diplomacy + subtract = scope:recipient.diplomacy + multiply = 5 + } + } + + modifier = { + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_CYNICAL + add = 30 + scope:recipient = { + has_trait = cynical + } + } + + modifier = { + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_STUBBORN + add = -30 + scope:recipient = { + has_trait = stubborn + } + } + + modifier = { + add = intimidated_external_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + desc = INTIMIDATED_REASON + } + modifier = { + add = cowed_external_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + desc = COWED_REASON + } + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + ai_min_reply_days = 1 + ai_max_reply_days = 5 + + on_accept = { + new_culture_created_vassal_conversion_effect = { + CONVERTEE = scope:recipient + CONVERTER = scope:actor + CULTURE = scope:actor.culture + } + } +} + +ai_cultural_hybridization_interaction = { + + hidden = yes + + auto_accept = yes + + ai_potential = { + has_dlc_feature = hybridize_culture + OR = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + } + is_playable_character = yes + realm_size >= 4 + is_physically_able_adult = yes + is_at_war = no + exists = capital_county + capital_county.holder = root + NOT = { + has_game_rule = none_hybrid_culture_ai_frequency + } + } + + is_shown = { + scope:actor = { + is_ai = yes + } + exists = scope:target + } + + ai_set_target = { + scope:actor = { + if = { + limit = { + exists = capital_county + any_sub_realm_county = { + NOT = { + culture = scope:actor.culture + } + culture = { + cultural_acceptance = { target = scope:actor.culture value >= hybridization_ai_threshold_value } + scope:actor = { + can_hybridize = prev + } + } + } + } + every_sub_realm_county = { + limit = { + NOT = { + culture = scope:actor.culture + } + culture = { + cultural_acceptance = { target = scope:actor.culture value >= hybridization_ai_threshold_value } + scope:actor = { + can_hybridize = prev + } + } + } + culture = { + add_to_list = culture_list + } + } + + ordered_in_list = { + list = culture_list + limit = { culture_realm_size >= 3 } + order_by = culture_realm_size + + save_scope_as = target + } + } + } + } + + on_accept = { + # Global cooldowns for the lower frequency game rule settings + if = { + limit = { + has_game_rule = less_common_hybrid_culture_ai_frequency + } + set_global_variable = { name = has_ai_hybrid_event_cooldown value = yes days = 3650 } + } + scope:actor = { + create_hybrid_culture_with_side_effects = scope:target + } + } + + ai_targets = { + ai_recipients = self + } + + ai_frequency = 60 + + ai_will_do = { + base = 100 + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0.2 + has_game_rule = less_common_hybrid_culture_ai_frequency + } + + modifier = { + factor = 0 + exists = global_var:has_ai_hybrid_event_cooldown + } + + modifier = { + factor = 0 + culture = { + has_cultural_parameter = harder_to_hybridize + } + } + + modifier = { # The AI should only want to hybridize if they're the second ruler of their culture for their primary title + factor = 0 + OR = { + NOT = { + exists = primary_title.previous_holder + } + AND = { + exists = primary_title.previous_holder + NOT = { + primary_title.previous_holder.culture = scope:actor.culture + } + } + } + } + + modifier = { # The AI doesn't want to hybridize if their culture is more than X% bigger than the targeted culture within the same realm (unless it's in the capital, and the capital is the De Jure capital of the primary title) + factor = 0 + scope:actor.culture.culture_realm_size > scope:target.culture_realm_size_larger_30_percent + NAND = { + scope:actor.primary_title.title_capital_county = scope:actor.capital_county + scope:actor.capital_county.culture = scope:target + } + } + + modifier = { # Do not hybridize if 30% or more of your vassals of the relevant culture/s dislike you + factor = 0 + scope:actor = { + any_vassal = { + percent >= 0.3 + OR = { + culture = scope:actor.culture + culture = scope:target + } + highest_held_title_tier >= tier_county + opinion = { + target = scope:actor + value <= 0 + } + } + } + } + + modifier = { # The AI does not want to create multiple hybrids from the same cultures + factor = 0 + any_in_global_list = { + variable = hybrid_cultures + any_parent_culture = { this = scope:target } + any_parent_culture = { this = scope:actor.culture } + } + } + + # Loose requirements + modifier = { # The AI does not want to create a hybrid with a hybrid culture that has the same roots + factor = 0 + has_game_rule = very_relaxed_hybrid_culture_ai_restrictions + scope:target = { is_hybrid_culture = yes } + scope:actor.culture = { + is_hybrid_culture = yes + any_parent_culture = { + save_temporary_scope_as = parent_culture_check + scope:target = { + any_parent_culture = { + this = scope:parent_culture_check + } + } + } + } + } + + modifier = { # The AI does not want to create a hybrid with a hybrid culture (unless a historical hybrid) + factor = 0 + has_game_rule = relaxed_hybrid_culture_ai_restrictions + scope:target = { + is_hybrid_culture = yes + culture_is_not_historical_hybrid_trigger = yes + } + scope:actor.culture = { + is_hybrid_culture = yes + culture_is_not_historical_hybrid_trigger = yes + } + } + + modifier = { # The AI does not want to create a hybrid with a hybrid culture or if the target is a hybrid (unless a historical hybrid) + factor = 0 + has_game_rule = default_hybrid_culture_ai_restrictions + OR = { + scope:target = { + is_hybrid_culture = yes + culture_is_not_historical_hybrid_trigger = yes + } + scope:actor.culture = { + is_hybrid_culture = yes + culture_is_not_historical_hybrid_trigger = yes + } + } + } + + modifier = { # The AI does not want to create a hybrid with a hybrid culture that their culture is a parent of, or share heritage of + factor = 0 + scope:target = { + is_hybrid_culture = yes + any_parent_culture = { + OR = { + this = scope:actor.culture + has_same_culture_heritage = scope:actor.culture + } + } + } + } + + modifier = { # The AI does not want to create a hybrid if their culture is a hybrid of the target culture, or share heritage of + factor = 0 + scope:actor.culture = { + is_hybrid_culture = yes + any_parent_culture = { + OR = { + this = scope:target + has_same_culture_heritage = scope:target + } + } + } + } + + modifier = { # Avoid hybridizing if your realm is of a significant size and elective, we don't want the HRE Emperor to hybdridize in ugly ways... + factor = 0 + primary_title = { + has_order_of_succession = election + tier >= tier_kingdom + } + realm_size >= 50 + any_vassal = { + highest_held_title_tier >= tier_county + NOT = { + culture = scope:actor.culture + } + } + } + + modifier = { # Theocrats such as the Pope shouldn't hybridize; they have an influx of different cultures, it's just weird + factor = 0 + government_has_flag = government_is_theocracy + } + + modifier = { # Block for Scots and Gaelic specifically + factor = 0 + OR = { + scope:actor.culture = culture:scottish + scope:actor.culture = culture:gaelic + } + OR = { + scope:target = culture:scottish + scope:target = culture:gaelic + } + } + + # Note: As we're checking if we can hybridize with a culture *right now*, a suboptimal culture might be checked. A buffer of 10 acceptance is used by the AI to alleviate this. + } +} diff --git a/common/character_interactions/00_debug_interactions.txt b/common/character_interactions/00_debug_interactions.txt new file mode 100644 index 00000000..ea9d6719 --- /dev/null +++ b/common/character_interactions/00_debug_interactions.txt @@ -0,0 +1,3461 @@ +#Change hunt score +change_hunt_success_chance = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + common_interaction = yes + icon = activity_hunt + is_shown = { + debug_only = yes + scope:actor.involved_activity ?= { + has_activity_type = activity_hunt + exists = var:hunt_success_chance + } + } + + send_option = { + flag = score_massive + localization = score_massive + } + + send_option = { + flag = score_major + localization = score_major + } + + send_option = { + flag = score_medium + localization = score_medium + } + + send_option = { + flag = score_minor + localization = score_minor + } + + send_option = { + flag = decrease_score_minor + localization = decrease_score_minor + } + + send_option = { + flag = decrease_score_medium + localization = decrease_score_medium + } + + send_option = { + flag = decrease_score_major + localization = decrease_score_major + } + + send_option = { + flag = decrease_score_massive + localization = decrease_score_massive + } + + on_accept = { + scope:actor.involved_activity = { + if = { + limit = { + NOT = { exists = var:hunt_success_chance_event } + } + set_variable = { name = hunt_success_chance_event value = 0 } + } + switch = { + trigger = yes + scope:score_massive = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_increase_massive_value } + } + scope:score_major = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_increase_major_value } + } + scope:score_medium = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_increase_medium_value } + } + scope:score_minor = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_increase_minor_value } + } + scope:decrease_score_massive = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_decrease_massive_value } + } + scope:decrease_score_major = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_decrease_major_value } + } + scope:decrease_score_medium = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_decrease_medium_value } + } + scope:decrease_score_minor = { + change_variable = { name = hunt_success_chance_event add = hunt_activity_success_decrease_minor_value } + } + } + set_variable = { + name = hunt_success_chance + value = { + value = hunt_success_chance_value + add = var:hunt_success_chance_event + } + } + } + } + + auto_accept = yes +} + +debug_give_animal_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + common_interaction = no + icon = dog_positive + is_shown = { + debug_only = yes + scope:recipient = { + NAND = { + any_owned_story = { story_type = story_cycle_pet_cat } + any_owned_story = { story_type = story_cycle_pet_dog } + any_owned_story = { story_type = story_cycle_martial_lifestyle_warhorse } + } + } + } + + send_option = { + is_valid = { + NOT = { + scope:recipient = { any_owned_story = { story_type = story_cycle_pet_dog } } + } + } + flag = story_cycle_pet_dog + localization = story_cycle_pet_dog + } + + send_option = { + is_valid = { + NOT = { + scope:recipient = { any_owned_story = { story_type = story_cycle_pet_cat } } + } + } + flag = story_cycle_pet_cat + localization = story_cycle_pet_cat + } + + send_option = { + is_valid = { + NOT = { + scope:recipient = { any_owned_story = { story_type = story_cycle_martial_lifestyle_warhorse } } + } + } + flag = story_cycle_martial_lifestyle_warhorse + localization = horse_story_modifier + } + + send_options_exclusive = yes + + on_accept = { + scope:recipient = { + switch = { + trigger = yes + scope:story_cycle_pet_dog = { + start_dog_story_cycle_effect = yes + } + scope:story_cycle_pet_cat = { + start_cat_story_cycle_effect = yes + } + scope:story_cycle_martial_lifestyle_warhorse = { + start_warhorse_story_cycle_effect = yes + } + } + } + } + + auto_accept = yes +} + +#Change tournament score +change_tournament_score = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + common_interaction = yes + icon = activity_tournament + is_shown = { + debug_only = yes + scope:recipient = { + exists = involved_activity + involved_activity = { + has_activity_type = activity_tournament + } + activity_is_competing_trigger = yes + } + } + + send_option = { + flag = score_massive + localization = score_massive + } + + send_option = { + flag = score_major + localization = score_major + } + + send_option = { + flag = score_medium + localization = score_medium + } + + send_option = { + flag = score_minor + localization = score_minor + } + + send_option = { + flag = decrease_score_minor + localization = decrease_score_minor + } + + send_option = { + flag = decrease_score_medium + localization = decrease_score_medium + } + + send_option = { + flag = decrease_score_major + localization = decrease_score_major + } + + send_option = { + flag = decrease_score_massive + localization = decrease_score_massive + } + + on_accept = { + scope:recipient = { + if = { + limit = { scope:score_massive = yes } + activity_tournament_change_contestant_score_effect = { SCORE = increase_massive } + } + else_if = { + limit = { scope:score_major = yes } + activity_tournament_change_contestant_score_effect = { SCORE = increase_major } + } + else_if = { + limit = { scope:score_medium = yes } + activity_tournament_change_contestant_score_effect = { SCORE = increase_medium } + } + else_if = { + limit = { scope:score_minor = yes } + activity_tournament_change_contestant_score_effect = { SCORE = increase_minor } + } + else_if = { + limit = { scope:decrease_score_massive = yes } + activity_tournament_change_contestant_score_effect = { SCORE = decrease_massive } + } + else_if = { + limit = { scope:decrease_score_major = yes } + activity_tournament_change_contestant_score_effect = { SCORE = decrease_major } + } + else_if = { + limit = { scope:decrease_score_medium = yes } + activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium } + } + else_if = { + limit = { scope:decrease_score_minor = yes } + activity_tournament_change_contestant_score_effect = { SCORE = decrease_minor } + } + } + } + + auto_accept = yes +} + +#Bring a character to your court +add_to_court_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = guest + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + scope:recipient = { + is_playable_character = no + NOT = { is_courtier_of = scope:actor } + } + } + + on_accept = { + scope:actor = { add_courtier = scope:recipient } + scope:recipient = { + hidden_effect = { return_to_court = yes } + } + } + + auto_accept = yes +} + +debug_secrets_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = debug_secret + + is_shown = { + debug_only = yes + } + + send_option = { + flag = realm + localization = set_up_secrets_in_realm_interaction + } + send_option = { + flag = court + localization = give_secrets_to_court_interaction + } + send_option = { + flag = expose + localization = expose_known_secrets_interaction + } + + on_accept = { + switch = { + trigger = yes + scope:realm = { + scope:recipient.top_liege = { + hidden_effect = { + # Start by adding all realm characters and neighbouring realm characters to a list + add_to_list = secret_setup + every_vassal = { + add_to_list = secret_setup + random_courtier_or_guest = { + add_to_list = secret_setup + } + } + every_neighboring_top_liege_realm_owner = { + add_to_list = secret_setup + every_vassal = { + add_to_list = secret_setup + random_courtier_or_guest = { + add_to_list = secret_setup + } + } + } + every_in_list = { # Give everyone in the list a 50% chance of getting a secret + list = secret_setup + give_random_likely_secret_effect = yes + } + random_in_list = { # Reveal one secret to the character the decision is used on, from the same realm + list = secret_setup + limit = { + top_liege = scope:recipient.top_liege + any_secret = { + NOT = { is_known_by = scope:recipient } + } + } + random_secret = { + limit = { + NOT = { is_known_by = scope:recipient } + } + reveal_to = scope:recipient + } + } + random_in_list = { # Reveal one secret to the character the decision is used on, NOT from the same realm + list = secret_setup + limit = { + NOT = { top_liege = scope:recipient.top_liege } + any_secret = { + NOT = { is_known_by = scope:recipient } + } + } + random_secret = { + limit = { + NOT = { is_known_by = scope:recipient } + } + reveal_to = scope:recipient + } + } + every_in_list = { # Everyone in the list has a chance to get to know of a secret anyone else has in the list + list = secret_setup + save_scope_as = reveal_to_me + random = { + chance = 75 + random_in_list = { + list = secret_setup + limit = { + any_secret = { + NOT = { is_known_by = scope:reveal_to_me } + } + } + random_secret = { + limit = { + NOT = { is_known_by = scope:reveal_to_me } + } + reveal_to = scope:reveal_to_me + } + } + } + } + random_in_list = { # Imprison someone with a secret you know about + list = secret_setup + limit = { + any_secret = { + is_known_by = scope:recipient + } + NOT = { this = scope:recipient } + is_foreign_court_guest = no + } + save_scope_as = prisoner_secret + scope:recipient = { + imprison = { + target = scope:prisoner_secret + type = dungeon + } + } + } + random_in_list = { # Imprison someone who has a secret you don't know about + list = secret_setup + limit = { + any_secret = { + NOT = { is_known_by = scope:recipient } + } + NOT = { this = scope:recipient } + is_foreign_court_guest = no + } + save_scope_as = prisoner_secret + scope:recipient = { + imprison = { + target = scope:prisoner_secret + type = dungeon + } + } + } + } + } + } + scope:court = { + scope:recipient = { + give_deviant_secret_or_trait_effect = yes + give_homosexual_secret_or_nothing_effect = yes + hidden_effect = { + every_courtier = { + give_random_likely_secret_effect = yes + } + } + } + } + scope:expose = { + scope:actor = { + every_known_secret = { + limit = { + secret_owner = scope:recipient + } + expose_secret = scope:actor + } + } + } + } + } + + auto_accept = yes +} + +add_hook_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + interface_priority = -1 + icon = hook_icon + common_interaction = no + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + send_option = { + flag = weak_hook + localization = add_weak_hook_interaction + } + send_option = { + flag = strong_hook + localization = add_strong_hook_interaction + } + send_option = { + flag = perpetual_hook + localization = add_perpetual_hook_interaction + } + send_option = { + flag = obligation_hook + localization = add_obligation_hook_interaction + } + auto_accept = yes + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:weak_hook = { + add_hook = { + target = scope:recipient + type = favor_hook + } + } + scope:strong_hook = { + add_hook = { + target = scope:recipient + type = strong_test_hook + } + } + scope:perpetual_hook = { + add_hook = { + target = scope:recipient + type = perpetual_test_hook + } + } + scope:obligation_hook = { + add_hook = { + target = scope:recipient + type = obligation_hook + } + } + } + } + } +} + +set_relation_debug = { + category = interaction_debug_main + desc = set_relationship_debug_desc + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = debug_chars + common_interaction = yes + is_shown = { + debug_only = yes + NOT = { + scope:recipient = scope:actor + } + } + + send_option = { + is_shown = { + NOR = { + scope:actor = { has_relation_potential_friend = scope:recipient } + scope:actor = { has_relation_friend = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_potential_friend_trigger = { CHARACTER = scope:recipient } + } + } + flag = potential_friend + localization = set_relation_debug_potential_friend + } + send_option = { + is_shown = { + NOR = { + scope:actor = { has_relation_potential_rival = scope:recipient } + scope:actor = { has_relation_rival = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_potential_rival_trigger = { CHARACTER = scope:recipient } + } + } + flag = potential_rival + localization = set_relation_debug_potential_rival + } + send_option = { + is_shown = { + NOR = { + scope:actor = { has_relation_potential_lover = scope:recipient } + scope:actor = { has_relation_lover = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_potential_lover_trigger = { CHARACTER = scope:recipient } + } + } + flag = potential_lover + localization = set_relation_debug_potential_lover + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_friend = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_friend_trigger = { CHARACTER = scope:recipient } + } + } + flag = friend + localization = set_relation_debug_friend + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_rival = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_rival_trigger = { CHARACTER = scope:recipient } + } + } + flag = rival + localization = set_relation_debug_rival + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_lover = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_lover_trigger = { CHARACTER = scope:recipient } + } + } + flag = lover + localization = set_relation_debug_lover + } + send_option = { + is_shown = { + scope:actor = { + NOR = { + any_secret ={ + secret_type = secret_lover + secret_target = scope:recipient + } + has_relation_lover = scope:recipient + has_relation_soulmate = scope:recipient + } + } + } + is_valid = { + scope:actor = { + can_set_relation_lover_trigger = { CHARACTER = scope:recipient } + } + } + flag = lover_secret + localization = set_relation_debug_lover_secret + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_best_friend = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_best_friend_trigger = { CHARACTER = scope:recipient } + } + } + flag = best_friend + localization = set_relation_debug_best_friend + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_nemesis = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_nemesis_trigger = { CHARACTER = scope:recipient } + } + } + flag = nemesis + localization = set_relation_debug_nemesis + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_soulmate = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_soulmate_trigger = { CHARACTER = scope:recipient } + } + } + flag = soulmate + localization = set_relation_debug_soulmate + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_bully = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_bully_trigger = { CHARACTER = scope:recipient } + } + } + flag = bully + localization = set_relation_debug_bully + } + send_option = { + is_shown = { + NOT = { + scope:actor = { has_relation_victim = scope:recipient } + } + } + is_valid = { + scope:actor = { + can_set_relation_victim_trigger = { CHARACTER = scope:recipient } + } + } + flag = victim + localization = set_relation_debug_victim + } + send_option = { + is_valid = { + scope:actor = { + NOT = { has_relation_crush = scope:recipient } + } + } + flag = crush + localization = set_relation_debug_crush + } + send_option = { + is_valid = { + scope:recipient = { + NOT = { has_relation_crush = scope:actor } + } + } + flag = crush_on_me + localization = set_relation_debug_crush_on_me + } + send_option = { + is_valid = { + scope:actor = { + NOT = { has_relation_grudge = scope:recipient } + } + } + flag = grudge + localization = set_relation_debug_grudge + } + send_option = { + is_valid = { + scope:recipient = { + NOT = { has_relation_grudge = scope:actor } + } + } + flag = grudge_on_me + localization = set_relation_debug_grudge_on_me + } + # REMOVE + send_option = { + is_shown = { + scope:actor = { has_relation_potential_friend = scope:recipient } + } + flag = remove_potential_friend + localization = remove_relation_debug_potential_friend + } + send_option = { + is_valid = { + scope:actor = { has_relation_potential_rival = scope:recipient } + } + flag = remove_potential_rival + localization = remove_relation_debug_potential_rival + } + send_option = { + is_shown = { + scope:actor = { has_relation_potential_lover = scope:recipient } + } + flag = remove_potential_lover + localization = remove_relation_debug_potential_lover + } + send_option = { + is_shown = { + scope:actor = { has_relation_friend = scope:recipient } + } + flag = remove_friend + localization = remove_relation_debug_friend + } + send_option = { + is_shown = { + scope:actor = { has_relation_rival = scope:recipient } + } + flag = remove_rival + localization = remove_relation_debug_rival + } + send_option = { + is_shown = { + scope:actor = { has_relation_lover = scope:recipient } + } + flag = remove_lover + localization = remove_relation_debug_lover + } + send_option = { + is_shown = { + scope:actor = { + any_secret = { + secret_type = secret_lover + secret_target = scope:recipient + } + } + } + flag = remove_lover_secret + localization = remove_relation_debug_lover_secret + } + send_option = { + is_shown = { + scope:actor = { has_relation_best_friend = scope:recipient } + } + flag = remove_best_friend + localization = remove_relation_debug_best_friend + } + send_option = { + is_shown = { + scope:actor = { has_relation_nemesis = scope:recipient } + } + flag = remove_nemesis + localization = remove_relation_debug_nemesis + } + send_option = { + is_shown = { + scope:actor = { has_relation_soulmate = scope:recipient } + } + flag = remove_soulmate + localization = remove_relation_debug_soulmate + } + send_option = { + is_shown = { + scope:actor = { has_relation_bully = scope:recipient } + } + flag = remove_bully + localization = remove_relation_debug_bully + } + send_option = { + is_shown = { + scope:actor = { has_relation_victim = scope:recipient } + } + flag = remove_victim + localization = remove_relation_debug_victim + } + send_option = { + is_shown = { + scope:actor = { has_relation_crush = scope:recipient } + } + flag = remove_crush + localization = remove_relation_debug_crush + } + send_option = { + is_shown = { + scope:recipient = { has_relation_crush = scope:actor } + } + flag = remove_crush_on_me + localization = remove_relation_debug_crush_on_me + } + send_option = { + is_shown = { + scope:actor = { has_relation_grudge = scope:recipient } + } + flag = remove_grudge + localization = remove_relation_debug_grudge + } + send_option = { + is_shown = { + scope:recipient = { has_relation_grudge = scope:actor } + } + flag = remove_grudge_on_me + localization = remove_relation_debug_grudge_on_me + } + + on_accept = { + scope:recipient = { + switch = { + trigger = yes + # SET + scope:potential_friend = { set_relation_potential_friend = scope:actor } + scope:potential_rival = { set_relation_potential_rival = scope:actor } + scope:potential_lover = { set_relation_potential_lover = scope:actor } + scope:friend = { + set_relation_friend = { reason = test_friend_desc target = scope:actor } + } + scope:rival = { + set_relation_rival = { reason = test_rival_desc target = scope:actor } + } + scope:lover = { + set_relation_lover = { reason = test_lover_desc target = scope:actor } + } + scope:lover_secret = { + add_secret = { + target = scope:actor + type = secret_lover + } + scope:actor = { + add_secret = { + target = scope:recipient + type = secret_lover + } + } + } + scope:best_friend = { + set_relation_best_friend = { reason = best_friend_poetry copy_reason = friend target = scope:actor } + } + scope:nemesis = { + set_relation_nemesis = { reason = test_nemesis_desc copy_reason = rival target = scope:actor } + } + scope:soulmate = { + set_relation_soulmate = { reason = test_soulmate_desc copy_reason = lover target = scope:actor } + } + scope:crush = { + scope:actor = { set_relation_crush = scope:recipient } #You crush on the recipient + } + scope:crush_on_me = { set_relation_crush = scope:actor } + scope:bully = { set_relation_bully = scope:actor } + scope:victim = { set_relation_victim = scope:actor } + scope:grudge = { + scope:actor = { + set_relation_grudge = { + reason = grudge_imprisonment_desc + target = scope:recipient + } + } + } + scope:grudge_on_me = { set_relation_grudge = scope:actor } + # REMOVE + scope:remove_potential_friend = { remove_relation_potential_friend = scope:actor } + scope:remove_potential_rival = { remove_relation_potential_rival = scope:actor } + scope:remove_potential_lover = { remove_relation_potential_lover = scope:actor } + scope:remove_friend = { remove_relation_friend = scope:actor } + scope:remove_rival = { remove_relation_rival = scope:actor } + scope:remove_lover = { remove_relation_lover = scope:actor } + scope:remove_lover_secret = { + random_secret = { + limit = { + secret_type = secret_lover + secret_target = scope:actor + } + remove_secret = yes + } + scope:actor = { + random_secret = { + limit = { + secret_type = secret_lover + secret_target = scope:recipient + } + remove_secret = yes + } + } + } + scope:remove_best_friend = { remove_relation_best_friend = scope:actor } + scope:remove_nemesis = { remove_relation_nemesis = scope:actor } + scope:remove_soulmate = { remove_relation_soulmate = scope:actor } + scope:remove_crush = { + scope:actor = { remove_relation_crush = scope:recipient } #You crush on the recipient + } + scope:remove_crush_on_me = { remove_relation_crush = scope:actor } + scope:remove_bully = { remove_relation_bully = scope:actor } + scope:remove_victim = { remove_relation_victim = scope:actor } + scope:remove_grudge = { + scope:actor = { remove_relation_grudge = scope:recipient } + } + scope:remove_grudge_on_me = { remove_relation_grudge = scope:actor } + } + } + } + auto_accept = yes +} + +change_character_weight_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = activity_feast + + is_shown = { debug_only = yes } + + send_option = { + flag = gain_weight + localization = add_character_weight_interaction + } + send_option = { + flag = lose_weight + localization = remove_character_weight_interaction + } + + on_accept = { + scope:recipient = { + switch = { + trigger = yes + scope:gain_weight = { change_current_weight = 25 } + scope:lose_weight = { change_current_weight = -25 } + } + } + } + auto_accept = yes +} + +slay_character_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_dead + common_interaction = no + + interface_priority = -1 + + is_shown = { debug_only = yes } + + send_option = { + flag = random_slayer + localization = random_slay_character_interaction + } + send_option = { + flag = no_slayer + localization = null_slay_character_interaction + } + send_option = { + is_valid = { + NOT = { scope:recipient = scope:actor } + } + flag = actor_slayer + localization = actor_slay_character_interaction + } + send_option = { + flag = bubonic_plague_slayer + localization = give_bubonic_plague_interaction + } + + on_accept = { + scope:recipient = { + switch = { + trigger = yes + scope:random_slayer = { + random_independent_ruler = { + limit = { + NOT = { this = scope:recipient } + } + save_scope_as = rando + } + hidden_effect = { + death = { + death_reason = death_duel + killer = scope:rando + } + } + } + scope:no_slayer = { + death = { death_reason = death_natural_causes } + } + scope:actor_slayer = { + death = { + death_reason = death_duel + killer = scope:actor + } + } + scope:bubonic_plague_slayer = { + add_trait = bubonic_plague + } + } + } + } + auto_accept = yes +} + +change_cultural_acceptance_debug_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_culture + + is_shown = { + debug_only = yes + NOT = { scope:actor.culture = scope:recipient.culture } + } + + send_option = { + flag = increase_cultural_acceptance + localization = increase_cultural_acceptance_debug_interaction + } + send_option = { + flag = decrease_cultural_acceptance + localization = decrease_cultural_acceptance_debug_interaction + } + + on_accept = { + scope:recipient.culture = { + switch = { + trigger = yes + scope:increase_cultural_acceptance = { + change_cultural_acceptance = { + target = scope:actor.culture + value = 25 + desc = debug + } + } + scope:decrease_cultural_acceptance = { + change_cultural_acceptance = { + target = scope:actor.culture + value = -25 + desc = debug + } + } + } + } + } + auto_accept = yes +} + +learn_language_debug_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_scheme_learn_language + + interface_priority = -1 + + is_shown = { + debug_only = yes + NOT = { + scope:actor = { knows_language_of_culture = scope:recipient.culture } + } + } + + on_accept = { + scope:actor = { + learn_language_of_culture = scope:recipient.culture + } + } + auto_accept = yes +} + +#Start a duel or board game against another character +start_bout_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_combat + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + on_accept = { + # Duels. + if = { + limit = { scope:single_combat = yes } + scope:actor = { trigger_event = single_combat.1004 } + } + # Board Games. + if = { + limit = { + OR = { + scope:board_game_chess = yes + scope:board_game_pachisi = yes + scope:board_game_tabula = yes + scope:board_game_hnefatafl = yes + scope:board_game_go = yes + scope:board_game_fidchell = yes + } + } + scope:actor = { trigger_event = board_games.0102 } + } + } + + send_option = { + flag = single_combat + localization = start_bout_interaction_single_combat + } + + send_option = { + flag = board_game_chess + localization = start_bout_interaction_board_game_chess + } + + send_option = { + flag = board_game_pachisi + localization = start_bout_interaction_board_game_pachisi + } + + send_option = { + flag = board_game_tabula + localization = start_bout_interaction_board_game_tabula + } + + send_option = { + flag = board_game_hnefatafl + localization = start_bout_interaction_board_game_hnefatafl + } + + send_option = { + flag = board_game_go + localization = start_bout_interaction_board_game_go + } + + send_option = { + flag = board_game_fidchell + localization = start_bout_interaction_board_game_fidchell + } + + auto_accept = yes +} + +add_artifact_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = artifact + is_shown = { + debug_only = yes + } + + send_option = { + flag = weapon + localization = add_artifact_interaction_weapon + } + send_option = { + flag = armor + localization = add_artifact_interaction_armor + } + send_option = { + flag = shinies + localization = add_artifact_interaction_shinies + } + send_option = { + flag = book + localization = add_artifact_interaction_book + } + send_option = { + flag = furniture + localization = add_artifact_interaction_furniture + } + send_option = { + flag = trinket + localization = add_artifact_interaction_trinket + } + send_option = { + flag = random_personal + localization = add_random_artifact_interaction + } + send_option = { + flag = christian + localization = christian_relic + } + send_option = { + flag = islam + localization = islam_relic + } + send_option = { + flag = buddhism + localization = buddhism_relic + } + send_option = { + flag = judaism + localization = judaism_relic + } + + on_accept = { + custom_tooltip = add_artifact_interaction + save_scope_value_as = { + name = quality + value = 100 + } + scope:recipient = { + hidden_effect = { + save_scope_as = owner + random_dummy_gender_effect = yes + switch = { + trigger = yes + scope:weapon = { + create_artifact_weapon_effect = { + OWNER = scope:owner + CREATOR = scope:dummy_gender + SET_WEAPON_TYPE = flag:no + } + } + scope:armor = { + create_artifact_armor_effect = { + OWNER = scope:owner + CREATOR = scope:dummy_gender + SET_ARMOR_TYPE = flag:no + } + } + scope:shinies = { + random_list = { + 10 = { + create_artifact_regalia_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + 10 = { + create_artifact_crown_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + 10 = { + create_artifact_brooch_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + } + } + scope:book = { + create_artifact_book_effect = { + OWNER = scope:owner + CREATOR = scope:dummy_gender + SET_SUBJECT = flag:no + SET_TOPIC = flag:no + } + } + scope:furniture = { + random_list = { + 10 = { + create_artifact_throne_effect = { + OWNER = scope:owner + MAKER = scope:dummy_gender + } + } + 10 = { + create_artifact_tapestry_effect = { + OWNER = scope:owner + WEAVER = scope:dummy_gender + } + } + 10 = { + create_artifact_box_small_effect = { + OWNER = scope:owner + CARPENTER = scope:dummy_gender + } + } + 10 = { + create_artifact_box_medium_effect = { + OWNER = scope:owner + CARPENTER = scope:dummy_gender + } + } + 10 = { + create_artifact_goblet_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + 30 = { + create_artifact_animal_hide_effect = { + OWNER = scope:owner + HUNTER = scope:dummy_gender + LEGENDARY = no + ANIMAL = flag:none + } + } + 10 = { + create_artifact_wall_banner_effect = { + OWNER = scope:owner + CREATOR = scope:dummy_gender + TARGET = scope:owner.primary_title + } + } + 10 = { + create_artifact_wall_skull_effect = { + OWNER = scope:owner + HUNTER = scope:dummy_gender + LEGENDARY = no + ANIMAL = flag:none + } + } + 10 = { + create_artifact_sculpture_effect = { + OWNER = scope:owner + SCULPTER = scope:dummy_gender + } + } + 10 = { + create_artifact_wall_shield_effect = { + OWNER = scope:owner + TARGET = scope:owner.house + CREATOR = scope:dummy_gender + } + } + } + } + scope:trinket = { + create_artifact = { + name = cuckoldry_psalter_name + description = cuckoldry_psalter_description + type = miscellaneous + visuals = book + modifier = artifact_monthly_prestige_penalty_modifier + } + } + scope:random_personal = { + custom_tooltip = add_random_artifact_interaction + random_list = { + 10 = { + random_dummy_gender_effect = yes + create_artifact_weapon_effect = { + OWNER = scope:owner + CREATOR = scope:dummy_gender + SET_WEAPON_TYPE = flag:no + } + } + 10 = { + random_dummy_gender_effect = yes + create_artifact_armor_effect = { + OWNER = scope:owner + CREATOR = scope:dummy_gender + SET_ARMOR_TYPE = flag:no + } + } + 10 = { + random_dummy_gender_effect = yes + create_artifact_regalia_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + 10 = { + random_dummy_gender_effect = yes + create_artifact_crown_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + 10 = { + random_dummy_gender_effect = yes + create_artifact_brooch_effect = { + OWNER = scope:owner + SMITH = scope:dummy_gender + } + } + } + } + scope:christian = { + create_artifact_pedestal_reliquary_christian_effect = { OWNER = scope:owner } + } + scope:islam = { + create_artifact_pedestal_reliquary_islam_effect = { OWNER = scope:owner } + } + scope:buddhism = { + create_artifact_pedestal_reliquary_buddhism_effect = { OWNER = scope:owner } + } + scope:judaism = { + create_artifact_pedestal_reliquary_judaism_effect = { OWNER = scope:owner } + } + } + } + } + } + auto_accept = yes +} + +take_artifact_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_scheme_steal_back_artifact + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + debug_only = yes + scope:recipient = { + any_character_artifact = { exists = this } + } + } + + send_option = { + is_valid = { + NOT = { scope:recipient = scope:actor } + } + flag = player + localization = take_artifact_player + } + send_option = { + is_valid = { + scope:recipient = { + any_neighboring_top_liege_realm_owner = { + NOR = { + this = scope:recipient + this = scope:actor + } + } + } + } + flag = random_neighbor + localization = give_away_random_artifact_interaction + } + + is_highlighted = { always = yes } + + on_accept = { + scope:recipient = { + switch = { + trigger = yes + scope:random_neighbor = { + random_neighboring_top_liege_realm_owner = { + limit = { + NOR = { + this = scope:recipient + this = scope:actor + } + } + save_scope_as = new_owner + } + } + scope:player = { + scope:actor = { save_scope_as = new_owner } + } + } + } + scope:target = { set_owner = scope:new_owner } + } + + auto_accept = yes + + ai_accept = { + base = 100 + } + + auto_accept = yes +} + +add_artifact_claim_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_scheme_steal_back_artifact + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + scope:recipient = { + any_character_artifact = { exists = this } + } + NOT = { scope:recipient = scope:actor } + debug_only = yes + } + + send_option = { + flag = personal + localization = add_claim_on_artifact_interaction + } + send_option = { + flag = house + localization = add_house_claim_on_artifact_interaction + } + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:personal = { add_personal_artifact_claim = scope:target } + scope:house = { + house = { add_house_artifact_claim = scope:target } + } + } + } + } + auto_accept = yes +} + +debug_destroy_artifact_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = artifact + + target_type = artifact + target_filter = recipient_artifacts + + is_shown = { + debug_only = yes + scope:recipient = { + any_character_artifact = { exists = this } + } + } + + send_option = { + flag = destroy + localization = destroy_artifact + } + + send_option = { + flag = damage + localization = damage_artifact + } + + send_options_exclusive = yes + + on_accept = { + switch = { + trigger = yes + scope:destroy = { destroy_artifact = scope:target } + scope:damage = { + scope:target = { + add_durability = { + value = { + value = artifact_durability + divide = 2 + multiply = -1 + } + } + } + } + } + } + + auto_accept = yes +} + +inspire_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = inspiration + + is_shown = { + debug_only = yes + scope:recipient = { + NOT = { exists = inspiration } + has_completed_inspiration = no + is_ruler = no + is_playable_character = no + } + } + + send_option = { + flag = weapon_inspiration + localization = debug_inspiration_weapon + } + send_option = { + flag = armor_inspiration + localization = debug_inspiration_armor + } + send_option = { + flag = book_inspiration + localization = debug_inspiration_book + } + send_option = { + flag = weaver_inspiration + localization = debug_inspiration_weaver + } + send_option = { + flag = adventure_inspiration + localization = debug_inspiration_adventure + } + send_option = { + flag = artisan_inspiration + localization = debug_inspiration_artisan + } + send_option = { + flag = smith_inspiration + localization = debug_inspiration_smith + } + send_option = { + flag = alchemy_inspiration + localization = debug_inspiration_alchemy + } + + on_accept = { + scope:recipient = { + if = { + limit = { + always = scope:book_inspiration + } + create_inspiration = book_inspiration + custom_tooltip = inspire_interaction_book + } + else_if = { + limit = { + always = scope:weaver_inspiration + } + create_inspiration = weaver_inspiration + custom_tooltip = inspire_interaction_weaver + } + else_if = { + limit = { + always = scope:adventure_inspiration + } + create_inspiration = adventure_inspiration + custom_tooltip = inspire_interaction_adventure + } + else_if = { + limit = { + always = scope:artisan_inspiration + } + create_inspiration = artisan_inspiration + custom_tooltip = inspire_interaction_artisan + } + else_if = { + limit = { + always = scope:smith_inspiration + } + create_inspiration = smith_inspiration + custom_tooltip = inspire_interaction_smith + } + else_if = { + limit = { + always = scope:alchemy_inspiration + } + create_inspiration = alchemy_inspiration + custom_tooltip = inspire_interaction_alchemy + } + else_if = { + limit = { + always = scope:armor_inspiration + } + create_inspiration = armor_inspiration + custom_tooltip = inspire_interaction_armor + } + else = { + create_inspiration = weapon_inspiration + custom_tooltip = inspire_interaction_weapon + } + } + } + + auto_accept = yes +} + +sponsor_inspiration_debug = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + auto_accept = yes + + is_shown = { + debug_only = yes + exists = scope:recipient.inspiration + } + + is_valid_showing_failures_only = { + scope:actor = { + can_sponsor_inspiration = scope:recipient.inspiration + } + } + + is_valid = { + scope:actor = { + can_sponsor_inspiration = scope:recipient.inspiration + } + } + + on_accept = { + scope:actor = { + sponsor_inspiration = scope:recipient.inspiration + } + } +} + +test_effect_localization_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + + is_shown = { + debug_only = yes + scope:actor = { is_ai = no } + NOT = { scope:actor = scope:recipient } + always = no # Comment out this line to see this interaction + } + on_accept = { + # Effects are shown under the actor and recipient entries + scope:actor = { add_prestige = 50 } + scope:recipient = { add_prestige = 50 } + + # Effects on the same things are collected together into their existing actor and recipient block + scope:actor = { add_piety = 50 } + scope:recipient = { add_piety = 50 } + + # Effects in a self contained list are shown in the general text output and will explicitly name the involved characters, including the actor and recipient, with respect to first person pronouns if the player + scope:actor = { + random = { + chance = 30 + scope:actor = { + add_gold = 200 + random_courtier = { remove_short_term_gold = 50 } + } + scope:recipient = { add_piety = 200 } + } + random_list = { + 50 = { + scope:actor = { + add_gold = 50 + random_courtier = { add_gold = 10 } + } + scope:recipient = { add_piety = 50 } + } + 50 = { + scope:actor = { + remove_short_term_gold = 50 + random_courtier = { remove_short_term_gold = 10 } + } + scope:recipient = { add_piety = -50 } + } + } + # Single Skill Duel + duel = { + skill = diplomacy + target = scope:recipient + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + scope:actor = { + add_gold = 50 + random_courtier = { add_gold = 10 } + } + scope:recipient = { add_piety = 50 } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + scope:actor = { + remove_short_term_gold = 50 + random_courtier = { remove_short_term_gold = 10 } + } + scope:recipient = { add_piety = -50 } + } + } + # Multi-skill duel + duel = { + skills = { prowess martial diplomacy } + target = scope:recipient + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + scope:actor = { + add_gold = 50 + random_courtier = { add_gold = 10 } + } + scope:recipient = { add_piety = 50 } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + scope:actor = { + remove_short_term_gold = 50 + random_courtier = { remove_short_term_gold = 10 } + } + scope:recipient = { add_piety = -50 } + } + } + } + + # Effects on non core targets get their own separate entries + scope:actor = { + every_courtier = { + add_gold = 10 + } + } + # And multiple effects on the same objects are collected into their existing entries + scope:actor = { + every_courtier = { + add_piety = 10 + } + } + } + + auto_accept = yes +} + +#Give the character a criminal trait that allows actor to imprison them +give_criminal_trait_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = prison + + is_shown = { + debug_only = yes + NOT = { + scope:actor = { + has_imprisonment_reason = scope:recipient + } + } + } + + on_accept = { + custom_tooltip = give_criminal_trait_interaction_tt + hidden_effect = { + scope:recipient = { + make_criminal_effect = yes + + #If they're still not a criminal we have them murder someone close to you + if = { + limit = { + NOT = { + scope:actor = { + has_imprisonment_reason = scope:recipient + } + } + any_close_family_member = { + NOT = { this = scope:recipient } + } + } + random_close_family_member = { + limit = { + NOT = { this = scope:recipient } + } + save_scope_as = family + known_murder_effect = { + VICTIM = scope:family + MURDERER = scope:recipient + EXPOSER = scope:recipient + } + } + } + } + } + } + + auto_accept = yes +} + +generate_artifact_with_history_interaction = { + category = interaction_debug_main + desc = generate_artifact_with_history_debug_desc + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = artifact + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + on_accept = { + scope:actor = { trigger_event = debug.400 } + } + + auto_accept = yes +} + +# Have (or trigger the aftermath of) sex with the target character +debug_sex_interaction = { # Sleep With Character + icon = seducer + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + on_accept = { scope:actor = { trigger_event = debug.410 } } + auto_accept = yes +} + +debug_change_every_county = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = alliance + + is_shown = { debug_only = yes } + send_option = { # Set Control to Max (100) + flag = debug_change_every_county_max_control + localization = debug_change_every_county.a + } + send_option = { # Set Control to Lowest (0) (-500) + flag = debug_change_every_county_lowest_control + localization = gain_county_corruption.message.low_control + } + send_option = { # Set Opinion to Max + flag = debug_change_every_county_highest_opinion + localization = debug_change_every_county.b.a + } + send_option = { # Set Opinion to Min + flag = debug_change_every_county_lowest_opinion + localization = debug_change_every_county.b.b + } + send_option = { # Here goes anything else you may want to do in the future, just add another send_option and then an if on the accept + flag = debug_change_every_county_convert_to_fatih + localization = FAITH_CONVERSION_CONVERT + } + # send_option = { # Here goes anything else you may want to do in the future, just add another send_option and then an if on the accept + # flag = auto_formatter_complains_if_I_do_not_do_this + # localization = debug_start_era_of_crusades_interaction + # } + + on_accept = { # In retrospect, this is pretty sloppy script, but it makes sense considering how old it is -h + if = { # Set Control to Max (100) + limit = { scope:debug_change_every_county_max_control = yes } + scope:recipient = { every_held_county = { change_county_control = 100 } } + } + else_if = { + limit = { scope:debug_change_every_county_lowest_control = yes } + scope:recipient = { every_held_county = { change_county_control = -500 } } + } + else_if = { + limit = { scope:debug_change_every_county_highest_opinion = yes } + scope:recipient = { every_held_county = { add_county_modifier = debug_max_popular_opinion_modifier } } # Please ignore this violation of basic scripting decency, I do it for compactness + } + else_if = { + limit = { scope:debug_change_every_county_lowest_opinion = yes } + scope:recipient = { every_held_county = { add_county_modifier = debug_min_popular_opinion_modifier } } + } + else_if = { + limit = { scope:debug_change_every_county_convert_to_fatih = yes } + scope:recipient = { every_held_county = { set_county_faith = scope:actor.faith } } + } + } + + auto_accept = yes + ai_accept = { + base = 100 + } +} + +# Embezzle from 'em +do_a_crime_embezzle_interaction = { + category = interaction_debug_main + desc = do_a_crime_embezzle_interaction_desc + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_gold + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + on_accept = { + scope:actor = { + # Steal a coin. + if = { + limit = { scope:steal_x1 = yes } + give_or_update_embezzler_secret_effect = { + TARGET = scope:recipient + STAKE = 1 + } + scope:recipient = { + pay_short_term_gold = { + target = scope:actor + gold = 1 + } + } + } + # Steal many coins. + else_if = { + limit = { scope:steal_x100 = yes } + give_or_update_embezzler_secret_effect = { + TARGET = scope:recipient + STAKE = 100 + } + scope:recipient = { + pay_short_term_gold = { + target = scope:actor + gold = 100 + } + } + } + # Steal the maniest coins. + else_if = { + limit = { scope:steal_x1000 = yes } + give_or_update_embezzler_secret_effect = { + TARGET = scope:recipient + STAKE = 1000 + } + scope:recipient = { + pay_short_term_gold = { + target = scope:actor + gold = 1000 + } + } + } + } + } + + send_option = { + flag = steal_x1 + localization = do_a_crime_embezzle_interaction_steal_x1 + } + + send_option = { + flag = steal_x100 + localization = do_a_crime_embezzle_interaction_steal_x100 + } + + send_option = { + flag = steal_x1000 + localization = do_a_crime_embezzle_interaction_steal_x1000 + } + + auto_accept = yes +} + +add_glory_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_combat + + interface_priority = -1 + + is_shown = { + debug_only = yes + } + + send_option = { + flag = high_glory + localization = add_glory_debug_high_tt + } + send_option = { + flag = low_glory + localization = add_glory_debug_low_tt + } + send_option = { + flag = delete_glory + localization = add_glory_debug_delete_tt + } + + on_accept = { + scope:recipient = { + hidden_effect = { + if = { + limit = { + scope:high_glory = yes + scope:recipient = { + is_acclaimed = yes + } + } + scope:recipient = { + accolade = { + add_glory = 2500 + } + } + } + else_if = { + limit = { + scope:low_glory = yes + scope:recipient = { + is_acclaimed = yes + } + } + scope:recipient = { + accolade = { + add_glory = 250 + } + } + } + else_if = { + limit = { + scope:delete_glory = yes + scope:recipient = { + is_acclaimed = yes + } + } + scope:recipient = { + accolade = { + add_glory = -5000 + } + } + } + } + } + } + auto_accept = yes +} + +debug_progress_all_active_schemes_interaction = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = debug_secret + is_shown = { debug_only = yes } + is_valid_showing_failures_only = { + scope:actor = { + any_scheme = { count >= 1 } + } + } + on_accept = { scope:recipient = { every_scheme = { add_scheme_progress = 100 } } } + auto_accept = yes +} + +debug_travel_to_ruler_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = travel_mixed + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + on_accept = { + scope:actor = { + random_courtier_or_guest = { + limit = { + is_available = yes + } + save_scope_as = companion1 + } + random_courtier_or_guest = { + limit = { + NOT = { + this = scope:companion1 + } + is_available = yes + } + save_scope_as = companion2 + } + random_courtier_or_guest = { + limit = { + NOR = { + this = scope:companion1 + this = scope:companion2 + } + is_available = yes + } + save_scope_as = companion3 + } + start_travel_plan = { + destination = scope:recipient.capital_province + companion = scope:companion1 + companion = scope:companion2 + companion = scope:companion3 + on_arrival_event = travel_completion_event.1000 + on_arrival_destinations = all_but_last + return_trip = no # One way + } + } + } + + auto_accept = yes +} + +debug_add_truce_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_retreat + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + send_option = { + flag = one_way_receive + localization = truce_one_way_receive + } + + send_option = { + flag = one_way_give + localization = truce_one_way_give + } + + send_option = { + flag = two_way + localization = truce_two_way + } + + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:one_way_receive = { + scope:recipient = { + add_truce_one_way = { + character = scope:actor + years = 5 + name = TRUCE_DEBUG + } + } + } + scope:one_way_give = { + add_truce_one_way = { + character = scope:recipient + years = 5 + name = TRUCE_DEBUG + } + } + scope:two_way = { + add_truce_both_ways = { + character = scope:recipient + years = 5 + name = TRUCE_DEBUG + } + } + } + } + } + + auto_accept = yes +} + +spawn_epidemic_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = plague + + interface_priority = -1 + + is_shown = { + debug_only = yes + } + + send_option = { + is_valid = { + scope:consumption = no + scope:smallpox = no + scope:ergotism = no + scope:bubonic_plague = no + scope:typhus = no + scope:dysentery = no + } + flag = measles + localization = spawn_epidemic_interaction_measles + } + send_option = { + is_valid = { + scope:measles = no + scope:smallpox = no + scope:ergotism = no + scope:bubonic_plague = no + scope:typhus = no + scope:dysentery = no + } + flag = consumption + localization = epidemic_consumption + } + send_option = { + is_valid = { + scope:measles = no + scope:consumption = no + scope:ergotism = no + scope:bubonic_plague = no + scope:typhus = no + scope:dysentery = no + } + flag = smallpox + localization = spawn_epidemic_interaction_smallpox + } + send_option = { + is_valid = { + scope:measles = no + scope:consumption = no + scope:smallpox = no + scope:bubonic_plague = no + scope:typhus = no + scope:dysentery = no + } + flag = ergotism + localization = spawn_epidemic_interaction_ergotism + } + send_option = { + is_valid = { + scope:measles = no + scope:consumption = no + scope:smallpox = no + scope:ergotism = no + scope:typhus = no + scope:dysentery = no + } + flag = bubonic_plague + localization = spawn_epidemic_interaction_bubonic_plague + } + send_option = { + is_valid = { + scope:measles = no + scope:consumption = no + scope:smallpox = no + scope:ergotism = no + scope:bubonic_plague = no + scope:dysentery = no + } + flag = typhus + localization = spawn_epidemic_interaction_typhus + } + send_option = { + is_valid = { + scope:measles = no + scope:consumption = no + scope:smallpox = no + scope:ergotism = no + scope:bubonic_plague = no + scope:typhus = no + } + flag = dysentery + localization = spawn_epidemic_interaction_dysentery + } + send_option = { + is_valid = { + scope:major = no + scope:apocalyptic = no + } + flag = minor + localization = spawn_minor_epidemic_interaction + } + send_option = { + is_valid = { + scope:minor = no + scope:apocalyptic = no + } + flag = major + localization = spawn_major_epidemic_interaction + } + send_option = { + is_valid = { + scope:minor = no + scope:major = no + } + flag = apocalyptic + localization = spawn_apocalyptic_epidemic_interaction + } + + send_options_exclusive = no + + can_send = { + calc_true_if = { + amount >= 1 + scope:measles = yes + scope:consumption = yes + scope:smallpox = yes + scope:ergotism = yes + scope:bubonic_plague = yes + scope:typhus = yes + scope:dysentery = yes + } + calc_true_if = { + amount >= 1 + scope:minor = yes + scope:major = yes + scope:apocalyptic = yes + } + } + + on_accept = { + scope:recipient.capital_province = { + hidden_effect = { + switch = { + trigger = yes + scope:minor = { + switch = { + trigger = yes + scope:measles = { create_epidemic_outbreak = { type = measles intensity = minor } } + scope:consumption = { create_epidemic_outbreak = { type = consumption intensity = minor } } + scope:smallpox = { create_epidemic_outbreak = { type = smallpox intensity = minor } } + scope:dysentery = { create_epidemic_outbreak = { type = dysentery intensity = minor } } + scope:bubonic_plague = { create_epidemic_outbreak = { type = bubonic_plague intensity = minor } } + scope:ergotism = { create_epidemic_outbreak = { type = ergotism intensity = minor } } + scope:typhus = { create_epidemic_outbreak = { type = typhus intensity = minor } } + } + } + scope:major = { + switch = { + trigger = yes + scope:measles = { create_epidemic_outbreak = { type = measles intensity = major } } + scope:consumption = { create_epidemic_outbreak = { type = consumption intensity = major } } + scope:smallpox = { create_epidemic_outbreak = { type = smallpox intensity = major } } + scope:dysentery = { create_epidemic_outbreak = { type = dysentery intensity = major } } + scope:bubonic_plague = { create_epidemic_outbreak = { type = bubonic_plague intensity = major } } + scope:ergotism = { create_epidemic_outbreak = { type = ergotism intensity = major } } + scope:typhus = { create_epidemic_outbreak = { type = typhus intensity = major } } + } + } + scope:apocalyptic = { + switch = { + trigger = yes + scope:measles = { create_epidemic_outbreak = { type = measles intensity = apocalyptic } } + scope:consumption = { create_epidemic_outbreak = { type = consumption intensity = apocalyptic } } + scope:smallpox = { create_epidemic_outbreak = { type = smallpox intensity = apocalyptic } } + scope:dysentery = { create_epidemic_outbreak = { type = dysentery intensity = apocalyptic } } + scope:bubonic_plague = { create_epidemic_outbreak = { type = bubonic_plague intensity = apocalyptic } } + scope:ergotism = { create_epidemic_outbreak = { type = ergotism intensity = apocalyptic } } + scope:typhus = { create_epidemic_outbreak = { type = typhus intensity = apocalyptic } } + } + } + } + } + } + } + auto_accept = yes +} + +spawn_legend_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = legend + + interface_priority = -1 + + is_shown = { + debug_only = yes + } + + send_option = { + flag = heroic + localization = spawn_legend_interaction_heroic + } + send_option = { + flag = holy + localization = spawn_legend_interaction_holy + } + send_option = { + flag = legitimizing + localization = spawn_legend_interaction_legitimizing + } + + on_accept = { + scope:recipient = { + hidden_effect = { + if = { + limit = { + scope:heroic = yes + } + scope:recipient = { + create_legend = { + type = heroic + quality = famed + chronicle = ancestral_glory + properties = { + ancestor = scope:recipient + title = scope:recipient.primary_title + } + } + } + } + else_if = { + limit = { + scope:holy = yes + } + scope:recipient = { + create_legend = { + type = holy + quality = famed + chronicle = ancestral_glory + properties = { + ancestor = scope:recipient + title = scope:recipient.primary_title + } + } + } + } + else_if = { + limit = { + scope:legitimizing = yes + } + scope:recipient = { + create_legend = { + type = legitimizing + quality = famed + chronicle = ancestral_glory + properties = { + ancestor = scope:recipient + title = scope:recipient.primary_title + } + } + } + } + } + } + } + auto_accept = yes +} + +debug_buff_schemes = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = scheme_assassination + send_options_exclusive = no + + interface_priority = -1 + + is_shown = { debug_only = yes } + + auto_accept = yes + + # Clear my opportunities. + send_option = { flag = debug_buff_schemes_zero_opportunity } + # Give me an opportunity. + send_option = { flag = debug_buff_schemes_one_opportunity } + # Give me max opportunities. + send_option = { flag = debug_buff_schemes_many_opportunity } + # Give me an agent slot that gives base success chance. + send_option = { flag = debug_buff_schemes_give_agent_success_chance_base } + # Give me an agent slot that gives success chance growth. + send_option = { flag = debug_buff_schemes_give_agent_success_chance_growth } + # Give me an agent slot that gives max success chance. + send_option = { flag = debug_buff_schemes_give_agent_success_chance_max } + # Give me an agent slot that gives speed. + send_option = { flag = debug_buff_schemes_give_agent_speed } + # Give me an agent slot that gives secrecy. + send_option = { flag = debug_buff_schemes_give_agent_secrecy } + # Set scheme progress to 1. + send_option = { flag = debug_buff_schemes_progress_one } + # Set scheme progress to half. + send_option = { flag = debug_buff_schemes_progress_half } + # Reset scheme progress. + send_option = { flag = debug_buff_schemes_progress_reset } + + on_accept = { + custom_tooltip = debug_buff_schemes.tt.application_warning + scope:recipient = { + every_scheme = { + if = { + limit = { always = scope:debug_buff_schemes_zero_opportunity } + change_opportunities = { + value = scheme_agent_charges + multiply = -1 + } + } + if = { + limit = { always = scope:debug_buff_schemes_one_opportunity } + change_opportunities = 2 + } + if = { + limit = { always = scope:debug_buff_schemes_many_opportunity } + change_opportunities = opportunity_cap_value + } + if = { + limit = { always = scope:debug_buff_schemes_give_agent_success_chance_base } + add_agent_slot = agent_wraith + } + if = { + limit = { always = scope:debug_buff_schemes_give_agent_success_chance_growth } + add_agent_slot = agent_changeling + } + if = { + limit = { always = scope:debug_buff_schemes_give_agent_success_chance_max } + add_agent_slot = agent_mage + } + if = { + limit = { always = scope:debug_buff_schemes_give_agent_speed } + add_agent_slot = agent_werewolf + } + if = { + limit = { always = scope:debug_buff_schemes_give_agent_secrecy } + add_agent_slot = agent_vampire + } + if = { + limit = { always = scope:debug_buff_schemes_progress_one } + custom_tooltip = { + text = debug_buff_schemes_progress_one + add_scheme_progress = { + value = scheme_phase_duration + subtract = scheme_progress + add = -1 + } + } + } + if = { + limit = { always = scope:debug_buff_schemes_progress_half } + custom_tooltip = { + text = debug_buff_schemes_progress_half + add_scheme_progress = { + value = scheme_progress + multiply = -1 + } + add_scheme_progress = { + value = scheme_phase_duration + multiply = 0.5 + } + } + } + if = { + limit = { always = scope:debug_buff_schemes_progress_reset } + custom_tooltip = { + text = debug_buff_schemes_progress_reset + add_scheme_progress = { + value = scheme_progress + multiply = -1 + } + } + } + } + } + } +} + +debug_clear_agents_from_schemes = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = independence + send_options_exclusive = no + + interface_priority = -1 + + is_shown = { debug_only = yes } + + auto_accept = yes + + send_option = { flag = debug_clear_agents_from_schemes_slot_1 } + send_option = { flag = debug_clear_agents_from_schemes_slot_2 } + send_option = { flag = debug_clear_agents_from_schemes_slot_3 } + send_option = { flag = debug_clear_agents_from_schemes_slot_4 } + send_option = { flag = debug_clear_agents_from_schemes_slot_5 } + send_option = { flag = debug_clear_agents_from_schemes_slot_excess } + send_option = { flag = debug_clear_agents_from_schemes_slot_all_but_first } + send_option = { flag = debug_clear_agents_from_schemes_slot_all } + + on_accept = { + custom_tooltip = debug_buff_schemes.tt.application_warning + scope:recipient = { + every_scheme = { + ordered_scheme_agent_slot = { + order_by = { value = 0 } + max = 5 + if = { + limit = { + NOT = { exists = scope:slot_1 } + } + save_scope_as = slot_1 + } + else_if = { + limit = { + NOR = { + this = scope:slot_1 + exists = scope:slot_2 + } + } + save_scope_as = slot_2 + } + else_if = { + limit = { + NOR = { + this = scope:slot_1 + this = scope:slot_2 + exists = scope:slot_3 + } + } + save_scope_as = slot_3 + } + else_if = { + limit = { + NOR = { + this = scope:slot_1 + this = scope:slot_2 + this = scope:slot_3 + exists = scope:slot_4 + } + } + save_scope_as = slot_4 + } + else_if = { + limit = { + NOR = { + this = scope:slot_1 + this = scope:slot_2 + this = scope:slot_3 + this = scope:slot_4 + exists = scope:slot_5 + } + } + save_scope_as = slot_5 + } + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_1 } + remove_agent_slot = scope:slot_1 + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_2 } + remove_agent_slot = scope:slot_2 + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_3 } + remove_agent_slot = scope:slot_3 + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_4 } + remove_agent_slot = scope:slot_4 + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_5 } + remove_agent_slot = scope:slot_5 + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_excess } + every_scheme_agent_slot = { + limit = { + NOR = { + this = scope:slot_1 + this = scope:slot_2 + this = scope:slot_3 + this = scope:slot_4 + this = scope:slot_5 + } + } + save_scope_as = slot_temp + prev = { remove_agent_slot = scope:slot_temp } + } + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_all_but_first } + every_scheme_agent_slot = { + limit = { + NOT = { this = scope:slot_1 } + } + save_scope_as = slot_temp + prev = { remove_agent_slot = scope:slot_temp } + } + } + if = { + limit = { always = scope:debug_clear_agents_from_schemes_slot_all } + every_scheme_agent_slot = { + save_scope_as = slot_temp + prev = { remove_agent_slot = scope:slot_temp } + } + } + } + } + } +} + +debug_make_laamp = { + category = interaction_debug_admin + desc = debug_make_laamp_desc + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = request_invasion_sponsorship_interaction + + interface_priority = -1 + + is_shown = { debug_only = yes } + + auto_accept = yes + + on_accept = { + scope:recipient = { + if = { + limit = { is_ruler = yes } + depose = yes + } + create_landless_adventurer_title_effect = { + REASON = flag:voluntary + FLAVOR_CHAR = scope:recipient + } + } + } +} + +debug_add_to_contact_list_interaction = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_contract_modification_single + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + scope:actor = { + is_landless_adventurer = yes + } + } + + is_valid_showing_failures_only = { + #not already on the list + scope:recipient = { NOT = { is_contact_of = scope:actor } } + } + + on_accept = { + scope:actor = { + add_contact = scope:recipient + } + } + + auto_accept = yes +} + +debug_alliance_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_ally + is_shown = { + debug_only = yes + NOR = { + scope:recipient = scope:actor + scope:recipient = { is_allied_to = scope:actor } + scope:recipient = { is_at_war_with = scope:actor } + } + } + + on_accept = { + 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 + } + } + } + auto_accept = yes +} + +create_task_contract_interaction = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_contract_modification_single + + interface_priority = -1 + + is_shown = { + debug_only = yes + } + + send_option = { flag = create_task_contract_interaction_option_1 } + send_option = { flag = create_task_contract_interaction_option_2 } + send_option = { flag = create_task_contract_interaction_option_3 } + send_option = { flag = create_task_contract_interaction_option_4 } + send_option = { flag = create_task_contract_interaction_option_5 } + + is_valid_showing_failures_only = { + valid_laamp_basic_trigger = { + EMPLOYER = scope:recipient + LAAMP = scope:actor + } + } + + on_accept = { + scope:actor = { + # Now fire the contract. + switch = { + trigger = yes + scope:create_task_contract_interaction_option_1 = { + create_task_contract = { + # Comment/de-comment as appropriate for what you want to fire. + #contract_type = laamp_base_0001 + #contract_type = laamp_base_1001 + #task_contract_type = laamp_base_2001 + #task_contract_type = laamp_base_3001 + #task_contract_type = laamp_base_4001 + #task_contract_type = laamp_base_6001 + task_contract_type = laamp_base_4100 + task_contract_tier = 0 + location = scope:recipient.location + task_contract_employer = scope:recipient + } + } + scope:create_task_contract_interaction_option_2 = { + create_task_contract = { + # Comment/de-comment as appropriate for what you want to fire. + #task_contract_type = laamp_base_0011 + #task_contract_type = laamp_base_1011 + task_contract_type = laamp_base_2011 + #task_contract_type = laamp_base_3011 + task_contract_type = laamp_base_4011 + #task_contract_type = laamp_base_6011 + task_contract_tier = 0 + location = scope:recipient.location + task_contract_employer = scope:recipient + } + } + scope:create_task_contract_interaction_option_3 = { + create_task_contract = { + # Comment/de-comment as appropriate for what you want to fire. + #task_contract_type = laamp_base_0021 + #task_contract_type = laamp_base_1021 + #task_contract_type = laamp_base_2001 + #task_contract_type = laamp_base_3021 + task_contract_type = laamp_base_4021 + #task_contract_type = laamp_base_6021 + task_contract_tier = 0 + location = scope:recipient.location + task_contract_employer = scope:recipient + } + } + scope:create_task_contract_interaction_option_4 = { + create_task_contract = { + # Comment/de-comment as appropriate for what you want to fire. + #task_contract_type = laamp_base_0031 + #task_contract_type = laamp_base_1031 + #task_contract_type = laamp_base_2031 + #task_contract_type = laamp_base_3031 + #task_contract_type = laamp_base_4031 + task_contract_type = laamp_base_5031 + #task_contract_type = laamp_base_6031 + task_contract_tier = 0 + location = scope:recipient.location + task_contract_employer = scope:recipient + } + } + scope:create_task_contract_interaction_option_5 = { + create_task_contract = { + # Comment/de-comment as appropriate for what you want to fire. + #task_contract_type = laamp_base_0041 + #task_contract_type = laamp_base_1041 + task_contract_type = laamp_base_2041 + #task_contract_type = laamp_base_3041 + #task_contract_type = laamp_base_4041 + task_contract_tier = 0 + location = scope:recipient.location + task_contract_employer = scope:recipient + } + } + } + + } + } + auto_accept = yes +} + +# Debug move domicile, choose between moving just the domicile, moving the domicile and the owner, and if you want to use the travel system to do it (last option is only for laamps). +debug_move_domicile_interaction = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + common_interaction = yes + icon = travel_mixed + + interface_priority = -1 + + is_shown = { + debug_only = yes + scope:actor = { + has_domicile = yes + } + } + + auto_accept = yes + + send_option = { + starts_enabled = { always = yes } + flag = move_domicile_option + } + send_option = { + is_shown = { + scope:actor = { + is_landless_adventurer = yes + } + } + flag = move_with_travel_option + } + send_options_exclusive = no + + on_accept = { + scope:recipient.capital_province = { + save_scope_as = relocation_destination + } + scope:actor = { + if = { + limit = { + scope:move_domicile_option = yes + } + if = { + limit = { + scope:move_with_travel_option = yes + } + start_travel_plan = { + destination = scope:relocation_destination + on_start_on_action = on_travel_relocation_start + on_arrival_on_action = on_travel_relocation_end + on_arrival_destinations = last + return_trip = no # One way + travel_with_domicile = yes + } + } + else = { + domicile = { + move_domicile = scope:relocation_destination + } + populate_location_with_contracts_effect = { + AREA_CHAR = scope:actor + AMOUNT = 5 + } + } + } + else = { + if = { + limit = { + scope:move_with_travel_option = yes + } + start_travel_plan = { + destination = scope:relocation_destination + on_start_on_action = on_travel_relocation_start + on_arrival_on_action = on_travel_relocation_end + on_arrival_destinations = last + return_trip = no # One way + travel_with_domicile = yes + } + } + else = { + domicile = { + move_domicile = scope:relocation_destination + } + populate_location_with_contracts_effect = { + AREA_CHAR = scope:actor + AMOUNT = 5 + } + } + } + } + } +} + +debug_populate_contracts = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + common_interaction = no + icon = icon_scheme_learn_language + + interface_priority = -1 + + is_shown = { + debug_only = yes + } + + auto_accept = yes + + on_accept = { + scope:actor = { + populate_location_with_contracts_effect = { + AREA_CHAR = scope:recipient + AMOUNT = 5 + } + } + } +} + +give_infinite_schemes_of_type_interaction = { + category = interaction_debug_admin + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_adultery + + interface_priority = -1 + + is_shown = { + debug_only = yes + } + + send_option = { flag = give_infinite_schemes_of_type_all } + send_option = { flag = give_infinite_schemes_of_type_hostile } + send_option = { flag = give_infinite_schemes_of_type_contract } + send_option = { flag = give_infinite_schemes_of_type_personal } + send_option = { flag = give_infinite_schemes_of_type_clear_modifiers } + + on_accept = { + scope:actor = { + custom_tooltip = give_infinite_schemes_of_type_interaction.tt + if = { + limit = { scope:give_infinite_schemes_of_type_all = yes } + add_character_modifier = infinite_hostile_schemes_modifier + add_character_modifier = infinite_contract_schemes_modifier + add_character_modifier = infinite_personal_schemes_modifier + } + if = { + limit = { scope:give_infinite_schemes_of_type_hostile = yes } + add_character_modifier = infinite_hostile_schemes_modifier + } + if = { + limit = { scope:give_infinite_schemes_of_type_contract = yes } + add_character_modifier = infinite_contract_schemes_modifier + } + if = { + limit = { scope:give_infinite_schemes_of_type_personal = yes } + add_character_modifier = infinite_personal_schemes_modifier + } + if = { + limit = { scope:give_infinite_schemes_of_type_clear_modifiers = yes } + remove_character_modifier = infinite_hostile_schemes_modifier + remove_character_modifier = infinite_contract_schemes_modifier + remove_character_modifier = infinite_personal_schemes_modifier + } + } + } + auto_accept = yes +} + +antagonise_court = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_hostile + + is_shown = { + debug_only = yes + } + + send_option = { + flag = vassals_only + localization = antagonise_court_vassals_only + } + + send_option = { + flag = courtiers_and_guests + localization = antagonise_court_courtiers_and_guests + } + + send_option = { + flag = present_family + localization = antagonise_court_present_family + } + + send_option = { + flag = antagonise_all + localization = antagonise_court_antagonise_all + } + + on_accept = { + scope:recipient = { + switch = { + trigger = yes + scope:vassals_only = { + every_vassal = { + add_opinion = { + target = scope:recipient + modifier = hate_opinion + opinion = -250 + } + } + } + scope:courtiers_and_guests = { + every_courtier_or_guest = { + add_opinion = { + target = scope:recipient + modifier = hate_opinion + opinion = -250 + } + } + } + scope:present_family = { + every_close_or_extended_family_member = { + add_opinion = { + target = scope:recipient + modifier = hate_opinion + opinion = -250 + } + } + } + scope:antagonise_all = { + every_vassal = { + limit = { + NOT = { + is_close_or_extended_family_of = scope:recipient + } + } + add_opinion = { + target = scope:recipient + modifier = hate_opinion + opinion = -250 + } + } + every_courtier_or_guest = { + limit = { + NOT = { + is_close_or_extended_family_of = scope:recipient + } + } + add_opinion = { + target = scope:recipient + modifier = hate_opinion + opinion = -250 + } + } + every_close_or_extended_family_member = { + add_opinion = { + target = scope:recipient + modifier = hate_opinion + opinion = -250 + } + } + } + } + } + } + + auto_accept = yes +} + +spawn_courtier_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = guest + + interface_priority = -1 + + is_shown = { + debug_only = yes + scope:recipient = { is_ruler = yes } + } + + send_option = { + flag = diplomacy + localization = diplomacy + } + send_option = { + flag = martial + localization = martial + } + send_option = { + flag = stewardship + localization = stewardship + } + send_option = { + flag = intrigue + localization = intrigue + } + send_option = { + flag = learning + localization = learning + } + send_option = { + flag = prowess + localization = prowess + } + + on_accept = { + switch = { + trigger = yes + scope:diplomacy = { + create_character = { + template = pool_repopulate_diplomacy + gender_female_chance = 50 + culture = scope:recipient.culture + faith = scope:recipient.faith + location = scope:recipient.location + dynasty = none + save_scope_as = new_courtier + } + } + scope:martial = { + create_character = { + template = pool_repopulate_martial + gender_female_chance = recipient_soldier_female_chance + culture = scope:recipient.culture + faith = scope:recipient.faith + location = scope:recipient.location + dynasty = none + save_scope_as = new_courtier + } + } + scope:stewardship = { + create_character = { + template = pool_repopulate_stewardship + gender_female_chance = 50 + culture = scope:recipient.culture + faith = scope:recipient.faith + location = scope:recipient.location + dynasty = none + save_scope_as = new_courtier + } + } + scope:intrigue = { + create_character = { + template = pool_repopulate_intrigue + gender_female_chance = 50 + culture = scope:recipient.culture + faith = scope:recipient.faith + location = scope:recipient.location + dynasty = none + save_scope_as = new_courtier + } + } + scope:learning = { + create_character = { + template = pool_repopulate_learning + gender_female_chance = 50 + culture = scope:recipient.culture + faith = scope:recipient.faith + location = scope:recipient.location + dynasty = none + save_scope_as = new_courtier + } + } + scope:prowess = { + create_character = { + template = pool_repopulate_prowess + gender_female_chance = recipient_soldier_female_chance + culture = scope:recipient.culture + faith = scope:recipient.faith + location = scope:recipient.location + dynasty = none + save_scope_as = new_courtier + } + } + } + scope:recipient = { custom_tooltip = spawn_courtier_interaction_tt } + if = { + limit = { exists = scope:new_courtier } + scope:recipient = { + hidden_effect = { + send_interface_toast = { + title = spawn_courtier_interaction_tt + left_icon = scope:new_courtier + right_icon = scope:actor + add_courtier = scope:new_courtier + hidden_effect = { + scope:new_courtier = { return_to_court = yes } + } + } + } + } + } + } + auto_accept = yes +} + +destroy_title_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = antagonistic + + is_shown = { + debug_only = yes + } + + send_option = { # Destroys just the top title of the realm + is_valid = { + scope:recipient = { + primary_title.tier >= tier_duchy + } + } + flag = top_title + localization = debug_top_title_interaction + } + + send_option = { # Destroys all the titles except county titles in the realm + flag = all_title + localization = debug_all_title_interaction + } + + on_accept = { + switch = { + trigger = yes + scope:top_title = { + scope:recipient = { + scope:recipient = { destroy_title = primary_title } + } + } + scope:all_title = { + scope:recipient = { + every_sub_realm_title = { + limit = { + tier >= tier_duchy + } + scope:recipient = { destroy_title = prev } + } + } + } + } + } + + auto_accept = yes +} + diff --git a/common/character_interactions/00_diarch_interactions.txt b/common/character_interactions/00_diarch_interactions.txt new file mode 100644 index 00000000..bc35b21f --- /dev/null +++ b/common/character_interactions/00_diarch_interactions.txt @@ -0,0 +1,9889 @@ +@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 = yes + 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 + + interface_priority = 60 + 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. + NOT = { 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 + } + } + # Make sure scope:recipient is suitable. + scope:recipient = { + # We only target vassals of the liege... + liege = scope:actor.liege + NOT = { 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. + NOT = { 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 + NOT = { 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_amkingtier_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 = 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 + 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 + + interface_priority = 55 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + on_decline_summary = diarch_rebel_or_crime_summary.retract + + is_shown = { + # The obvious. + NOT = { 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 + } + # 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 + NOT = { 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. + NOT = { 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 = { + tier >= 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 = { + limit = { tier >= 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 } + } + } + } + } + + can_send_despite_rejection = yes + + # AI + ai_targets = { ai_recipients = peer_vassals } + ai_frequency = 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 + 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 + + interface_priority = 60 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + on_decline_summary = diarch_rebel_or_crime_summary.crominal + + is_shown = { + # The obvious. + NOT = { 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 + } + # 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. + NOT = { 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 = root } + } + 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 } + NOT = { 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_amkingtier_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_is_type = claimant_faction + faction_is_at_war = yes + exists = special_character + 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_targets = { ai_recipients = scripted_relations } + ai_frequency = 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. + NOT = { 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 + } + # 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 + } + } + # 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 = 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 + 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. + NOT = { 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 + } + # 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 = 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 + 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 + + interface_priority = 60 + + is_shown = { + # The obvious. + NOT = { 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 + } + } + # Make sure scope:recipient is suitable. + scope:recipient = { + # We only target vassals of the liege... + liege = scope:actor.liege + NOT = { 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 = 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 = { + exists = holder + 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.kingdom ?= { + NOT = { this = scope:actor.primary_title.kingdom } + } + } + ## 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 + + desc = diarch_syphon_treasury_interaction_desc + + + interface_priority = 60 + + is_shown = { + # The obvious. + NOT = { 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 + } + } + # 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 } + custom_tooltip = diarch_syphon_treasury_interaction.tt.success.syphon_development_growth + } + ## 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 } + } + } + # 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 = { + NOT = { 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 = { + NOT = { 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 = { + NOT = { 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 = { + NOT = { 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 = 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 + + ai_intermediary_maybe = yes + desc = diarch_shift_privileges_interaction_desc + + popup_on_receive = yes + + interface_priority = 60 + + is_shown = { + # The obvious. + NOT = { 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 + } + } + # Make sure scope:recipient is suitable. + scope:recipient = { + # We only target vassals of the liege... + liege = scope:actor.liege + NOT = { 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 } + } + + # Debug logging. + debug_log = debug_log.shift_privileges.attempt_made + } + + auto_accept = yes + + # AI + ai_targets = { ai_recipients = peer_vassals } + ai_frequency = 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 + + desc = diarch_request_imperial_expedition_interaction_desc + + ai_maybe = yes + popup_on_receive = yes + pause_on_receive = yes + + is_shown = { + # The obvious. + NOT = { 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 = 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 + + 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. + NOT = { 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 = { + limit = { tier >= 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 = 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 + 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 = { + NOT = { 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 } + } + + interface_priority = 20 + + 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_is_administrative } + } + 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 + } + } + } + } + } + + # 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 = 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 = 20 + + 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 = { + 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 = 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 = { + # 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 + } + # 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_targets = { ai_recipients = diarch } + ai_frequency = 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 = 6 + scope:swing_influence = 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 } + } + } + } + starts_enabled = { scope:actor.influence >= scope:actor.swing_scales_influence_cost_value } + flag = swing_influence + localization = SWING_INFLUENCE + current_description = SWING_INFLUENCE_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 = 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. + NOT = { 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 = 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. + NOT = { 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 = { + #TODO_CD_EP3_POLISH; this should really be a letter event rather than just a notification, plus notifications for player governors. + # 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 = 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. + NOT = { scope:actor = scope:recipient } + # Diarchy checks for scope:actor. + scope:actor = { + # If you're not in a diarchy, we don't care. + exists = diarch + 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 + # 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 = 24 + 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. + NOT = { scope:actor = scope:recipient } + # Diarchy checks for scope:actor. + scope:actor = { + # If you're not in a diarchy, we don't care. + exists = diarch + diarch = scope:recipient + # With the extra consideration that we only want this to appear for Entrenched Regencies. + has_diarchy_parameter = dismissal_requires_gift + } + } + + 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 + } + } + } + } + + 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 } + NOT = { + 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 + } + + 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 + } + } + } + } + } + + # 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 } + } + } + } + + 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 } + } + } + } + + 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 + NOT = { 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 = 24 + 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 + } + } +} + +# 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. + NOT = { 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 = 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 + + 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. + NOT = { 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 = { has_active_diarchy = no } + # ... or have declared you their regent already! + scope:actor = { is_designated_diarch = no } + # Can't be used during the Cid story cycle + scope:actor = { NOT = { 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 } + } + # 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 = { 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 = { + NOT = { + 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 + } + } + + # AI + ai_targets = { ai_recipients = liege } + ai_frequency = 150 + + 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 + } + } +} + +# 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 = { + NOT = { has_active_diarchy = yes } + } + # 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 = 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 + 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 = { + NOT = { 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 = { + NOT = { 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 = 240 + + 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 = yes } + } + } + 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 = yes } + } + } + + is_valid_showing_failures_only = { + # You can't already be in a diarchy of any kind. + scope:actor = { + NOT = { has_active_diarchy = yes } + } + # 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 = yes } + } + # 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 + 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 = { + 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: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 + } + + #TODO_CD_EP3_POLISH; notification event for the relevant parties if they're players. + #TODO_CD_EP3_POLISH; memories for those involved, plus probably a rivalry reason with at least designated heirs. + + # 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 = 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 = 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_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 = { + NOT = { has_active_diarchy = yes } + } + # 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 + 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 = { + 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.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 + } + + #TODO_CD_EP3_POLISH; notification event for the relevant parties if they're players. + #TODO_CD_EP3_POLISH; memories for those involved, plus probably a rivalry reason with at least designated heirs. + + # 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 = 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 = { + NOT = { has_active_diarchy = yes } + } + # 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 = yes } + } + # 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 = yes } + 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 + 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 = { + 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: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 + } + + #TODO_CD_EP3_POLISH; notification event for the relevant parties if they're players. + #TODO_CD_EP3_POLISH; memories for those involved, plus probably a rivalry reason with at least designated heirs. + + # 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 = 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 = { + NOT = { this = scope:actor } + liege ?= { + this = scope:actor.liege + diarch ?= scope:recipient + NOT = { 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 = 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_dynast_interactions.txt b/common/character_interactions/00_dynast_interactions.txt new file mode 100644 index 00000000..76f1c3f6 --- /dev/null +++ b/common/character_interactions/00_dynast_interactions.txt @@ -0,0 +1,1940 @@ +#Interactions relating to the head of the dynasty + +disinherit_interaction = { + icon = icon_dynasty + category = interaction_category_hostile + interface_priority = 60 + + desc = disinherit_interaction_desc + use_diplomatic_range = no + + is_shown = { + NOT = { + scope:recipient = scope:actor + + AND = { # Explicit AND to ensure no funny business + scope:recipient = { is_child_of = scope:actor } + scope:actor.dynasty = { + this = scope:recipient.dynasty + has_dynasty_perk = fp2_coterie_legacy_5 + } + } + } + + scope:actor = { + is_dynast = yes + dynasty = scope:recipient.dynasty + + } + scope:recipient = { + NOT = { + has_trait = disinherited + } + } + } + + is_valid = { + custom_description = { + scope:actor.culture = { + NOT = { has_cultural_parameter = cannot_disherit } + } + text = "mystical_ancestors_disinherit" + } + } + + is_valid_showing_failures_only = { + trigger_if = { + limit = { + NOT = { # in such cases, it will be free so no need to check for Renown + scope:recipient = { + OR = { + has_trait = disputed_heritage + any_secret = { + secret_type = secret_disputed_heritage + is_known_by = scope:actor + } + has_trait = bastard + } + } + } + } + scope:actor.dynasty = { + dynasty_prestige >= medium_dynasty_prestige_value + } + } + + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + trigger_if = { + limit = { + scope:recipient = { + NOR = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + } + } + custom_description = { + scope:recipient.top_liege = scope:actor.top_liege + text = "same_realm_as" + } + } + custom_tooltip = { + text = cannot_take_overt_hostile_actions_against_diarch.tt + NOT = { scope:recipient ?= scope:actor.diarch } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0020 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + forgiving = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + + #Legitimacy loss + if = { + limit = { has_legitimacy = yes } + if = { + limit = { scope:recipient = { is_primary_heir_of = scope:actor } } + add_legitimacy = { + value = medium_legitimacy_loss + multiply = scope:actor.primary_title.tier + } + } + else_if = { + limit = { scope:recipient = { is_child_of = scope:actor } } + add_legitimacy = { + value = minor_legitimacy_loss + multiply = scope:actor.primary_title.tier + } + } + else = { + add_legitimacy = { + value = miniscule_legitimacy_loss + multiply = scope:actor.primary_title.tier + } + } + } + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = disinherit_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + show_as_tooltip = { + disinherit_effect = { DISINHERITOR = scope:actor } + } + } + } + } + } + + scope:recipient = { + disinherit_effect = { DISINHERITOR = scope:actor } + } + + # 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_disinheritance.desc + REVERSE_NON_HOUSE_TARGET = no + } + + if = { + limit = { + scope:recipient = { + any_secret = { + secret_type = secret_disputed_heritage + is_known_by = scope:actor + save_temporary_scope_as = secret_to_reveal + } + } + } + + scope:secret_to_reveal = { + expose_secret = scope:recipient.mother + } + + scope:recipient = { + add_trait = disputed_heritage + } + } + } + + cost = { + renown = { + value = { + add = medium_dynasty_prestige_value + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = yes + } + } + add = major_dynasty_prestige_value + } + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = no + any_heir_title = { + exists = holder + } + } + } + add = medium_dynasty_prestige_value + } + if = { + limit = { + scope:recipient = { + OR = { + has_trait = disputed_heritage + any_secret = { + secret_type = secret_disputed_heritage + is_known_by = scope:actor + } + has_trait = bastard + } + } + } + multiply = 0 + } + } + } + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = yes + } + } + add = massive_prestige_value + } + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = no + any_heir_title = { + exists = holder + } + } + } + add = medium_prestige_value + } + if = { + limit = { + scope:recipient = { + OR = { + has_trait = disputed_heritage + any_secret = { + secret_type = secret_disputed_heritage + is_known_by = scope:actor + } + has_trait = bastard + } + } + } + multiply = 0 + } + } + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + NOT = { + has_trait = forgiving + } + } + + ai_targets = { + ai_recipients = dynasty + max = 20 + } + + ai_frequency = 96 + + ai_will_do = { + base = 0 + + modifier = { + add = -100 + scope:actor = { + OR = { + legitimacy_level = 0 + legitimacy_level = 1 + } + } + scope:recipient = { is_primary_heir_of = scope:actor } + } + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + modifier = { + add = 100 + scope:recipient = { + is_primary_heir_of = scope:actor + OR = { + has_trait = inbred + has_trait = intellect_bad_3 + has_trait = incapable + } + } + } + + modifier = { + add = 5 + ai_vengefulness >= medium_positive_ai_value + scope:recipient = { + is_heir_of = scope:actor + } + OR = { + AND = { + scope:recipient = { + has_trait = incestuous + } + NOT = { is_incestuous_trigger = yes } + trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = kinslayer + } + NOT = { has_trait = kinslayer } + } + AND = { + scope:recipient = { + has_trait = adulterer + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = fornicator + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = deviant + } + NOT = { + is_deviant_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = witch + } + NOT = { + is_witch_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = sodomite + } + NOR = { + has_trait = sodomite + any_secret = { + secret_type = secret_homosexual + } + } + trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = cannibal + } + NOT = { + is_cannibal_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + modifier = { + factor = 0 + scope:recipient = { + is_ai = no + } + } + } +} + +disinherit_children_interaction = { + icon = icon_dynasty + category = interaction_category_hostile + interface_priority = 60 + + desc = disinherit_children_interaction_desc + use_diplomatic_range = no + + is_shown = { + # DLC checking + has_fp2_dlc_trigger = yes + # Standard check + NOT = { scope:recipient = scope:actor } + + scope:actor.dynasty = { + this = scope:recipient.dynasty + has_dynasty_perk = fp2_coterie_legacy_5 + } + scope:recipient = { + NOT = { + has_trait = disinherited + } + } + } + + is_valid = { + scope:actor = { is_parent_of = scope:recipient } + + + custom_description = { + scope:actor.culture = { + NOT = { has_cultural_parameter = cannot_disherit } + } + text = "mystical_ancestors_disinherit" + } + } + + is_valid_showing_failures_only = { + scope:actor = { + prestige >= major_prestige_value + } + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + trigger_if = { + limit = { + scope:recipient = { + NOR = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + } + } + custom_description = { + scope:recipient.top_liege = scope:actor.top_liege + text = "same_realm_as" + } + } + custom_tooltip = { + text = cannot_take_overt_hostile_actions_against_diarch.tt + NOT = { scope:recipient ?= scope:actor.diarch } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0020 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + forgiving = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + add_tyranny = massive_tyranny_value + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = disinherit_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + show_as_tooltip = { + disinherit_effect = { DISINHERITOR = scope:actor } + } + } + } + } + } + + scope:recipient = { + disinherit_effect = { DISINHERITOR = scope:actor } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_disinheritance.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + cost = { + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = yes + } + } + add = massive_prestige_value + } + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = no + any_heir_title = { + exists = holder + } + } + } + add = medium_prestige_value + } + } + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + NOT = { + has_trait = forgiving + } + } + + ai_targets = { + ai_recipients = dynasty + max = 20 + } + + ai_frequency = 96 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + modifier = { + add = 100 + scope:recipient = { + is_primary_heir_of = scope:actor + OR = { + has_trait = inbred + has_trait = intellect_bad_3 + has_trait = incapable + } + } + } + + modifier = { + add = 5 + ai_vengefulness >= medium_positive_ai_value + scope:recipient = { + is_heir_of = scope:actor + } + OR = { + AND = { + scope:recipient = { + has_trait = incestuous + } + NOT = { is_incestuous_trigger = yes } + trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = kinslayer + } + NOT = { has_trait = kinslayer } + } + AND = { + scope:recipient = { + has_trait = adulterer + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = fornicator + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = deviant + } + NOT = { + is_deviant_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = witch + } + NOT = { + is_witch_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = sodomite + } + NOR = { + has_trait = sodomite + any_secret = { + secret_type = secret_homosexual + } + } + trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = cannibal + } + NOT = { + is_cannibal_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + modifier = { + factor = 0 + scope:recipient = { + is_ai = no + } + } + } +} + +restore_inheritance_interaction = { + icon = icon_dynasty + category = interaction_category_friendly + desc = restore_inheritance_interaction_desc + + interface_priority = 60 + + is_shown = { + scope:actor = { + is_dynast = yes + dynasty = scope:recipient.dynasty + + } + scope:recipient = { + has_trait = disinherited + } + } + + is_valid_showing_failures_only = { + scope:actor.dynasty ={ + dynasty_prestige >= miniscule_dynasty_prestige_value + } + scope:recipient = { is_busy_in_events_localised = yes } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0030 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + vengeful = minor_stress_impact_gain + stubborn = minor_stress_impact_gain + } + hidden_effect = { + send_interface_message = { + type = event_dynasty_neutral + title = restore_inheritance_interaction_notification + right_icon = scope:recipient + show_as_tooltip = { + scope:recipient = { + restore_inheritance_effect = yes + } + } + } + } + } + + scope:recipient = { + restore_inheritance_effect = yes + } + + # 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_re_inheritance.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + cost = { + renown = { + value = medium_dynasty_prestige_value + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + } + + ai_targets = { + ai_recipients = dynasty + max = 20 + } + + ai_frequency = 120 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + modifier = { + add = 5 + ai_vengefulness <= medium_negative_ai_value + } + + modifier = { + add = 100 + scope:recipient = scope:actor + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + } +} + +denounce_interaction = { + icon = icon_dynasty + category = interaction_category_hostile + interface_priority = 60 + + desc = denounce_interaction_desc + + is_shown = { + NOT = { scope:recipient = scope:actor } + + scope:actor = { + is_dynast = yes + dynasty = scope:recipient.dynasty + } + scope:recipient = { + NOT = { + has_trait = denounced + } + } + } + + is_valid_showing_failures_only = { + scope:actor.dynasty = { + dynasty_prestige >= minor_dynasty_prestige_value + } + scope:recipient = { is_busy_in_events_localised = yes } + 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 } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0040 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + forgiving = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = denounce_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + show_as_tooltip = { + denounce_effect = { ACTOR = scope:actor RECIPIENT = scope:recipient } + } + } + } + } + } + + scope:recipient = { + denounce_effect = { ACTOR = scope:actor RECIPIENT = scope:recipient } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_denouncement.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + cost = { + renown = { + value = { + add = minor_dynasty_prestige_value + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = yes + } + } + add = medium_dynasty_prestige_value + } + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = no + any_heir_title = { + exists = holder + } + } + } + add = minor_dynasty_prestige_value + } + } + } + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = yes + } + } + add = major_prestige_value + } + if = { + limit = { + scope:recipient = { + is_landed_or_landless_administrative = no + any_heir_title = { + exists = holder + } + } + } + add = medium_prestige_value + } + } + } + } + + auto_accept = yes + + ai_potential = { + is_adult = yes + NOT = { + has_trait = forgiving + } + } + + ai_targets = { + ai_recipients = dynasty + max = 20 + } + + ai_frequency = 96 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + modifier = { + add = 5 + ai_vengefulness >= medium_positive_ai_value + OR = { + AND = { + scope:recipient = { + has_trait = incestuous + } + NOT = { is_incestuous_trigger = yes } + trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = kinslayer + } + NOT = { has_trait = kinslayer } + } + AND = { + scope:recipient = { + has_trait = adulterer + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = fornicator + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = deviant + } + NOT = { + is_deviant_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = witch + } + NOT = { + is_witch_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = sodomite + } + NOR = { + has_trait = sodomite + any_secret = { + secret_type = secret_homosexual + } + } + trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = cannibal + } + NOT = { + is_cannibal_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + } +} + +forgive_interaction = { + icon = icon_dynasty + category = interaction_category_friendly + interface_priority = 60 + + desc = forgive_interaction_desc + + is_shown = { + NOT = { scope:recipient = scope:actor } + + scope:actor = { + is_dynast = yes + dynasty = scope:recipient.dynasty + } + scope:recipient = { + has_trait = denounced + } + } + + is_valid_showing_failures_only = { + scope:actor.dynasty = { + dynasty_prestige >= miniscule_dynasty_prestige_value + } + scope:recipient = { is_busy_in_events_localised = yes } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0050 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + vengeful = minor_stress_impact_gain + stubborn = minor_stress_impact_gain + } + hidden_effect = { + send_interface_message = { + type = event_generic_neutral + title = forgive_interaction_notification + right_icon = scope:recipient + show_as_tooltip = { + scope:recipient = { + forgive_effect = yes + } + } + } + } + } + + scope:recipient = { + forgive_effect = yes + } + + # 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 + } + } + + cost = { + renown = { + value = miniscule_dynasty_prestige_value + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + } + + ai_targets = { + ai_recipients = dynasty + max = 20 + } + + ai_frequency = 120 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + modifier = { + add = 5 + ai_vengefulness <= medium_negative_ai_value + } + + modifier = { + add = 100 + scope:recipient = scope:actor + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + } +} + +call_dynasty_member_to_war_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + interface_priority = 60 + + desc = call_dynasty_member_to_war_interaction_desc + + interface = call_ally + special_interaction = call_ally_interaction + popup_on_receive = yes + pause_on_receive = yes + + greeting = positive + notification_text = CALL_DYNASTY_MEMBER_NOTIFICATION + + is_shown = { + NOT = { scope:recipient = scope:actor } + + scope:actor = { + is_dynast = yes + religion = scope:recipient.religion + dynasty = scope:recipient.dynasty + NOT = { house = scope:recipient.house } # Use the House Head version instead + any_character_war = { + is_war_leader = scope:actor + } + } + scope:recipient = { + is_ruler = yes + } + + scope:recipient = { + NOT = { + target_is_liege_or_above = scope:actor + } + } + } + + has_valid_target = { + exists = scope:target + } + + has_valid_target_showing_failures_only = { + scope:target = { + is_war_leader = scope:actor + } + joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { + WARRIOR = scope:actor + JOINER = scope:recipient + } + } + + is_valid_showing_failures_only = { + scope:actor.dynasty = { dynasty_prestige >= medium_dynasty_prestige_value } + scope:recipient = { + NOT = { government_has_flag = government_is_mercenary } + NOT = { government_has_flag = government_is_holy_order } + } + custom_description = { + text = "is_already_in_all_wars" + scope:actor = { + any_character_war = { + NOR = { + is_participant = scope:recipient + was_called = scope:recipient + } + OR = { + primary_attacker = scope:actor + primary_defender = scope:actor + } + } + } + } + } + + can_be_picked = { + can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = call_ally.0001 + } + } + + on_accept = { + call_dynasty_member_to_war_interaction_effect = yes + + save_scope_value_as = { + name = call_dynasty_member_to_war_interaction + value = yes + } + + if = { + limit = { + exists = scope:target + } + scope:actor = { + trigger_event = call_ally.0100 + } + } + } + + 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 + } + } + } + else = { + scope:actor = { + add_opinion = { + modifier = rejected_call_to_defensive_war + target = scope:recipient + } + } + } + hidden_effect = { + if = { + limit = { + NOT = { was_called = scope:recipient } + } + set_called_to = scope:recipient + } + } + } + scope:actor.dynasty = { + add_dynasty_prestige = medium_dynasty_prestige_loss + } + } + + if = { + limit = { + exists = scope:target + } + scope:actor = { + trigger_event = call_ally.0101 + } + } + } + + ai_accept = { + base = 20 + + 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 = { # Reluctant when already at war + add = -50 + scope:recipient = { + is_at_war = yes + } + desc = ALREADY_AT_WAR + } + + 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 + } + + 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 + NOT = { 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 + } + + fp3_struggle_resist_allied_wars_modifier = yes + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = 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 +} + +dynast_claim_title_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + desc = dynast_claim_title_interaction_desc + target_type = title + target_filter = recipient_domain_titles + ignores_pending_interaction_block = yes + cost = { renown = major_dynasty_prestige_value } + is_shown = { + NOT = { scope:recipient = scope:actor } + + scope:actor = { + is_dynast = yes + religion = scope:recipient.religion + dynasty = scope:recipient.dynasty + } + + scope:recipient = { + is_playable_character = yes + } + } + + can_be_picked = { + custom_description = { + scope:target = { NOT = { any_claimant = { this = scope:actor } } } + text = "already_have_a_claim_on_this_title" + } + } + + is_valid_showing_failures_only = { + custom_description = { + scope:recipient = { + any_held_title = { + tier >= tier_county + NOT = { any_claimant = { this = scope:actor } } + } + } + + object = scope:recipient + text = "already_have_claims_on_all_titles" + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0060 + } + } + + on_accept = { + dynast_claim_title_effect = yes + scope:actor = { + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = dynast_claim_title_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + show_as_tooltip = { + dynast_claim_title_effect = yes + } + } + } + } + + # 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_title_claim.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes +} + +dynast_end_dynasty_wars_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + desc = dynast_end_dynasty_wars_interaction_desc + + is_shown = { + NOT = { scope:actor = scope:recipient } + + scope:actor = { + is_dynast = yes + religion = scope:recipient.religion + dynasty = scope:recipient.dynasty + } + + scope:recipient = { + is_playable_character = yes + any_character_war = { + NOT = { primary_defender = scope:actor } + primary_attacker = scope:recipient + primary_defender.dynasty = scope:recipient.dynasty + } + } + } + + is_valid_showing_failures_only = { + scope:actor.dynasty = { + dynasty_prestige >= medium_dynasty_prestige_value + } + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0070 + } + } + + on_accept = { + + scope:actor = { + hidden_effect = { + send_interface_message = { + type = event_dynasty_neutral + title = dynast_end_dynasty_wars_interaction_notification + right_icon = scope:recipient + show_as_tooltip = { + dynast_end_dynasty_wars_effect = yes + } + } + } + } + dynast_end_dynasty_wars_effect = yes + } + + auto_accept = yes +} + +dynast_legitimize_bastard_interaction = { + icon = icon_dynasty + category = interaction_category_diplomacy + desc = dynast_legitimize_bastard_interaction_desc + + is_shown = { + scope:actor = scope:recipient.dynasty.dynast + scope:actor = { + religion = scope:recipient.religion + NOT = { house = scope:recipient.house } + faith = { has_doctrine_parameter = bastards_legitimize } + } + scope:recipient = { + has_trait = bastard + faith = { has_doctrine_parameter = bastards_legitimize } + } + } + + is_valid = { + scope:actor.dynasty = { + dynasty_prestige >= medium_dynasty_prestige_value + } + scope:recipient = { is_busy_in_events_localised = yes } + } + + auto_accept = yes + + cost = { + renown = medium_dynasty_prestige_value + } + + on_accept = { + scope:actor = { + stress_impact = { + arrogant = minor_stress_impact_gain + } + send_interface_message = { + type = event_dynasty_neutral + title = dynast_legitimize_bastard_interaction_notification + right_icon = scope:recipient + show_as_tooltip = { + scope:recipient = { + add_trait_force_tooltip = legitimized_bastard + add_opinion = { + target = scope:actor + modifier = legitimized_me_opinion + } + } + } + } + } + + hidden_effect = { + scope:recipient = { + trigger_event = bastard_interaction.0009 + every_parent = { + limit = { + is_playable_character = yes + NOT = { this = scope:actor } + } + hidden_effect = { #Nudge towards friendship + if = { + limit = { + NOR = { + has_relation_friend = scope:actor + has_relation_potential_friend = scope:actor + } + } + set_relation_potential_friend = scope:actor + } + } + trigger_event = bastard_interaction.0010 + } + every_sibling = { + limit = { + is_playable_character = yes + NOT = { this = scope:actor } + } + trigger_event = bastard_interaction.0010 + } + } + } + } +} + +send_to_varangian_guard_interaction = { + category = interaction_category_friendly + interface_priority = 60 + icon = send_to_varangian_guard_interaction + + desc = send_to_varangian_guard_interaction_desc + use_diplomatic_range = no + common_interaction = yes + + is_shown = { + NOT = { scope:recipient = scope:actor } + + scope:actor = { + is_dynast = yes + dynasty = scope:recipient.dynasty + + dynasty = { + has_dynasty_perk = fp1_adventure_legacy_1 + } + + exists = title:e_byzantium.holder + NOR = { + faith = { + has_doctrine_parameter = pacifist_opinion_active + } + this = title:e_byzantium.holder + has_truce = title:e_byzantium.holder + is_at_war_with = title:e_byzantium.holder + } + } + } + + cooldown = { years = 2 } + + is_valid_showing_failures_only = { + scope:actor = { + is_at_war = no + NOT = { + has_relation_rival = title:e_byzantium.holder + } + } + scope:recipient = { + is_busy_in_events_localised = yes + is_ruler = no + is_adult = yes + is_married = no + NOT = { + has_trait = varangian + } + } + trigger_if = { + limit = { + scope:recipient = { + is_adult = yes + NOT = { + can_be_knight_trigger = { + ARMY_OWNER = title:e_byzantium.holder + } + } + } + } + custom_description = { + scope:recipient = { + can_be_knight_trigger = { + ARMY_OWNER = title:e_byzantium.holder + } + } + text = "not_allowed_in_varangian_guard" + } + } + trigger_if = { + limit = { + scope:recipient = { + NOR = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + } + } + custom_description = { + scope:recipient.top_liege = scope:actor.top_liege + text = "same_realm_as" + } + } + } + + on_accept = { + title:e_byzantium.holder = { + save_scope_as = emperor + if = { + limit = { capital_county = title:c_byzantion } + set_local_variable = { + name = to_miklagard + value = yes + } + } + } + + scope:actor = { + stress_impact = { + paranoid = minor_stress_impact_gain + } + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = send_to_varangian_guard_interaction_toast + + left_icon = scope:recipient + right_icon = scope:emperor + + custom_tooltip = send_to_varangian_guard_interaction_toast_desc + } + } + } + + scope:recipient = { + save_scope_as = varangian_candidate + + } + + show_as_tooltip = { + scope:varangian_candidate = { + visit_court_of = scope:emperor + add_trait = varangian + custom_description_no_bullet = { + text = send_to_varangian_guard_interaction_effect + } + } + } + hidden_effect = { + scope:emperor = { + trigger_event = varangian.0003 + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_vaering.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + cost = { + prestige = { + value = 350 + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + is_dynast = yes + + dynasty = { + has_dynasty_perk = fp1_adventure_legacy_1 + } + + exists = title:e_byzantium.holder + NOR = { + faith = { + has_doctrine_parameter = pacifist_opinion_active + } + this = title:e_byzantium.holder + has_truce = title:e_byzantium.holder + is_at_war_with = title:e_byzantium.holder + } + } + + ai_targets = { + ai_recipients = children + max = 10 + } + + ai_frequency = 120 + + ai_will_do = { + base = 100 + } +} diff --git a/common/character_interactions/00_education_interactions.txt b/common/character_interactions/00_education_interactions.txt new file mode 100644 index 00000000..a9511006 --- /dev/null +++ b/common/character_interactions/00_education_interactions.txt @@ -0,0 +1,3923 @@ +# Interactions relating to the education of children + + +# Designate guardian and ward in your own court +# This interaction is referenced in code! If it's renamed you have to ping a coder +educate_child_interaction = { + category = interaction_category_friendly + common_interaction = yes + icon = child + + send_name = SEND_PROPOSAL + desc = educate_child_interaction_desc + + # secondary_actor = guardian + # actor = guardian.liege - can be same as guardian + # secondary_recipient = ward + # recipient = ward.liege - can be same as ward + + redirect = { + if = { + limit = { + scope:actor = { is_ai = no } + } + scope:actor = { + #If the character performing the action is a child, let's set ourselves as the ward + if = { + limit = { + is_physically_able_adult = no + num_of_relation_guardian = 0 + } + save_scope_as = secondary_recipient + } + #If the character peforming the action is an adult, let's set ourselves as the guardian + else_if = { + limit = { + is_physically_able_adult = yes + num_of_relation_ward < 2 + NOT = { scope:recipient = scope:secondary_recipient } + } + save_scope_as = secondary_actor + } + #Otherwise just pick whoever chum for the guardian position + else_if = { + limit = { + any_courtier = { + is_physically_able_adult = yes + num_of_relation_ward < 2 + } + } + random_courtier = { + limit = { + is_physically_able_adult = yes + num_of_relation_ward < 2 + } + weight = { + base = 1 + modifier = { + add = 5 + culture = scope:actor.culture + } + modifier = { + add = 2 + faith = scope:actor.faith + } + modifier = { + add = 10 + has_council_position = councillor_court_chaplain + } + modifier = { + add = 2 + is_councillor = yes + } + modifier = { + add = 3 + this.dynasty = scope:actor.dynasty + } + modifier = { + add = 2 + has_education_rank_4_trigger = yes + } + modifier = { + add = 1 + has_education_rank_3_trigger = yes + } + } + save_scope_as = secondary_actor + } + } + if = { + limit = { + exists = employer + NOT = { employer = scope:actor } + } + + employer = { + save_scope_as = actor + } + } + } + + scope:recipient = { + if = { + limit = { + is_physically_able_adult = yes + num_of_relation_ward < 2 + } + save_scope_as = secondary_actor + } + else = { + save_scope_as = secondary_recipient + } + + if = { + limit = { + exists = employer + NOT = { employer = scope:recipient } + } + + employer = { + save_scope_as = recipient + } + } + } + } + } + + populate_actor_list = { + scope:actor = { + if = { + limit = { + is_physically_able_adult = yes + num_of_relation_ward < 2 + is_imprisoned = no + NOT = { has_trait = incapable } + } + add_to_list = characters + } + every_courtier = { + limit = { + is_physically_able_adult = yes + num_of_relation_ward < 2 + is_imprisoned = no + NOT = { has_trait = incapable } + } + add_to_list = characters + } + } + } + + populate_recipient_list = { + scope:recipient = { + if = { + limit = { + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = no + } + } + is_available_child = yes + } + trigger_else = { + is_available_child_allow_travel = yes + } + num_of_relation_guardian = 0 + is_imprisoned = no + NOT = { has_trait = incapable } + trigger_if = { #If a hostage then only if scope:actor is the hostage taker + limit = { + is_hostage = yes + } + is_hostage_of = scope:actor + } + } + add_to_list = characters + } + every_courtier = { + limit = { + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = no + } + } + is_available_child = yes + } + trigger_else = { + is_available_child_allow_travel = yes + } + num_of_relation_guardian = 0 + is_imprisoned = no + NOT = { has_trait = incapable } + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + } + is_close_family_of = scope:actor + } + trigger_if = { #If a hostage then only if scope:actor is the hostage taker + limit = { + is_hostage = yes + } + is_hostage_of = scope:actor + } + } + add_to_list = characters + } + } + } + + greeting = positive + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:actor = scope:secondary_actor + NOT = { scope:recipient = scope:secondary_recipient } + } + desc = EDUCATE_RECIPIENT_CHILD_PERSONALLY_REQUEST + } + triggered_desc = { + trigger = { + scope:actor = scope:secondary_actor + scope:recipient = scope:secondary_recipient + } + desc = EDUCATE_RECIPIENT_PERSONALLY_REQUEST + } + triggered_desc = { + trigger = { + NOT = { scope:recipient = scope:secondary_recipient } + NOT = { scope:actor = scope:secondary_actor } + } + desc = EDUCATE_RECIPIENT_CHILD_REQUEST + } + triggered_desc = { + trigger = { + scope:recipient = scope:secondary_recipient + NOT = { scope:actor = scope:secondary_actor } + } + desc = EDUCATE_RECIPIENT_REQUEST + } + } + } + + prompt = { + first_valid = { + triggered_desc = { + trigger = { + NOT = { exists = scope:secondary_actor } + } + desc = EDUCATE_SELECT_YOUR_GUARDIAN + } + triggered_desc = { + trigger = { + NOT = { exists = scope:secondary_recipient } + } + desc = EDUCATE_SELECT_YOUR_WARD + } + } + } + + is_shown = { + scope:recipient = { + is_in_the_same_court_as = scope:actor + } + trigger_if = { + limit = { + exists = scope:secondary_actor + } + scope:secondary_actor = { + is_adult = yes + num_of_relation_ward < 2 + } + } + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_adult = no + num_of_relation_guardian = 0 + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_imprisoned = no + NOT = { has_trait = incapable } + trigger_if = { + limit = { + NOT = { this = scope:actor } + } + is_courtier_of = scope:actor + } + + } + trigger_if = { + limit = { + exists = scope:secondary_actor + } + scope:secondary_actor = { + is_imprisoned = no + NOT = { has_trait = incapable } + } + } + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_imprisoned = no + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = no + } + } + is_travelling = no #The child in question should not already have a travel plan + } + NOT = { has_trait = incapable } + NOT = { exists = var:hostage_travelling_to_warden } + trigger_if = { + limit = { is_hostage = yes } + is_courtier_of = scope:actor + } + } + } + custom_description = { + text = character_to_guard_exists + subject = scope:actor + scope:actor = { + OR = { + any_courtier = { + is_adult = yes + num_of_relation_ward < 2 + is_imprisoned = no + NOT = { has_trait = incapable } + } + AND = { + is_adult = yes + num_of_relation_ward < 2 + is_imprisoned = no + NOT = { has_trait = incapable } + } + } + } + } + custom_description = { + text = character_to_educate_exists + object = scope:actor + scope:actor = { + OR = { + any_courtier = { + is_adult = no + num_of_relation_guardian = 0 + is_imprisoned = no + NOT = { has_trait = incapable } + } + AND = { + is_adult = no + num_of_relation_guardian = 0 + is_imprisoned = no + NOT = { has_trait = incapable } + } + } + } + } + trigger_if = { # Ward + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { + custom_tooltip = { + text = ward_travelling_tt + NOT = { exists = var:ward_travelling_to_guardian } + } + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + # Structured this way for tooltip purposes + trigger_if = { + limit = { exists = var:ward_waiting_for_guardian } + var:ward_waiting_for_guardian = { + custom_tooltip = { + text = guardian_travelling_tt + NOT = { exists = scope:secondary_recipient.var:ward_waiting_for_guardian } + } + } + } + } + } + trigger_if = { # Guardian + limit = { exists = scope:secondary_actor } + scope:secondary_actor = { + custom_tooltip = { + text = guardian_travelling_tt + NOT = { exists = var:guardian_travelling_to_ward } + } + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + # Structured this way for tooltip purposes + trigger_if = { + limit = { exists = var:guardian_waiting_for_ward } + var:guardian_waiting_for_ward = { + custom_tooltip = { + text = ward_travelling_tt + NOT = { scope:secondary_actor.num_of_relation_ward >= 1 } + } + } + } + } + } + #limit range for landless adventurers + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + #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 + } + } + } + + can_be_picked = { #Potential Issue: This is only evaluated if both secondary recipient/actor are unselected TIT-49632 + trigger_if = { + limit = { + OR = { + AND = { + is_ruler = no + liege ?= { + is_landless_adventurer = no + } + } + AND = { + is_ruler = yes + is_landless_adventurer = no + } + } + } + is_available = yes + } + trigger_else = { + is_available_allow_travelling = yes + } + is_at_home = yes + # Under offer + custom_tooltip = { + text = ward_already_offered_awaiting_response_tt + NOT = { has_character_flag = under_offer_as_ward_flag } + } + custom_tooltip = { + text = guardian_already_offered_awaiting_response_tt + NOT = { has_character_flag = under_offer_as_guardian_flag } + } + # Already offered + custom_tooltip = { + text = ward_already_offered_awaiting_travel_tt + NOR = { + exists = var:ward_travelling_to_guardian + exists = var:ward_waiting_for_guardian + } + } + custom_tooltip = { + text = guardian_already_offered_awaiting_travel_tt + NOR = { + exists = var:guardian_travelling_to_ward + AND = { + exists = var:guardian_waiting_for_ward + num_of_relation_ward >= 1 + } + } + } + # Hostage + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + # Guardian has too many students + num_of_relation_ward <= 2 + trigger_if = { + limit = { exists = var:character_requested_as_educator } + num_of_relation_ward <= 1 + } + } + + on_accept = { + scope:secondary_recipient = { + save_scope_as = ward + scope:secondary_actor = { save_scope_as = guardian } + scope:recipient = { save_scope_as = ward_liege } + scope:actor = { save_scope_as = guardian_liege } + } + + if = { + limit = { scope:ward.age >= 15 } + custom_description_no_bullet = { + text = ward_nearing_adulthood_tt + object = scope:ward + } + } + + scope:guardian_liege = { + send_interface_message = { + type = event_childhood_neutral + title = educate_child_interaction_notification + left_icon = scope:guardian + right_icon = scope:ward + educate_child_interaction_effect = yes + show_as_tooltip = { + scope:ward = { + if = { + limit = { exists = var:ward_travelling_to_guardian } + custom_tooltip = ward_departs_tt + } + else_if = { + limit = { exists = scope:guardian.var:guardian_travelling_to_ward } + scope:guardian = { custom_tooltip = guardian_departs_tt } + } + else = { + set_relation_guardian = scope:guardian + } + } + } + } + } + #to see the "becomes guardian of x" effect in the interaction confirmation window + show_as_tooltip = { + scope:guardian = { set_relation_ward = scope:ward } + } + } + + auto_accept = yes + + ai_accept = { + base = 100 + } + + send_option = { + is_shown = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + NOT = { scope:secondary_actor.culture = scope:secondary_recipient.culture } + } + flag = convert_culture + localization = EDUCATE_CHILD_OPTION_CONVERT_CULTURE + current_description = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_CULTURE_TT_TO_RECIPIENT + } + triggered_desc = { + trigger = { + exists = scope:secondary_recipient + scope:secondary_recipient = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_CULTURE_TT_TO_ACTOR + } + } + } + } + send_option = { + is_shown = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + NOT = { scope:secondary_actor.faith = scope:secondary_recipient.faith } + } + flag = convert_faith + localization = EDUCATE_CHILD_OPTION_CONVERT_FAITH + current_description = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_FAITH_TT_TO_RECIPIENT + } + triggered_desc = { + trigger = { + exists = scope:secondary_recipient + scope:secondary_recipient = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_FAITH_TT_TO_ACTOR + } + } + } + } + send_option = { + is_shown = { + scope:recipient = { + OR = { + any_realm_province = { + has_university_building_trigger = yes + } + any_realm_county = { + has_county_modifier = pandidakterion_university_modifier + } + } + } + } + is_valid = { + scope:actor.gold >= scope:actor.medium_gold_value + } + flag = send_to_university + localization = EDUCATION_UNIVERSITY + } + send_option = { + is_shown = { + exists = scope:actor + exists = scope:secondary_actor + NOT = { scope:secondary_actor = scope:actor } + } + is_valid = { + scope:actor = { + has_usable_hook = scope:secondary_actor + } + } + flag = education_hook + localization = EDUCATION_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 = self + } + + ai_frequency = 24 + + ai_potential = { + OR = { + AND = { + is_physically_able_adult = no + num_of_relation_guardian = 0 + is_imprisoned = no + NOT = { has_trait = incapable } + } + any_courtier = { + is_physically_able_adult = no + num_of_relation_guardian = 0 + is_imprisoned = no + NOT = { has_trait = incapable } + is_close_family_of = root + } + } + } + + ai_will_do = { + base = 100 + + modifier = { # Slight preference for older heirs + add = scope:secondary_recipient.age + } + + modifier = { # Prefer to educate your own heirs + add = 900 + scope:actor = scope:secondary_actor + scope:secondary_recipient = { + is_heir_of = scope:actor + } + } + + modifier = { # Otherwise, find a good educator for them + add = 200 + scope:secondary_actor = { + OR = { + has_education_rank_4_trigger = yes + has_education_rank_3_trigger = yes + } + } + scope:secondary_recipient = { + is_heir_of = scope:actor + } + } + + modifier = { # Generally prefer your own flesh & blood to educate children + add = 200 + exists = scope:secondary_actor.dynasty + exists = scope:actor.dynasty + scope:secondary_actor.dynasty = scope:actor.dynasty + } + + modifier = { # Also prefer friends & lovers + add = 100 + scope:secondary_actor = { + OR = { + has_relation_lover = scope:actor + has_relation_friend = scope:actor + has_secret_relation_lover = scope:actor + has_relation_soulmate = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + modifier = { # The AI shouldn't change culture/faith of their children + add = -1000 + scope:secondary_recipient.culture = scope:actor.culture + scope:secondary_recipient.faith = scope:actor.faith + OR = { + scope:convert_culture = yes + scope:convert_faith = yes + } + } + + modifier = { # The AI should not convert child of vassals with protected religious right + add = -1000 + scope:convert_faith = yes + scope:recipient = { is_vassal_of = scope:actor } + scope:recipient = { vassal_contract_has_flag = religiously_protected } + } + + modifier = { # If your kids aren't of your culture/faith, make them so! + add = 900 + scope:secondary_actor.culture = scope:actor.culture + scope:secondary_actor.faith = scope:actor.faith + NOR = { + scope:secondary_recipient.culture = scope:actor.culture + scope:secondary_recipient.faith = scope:actor.faith + } + scope:convert_culture = yes + scope:convert_faith = yes + } + + modifier = { # If your kids aren't of your culture/faith, make them so! + add = 500 + scope:secondary_actor.culture = scope:actor.culture + NOT = { scope:secondary_recipient.culture = scope:actor.culture } + scope:convert_culture = yes + } + + modifier = { # If your kids aren't of your culture/faith, make them so! + add = 500 + scope:secondary_actor.faith = scope:actor.faith + NOT = { scope:secondary_recipient.faith = scope:actor.faith } + scope:convert_faith = yes + } + + modifier = { # Rivals are not welcome + add = -1000 + scope:secondary_recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + modifier = { # Random peasants can only dream about educating noble children! + add = -1000 + scope:actor = { + is_lowborn = no + } + scope:secondary_recipient = { + is_lowborn = yes + NOR = { + is_councillor = yes + is_knight = yes + } + } + } + + modifier = { # Don't care about random children + factor = 0 + scope:secondary_recipient = { + NOR = { + is_close_family_of = scope:actor + this = scope:actor + } + } + } + + modifier = { # Don't spend gold on this unless very, very rich + factor = 0 + scope:send_to_university = yes + + scope:actor.short_term_gold < scope:actor.monumental_gold_value + } + } +} + +#Offer a ward to a landed character +#This interaction is referenced in code! If it's renamed you have to ping a coder +offer_ward_interaction = { + category = interaction_category_friendly + icon = child + + desc = offer_ward_interaction_desc + + send_name = SEND_PROPOSAL + + # secondary_actor = ward + # actor = ward.liege - can be same as ward + # secondary_recipient = guardian + # recipient = guardian.liege - can be same as guardian + + redirect = { + scope:recipient = { + if = { + limit = { + exists = employer + NOT = { employer = scope:recipient } + } + save_scope_as = secondary_recipient + employer = { + save_scope_as = recipient + } + } + } + } + + populate_actor_list = { + scope:actor = { + if = { + limit = { + is_adult = no + is_physically_able = yes + NOT = { + any_relation = { + type = guardian + this = scope:recipient + } + } + is_hostage = no + is_travelling = no #Can be removed once the can_be_picked is fixed to re-evaluate + } + add_to_list = characters + } + every_courtier = { + limit = { + is_adult = no + is_physically_able = yes + NOT = { + any_relation = { + type = guardian + this = scope:recipient + } + } + is_hostage = no + is_travelling = no #Can be removed once the can_be_picked is fixed to re-evaluate + } + add_to_list = characters + } + every_courtier_away = { + limit = { + is_adult = no + is_physically_able = yes + NOT = { + any_relation = { + type = guardian + this = scope:recipient + } + } + is_hostage = no + is_travelling = no #Can be removed once the can_be_picked is fixed to re-evaluate + } + add_to_list = characters + } + } + } + + populate_recipient_list = { + scope:recipient = { + if = { + limit = { + is_adult = yes + num_of_relation_ward < 2 + } + add_to_list = characters + } + every_courtier = { + limit = { + is_adult = yes + num_of_relation_ward < 2 + NOR = { + is_theocratic_lessee = yes + is_consort_of = scope:recipient + } + } + add_to_list = characters + } + } + } + + greeting = positive + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:actor = scope:secondary_actor + NOT = { scope:recipient = scope:secondary_recipient } + } + desc = EDUCATE_ACTOR_REQUEST + } + triggered_desc = { + trigger = { + scope:actor = scope:secondary_actor + scope:recipient = scope:secondary_recipient + } + desc = EDUCATE_ACTOR_PERSONALLY_REQUEST + } + triggered_desc = { + trigger = { + NOT = { scope:recipient = scope:secondary_recipient } + NOT = { scope:actor = scope:secondary_actor } + } + desc = EDUCATE_ACTOR_CHILD_REQUEST + } + triggered_desc = { + trigger = { + scope:recipient = scope:secondary_recipient + NOT = { scope:actor = scope:secondary_actor } + } + desc = EDUCATE_ACTOR_CHILD_PERSONALLY_REQUEST + } + } + } + + prompt = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:actor = scope:recipient + } + desc = EDUCATE_SELECT_YOUR_GUARDIAN + } + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { + is_adult = no + } + } + desc = EDUCATE_SELECT_THEIR_GUARDIAN + } + desc = EDUCATE_SELECT_YOUR_WARD + } + } + + is_shown = { + scope:recipient = { + NOT = { this = scope:actor } + is_playable_character = yes + is_alive = yes + } + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_adult = yes + NOR = { + is_theocratic_lessee = yes + is_consort_of = scope:recipient + } + } + } + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + scope:recipient = { + is_courtier_of = scope:actor + } + } + } + + is_valid_showing_failures_only = { + custom_description = { + text = character_to_guard_exists + subject = scope:recipient + scope:recipient = { + OR = { + any_courtier = { + is_adult = yes + num_of_relation_ward < 2 + } + AND = { + is_adult = yes + num_of_relation_ward < 2 + } + } + } + } + custom_description = { + text = character_to_educate_exists + object = scope:actor + scope:actor = { + OR = { + any_courtier = { + is_adult = no + is_physically_able = yes + NOR = { + any_relation = { + type = guardian + this = scope:recipient + } + any_relation = { + type = guardian + OR = { + is_at_war_with = scope:actor + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + } + } + AND = { + is_adult = no + is_physically_able = yes + NOR = { + any_relation = { + type = guardian + this = scope:recipient + } + any_relation = { + type = guardian + OR = { + is_at_war_with = scope:actor + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + } + } + } + } + } + NOT = { + scope:actor = { is_at_war_with = scope:recipient } + } + scope:recipient = { + is_imprisoned = no + is_busy_in_events_localised = yes + } + trigger_if = { # Ward + limit = { + exists = scope:secondary_actor + } + scope:secondary_actor = { + is_imprisoned = no + is_busy_in_events_localised = yes + custom_tooltip = { + text = ward_travelling_tt + NOT = { exists = var:ward_travelling_to_guardian } + } + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + # Structured this way for tooltip purposes + trigger_if = { + limit = { exists = var:ward_waiting_for_guardian } + var:ward_waiting_for_guardian = { + custom_tooltip = { + text = guardian_travelling_tt + NOT = { exists = scope:secondary_actor.var:ward_waiting_for_guardian } + } + } + } + } + } + trigger_if = { # Guardian + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_imprisoned = no + is_busy_in_events_localised = yes + custom_tooltip = { + text = guardian_travelling_tt + NOT = { exists = var:guardian_travelling_to_ward } + } + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + # Structured this way for tooltip purposes + trigger_if = { + limit = { exists = var:guardian_waiting_for_ward } + var:guardian_waiting_for_ward = { + custom_tooltip = { + text = ward_travelling_tt + NOT = { exists = scope:secondary_recipient.var:guardian_waiting_for_ward } + } + } + } + } + } + #limit range for landless adventurers + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + #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 + } + } + } + + can_be_picked = { + is_available = yes #Potential Issue: This is only evaluated if both secondary recipient/actor are unselected TIT-49632 + # Under offer + custom_tooltip = { + text = ward_already_offered_awaiting_response_tt + NOT = { has_character_flag = under_offer_as_ward_flag } + } + custom_tooltip = { + text = guardian_already_offered_awaiting_response_tt + NOT = { has_character_flag = under_offer_as_guardian_flag } + } + # Already offered + custom_tooltip = { + text = ward_already_offered_awaiting_travel_tt + NOR = { + exists = var:ward_travelling_to_guardian + exists = var:ward_waiting_for_guardian + } + } + custom_tooltip = { + text = guardian_already_offered_awaiting_travel_tt + NOR = { + exists = var:guardian_travelling_to_ward + AND = { + exists = var:guardian_waiting_for_ward + num_of_relation_ward >= 1 + } + } + } + # Hostage + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + } + + on_send = { + scope:secondary_recipient = { + add_character_flag = { + flag = under_offer_as_guardian_flag + months = 1 + } + } + scope:secondary_actor = { + add_character_flag = { + flag = under_offer_as_ward_flag + months = 1 + } + } + } + + on_accept = { + scope:secondary_actor = { save_scope_as = ward } + scope:actor = { save_scope_as = ward_liege } + scope:recipient = { save_scope_as = guardian_liege } + scope:secondary_recipient = { save_scope_as = guardian } + + if = { + limit = { scope:ward.age >= 15 } + custom_description_no_bullet = { + text = ward_nearing_adulthood_tt + object = scope:ward + } + } + + # Handle existing guardian + scope:ward = { + if = { + limit = { + any_relation = { + type = guardian + NOT = { this = scope:guardian } + } + } + random_relation = { + type = guardian + save_scope_as = old_guardian + + #Letter event to guardian + if = { + limit = { + NOT = { scope:old_guardian = scope:actor } + } + scope:old_guardian = { trigger_event = char_interaction.0090 } + } + } + scope:actor = { + send_interface_message = { + type = event_childhood_neutral + title = remove_guardian_interaction_notification + left_icon = scope:old_guardian + right_icon = scope:ward + remove_guardian_effect = { + GUARDIAN = scope:old_guardian + WARD = scope:ward + RETURN_WARD = yes + HIDE_OPINION = no + } + + #Was education promised in interaction or in vassal.2001? Then you get an opinion penalty + if = { + limit = { + exists = scope:ward.var:character_requested_as_educator + scope:ward.var:character_requested_as_educator = scope:old_guardian + exists = scope:ward.var:character_making_education_request + scope:ward.var:character_making_education_request = { + is_alive = yes + OR = { + this = scope:old_guardian + scope:old_guardian = { is_courtier_of = prev } + } + NOT = { this = scope:actor } + } + } + scope:ward.var:character_making_education_request = { + add_opinion = { + modifier = insult_opinion + target = scope:actor + opinion = -15 + } + } + } + } + } + } + } + + show_as_tooltip = { + scope:guardian = { set_relation_ward = scope:ward } + educate_child_interaction_effect = yes + } + + scope:actor = { + if = { + limit = { + NOT = { this = scope:recipient } + scope:ward = { + #num_of_relation_guardian = 0 + NOR = { + any_relation = { + type = guardian + this = scope:recipient + } + any_relation = { + type = guardian + OR = { + is_at_war_with = scope:actor + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + } + } + scope:guardian = { num_of_relation_ward < 2 } + } + trigger_event = char_interaction.0080 + } + } + + # 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_ward_offerage.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + + on_decline = { + # If we're a clan this interaction affects unity. Conditioned to the opinion modifier to avoid exploit + if = { + limit = { + NOT = { + scope:actor = { + has_opinion_modifier = { + modifier = declined_ward_opinion + target = scope:recipient + } + } + } + } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_ward_decline.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + + + scope:actor = { + trigger_event = char_interaction.0081 + add_opinion = { + modifier = declined_ward_opinion + target = scope:recipient + } + } + + scope:secondary_recipient = { remove_character_flag = under_offer_as_guardian_flag } + scope:secondary_actor = { remove_character_flag = under_offer_as_ward_flag } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:education_hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + ai_accept = { + base = 0 + + # AI should always accept children the Player has jurisdiction over + # You can always send your own child away + modifier = { + add = 200 + scope:secondary_actor = { + is_adult = no + is_child_of = scope:actor + } + desc = AI_YOUR_OWN_CHILD + } + # Including you + modifier = { + add = 200 + scope:secondary_actor = scope:actor + desc = AI_EDUCATE_YOU + } + # You can always send your courtier's child away + modifier = { + add = 200 + scope:secondary_actor = { + is_adult = no + NOT = { is_child_of = scope:actor } + is_courtier_of = scope:actor + } + #But only if you are of interest to the educator. To educate the courtier of a count is of no interest to a foreign emperor. + scope:secondary_recipient ?= { + OR = { + is_of_major_or_minor_interest_trigger = { CHARACTER = scope:actor } + is_of_major_or_minor_interest_trigger = { CHARACTER = scope:secondary_actor } + highest_held_title_tier <= scope:actor.highest_held_title_tier + } + } + desc = AI_YOUR_COURTIER_CHILD + } + + #Weak hook: extra points + modifier = { + scope:education_hook = yes + add = 100 + scope:actor = { NOT = { has_strong_hook = scope:recipient } } + desc = SCHEME_WEAK_HOOK_USED + } + + modifier = { # Respect the liege + add = 50 + scope:recipient = { target_is_liege_or_above = scope:actor } + desc = EDUCATE_CHILD_ACTOR_IS_MY_LIEGE + } + + #If the child is theirs they are more likely to accept + modifier = { + add = 100 + scope:secondary_actor = { + is_child_of = scope:recipient + is_adult = no + } + desc = AI_MY_CHILD + } + + #If the child is the educator's child they should be more likely to accept + modifier = { + add = 100 + exists = scope:secondary_recipient + scope:secondary_actor = { + is_adult = no + is_child_of = scope:secondary_recipient + } + desc = AI_MY_CHILD + } + + #Their opinion of you matters! + opinion_modifier = { + opinion_target = scope:actor + who = scope:recipient + multiplier = 0.5 + desc = AI_OPINION_REASON + } + + #Make less likely that they accept if they are of another culture + modifier = { + add = -10 + trigger = { + scope:secondary_actor = { + culture = { has_same_culture_heritage = scope:recipient.culture } + NOT = { has_same_culture_as = scope:recipient } + } + } + desc = AI_NOT_CULTURE + } + + modifier = { + add = -20 + trigger = { + scope:secondary_actor = { + NOT = { culture = { has_same_culture_heritage = scope:recipient.culture } } + } + } + desc = AI_NOT_CULTURE + } + + #Less likely if they don't like other religion + modifier = { + add = { + value = -5 + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_hostile_level + } + } + } + subtract = 5 + } + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_evil_level + } + } + } + subtract = 10 + } + } + trigger = { + NOT = { scope:recipient.faith = scope:actor.faith } + } + desc = AI_RELIGION + } + + #The better the educator is at a skill, the less likely they are to accept + compare_modifier = { + trigger = { + scope:secondary_recipient ?= { + diplomacy >= 10 + } + NOT = { scope:actor = scope:secondary_actor } + } + target = scope:secondary_recipient + value = diplomacy + step = 4 + multiplier = -0.5 + offset = -2 + max = 0 + desc = AI_GUARDIAN_SKILL_DIPLOMACY + } + compare_modifier = { + trigger = { + scope:secondary_recipient ?= { + martial >= 10 + } + NOT = { scope:actor = scope:secondary_actor } + } + target = scope:secondary_recipient + value = martial + step = 4 + multiplier = -0.5 + offset = -2 + max = 0 + desc = AI_GUARDIAN_SKILL_MARTIAL + } + compare_modifier = { + trigger = { + scope:secondary_recipient ?= { + stewardship >= 10 + } + NOT = { scope:actor = scope:secondary_actor } + } + target = scope:secondary_recipient + value = stewardship + step = 4 + multiplier = -0.5 + offset = -2 + max = 0 + desc = AI_GUARDIAN_SKILL_STEWARDSHIP + } + compare_modifier = { + trigger = { + scope:secondary_recipient ?= { + intrigue >= 10 + } + NOT = { scope:actor = scope:secondary_actor } + } + target = scope:secondary_recipient + value = intrigue + step = 4 + multiplier = -0.5 + offset = -2 + max = 0 + desc = AI_GUARDIAN_SKILL_INTRIGUE + } + compare_modifier = { + trigger = { + scope:secondary_recipient ?= { + learning >= 10 + } + NOT = { scope:actor = scope:secondary_actor } + } + target = scope:secondary_recipient + value = learning + step = 4 + multiplier = -0.5 + offset = -2 + max = 0 + desc = AI_GUARDIAN_SKILL_LEARNING + } + + #The better you as an educator is at a skill, the more likely they are to accept + compare_modifier = { + trigger = { + AND = { + scope:actor = scope:secondary_actor + scope:actor = { + diplomacy >= 11 + } + } + } + target = scope:actor + value = diplomacy + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_DIPLOMACY + } + compare_modifier = { + trigger = { + AND = { + scope:actor = scope:secondary_actor + scope:actor = { + martial >= 11 + } + } + } + target = scope:actor + value = martial + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_MARTIAL + } + compare_modifier = { + trigger = { + AND = { + scope:actor = scope:secondary_actor + scope:actor = { + stewardship >= 11 + } + } + } + target = scope:actor + value = stewardship + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_STEWARDSHIP + } + compare_modifier = { + trigger = { + AND = { + scope:actor = scope:secondary_actor + scope:actor = { + intrigue >= 11 + } + } + } + target = scope:actor + value = intrigue + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_INTRIGUE + } + compare_modifier = { + trigger = { + AND = { + scope:actor = scope:secondary_actor + scope:actor = { + learning >= 11 + } + } + } + target = scope:actor + value = learning + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_LEARNING + } + + #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 = 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 + } + modifier = { + add = diarch_should_educate_liege_value + scope:actor.diarch ?= scope:recipient + desc = DIARCH_SHOULD_EDUCATE_LIEGE_TO_DIARCH + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + send_option = { + is_shown = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + NOT = { scope:secondary_actor.culture = scope:secondary_recipient.culture } + } + flag = convert_culture + localization = EDUCATE_CHILD_OPTION_CONVERT_CULTURE + current_description = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_CULTURE_TT_TO_RECIPIENT + } + triggered_desc = { + trigger = { + exists = scope:secondary_recipient + scope:secondary_recipient = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_CULTURE_TT_TO_ACTOR + } + } + } + } + send_option = { + is_shown = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + NOT = { scope:secondary_actor.faith = scope:secondary_recipient.faith } + } + flag = convert_faith + localization = EDUCATE_CHILD_OPTION_CONVERT_FAITH + current_description = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_FAITH_TT_TO_RECIPIENT + } + triggered_desc = { + trigger = { + exists = scope:secondary_recipient + scope:secondary_recipient = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_FAITH_TT_TO_ACTOR + } + } + } + } + send_option = { + is_shown = { + OR = { + scope:recipient = { + any_realm_province = { + has_university_building_trigger = yes + } + } + scope:actor = { + this = scope:secondary_actor + any_realm_province = { + has_university_building_trigger = yes + } + } + } + } + is_valid = { + scope:actor.gold >= scope:actor.monumental_gold_value + } + starts_enabled = { always = yes } + flag = send_to_university + localization = EDUCATION_UNIVERSITY + } + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = education_hook + localization = EDUCATION_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 = vassals + ai_recipients = head_of_faith + } + + ai_frequency = 12 + + ai_potential = { + primary_title.tier >= tier_duchy + any_courtier = { + is_physically_able_adult = no + is_child_of = root + is_imprisoned = no + NOT = { has_trait = incapable } + } + any_vassal = { + primary_title.tier >= tier_county + opinion = { + target = root + value <= -25 + } + } + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to use wards to improve opinion with their vassals + add = 500 + scope:actor = { + NOT = { + has_trait = paranoid + } + } + scope:recipient = scope:secondary_recipient + scope:recipient = { + is_ruler = yes + primary_title.tier >= tier_county + OR = { + AND = { + is_vassal_of = scope:actor + opinion = { + target = scope:actor + value <= -25 + } + } + AND = { + is_powerful_vassal_of = scope:actor + opinion = { + target = scope:actor + value <= 25 + } + } + } + } + } + + modifier = { # Zealous AI's want their head of faith to educate their children + add = 600 + scope:actor = { + OR = { + has_trait = zealous + ai_zeal >= 90 + } + } + scope:recipient = scope:secondary_recipient + scope:recipient = scope:actor.faith.religious_head + scope:recipient = { + is_ai = yes # Don't spam players + num_of_relation_ward < 2 + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { # Don't send your primary heir away + factor = 0 + scope:secondary_actor = { + is_primary_heir_of = scope:actor + } + } + + modifier = { # The AI shouldn't change culture/faith of their children + factor = 0 + OR = { + scope:convert_culture = yes + scope:convert_faith = yes + } + } + + modifier = { # Don't care about random children + factor = 0 + scope:secondary_actor = { + NOR = { + is_close_family_of = scope:actor + this = scope:actor + } + } + } + + modifier = { # Don't send children that are in need of a culture conversion + factor = 0 + NOT = { + scope:secondary_actor.culture = scope:actor.culture + } + } + + modifier = { # Don't send away yourself + factor = 0 + scope:secondary_actor = scope:actor + } + + modifier = { # Rivals are not welcome + factor = 0 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + modifier = { # Don't backtrack + factor = 0 + scope:secondary_actor = { + any_relation = { + type = guardian + OR = { + is_vassal_of = scope:actor + this = scope:actor.faith.religious_head + } + } + } + } + + modifier = { # Don't override players + factor = 0 + scope:secondary_actor = { + has_character_flag = player_educated + } + } + + modifier = { # Don't spend gold on this unless very, very rich + factor = 0 + scope:send_to_university = yes + + scope:actor.short_term_gold <= scope:actor.monumental_gold_value + } + } +} + +# Request guardianship +offer_guardianship_interaction = { + category = interaction_category_friendly + icon = child + + desc = offer_guardianship_interaction_desc + + # secondary_actor = guardian + # actor = guardian.liege - can be same as guardian + # secondary_recipient = ward + # recipient = ward.liege - can be same as ward + + redirect = { + if = { + limit = { + scope:actor = { is_ai = no } + } + scope:recipient = { + if = { + limit = { + exists = employer + NOT = { employer = scope:recipient } + } + if = { + limit = { + is_adult = no + #num_of_relation_guardian = 0 + } + save_scope_as = secondary_recipient + } + employer = { + save_scope_as = recipient + } + } + else_if = { + limit = { + is_ruler = yes + is_adult = no + } + save_scope_as = recipient + save_scope_as = secondary_recipient + } + } + } + } + + populate_actor_list = { + scope:actor = { + if = { + limit = { + is_adult = yes + num_of_relation_ward < 2 + bp2_valid_for_standard_interactions_trigger = yes + is_hostage = no + } + add_to_list = characters + } + every_courtier = { + limit = { + is_adult = yes + num_of_relation_ward < 2 + NOR = { + is_theocratic_lessee = yes + is_consort_of = scope:actor + } + bp2_valid_for_standard_interactions_trigger = yes + is_hostage = no + } + add_to_list = characters + } + } + } + + populate_recipient_list = { + scope:recipient = { + if = { + limit = { + is_available_child_allow_travel = yes + bp2_valid_for_standard_interactions_trigger = yes + } + } + add_to_list = characters + every_courtier = { + limit = { + is_available_child_allow_travel = yes + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + } + is_close_family_of = scope:recipient + } + bp2_valid_for_standard_interactions_trigger = yes + } + add_to_list = characters + } + } + } + + greeting = positive + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + # I assign, myself, to educate not you, but your... + scope:actor = scope:secondary_actor + NOT = { scope:recipient = scope:secondary_recipient } + } + desc = EDUCATE_RECIPIENT_CHILD_PERSONALLY_REQUEST + } + triggered_desc = { + trigger = { + # I assign, myself, to educate you, yourself! + scope:actor = scope:secondary_actor + scope:recipient = scope:secondary_recipient + } + desc = EDUCATE_RECIPIENT_PERSONALLY_REQUEST + } + triggered_desc = { + trigger = { + # I assign, not myself, to educate not you, but your... + NOT = { scope:recipient = scope:secondary_recipient } + NOT = { scope:actor = scope:secondary_actor } + } + desc = EDUCATE_RECIPIENT_CHILD_REQUEST + } + triggered_desc = { + trigger = { + # I assign, not myself, to educate you, yourself + scope:recipient = scope:secondary_recipient + NOT = { scope:actor = scope:secondary_actor } + } + desc = EDUCATE_RECIPIENT_REQUEST + } + } + } + + prompt = { + first_valid = { + triggered_desc = { + trigger = { + NOT = { exists = scope:secondary_actor } + } + desc = EDUCATE_SELECT_YOUR_GUARDIAN + } + triggered_desc = { + trigger = { + NOT = { exists = scope:secondary_recipient } + } + desc = EDUCATE_SELECT_THEIR_WARD + } + desc = EDUCATE_SELECT_YOUR_WARD_OR_GUARDIAN + } + } + + is_shown = { + scope:recipient = { + NOT = { this = scope:actor } + is_playable_character = yes + } + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { is_adult = no } + } + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + scope:recipient = { + is_courtier_of = scope:actor + } + } + } + + is_valid_showing_failures_only = { + custom_description = { + text = character_to_educate_exists + object = scope:recipient + scope:recipient = { + OR = { + any_courtier = { + is_adult = no + #num_of_relation_guardian = 0 + } + AND = { + is_adult = no + #num_of_relation_guardian = 0 + } + } + } + } + custom_description = { + text = character_to_guard_exists + subject = scope:recipient + scope:recipient = { + OR = { + any_courtier = { + is_adult = yes + num_of_relation_ward < 2 + } + AND = { + is_adult = yes + num_of_relation_ward < 2 + } + } + } + } + NOT = { + scope:actor = { is_at_war_with = scope:recipient } + } + scope:recipient = { + is_imprisoned = no + is_busy_in_events_localised = yes + bp2_valid_for_standard_interactions_trigger = yes + } + trigger_if = { # Ward + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_available = yes + is_imprisoned = no + is_busy_in_events_localised = yes + bp2_valid_for_standard_interactions_trigger = yes + custom_tooltip = { + text = ward_travelling_tt + NOT = { exists = var:ward_travelling_to_guardian } + } + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + # Structured this way for tooltip purposes + trigger_if = { + limit = { exists = var:ward_waiting_for_guardian } + var:ward_waiting_for_guardian = { + custom_tooltip = { + text = guardian_travelling_tt + NOT = { exists = scope:secondary_recipient.var:ward_waiting_for_guardian } + } + } + } + } + } + trigger_if = { # Guardian + limit = { + exists = scope:secondary_actor + } + scope:secondary_actor = { + is_imprisoned = no + is_busy_in_events_localised = yes + custom_tooltip = { + text = guardian_travelling_tt + NOT = { exists = var:guardian_travelling_to_ward } + } + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + + # Structured this way for tooltip purposes + trigger_if = { + limit = { exists = var:guardian_waiting_for_ward } + var:guardian_waiting_for_ward = { + custom_tooltip = { + text = ward_travelling_tt + NOT = { exists = scope:secondary_actor.var:guardian_waiting_for_ward } + } + } + } + } + } + #limit range for landless adventurers + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + #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 + } + } + } + + can_be_picked = { #Potential Issue: This is only evaluated if both secondary recipient/actor are unselected TIT-49632 + is_available = yes + # Under offer + custom_tooltip = { + text = ward_already_offered_awaiting_response_tt + NOT = { has_character_flag = under_offer_as_ward_flag } + } + custom_tooltip = { + text = guardian_already_offered_awaiting_response_tt + NOT = { has_character_flag = under_offer_as_guardian_flag } + } + # Already offered + custom_tooltip = { + text = ward_already_offered_awaiting_travel_tt + NOR = { + exists = var:ward_travelling_to_guardian + exists = var:ward_waiting_for_guardian + } + } + custom_tooltip = { + text = guardian_already_offered_awaiting_travel_tt + NOR = { + exists = var:guardian_travelling_to_ward + AND = { + exists = var:guardian_waiting_for_ward + num_of_relation_ward >= 1 + } + } + } + # Hostage + custom_tooltip = { + text = hostage_travelling_tt + NOT = { exists = var:hostage_travelling_to_warden } + } + } + + on_send = { + scope:secondary_recipient = { + add_character_flag = { + flag = under_offer_as_ward_flag + months = 1 + } + } + scope:secondary_actor = { + add_character_flag = { + flag = under_offer_as_guardian_flag + months = 1 + } + } + } + + on_accept = { + scope:secondary_actor = { save_scope_as = guardian } + scope:actor = { save_scope_as = guardian_liege } + scope:secondary_recipient = { save_scope_as = ward } + scope:recipient = { save_scope_as = ward_liege } + + if = { + limit = { scope:ward.age >= 15 } + custom_description_no_bullet = { + text = ward_nearing_adulthood_tt + object = scope:ward + } + } + + show_as_tooltip = { + scope:guardian = { set_relation_ward = scope:ward } + educate_child_interaction_effect = yes + } + + if = { + limit = { + scope:actor = { + is_ai = no + } + } + scope:ward = { + add_character_flag = player_educated + } + } + + if = { #To block against too many wards + limit = { + scope:guardian = { num_of_relation_ward < 2 } + } + + save_scope_value_as = { #To give right tooltip in char_interaction.0080 + name = offer_guardianship_interaction + value = yes + } + + scope:actor = { + if = { + limit = { NOT = { this = scope:recipient } } + trigger_event = char_interaction.0080 + } + } + } + else = { #Notifications about the relationship being blocked because actor tried to set it with too many + scope:recipient = { + trigger_event = char_interaction.0078 + } + scope:actor = { + trigger_event = char_interaction.0079 + } + } + + # 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_guardianship.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + + on_decline = { + if = { + limit = { + NOT = { + scope:actor = { + has_opinion_modifier = { + target = scope:recipient + modifier = declined_guardianship_opinion + } + } + } + } + # If we're a clan this interaction affects unity; conditioned by the opinion modifer to avoid exploit + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_guardianship_decline.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + + scope:actor = { + trigger_event = char_interaction.0081 + add_opinion = { + modifier = declined_guardianship_opinion + target = scope:recipient + opinion = -15 + } + } + scope:recipient = { + if = { + limit = { + is_ai = no + } + add_character_flag = { flag = ai_guardianship_ask_cooldown years = 5 } + } + } + + scope:secondary_recipient = { remove_character_flag = under_offer_as_ward_flag } + scope:secondary_actor = { remove_character_flag = under_offer_as_guardian_flag } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:education_hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + ai_accept = { + base = -50 + + #Weak hook: extra points + modifier = { + scope:education_hook = yes + add = 200 + scope:actor = { NOT = { has_strong_hook = scope:recipient } } + desc = SCHEME_WEAK_HOOK_USED + } + + modifier = { # Respect the liege + add = 100 + scope:recipient = { target_is_liege_or_above = scope:actor } + desc = EDUCATE_CHILD_ACTOR_IS_MY_LIEGE + } + + #If the child is the educator's child they should be more likely to accept + modifier = { + add = 100 + scope:secondary_recipient ?= { + is_adult = no + is_child_of = scope:secondary_actor + } + desc = AI_GUARDIANS_OWN_CHILD + } + + modifier = { + add = -75 + scope:secondary_actor.court_owner = { + NOR = { + this = scope:recipient.court_owner + this = scope:secondary_recipient.court_owner + } + } + NOT = { scope:secondary_recipient ?= { is_child_of = scope:actor } } + NOT = { scope:secondary_recipient ?= { is_child_of = scope:recipient } } + NOT = { scope:recipient = { target_is_liege_or_above = scope:actor } } + desc = AI_FOREIGN_COURT + } + + modifier = { + add = -100 + scope:secondary_actor.court_owner = { + NOR = { + this = scope:recipient.court_owner + this = scope:secondary_recipient.court_owner + } + } + NOT = { scope:secondary_recipient ?= { is_child_of = scope:actor } } + scope:secondary_recipient ?= { is_child_of = scope:recipient } + NOR = { + scope:recipient = { target_is_liege_or_above = scope:actor } + scope:recipient = { target_is_vassal_or_below = scope:actor} + } + desc = AI_CHILD_TO_FOREIGN_COURT + } + + modifier = { + add = -50 + scope:secondary_actor.court_owner = { + NOR = { + this = scope:recipient.court_owner + this = scope:secondary_recipient.court_owner + } + } + NOT = { scope:secondary_recipient ?= { is_child_of = scope:actor } } + scope:secondary_recipient ?= { is_child_of = scope:recipient } + scope:recipient = { target_is_vassal_or_below = scope:actor} + desc = AI_CHILD_TO_VASSAL_COURT + } + + modifier = { + add = 25 + scope:secondary_recipient ?= { + is_close_or_extended_family_of = scope:secondary_actor + } + + desc = AI_CHILD_EDUCATED_BY_FAMILY + } + + modifier = { + add = -100 + scope:convert_culture = yes + scope:secondary_recipient.culture = scope:recipient.culture + desc = AI_CONVERT_CULTURE + } + + modifier = { + add = -100 + scope:convert_faith = yes + scope:secondary_recipient.faith = scope:recipient.faith + desc = AI_CONVERT_FAITH + } + + modifier = { + add = 50 + scope:recipient = { has_relation_friend = scope:actor } + desc = AI_YOUR_FRIEND + } + + modifier = { + add = -50 + scope:recipient = { has_relation_rival = scope:actor } + desc = AI_YOUR_RIVAL + } + + # If the guardian is the child's secret father, the mother is more likely to send them + modifier = { + add = 100 + exists = scope:secondary_recipient.mother + scope:recipient = scope:secondary_recipient.mother + OR = { + scope:actor = { + any_known_secret = { + OR = { + secret_type = secret_unmarried_illegitimate_child + secret_type = secret_disputed_heritage + } + exists = secret_target + secret_target = scope:secondary_recipient + } + } + scope:secondary_recipient = { has_trait = disputed_heritage } + AND = { + scope:secondary_recipient = { has_trait = bastard } + NOT = { exists = scope:secondary_recipient.father } + } + } + exists = scope:secondary_recipient.real_father + scope:secondary_recipient.real_father = scope:secondary_actor + desc = AI_YOU_ARE_THE_FATHER + } + + #Their opinion of you matters! + opinion_modifier = { + opinion_target = scope:actor + who = scope:recipient + multiplier = 1 + desc = AI_OPINION_REASON + } + + #Make less likely that they accept you as educator if they are of another culture + modifier = { + add = -5 + trigger = { + scope:actor = { + this = scope:secondary_actor + culture = { has_same_culture_heritage = scope:recipient.culture } + NOT = { has_same_culture_as = scope:recipient } + } + } + desc = AI_NOT_CULTURE + } + + modifier = { + add = -10 + trigger = { + scope:actor = { + this = scope:secondary_actor + NOT = { culture = { has_same_culture_heritage = scope:recipient.culture } } + } + } + desc = AI_NOT_CULTURE + } + + #Less likely if they don't like other religion + modifier = { + add = { + value = -5 + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_hostile_level + } + } + } + subtract = 5 + } + if = { + limit = { + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_evil_level + } + } + } + subtract = 10 + } + } + trigger = { + NOT = { scope:recipient.faith = scope:actor.faith } + } + desc = AI_RELIGION + } + + #The better the educator is at a skill, the more likely they are to accept + compare_modifier = { + trigger = { + scope:secondary_actor = { + diplomacy >= 11 + } + } + target = scope:secondary_actor + value = diplomacy + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_DIPLOMACY + } + compare_modifier = { + trigger = { + scope:secondary_actor = { + martial >= 11 + } + } + target = scope:secondary_actor + value = martial + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_MARTIAL + } + compare_modifier = { + trigger = { + scope:secondary_actor = { + stewardship >= 11 + } + } + target = scope:secondary_actor + value = stewardship + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_STEWARDSHIP + } + compare_modifier = { + trigger = { + scope:secondary_actor = { + intrigue >= 11 + } + } + target = scope:secondary_actor + value = intrigue + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_INTRIGUE + } + compare_modifier = { + trigger = { + scope:secondary_actor = { + learning >= 11 + } + } + target = scope:secondary_actor + value = learning + step = 4 + multiplier = 0.75 + offset = -5 + min = 0 + desc = AI_GUARDIAN_SKILL_LEARNING + } + + # FP3 Beacon of Learning tradition (it makes a higher education trait more likely) + modifier = { + add = 15 + scope:secondary_actor = { + culture = { has_cultural_parameter = guardian_education_better_outcomes } + } + desc = tradition_fp3_beacon_of_learning_name + } + + #More/Less likely based on difference in rank between actor and recipient + modifier = { + add = 30 + scope:actor = { + tier_difference = { + target = scope:recipient + value = 1 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = 40 + scope:actor = { + tier_difference = { + target = scope:recipient + value = 2 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = 50 + scope:actor = { + tier_difference = { + target = scope:recipient + value = 3 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = 60 + scope:actor = { + tier_difference = { + target = scope:recipient + value = 4 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = 70 + scope:actor = { + tier_difference = { + target = scope:recipient + value = 5 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = -30 + scope:actor = { + tier_difference = { + target = scope:recipient + value = -1 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = -40 + scope:actor = { + tier_difference = { + target = scope:recipient + value = -2 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = -50 + scope:actor = { + tier_difference = { + target = scope:recipient + value = -3 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = -60 + scope:actor = { + tier_difference = { + target = scope:recipient + value = -4 + } + } + desc = AI_RANK_DIFF + } + modifier = { + add = -70 + scope:actor = { + tier_difference = { + target = scope:recipient + value = -5 + } + } + desc = AI_RANK_DIFF + } + + #More likely to accept if you have an alliance + modifier = { + add = 40 + scope:actor = { is_allied_to = scope:recipient } + desc = AI_HAS_ALLIANCE + } + + modifier = { + add = 50 + scope:recipient = { + target_is_liege_or_above = scope:actor + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + desc = INTIMIDATED_REASON + } + modifier = { + add = 100 + scope:recipient = { + target_is_liege_or_above = scope:actor + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + desc = COWED_REASON + } + + modifier = { + add = 10 + scope:recipient = { + NOT = { target_is_liege_or_above = scope:actor } + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + desc = INTIMIDATED_REASON + } + modifier = { + add = 20 + scope:recipient = { + NOT = { target_is_liege_or_above = scope:actor } + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + desc = COWED_REASON + } + modifier = { + add = 20 + scope:actor = { + has_royal_court = yes + has_dlc_feature = royal_court + target_is_vassal_or_below = scope:recipient + court_grandeur_current_level >= 7 + court_grandeur_current_level < 9 + } + desc = GRANDEUR_REASON + } + modifier = { + add = 40 + scope:actor = { + has_royal_court = yes + has_dlc_feature = royal_court + target_is_vassal_or_below = scope:recipient + court_grandeur_current_level >= 9 + } + desc = GRANDEUR_REASON + } + + modifier = { + add = -200 + exists = scope:secondary_recipient.house + scope:recipient = { + exists = house.house_head + house = scope:secondary_recipient.house + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + exists = var:house_feud_house + var:house_feud_house = scope:actor.house + } + } + } + desc = AI_GUARDIAN_FEUD_HESITANCE + } + + modifier = { + add = diarch_should_educate_liege_value + scope:recipient.diarch ?= scope:actor + desc = DIARCH_SHOULD_EDUCATE_DIARCH_TO_LIEGE + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + send_option = { + is_shown = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + NOT = { scope:secondary_actor.culture = scope:secondary_recipient.culture } + } + flag = convert_culture + localization = EDUCATE_CHILD_OPTION_CONVERT_CULTURE + current_description = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_CULTURE_TT_TO_RECIPIENT + } + triggered_desc = { + trigger = { + exists = scope:secondary_recipient + scope:secondary_recipient = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_CULTURE_TT_TO_ACTOR + } + } + } + } + send_option = { + is_shown = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + NOT = { scope:secondary_actor.faith = scope:secondary_recipient.faith } + } + flag = convert_faith + localization = EDUCATE_CHILD_OPTION_CONVERT_FAITH + current_description = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_FAITH_TT_TO_RECIPIENT + } + triggered_desc = { + trigger = { + exists = scope:secondary_recipient + scope:secondary_recipient = { is_adult = no } + } + desc = EDUCATE_CHILD_OPTION_CONVERT_FAITH_TT_TO_ACTOR + } + } + } + } + send_option = { + is_shown = { + scope:recipient = { + any_realm_province = { + has_university_building_trigger = yes + } + } + } + is_valid = { + scope:actor.gold >= scope:actor.medium_gold_value + } + starts_enabled = { always = yes } + flag = send_to_university + localization = EDUCATION_UNIVERSITY + } + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = education_hook + localization = EDUCATION_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 = vassals + } + + ai_frequency = 48 + + ai_potential = { + is_imprisoned = no + NOT = { has_trait = incapable } + } + + ai_will_do = { + base = 0 + + modifier = { # Liege's should want to culture/faith convert their vassal's children + add = 100 + + scope:convert_culture = yes + scope:convert_faith = yes + + scope:secondary_actor = { + culture = scope:actor.culture + faith = scope:actor.faith + } + scope:secondary_recipient = { + OR = { + is_heir_of = scope:recipient + scope:secondary_recipient = scope:recipient + } + } + } + + modifier = { # Liege's should want to culture/faith convert their vassal's children + add = 95 + + scope:convert_culture = yes + + scope:secondary_actor = { + culture = scope:actor.culture + } + scope:secondary_recipient = { + OR = { + is_heir_of = scope:recipient + scope:secondary_recipient = scope:recipient + } + } + } + + modifier = { # Liege's should want to culture/faith convert their vassal's children + add = 90 + + scope:convert_faith = yes + + scope:secondary_actor = { + faith = scope:actor.faith + } + scope:secondary_recipient = { + OR = { + is_heir_of = scope:recipient + scope:secondary_recipient = scope:recipient + } + } + } + + modifier = { # Players shouldn't be spammed + add = -90 + + scope:secondary_recipient = { + is_ai = no + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { # Players shouldn't be spammed + factor = 0 + + scope:recipient = { + has_character_flag = ai_guardianship_ask_cooldown + } + } + + modifier = { # Don't ask to convert faith if that's already a thing + factor = 0 + + scope:convert_faith = yes + NOT = { scope:convert_culture = yes } + + scope:secondary_recipient = { + any_relation = { + faith = scope:actor.faith + type = guardian + has_relation_flag = { + target = scope:secondary_recipient + relation = ward + flag = convert_faith + } + } + } + } + + modifier = { # Don't ask to convert culture if that's already a thing + factor = 0 + + scope:convert_culture = yes + NOT = { scope:convert_faith = yes } + + scope:secondary_recipient = { + any_relation = { + culture = scope:actor.culture + type = guardian + has_relation_flag = { + target = scope:secondary_recipient + relation = ward + flag = convert_culture + } + } + } + } + + modifier = { # Don't ask to convert culture and faith if that's already a thing + factor = 0 + + scope:convert_culture = yes + scope:convert_faith = yes + + scope:secondary_recipient = { + any_relation = { + culture = scope:actor.culture + faith = scope:actor.faith + type = guardian + has_relation_flag = { + target = scope:secondary_recipient + relation = ward + flag = convert_culture + } + } + } + } + + modifier = { # Don't spend gold on this unless very, very rich + factor = 0 + scope:send_to_university = yes + + scope:actor.short_term_gold <= scope:actor.monumental_gold_value + } + } +} + +remove_guardian_interaction = { + category = interaction_category_friendly + desc = remove_guardian_interaction_desc + icon = child + + force_notification = yes + greeting = positive + notification_text = REMOVE_GUARDIAN_INTERACTION + use_diplomatic_range = no + + is_shown = { + scope:actor = { is_ruler = yes } + OR = { + scope:recipient = { + any_relation = { + type = ward + remove_guardian_interaction_visible_ward_trigger = yes + } + } + scope:recipient = { + remove_guardian_interaction_visible_ward_trigger = yes + any_relation = { type = guardian always = yes } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + #RECIPIENT = GUARDIAN + trigger_if = { + limit = { scope:recipient = { is_adult = yes } } + + #Diplo availability/not imprisoned + #is_busy_in_events_localised = yes + + any_relation = { + type = ward + + remove_guardian_interaction_visible_ward_trigger = yes + remove_guardian_interaction_available_ward_trigger = yes + } + + + #War blocker + NOR = { + is_at_war_with = scope:actor + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + #RECIPIENT = WARD + trigger_else = { + + #Diplo availability + remove_guardian_interaction_visible_ward_trigger = yes + remove_guardian_interaction_available_ward_trigger = yes + + any_relation = { + type = guardian + #is_busy_in_events_localised = yes + } + + #War blocker + any_relation = { + type = guardian + NOR = { + is_at_war_with = scope:actor + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + } + } + + #Misc + #scope:actor = { is_imprisoned = no } + } + + auto_accept = yes + + ai_min_reply_days = 1 + ai_max_reply_days = 3 + + on_accept = { + #Save guardian scope + if = { + limit = { scope:recipient = { is_adult = yes } } + scope:recipient = { + save_scope_as = guardian + } + } + else = { + scope:recipient = { every_relation = { type = guardian save_scope_as = guardian } } + } + + #Save ward(s) scope(s) + scope:guardian = { + #If the recipient is the ward, always pick them as ward + if = { + limit = { + NOT = { this = scope:recipient } + } + scope:recipient = { save_scope_as = ward } + } + #If recipient is the guardian, pick a random ward as ward 1 and if there is an additional one, set is as ward 2 + else = { + random_relation = { + type = ward + limit = { + remove_guardian_interaction_visible_ward_trigger = yes + remove_guardian_interaction_available_ward_trigger = yes + } + save_scope_as = ward + save_scope_as = secondary_recipient + } + if = { + limit = { + any_relation = { + type = ward + remove_guardian_interaction_visible_ward_trigger = yes + remove_guardian_interaction_available_ward_trigger = yes + NOR = { + this = scope:ward + scope:ward = scope:recipient #because if we target a specific child, no 2nd ward + } + } + } + random_relation = { + type = ward + limit = { + remove_guardian_interaction_visible_ward_trigger = yes + remove_guardian_interaction_available_ward_trigger = yes + NOR = { + this = scope:ward + this = scope:recipient + } + } + save_scope_as = ward_2 + } + } + } + } + + #Letter event to guardian + if = { + limit = { + NOT = { + scope:guardian = scope:actor + } + } + scope:guardian = { + trigger_event = char_interaction.0090 + } + } + + #Handling the wards and feedback to actor + scope:actor = { + send_interface_message = { + type = event_childhood_neutral + title = remove_guardian_interaction_notification + left_icon = scope:guardian + right_icon = scope:ward + remove_guardian_effect = { + GUARDIAN = scope:guardian + WARD = scope:ward + RETURN_WARD = yes + HIDE_OPINION = no + } + if = { + limit = { exists = scope:ward_2 } + remove_guardian_effect = { + GUARDIAN = scope:guardian + WARD = scope:ward_2 + RETURN_WARD = yes + HIDE_OPINION = no + } + } + + #Was education promised in interaction or in vassal.2001? Then you get an opinion penalty + if = { + limit = { + exists = scope:ward.var:character_requested_as_educator + scope:ward.var:character_requested_as_educator = scope:guardian + exists = scope:ward.var:character_making_education_request + scope:ward.var:character_making_education_request = { + is_alive = yes + OR = { + this = scope:guardian + scope:guardian = { is_courtier_of = prev } + } + NOT = { this = scope:actor } + } + } + scope:ward.var:character_making_education_request = { + add_opinion = { + modifier = insult_opinion + target = scope:actor + opinion = -15 + } + } + } + } + } + + #Remove guardian opinion from guardian/guardian's liege + #Ward + if = { + limit = { scope:actor = scope:ward.liege } #Only show if actor is ward's liege + guardian_remove_opinion_effect = { + GUARDIAN = scope:guardian + WARD = scope:ward + WARD_LIEGE = scope:ward.liege + } + } + else = { + hidden_effect = { #Else hide it + guardian_remove_opinion_effect = { + GUARDIAN = scope:guardian + WARD = scope:ward + WARD_LIEGE = scope:ward.liege + } + } + } + #Ward_2 + if = { + limit = { + exists = scope:ward_2 + scope:actor = scope:ward_2.liege #Only show guardian opinion removed if actor is ward_2's liege + NOT = { scope:actor = scope:ward.liege } #also don't show it twice if both wards' are actor's + } + guardian_remove_opinion_effect = { + GUARDIAN = scope:guardian + WARD = scope:ward_2 + WARD_LIEGE = scope:ward_2.liege + } + } + else_if = { + limit = { + exists = scope:ward_2 + } + hidden_effect = { #Else hide it + guardian_remove_opinion_effect = { + GUARDIAN = scope:guardian + WARD = scope:ward_2 + WARD_LIEGE = scope:ward_2.liege + } + } + } + + #Make the liege of the ward(s) insulted if actor is not the liege of the ward + if = { + limit = { + NOR = { + scope:ward.liege = scope:actor + scope:ward = scope:actor + } + } + scope:ward.liege = { + add_opinion = { + modifier = insulted_opinion + target = scope:actor + opinion = -15 + } + } + } + if = { + limit = { + exists = scope:ward_2 + NOR = { + scope:ward_2.liege = scope:actor + scope:ward_2.liege = scope:ward.liege + scope:ward_2 = scope:actor + } + } + scope:ward_2.liege = { + add_opinion = { + modifier = insulted_opinion + target = scope:actor + opinion = -15 + } + } + } + + if = { + limit = { + scope:actor = { + NOT = { + has_character_flag = guardian_unity_block + } + } + } + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_removed_guardian.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + scope:actor = { + if = { + limit = { + is_ai = no + government_has_flag = government_is_clan + } + } + add_character_flag = { + flag = guardian_unity_block + months = 3 + } + } + } +} + +make_child_learn_language_interaction = { + category = interaction_category_friendly + common_interaction = yes + icon = icon_scheme_learn_language + + send_name = study_language + + desc = make_child_learn_language_interaction_desc + + redirect = { + scope:actor = { + if = { + limit = { + scope:recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + save_scope_as = secondary_actor + } + else_if = { + limit = { + any_courtier = { + scope:recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + } + random_courtier = { + limit = { + scope:recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + save_scope_as = secondary_actor + } + } + else_if = { + limit = { + any_vassal = { + scope:recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + } + random_vassal = { + limit = { + scope:recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + save_scope_as = secondary_actor + } + } + } + scope:recipient = { + save_scope_as = secondary_recipient + + if = { + limit = { + exists = employer + NOT = { employer = scope:recipient } + } + + employer = { + save_scope_as = recipient + } + } + } + } + + populate_actor_list = { + scope:actor = { + if = { + limit = { + is_physically_able_adult = yes + exists = scope:secondary_recipient + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + add_to_list = characters + } + every_courtier = { + limit = { + is_physically_able_adult = yes + exists = scope:secondary_recipient + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + add_to_list = characters + } + every_vassal = { + limit = { + is_physically_able_adult = yes + exists = scope:secondary_recipient + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + add_to_list = characters + } + if = { + limit = { + NOT = { + exists = scope:secondary_recipient + } + } + every_courtier = { + limit = { + is_physically_able_adult = yes + } + add_to_list = characters + } + every_vassal = { + limit = { + is_physically_able_adult = yes + } + add_to_list = characters + } + } + } + } + + populate_recipient_list = { + scope:recipient = { + every_courtier = { + limit = { + is_adult = no + is_physically_able = yes + age >= 6 + is_close_or_extended_family_of = scope:actor + is_ai = yes + } + add_to_list = characters + } + } + } + + greeting = positive + notification_text = { + desc = MAKE_LEARN_LANGUAGE_REQUEST + } + + prompt = { + desc = SELECT_TARGET_LANGUAGE_SCHEME + } + + is_shown = { + has_ep1_court_positions_dlc_trigger = yes + scope:recipient = { + is_in_the_same_court_as = scope:actor + } + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_adult = no + is_ai = yes + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_imprisoned = no + NOT = { has_trait = incapable } + employs_court_position = court_tutor_court_position + } + trigger_if = { + limit = { + exists = scope:secondary_actor + } + scope:secondary_actor = { + is_imprisoned = no + NOT = { has_trait = incapable } + } + } + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + scope:secondary_recipient = { + is_adult = no + is_physically_able = yes + age >= 6 + is_close_or_extended_family_of = scope:actor + custom_description = { + text = already_scheming_language + NOT = { + any_scheme = { + scheme_type = learn_language + } + } + } + } + custom_description = { + text = no_target_language + scope:actor = { + OR = { + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + any_courtier = { + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + any_vassal = { + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + } + } + } + } + trigger_if = { + limit = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + } + scope:secondary_actor = { + scope:secondary_recipient = { + can_start_scheme = { type = learn_language target_character = prev } + } + } + } + } + + can_be_picked = { + is_at_home = yes + } + + on_accept = { + scope:actor = { + send_interface_message = { + type = event_childhood_neutral + title = make_child_learn_language_interaction_notification + left_icon = scope:secondary_recipient + right_icon = scope:secondary_actor + scope:secondary_recipient = { + custom_tooltip = secondary_actors_language + begin_scheme_basic_effect = { + SCHEME_TYPE = learn_language + TARGET_TYPE = target_character + TARGET_SCOPE = scope:secondary_actor + } + if = { + limit = { + scope:actor = { + exists = court_position:court_tutor_court_position + court_position:court_tutor_court_position = { + aptitude:court_tutor_court_position = 1 + } + } + } + custom_tooltip = court_tutor_child_language_rank_1 + hidden_effect = { + random_scheme = { + limit = { + scheme_type = learn_language + } + add_scheme_modifier = { + type = court_tutor_child_language_rank_1_modifier + } + } + } + } + else_if = { + limit = { + scope:actor = { + exists = court_position:court_tutor_court_position + court_position:court_tutor_court_position = { + aptitude:court_tutor_court_position = 2 + } + } + } + custom_tooltip = court_tutor_child_language_rank_2 + hidden_effect = { + random_scheme = { + limit = { + scheme_type = learn_language + } + add_scheme_modifier = { + type = court_tutor_child_language_rank_2_modifier + } + } + } + } + else_if = { + limit = { + scope:actor = { + exists = court_position:court_tutor_court_position + court_position:court_tutor_court_position = { + aptitude:court_tutor_court_position = 3 + } + } + } + custom_tooltip = court_tutor_child_language_rank_3 + hidden_effect = { + random_scheme = { + limit = { + scheme_type = learn_language + } + add_scheme_modifier = { + type = court_tutor_child_language_rank_3_modifier + } + } + } + } + else_if = { + limit = { + scope:actor = { + exists = court_position:court_tutor_court_position + court_position:court_tutor_court_position = { + aptitude:court_tutor_court_position = 4 + } + } + } + custom_tooltip = court_tutor_child_language_rank_4 + hidden_effect = { + random_scheme = { + limit = { + scheme_type = learn_language + } + add_scheme_modifier = { + type = court_tutor_child_language_rank_4_modifier + } + } + } + } + else_if = { + limit = { + scope:actor = { + exists = court_position:court_tutor_court_position + court_position:court_tutor_court_position = { + aptitude:court_tutor_court_position = 5 + } + } + } + custom_tooltip = court_tutor_child_language_rank_5 + hidden_effect = { + random_scheme = { + limit = { + scheme_type = learn_language + } + add_scheme_modifier = { + type = court_tutor_child_language_rank_5_modifier + } + } + } + } + } + } + } + } + + auto_accept = yes + + ai_accept = { + base = 100 + } + + ai_frequency = 24 + + ai_targets = { + ai_recipients = children + } + + ai_potential = { + has_ep1_court_positions_dlc_trigger = yes + employs_court_position = court_tutor_court_position + primary_title.tier >= tier_county + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to prepare their children for ruling their vassals + add = 100 + any_vassal = { + primary_title.tier >= tier_county + knows_language_of_culture = scope:secondary_actor.culture + } + } + } +} diff --git a/common/character_interactions/00_faction_interactions.txt b/common/character_interactions/00_faction_interactions.txt new file mode 100644 index 00000000..7ff4211d --- /dev/null +++ b/common/character_interactions/00_faction_interactions.txt @@ -0,0 +1,162 @@ +#Interactions relating to factions + +force_join_faction_interaction = { + category = interaction_category_vassal + special_interaction = force_join_faction + desc = force_join_faction_interaction_desc + icon = scroll_scales + + force_notification = yes + greeting = positive + notification_text = FORCE_JOIN_FACTION_NOTIFICATION + + is_shown = { + scope:actor = { + is_a_faction_member = yes + liege = scope:recipient.liege + NOR = { + joined_faction = scope:recipient.joined_faction + scope:recipient = scope:actor.liege + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + trigger_if = { + limit = { government_allows = administrative } + custom_tooltip = { + text = force_join_faction_admin_requirement_desc + OR = { + has_strong_usable_hook = scope:recipient + AND = { + influence >= { value = scope:actor.monumental_influence_value multiply = 2 } + scope:recipient ?= { + NOT = { opinion = { target = scope:actor value <= -50 } } + NOT = { opinion = { target = scope:recipient.liege value >= 50 } } + } + } + } + } + } + trigger_else = { + has_strong_usable_hook = scope:recipient # Make sure to update the NFaction::POTENTIAL_FORCE_JOIN_HOOK_TYPE define if you change the type of hook used here + } + NOT = { is_at_war_with = scope:recipient } + } + scope:recipient = { + trigger_if = { + limit = { is_a_faction_member = yes } + joined_faction.faction_leader = { is_ai = yes } + } + is_forced_into_faction = no + can_join_faction = scope:actor.joined_faction + } + custom_description = { + text = barons_joining_independence_factions + NAND = { + scope:actor.joined_faction = { faction_is_type = independence_faction } + scope:recipient.highest_held_title_tier = tier_barony + } + } + } + + on_accept = { + scope:actor = { + send_interface_message = { + type = event_faction_neutral + title = force_join_faction_interaction_notification + right_icon = scope:recipient + if = { + limit = { scope:hook = yes } + use_hook = scope:recipient + } + else_if = { + limit = { scope:influence = yes } + change_influence = { + value = monumental_influence_value + multiply = -2 + } + } + scope:recipient = { + join_faction_forced = { + faction = scope:actor.joined_faction + forced_by = scope:actor + years = 10 + } + } + } + } + + # 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_faction_joinage.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes + + #Use hook + send_option = { + is_valid = { + exists = scope:recipient + scope:actor ?= { has_strong_usable_hook = scope:recipient } + } + flag = hook + localization = GENERIC_SPEND_A_HOOK + } + + #Spend influence + send_option = { + is_shown = { + scope:actor = { government_allows = administrative } + scope:actor.top_liege ?= { government_allows = administrative } + } + is_valid = { # Convincing someone with influence is not available if they hate you or love the liege + scope:actor ?= { influence >= { value = scope:actor.monumental_influence_value multiply = 2 } } + scope:recipient ?= { + NOT = { opinion = { target = scope:actor value <= -50 } } + NOT = { opinion = { target = scope:recipient.liege value >= 50 } } + } + } + flag = influence + localization = SPEND_INFLUENCE + } + + send_options_exclusive = yes + + # AI + ai_targets = { + ai_recipients = peer_vassals + } + ai_frequency = 12 + + ai_potential = { + is_independent_ruler = no + is_a_faction_member = yes + + # Only force others to join a faction if you joined by your own free will + is_forced_into_faction = no + } + + ai_will_do = { + base = 100 + + # Don't steal players' factions' members + modifier = { + factor = 0 + scope:recipient = { + is_a_faction_member = yes + joined_faction = { + faction_leader = { + is_ai = no + } + } + } + } + } +} diff --git a/common/character_interactions/00_fp3_interactions.txt b/common/character_interactions/00_fp3_interactions.txt new file mode 100644 index 00000000..b55da636 --- /dev/null +++ b/common/character_interactions/00_fp3_interactions.txt @@ -0,0 +1,2230 @@ +# As a Supporter, demand that a Muslim ruler recognize your authority +# Success makes the Strengthen the Caliphate struggle decision easier to take +fp3_demand_submission_interaction = { + icon = demand_submission + category = interaction_category_religion + popup_on_receive = yes + pause_on_receive = yes + can_send_despite_rejection = yes + ai_maybe = yes + + greeting = positive + notification_text = DEMAND_SUBMISSION_NOTIFICATION + + is_shown = { + NOT = { scope:actor = scope:recipient } + struggle:persian_struggle ?= { has_struggle_phase_parameter = demand_submission_interaction_unlocked } + scope:actor = { has_title = title:d_sunni } + scope:recipient = { + faith.religious_head ?= scope:actor + has_trait = fp3_struggle_supporter + any_character_struggle = { this = struggle:persian_struggle } + } + } + + cooldown_against_recipient = { years = 10 } + + ai_min_reply_days = 2 + ai_max_reply_days = 7 + + ai_accept = { + base = 0 + # This is more flavorful than "base acceptance" + modifier = { + desc = DEMAND_SUBMISSION_I_AM_HEAD_OF_FAITH + add = 50 + } + ## Piety + # How pious are you? + modifier = { + # (Stolen shamelessly from piety_level_affects_vassalage_acceptance) + add = { + value = { + value = -1 + add = scope:actor.piety_level + } + multiply = 10 + } + desc = I_AM_PIOUS + # Only matters if they aren't cynical + NOT = { scope:recipient = { has_trait = cynical } } + } + # Are they cynical/zealous? + modifier = { + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_CYNICAL + add = -30 + scope:recipient = { + has_trait = cynical + } + } + modifier = { + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_ZEALOUS + add = 20 + scope:recipient = { has_trait = zealous } + } + # Are you giving them extra piety? + modifier = { + add = 30 + desc = STRUGGLE_MARRIAGE_ACCEPTANCE_USING_PIETY_AS_CURRENCY + scope:piety_cost_reduction ?= yes + } + ## Opinion + # Do they like you? + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.25 + desc = AI_OPINION_REASON + } + ## Personality + # Are they ambitious? + modifier = { + desc = DEMAND_SUBMISSION_RECIPIENT_IS_AMBITIOUS + add = -30 + scope:recipient = { has_trait = ambitious } + } + # Are they content? + modifier = { + desc = DEMAND_SUBMISSION_RECIPIENT_IS_CONTENT + add = 10 + 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 = 10 + scope:recipient = { has_trait = trusting } + } + # Are they paranoid? + modifier = { + desc = DEMAND_SUBMISSION_RECIPIENT_IS_PARANOID + add = -20 + scope:recipient = { has_trait = paranoid } + } + # Are they loyal? + # Independent rulers should rarely have this trait, but if your predecessor installed a puppet and died, then this makes it easier to demand submission from the puppet + modifier = { + desc = DEMAND_SUBMISSION_RECIPIENT_IS_LOYAL + add = 20 + scope:recipient = { has_trait = loyal } + } + ## Realm + # Are you stronger/weaker than them? + 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 = 10 + } + desc = offer_vassalization_interaction_aibehavior_power_tt + } + # Reign duration + modifier = { + add = { + value = scope:actor.primary_title.title_held_years + subtract = 21 + max = 20 + } + desc = DEMAND_SUBMISSION_SHORT_REIGN + } + ## 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 + } + } + + on_accept = { + scope:actor = { + if = { + limit = { scope:piety_cost_reduction ?= yes } + add_piety = massive_piety_loss + } + add_hook = { + target = scope:recipient + type = caliphal_submission_hook + } + if = { + limit = { has_variable = last_explicit_defied_caliph } + remove_variable = last_explicit_defied_caliph + } + trigger_event = fp3_misc_decisions.0010 # Letter event informing player of success + } + scope:recipient = { + if = { + limit = { scope:piety_cost_reduction ?= yes } + add_piety = massive_piety_gain + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_forment_revolt.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + scope:recipient = { + custom_tooltip = DEMAND_SUBMISSION_INSTALL_LOYALIST_WARNING + add_piety = medium_piety_loss + remove_trait = fp3_struggle_supporter + add_trait_force_tooltip = fp3_struggle_detractor + # This is for the install loyalist CB discount + set_variable = { + name = last_explicit_defied_caliph + value = scope:actor + years = 30 + } + } + scope:actor = { + trigger_event = fp3_misc_decisions.0011 # Letter event informing player of failure + } + + # 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_forment_revolt.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # Use piety to increase acceptance + send_option = { + flag = piety_cost_reduction + localization = TRADE_PIETY_FOR_BETTER_AI_ACCEPTANCE + } + send_options_exclusive = no + + ai_potential = { + is_physically_able = yes + } + + ai_targets = { + ai_recipients = neighboring_rulers + } + + ai_frequency = 12 + + # Very similar to ai_accept, but ignores effects that are < 10 in value for brevity's sake + ai_will_do = { + # The caliph generally _wants_ to be chucking these out all over the place. + ## Basically, the more rulers submit to their authority, the better. + ### Subs over drubs, as it were. + base = 100 + # Will demand rulers who were installed via the puppet CB + modifier = { + add = 200 + scope:recipient = { + has_trait = loyal + scope:actor = { has_hook = prev } + } + } + modifier = { + add = { + value = { + value = -1 + add = scope:actor.piety_level + } + multiply = 10 + } + NOT = { scope:recipient = { has_trait = cynical } } + } + modifier = { + add = -30 + scope:recipient = { + has_trait = cynical + } + } + modifier = { + add = 20 + scope:recipient = { has_trait = zealous } + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.25 + } + modifier = { + add = -30 + scope:recipient = { has_trait = ambitious } + } + modifier = { + add = { + value = 1 + subtract = { + value = scope:recipient.max_military_strength + divide = { value = scope:actor.current_military_strength min = 1 } + } + multiply = 10 + } + } + # Reign duration + modifier = { + add = { + value = scope:actor.primary_title.title_held_years + subtract = 21 + max = 20 + } + } + ## Dread + modifier = { + add = intimidated_halved_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + } + modifier = { + add = cowed_halved_reason_value + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + } + } +} + +################################### +# Request Turkic invasion (can_request_incursion_interaction) +# By Hugo Cortell +################################### +fp3_request_turkic_invasion_interaction = { + interface_priority = 100 + common_interaction = yes + category = interaction_category_hostile + cooldown_against_recipient = { years = 2 } + + icon = request_mercenary + desc = fp3_request_turkic_invasion_interaction_desc + + is_shown = { + scope:actor = { + has_trait = fp3_struggle_detractor + any_character_struggle = { is_struggle_type = persian_struggle } + } + scope:recipient = { + is_playable_character = yes + OR = { + any_character_struggle = { is_struggle_type = persian_struggle } + title:d_sunni.holder ?= this + } + is_independent_ruler = yes + is_ai = yes + } + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + } + + populate_recipient_list = { + scope:actor.top_liege = { + every_independent_ruler = { + limit = { + is_ai = yes + is_landed = yes + is_physically_able = yes + has_raised_armies = no + in_diplomatic_range = scope:actor + OR = { + government_has_flag = government_is_clan + government_has_flag = government_is_tribal + } + culture = { has_cultural_pillar = heritage_turkic } + highest_held_title_tier >= tier_county + NOR = { + is_at_war_with = scope:actor + is_at_war_with = scope:recipient + is_allied_to = scope:recipient + has_truce = scope:recipient + this = scope:actor + this = scope:recipient + } + } + add_to_list = characters + } + } + } + + send_options_exclusive = no + + send_option = { + flag = war_support + localization = fp3_request_turkic_invasion_interaction_option_join_war + current_description = fp3_request_turkic_invasion_interaction_option_join_war_desc + is_shown = { exists = scope:secondary_recipient } + is_valid = { + scope:actor = { + NOR = { + is_at_war_with = scope:recipient + is_allied_to = scope:recipient + has_truce = scope:recipient + } + } + } + } + + send_option = { + flag = financial_support + localization = fp3_request_turkic_invasion_interaction_option_more_gold + current_description = fp3_request_turkic_invasion_interaction_option_more_gold_desc + is_shown = { exists = scope:secondary_recipient } + is_valid = { + custom_description = { + text = fp3_please_dont_give_me_negative_gold + fp3_request_invasion_troop_value_estimate > 0 + } + } + } + + cost = { + gold = { + value = { + value = scope:secondary_recipient.max_military_strength + divide = 20 + round = yes + } + add = { + if = { + limit = { scope:financial_support = yes } + add = fp3_request_invasion_troop_value_estimate + } + } + if = { + limit = { + scope:recipient = { has_title = title:d_sunni } + struggle:persian_struggle = { has_struggle_phase_parameter = cheaper_incursions_vs_caliph } + } + divide = 2 + } + } + } + + on_accept = { + if = { + limit = { exists = scope:secondary_recipient } + + scope:recipient = { + if = { + limit = { + any_realm_county = { + NOT = { this = scope:recipient.capital_county } + any_neighboring_county = { holder.top_liege = scope:secondary_recipient.top_liege } + any_county_province = { geographical_region = world_persian_empire } + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + } + random_realm_county = { + limit = { + NOT = { this = scope:recipient.capital_county } + any_neighboring_county = { holder.top_liege = scope:secondary_recipient.top_liege } + any_county_province = { geographical_region = world_persian_empire } + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + save_scope_as = invasion_target_title + } + } + else_if = { + limit = { + any_realm_county = { + NOT = { this = scope:recipient.capital_county } + any_neighboring_county = { + any_county_province = { geographical_region = world_persian_empire } + NOT = { + holder.top_liege = prev.holder.top_liege + } + } + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + } + random_realm_county = { + limit = { + NOT = { this = scope:recipient.capital_county } + any_neighboring_county = { + any_county_province = { geographical_region = world_persian_empire } + NOT = { + holder.top_liege = prev.holder.top_liege + } + } + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + save_scope_as = invasion_target_title + } + } + else_if = { + limit = { + any_realm_county = { + NOT = { this = scope:recipient.capital_county } + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + } + random_realm_county = { + limit = { + NOT = { this = scope:recipient.capital_county } + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + save_scope_as = invasion_target_title + } + } + else_if = { + limit = { + any_realm_county = { + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + } + random_realm_county = { + limit = { + NOR = { + holder = scope:actor + holder = { is_vassal_or_below_of = scope:actor } + } + } + save_scope_as = invasion_target_title + } + } + else = { + random_realm_county = { save_scope_as = invasion_target_title } + } + + scope:invasion_target_title.duchy = { save_scope_as = text_title } + + hidden_effect = { # Not worth cluttering the UI with + add_opinion = { + modifier = fp3_incited_conflict + target = scope:actor + } + add_opinion = { + modifier = declared_war + target = scope:secondary_recipient + } + } + } + + scope:secondary_recipient = { + add_gold = { + value = { + value = scope:secondary_recipient.max_military_strength + divide = 20 + round = yes + } + add = { + if = { + limit = { scope:financial_support = yes } + add = fp3_request_invasion_troop_value_estimate + } + } + if = { + limit = { + scope:recipient = { has_title = title:d_sunni } + struggle:persian_struggle = { has_struggle_phase_parameter = cheaper_incursions_vs_caliph } + } + divide = 2 + } + } + start_war = { + casus_belli = fp3_turkic_invasion_cb + target = scope:recipient + target_title = scope:invasion_target_title.duchy + } + custom_tooltip = fp3_turkic_invasion_cb_result_tt + if = { + limit = { + scope:financial_support = yes + } + trigger_event = fp3_misc_decisions.0006 + show_as_tooltip = { + spawn_army = { + men_at_arms = { + type = horse_archers + stacks = fp3_request_invasion_troop_value_bonus_troops + } + men_at_arms = { + type = light_horsemen + stacks = fp3_request_invasion_troop_value_bonus_troops + } + levies = fp3_request_invasion_troop_value_bonus_levy_troops + location = capital_province + uses_supply = yes + inheritable = no + name = turkic_tribal_event_troops + } + } + } + if = { + limit = { scope:war_support = yes } + custom_tooltip = fp3_request_turkic_invasion_interaction_option_join_war_outcome_tooltip + trigger_event = fp3_misc_decisions.0005 + } + } + + scope:actor = { + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_good + title = fp3_request_turkic_invasion_interaction_accept_notification.t + left_icon = scope:secondary_recipient + right_icon = scope:recipient + + show_as_tooltip = { + custom_tooltip = fp3_request_turkic_invasion_interaction_accept_notification.desc + } + } + } + } + + scope:recipient = { + add_character_flag = { + flag = incursion_ai_pacing + years = 5 + } + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_bad + title = fp3_request_turkic_invasion_interaction_accept_notification.t + left_icon = scope:secondary_recipient + right_icon = scope:actor + + show_as_tooltip = { + custom_tooltip = fp3_request_turkic_invasion_interaction_accept_target_notification.desc + } + } + } + } + } + } + + use_diplomatic_range = yes + + ai_accept = { + base = 0 + + # Relationships: actor -> recipient / We avoid more relationship checks for balance reasons (and because important decisions tend to care little for relationships) + modifier = { # Rivalry modifier. + desc = offer_vassalization_interaction_aibehavior_rival_tt_2 + trigger = { + scope:secondary_recipient = { + has_relation_rival = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + } + add = -10 + } + modifier = { # Nemesis modifier. + desc = offer_vassalization_interaction_aibehavior_nemesis_tt_2 + trigger = { + scope:secondary_recipient = { + has_relation_nemesis = scope:actor + } + } + add = -30 + } + modifier = { # Same Dynasty modifier. + desc = offer_vassalization_interaction_aibehavior_dynasty_tt_2 + trigger = { + scope:secondary_recipient = { + dynasty = scope:actor.dynasty + } + } + add = 10 + } + + # Compare Opinion modifier + opinion_modifier = { + who = scope:secondary_recipient + opinion_target = scope:actor + multiplier = 0.25 + } + + # Pledged to help in invasion + modifier = { + add = { + value = scope:actor.max_military_strength + divide = 70 + round = yes + } + desc = HAS_YOUR_SUPPORT_REASON + scope:war_support = yes + } + + # Relative power (taken from PT interaction) + modifier = { # A lot less levies than scope:secondary_recipient + add = -100 + scope:secondary_recipient.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_far_weaker_value + desc = fp3_RTI_AI_RECIPIENT_IS_MUCH_WEAKER + } + modifier = { # Few less levies than scope:secondary_recipient + add = -75 + scope:secondary_recipient.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_far_weaker_value + scope:secondary_recipient.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_somewhat_weaker_value + desc = fp3_RTI_AI_RECIPIENT_IS_SOMEWHAT_WEAKER + } + modifier = { # Roughly equal levies with scope:secondary_recipient + add = 10 + scope:secondary_recipient.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_somewhat_weaker_value + scope:secondary_recipient.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_somewhat_stronger_value + desc = fp3_RTI_AI_RECIPIENT_IS_ROUGHLY_EQUAL + } + modifier = { # More levies than scope:secondary_recipient + add = 50 + scope:secondary_recipient.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_somewhat_stronger_value + scope:secondary_recipient.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_far_stronger_value + desc = fp3_RTI_AI_RECIPIENT_IS_SOMEWHAT_STRONGER + } + modifier = { # Many more levies than scope:secondary_recipient + add = 75 + scope:secondary_recipient.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_far_stronger_value + desc = fp3_RTI_AI_RECIPIENT_IS_MUCH_STRONGER + } + + # AI who are in debt will take whatever windfalls they can. + modifier = { + add = { + value = scope:secondary_recipient.debt_level + add = 1 # Our first level is 0, so we add one to always get a positive number. + multiply = 10 + } + debt_level >= 0 + desc = PT_AI_IS_IN_DEBT + } + + # Pacifist AI don't like raiding + modifier = { + add = -25 + scope:secondary_recipient.faith = { has_doctrine_parameter = pacifist_opinion_active } + desc = PT_AI_IS_PACIFIST_FAITH_2 + } + modifier = { + add = -25 + scope:secondary_recipient.culture = { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith } + desc = PT_AI_IS_PACIFIST_CULTURE_2 + } + + # Offered proportional gold + modifier = { + add = 85 + scope:financial_support = yes + desc = GOLD_REASON + } + + # AI value mod + ai_value_modifier = { + ai_greed = 0.5 + ai_boldness = 0.25 + min = 0 + max = 25 + } + } + #auto_accept = { + # scope:recipient = { is_ai = yes } + #} + can_send_despite_rejection = no + ai_frequency = 24 + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = liege + } + ai_potential = { + has_trait = fp3_struggle_detractor + is_at_war = no + NOT = { ai_has_economical_boom_personality = yes } + ai_greed <= 25 + highest_held_title_tier > tier_barony + NOT = { culture = { has_cultural_pillar = heritage_turkic } } + } + ai_will_do = { + base = 0 + + modifier = { + add = 50 + scope:recipient = { + has_trait = fp3_struggle_supporter + scope:recipient.max_military_strength >= scope:actor.max_military_strength + } + } + + modifier = { + add = 50 + title:d_sunni.holder ?= scope:recipient + } + + modifier = { + add = 100 + scope:recipient = { + has_relation_rival = scope:actor + } + } + + modifier = { + factor = 0.1 + scope:actor.liege ?= scope:recipient + } + + modifier = { + factor = 0 + scope:recipient = { + has_character_flag = incursion_ai_pacing + } + } + + modifier = { + factor = 0 + scope:recipient = { + is_at_war = yes + is_ai = no + } + } + + modifier = { + factor = 0 + scope:recipient = { + is_ai = no + is_liege_or_above_of = scope:actor + } + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + opinion = { + target = scope:actor + value >= 45 + } + } + } + } + } +} + +################################### +# Challenge House Head +# By Hugo Cortell +# Reworked by Joe Parkin +################################### +fp3_challenge_house_head_interaction = { + icon = house_unity_sword + category = interaction_category_hostile + common_interaction = no + ai_min_reply_days = 4 + ai_max_reply_days = 9 + popup_on_receive = yes + pause_on_receive = yes + use_diplomatic_range = no + + interface_priority = 107 + + desc = fp3_challenge_house_head_interaction_desc + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { scope:diplomacy = yes } + desc = fp3_challenge_house_head_interaction_notification_diplomacy + } + desc = fp3_challenge_house_head_interaction_notification + } + } + + greeting = positive + + ai_maybe = yes + + cooldown_against_recipient = { years = 10 } + + is_shown = { + has_fp3_dlc_trigger = yes + scope:actor = { + NOT = { this = scope:recipient } + government_has_flag = government_is_clan + } + scope:actor.house ?= { + house_head = scope:recipient + OR = { + has_house_unity_parameter = unity_can_challenge_house_head + scope:actor = { + any_character_struggle = { has_struggle_phase_parameter = unlocks_challenge_house_head_for_clans } + } + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_at_war = no + is_available_adult = yes + } + scope:recipient = { + is_at_war = no + is_available_adult = yes + # Stop challenges from barons and counts against kings + custom_tooltip = { + text = fp3_challenge_house_head_interaction_tier_tt + tier_difference = { + target = scope:actor + value <= 1 + } + } + # Give some respite after a recent challenge + custom_tooltip = { + text = fp3_challenge_house_head_interaction_recent_tt + NOT = { has_character_flag = fp3_challenge_house_head_recent_flag } + } + } + } + + auto_accept = { + trigger_if = { + limit = { + scope:recipient = { is_ruler = no } + } + scope:recipient = { is_ruler = no } + } + trigger_else_if = { + limit = { scope:hook = yes } + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + } + } + trigger_else_if = { + limit = { + scope:actor = { is_heir_of = scope:recipient } + } + custom_tooltip = { + text = fp3_challenge_house_head_interaction_heir_bonus_desc + scope:actor = { is_heir_of = scope:recipient } + } + } + trigger_else = { always = no } + } + + can_send = { + scope:actor = { + # Do not allow house heads who accepted a challenge to ping pong back and forth + custom_tooltip = { + text = fp3_challenge_house_head_interaction_accepted_tt + NOT = { has_character_flag = accepted_house_head_challenge_flag } + } + } + scope:recipient = { + # Do not allow multiple challenges at the same time + custom_tooltip = { + text = fp3_challenge_house_head_interaction_ongoing_tt + NOT = { has_character_flag = ongoing_house_head_challenge_flag } + } + } + } + + on_send = { + scope:recipient = { + add_character_flag = { # stop multiple challenges at same time + flag = ongoing_house_head_challenge_flag + months = 1 + } + add_character_flag = { # stop AI constantly challenging players + flag = ai_cooldown_house_head_challenge_flag + years = 5 + } + } + } + + on_accept = { + scope:recipient = { save_scope_as = house_head } + if = { + limit = { + scope:recipient = { + is_ruler = no + } + } + scope:actor.house = { set_house_head = scope:actor } + } + else = { + scope:actor = { + save_scope_as = house_challenger + if = { # Hook consumption + limit = { scope:hook = yes } + use_hook = scope:house_head + } + if = { + limit = { scope:diplomacy = yes } + custom_tooltip = fp3_challenge_house_head_interaction_tooltip_actor.diplomacy + trigger_event = fp3_misc_decisions.0026 + scope:house_head = { custom_tooltip = fp3_challenge_house_head_interaction_tooltip_recipient.diplomacy } + house = { + add_clan_unity_interaction_effect = { + CHARACTER = scope:house_challenger + TARGET = scope:house_head + VALUE = minor_unity_loss + DESC = clan_unity_challenged_to_duel.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + } + else = { + if = { + limit = { scope:lethal = no } + custom_tooltip = fp3_challenge_house_head_interaction_tooltip_actor.a + scope:house_head = { custom_tooltip = fp3_challenge_house_head_interaction_tooltip_recipient.b } + house = { + add_clan_unity_interaction_effect = { + CHARACTER = scope:house_challenger + TARGET = scope:house_head + VALUE = minor_unity_loss + DESC = clan_unity_challenged_to_duel.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + } + else = { + custom_tooltip = fp3_challenge_house_head_interaction_tooltip_actor.a.lethal + scope:house_head = { custom_tooltip = fp3_challenge_house_head_interaction_tooltip_recipient.b.lethal } + house = { + add_clan_unity_interaction_effect = { + CHARACTER = scope:house_challenger + TARGET = scope:house_head + VALUE = major_unity_loss + DESC = clan_unity_challenged_to_duel.desc + REVERSE_NON_HOUSE_TARGET = yes + } + } + } + trigger_event = fp3_misc_decisions.0022 + } + } + if = { + limit = { scope:diplomacy = no } + if = { + limit = { scope:lethal = no } + custom_tooltip = fp3_challenge_house_head_interaction_duel_tooltip_warning + } + else = { custom_tooltip = fp3_challenge_house_head_interaction_duel_tooltip_warning_lethal } + } + } + } + + on_decline = { # Get letter of rejection, to further escalate the situation if the player wills it + scope:actor = { trigger_event = fp3_misc_decisions.0025 } + scope:recipient = { + add_prestige = major_prestige_loss + remove_character_flag = ongoing_house_head_challenge_flag + } + } + + send_option = { + flag = diplomacy + localization = CHALLENGE_HOUSE_HEAD_DIPLOMACY_DUEL + is_valid = { + custom_tooltip = { + text = CHALLENGE_HOUSE_HEAD_LETHAL_DUEL_INVALID_TT + NOT = { scope:lethal = yes } + } + } + } + send_option = { + flag = lethal + localization = CHALLENGE_HOUSE_HEAD_LETHAL_DUEL + is_valid = { + scope:actor = { has_relation_rival = scope:recipient } + custom_tooltip = { + text = CHALLENGE_HOUSE_HEAD_LETHAL_DUEL_INVALID_TT + NOT = { scope:diplomacy = yes } + } + } + } + send_option = { + flag = hook + localization = GENERIC_SPEND_A_HOOK + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + } + } + 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 = 25 + modifier = { + add = -50 + scope:lethal = yes + desc = AI_AVOID_LETHAL_DUEL + } + modifier = { + add = 15 + scope:recipient = { has_trait = ambitious } + desc = INTERACTION_AMBITIOUS + } + modifier = { + add = 25 + scope:recipient = { has_trait = brave } + desc = INTERACTION_BRAVE + } + modifier = { + add = { + value = -25 + if = { + limit = { scope:lethal = yes } + multiply = 2 + } + } + scope:recipient = { has_trait = craven } + desc = INTERACTION_CRAVEN + } + modifier = { + scope:recipient.ai_greed != 0 + add = { # Greedy people won't risk a position of power, even if their prestige suffers + value = scope:recipient.ai_greed + multiply = -1 + max = 35 + min = -35 + } + desc = AI_VALUE_MODIFIER_GREED + } + modifier = { + scope:recipient.ai_honor != 0 + add = { + value = scope:recipient.ai_honor + max = 75 + min = -35 + } + desc = AI_VALUE_MODIFIER_HONOR + } + modifier = { + scope:recipient.ai_energy != 0 + add = { + value = scope:recipient.ai_energy + max = 10 + min = -10 + } + desc = AI_VALUE_MODIFIER_ENERGY + } + modifier = { + NOT = { scope:diplomacy = yes } + add = { + value = scope:recipient.prowess + subtract = scope:actor.prowess + multiply = 2 + } + desc = CTSC_RELATIVE_PROWESS + } + modifier = { + scope:lethal = yes + scope:recipient = { + OR = { + is_parent_of = scope:actor + is_child_of = scope:actor + } + NOT = { has_relation_rival = scope:actor } + } + desc = AI_AVOID_LETHAL_DUEL_WITH_FAMILY + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + } + } + + ai_frequency = 24 + + ai_target_quick_trigger = { + adult = yes + } + + ai_potential = { + NOR = { + has_trait = craven + has_trait = content + } + government_has_flag = government_is_clan + is_physically_able = yes + } + + ai_targets = { + ai_recipients = dynasty + ai_recipients = family + max = 10 + } + + ai_targets = { + ai_recipients = liege + ai_recipients = head_of_faith + ai_recipients = hooked_characters + ai_recipients = scripted_relations + } + + ai_targets = { + ai_recipients = peer_vassals + ai_recipients = vassals + ai_recipients = neighboring_rulers + max = 30 + } + + ai_will_do = { + base = 5 + # Base requirements for AI + modifier = { + add = -1000 + NOR = { + AND = { + is_independent_ruler = yes + highest_held_title_tier >= scope:recipient.highest_held_title_tier + } + is_powerful_vassal = yes + is_close_or_extended_family_of = scope:recipient + opinion = { + target = scope:recipient + value >= 25 + } + } + } + # Stop AI constantly challenging players + modifier = { + scope:recipient = { has_character_flag = ai_cooldown_house_head_challenge_flag } + add = -1000 + } + # Tiers + modifier = { + add = 10 + piety_level >= scope:recipient.piety_level + } + modifier = { + add = 10 + prestige_level >= scope:recipient.prestige_level + } + modifier = { + add = 10 + highest_held_title_tier >= scope:recipient.highest_held_title_tier + } + # Traits + modifier = { + add = 30 + has_trait = ambitious + } + modifier = { + add = 30 + has_trait = brave + } + modifier = { + add = -30 + has_trait = craven + } + # Dread + modifier = { + add = -25 + has_dread_level_towards = { + target = scope:recipient + level >= 1 + } + } + modifier = { + add = -25 + has_dread_level_towards = { + target = scope:recipient + level >= 2 + } + } + # Personality + modifier = { + ai_boldness > 0 + add = { + value = ai_boldness + divide = 2 + min = 1 + } + } + modifier = { + ai_greed >= 50 + add = { + value = ai_greed + divide = 2 + } + } + modifier = { + ai_sociability = 100 + add = 10 + } + } +} + + +################################### +# Change struggle allegiance +################################### +fp3_change_allegiance = { + interface_priority = 30 + category = interaction_category_diplomacy + common_interaction = yes + desc = { + first_valid = { + # Become a supporter. + triggered_desc = { + trigger = { + scope:actor = { has_trait = fp3_struggle_supporter } + } + desc = fp3_change_allegiance.desc.actor_is_supporter + } + # Become a detractor. + triggered_desc = { + trigger = { + scope:actor = { has_trait = fp3_struggle_detractor } + } + desc = fp3_change_allegiance.desc.actor_is_detractor + } + desc = fp3_change_allegiance.desc.fallback + } + } + icon = change_allegiance + + greeting = positive + + 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_maybe = yes + + is_shown = { + has_fp3_dlc_trigger = yes + # There has to be a caliph around to sway on. + ## Arguably narratively not, but mechanically, everything will break if we don't. + exists = title:d_sunni.holder + NOT = { scope:recipient = scope:actor } + scope:actor = { + any_character_struggle = { is_struggle_type = persian_struggle } + OR = { + # Detractors are made from supporters. + AND = { + has_trait = fp3_struggle_detractor + scope:recipient = { has_trait = fp3_struggle_supporter } + } + # Supporters are made from detractors. + AND = { + has_trait = fp3_struggle_supporter + scope:recipient = { has_trait = fp3_struggle_detractor } + } + # Neutrals can be asked either way, should they exist. + AND = { + OR = { + has_trait = fp3_struggle_detractor + has_trait = fp3_struggle_supporter + } + scope:recipient = { + NOR = { + has_trait = fp3_struggle_detractor + has_trait = fp3_struggle_supporter + } + } + } + } + } + scope:recipient = { + any_character_struggle = { is_struggle_type = persian_struggle } + # You cannot ask the Caliph! + NOT = { this = title:d_sunni.holder } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + # We want to disable some stuff for supporters who can't be persuaded away from the caliph. + trigger_if = { + limit = { has_trait = fp3_struggle_supporter } + # Can't be allied to the caliph. + NOT = { is_allied_to = title:d_sunni.holder } + # Can't be strong hooked _by_ the caliph. + NOT = { + title:d_sunni.holder = { has_strong_hook = prev } + } + # Can't have only recently changed to become a supporter. + custom_tooltip = { + text = fp3_change_allegiance.tt.recently_voluntarily_became_supporter + OR = { + NOT = { has_variable = last_explicit_friday_prayer_caliph } + NOT = { var:last_explicit_friday_prayer_caliph = title:d_sunni.holder } + } + } + } + # Likewise, some circumstances can force them to stay as a detractor. + trigger_if = { + limit = { has_trait = fp3_struggle_detractor } + # Can't have only recently changed to become a detractor. + custom_tooltip = { + text = fp3_change_allegiance.tt.recently_voluntarily_became_detractor + OR = { + NOT = { has_variable = last_explicit_friday_prayer_caliph } + NOT = { var:last_explicit_friday_prayer_caliph = title:d_sunni.holder } + } + } + # Can't have been forced into becoming a detractor by the caliph overstepping. + custom_tooltip = { + text = fp3_change_allegiance.tt.recently_forced_to_detractor + OR = { + NOT = { has_variable = last_explicit_defied_caliph } + NOT = { var:last_explicit_defied_caliph = title:d_sunni.holder } + } + } + } + # Plus some general stuff. + is_at_war = no + # Can't have recently been convinced to change their minds. + custom_tooltip = { + text = fp3_change_allegiance.tt.recently_changed_mind + NOT = { has_character_flag = fp3_change_allegiance_recipient_cooldown } + } + custom_tooltip = { + text = fp3_change_allegiance.tt.recently_refused + NOT = { has_character_flag = fp3_change_allegiance_refused_cooldown } + } + # They must be an orthodox Sunni. + custom_tooltip = { + text = fp3_change_allegiance.tt.hof_is_d_sunni + faith.religious_head ?= title:d_sunni.holder + } + } + scope:actor = { is_available_adult = yes } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + } + } + + ai_accept = { + base = 0 + + # Those who already have a stance are more set in their ways. + ## Detractors + modifier = { + add = -25 + scope:actor = { has_trait = fp3_struggle_supporter } + scope:recipient = { has_trait = fp3_struggle_detractor } + desc = INTERACTION_DETRACTOR + } + ## Supporters + modifier = { + add = -25 + scope:actor = { has_trait = fp3_struggle_detractor } + scope:recipient = { has_trait = fp3_struggle_supporter } + desc = INTERACTION_SUPPORTER + } + + # Opinions + ## Opinion of you + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = { + value = 1 + # Despawn this if you're not the caliph. + if = { + limit = { scope:actor = title:d_sunni.holder } + multiply = 0 + } + } + } + ## Opinion of the caliph + opinion_modifier = { + who = scope:recipient + opinion_target = title:d_sunni.holder + multiplier = { + value = 0.5 + # If you're the caliph, you can take the full amount. + if = { + limit = { scope:actor = title:d_sunni.holder } + add = 0.5 + } + } + } + # Traits. + ## Become supporter. + ### ++ Zealous. + modifier = { + add = 25 + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_ZEALOUS + scope:actor = { has_trait = fp3_struggle_supporter } + scope:recipient = { has_trait = zealous } + } + ## Become detractor. + ### -- Cynical. + modifier = { + add = 25 + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_CYNICAL + scope:actor = { has_trait = fp3_struggle_detractor } + scope:recipient = { has_trait = cynical } + } + ## Neutral. + ### ++ Fickle. + modifier = { + add = 25 + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_FICKLE + scope:recipient = { has_trait = fickle } + } + ### + Disloyal. + modifier = { + add = 15 + desc = HAS_LOYAL_TRAIT + scope:recipient = { has_trait = disloyal } + } + ### - Loyal. + modifier = { + add = 15 + desc = HAS_DISLOYAL_TRAIT + scope:recipient = { has_trait = loyal } + } + ### -- Stubborn. + modifier = { + add = 25 + desc = ASK_FOR_CONVERSION_RECIPIENT_IS_STUBBORN + scope:recipient = { has_trait = stubborn } + } + # Diplomacy + ## Scope:actor's for convincing + modifier = { + add = { + value = scope:actor.diplomacy + multiply = 5 + } + desc = INTERACTION_DIPLOMACY_ACTOR + } + ## Scope:recipient's for resisting + modifier = { + add = { + value = scope:recipient.diplomacy + multiply = -3 + } + desc = INTERACTION_DIPLOMACY_RECIPIENT + } + } + + cost = { + prestige = medium_prestige_value + } + + # Use hook + send_option = { + flag = hook + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + localization = GENERIC_SPEND_A_HOOK + } + + on_accept = { + # Use our hook if we have to. + if = { + limit = { always = scope:hook } + 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:recipient + VALUE = medium_unity_gain + DESC = clan_unity_changed_alignment.desc + REVERSE_NON_HOUSE_TARGET = no + } + # Run the actual effects. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = recipient_joined_your_side_title + left_icon = scope:recipient + + scope:recipient = { + if = { + limit = { scope:actor = { has_trait = fp3_struggle_detractor } } + if = { + limit = { has_trait = fp3_struggle_supporter } + remove_trait = fp3_struggle_supporter + } + add_trait_force_tooltip = fp3_struggle_detractor + + # Catalyst + hidden_effect = { + if = { + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_turn_supporter_into_detractor + } + } + } + every_character_struggle = { + involvement = involved + activate_struggle_catalyst = { + catalyst = catalyst_turn_supporter_into_detractor + character = scope:actor + } + log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_turn_supporter_into_detractor } + } + } + } + } + else = { + if = { + limit = { has_trait = fp3_struggle_detractor } + remove_trait = fp3_struggle_detractor + } + add_trait_force_tooltip = fp3_struggle_supporter + + # Catalyst + hidden_effect = { + if = { + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_turn_detractor_into_supporter + } + } + } + every_character_struggle = { + involvement = involved + activate_struggle_catalyst = { + catalyst = catalyst_turn_detractor_into_supporter + character = scope:actor + } + log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_turn_detractor_into_supporter } + } + } + } + } + } + } + } + # Aaaaand flag scope:recipient as on cooldown for a while. + scope:recipient = { + set_variable = { + name = fp3_change_allegiance_recipient_cooldown + years = 20 + } + } + } + + on_decline = { + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_loss + DESC = clan_unity_refused_alignment.desc + REVERSE_NON_HOUSE_TARGET = no + } + scope:actor = { + if = { + limit = { + scope:actor = { has_trait = fp3_struggle_detractor } + } + send_interface_toast = { + type = event_toast_effect_bad + title = recipient_refused_to_join_your_side_title + left_icon = scope:recipient + progress_towards_rival_effect = { + REASON = rival_rejected_switching_to_struggle_detractor + CHARACTER = scope:recipient + OPINION = default_rival_opinion + } + } + } + else = { + send_interface_toast = { + type = event_toast_effect_bad + title = recipient_refused_to_join_your_side_title + left_icon = scope:recipient + progress_towards_rival_effect = { + REASON = rival_rejected_switching_to_struggle_supporter + CHARACTER = scope:recipient + OPINION = default_rival_opinion + } + } + } + } + scope:recipient = { + set_variable = { + name = fp3_change_allegiance_refused_cooldown + years = 20 + } + } + } + ai_frequency = 120 + + ai_potential = { + primary_title.tier >= tier_duchy + OR = { + has_trait = fp3_struggle_detractor + has_trait = fp3_struggle_supporter + } + } + + ai_targets = { + ai_recipients = liege + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = vassals + ai_recipients = top_realm_domicile_owners + max = 10 + } + + ai_will_do = { + base = -50 # Let's limit it to specific character to avoid pure chaos + + ############### + ## BASE + ############### + + # AI Values + ## Detractors run off of lacking zeal + modifier = { + add = { + value = ai_zeal + multiply = -2 + } + has_trait = fp3_struggle_detractor + ai_zeal <= -1 + } + ## Supporters run off of turbo-charged zeal + modifier = { + add = { + value = ai_zeal + multiply = 2 + } + has_trait = fp3_struggle_supporter + ai_zeal >= 1 + } + + # The caliph wants to use this all the time. + modifier = { + has_title = title:d_sunni + add = 200 + } + + ############### + ## TRAITS + ############### + + # schemer + modifier = { + add = 15 + has_trait = schemer + } + + # theologian + modifier = { + add = 25 + has_trait = theologian + } + + # intrigue education + modifier = { + add = 15 + has_trait = education_intrigue + } + + # learning education + modifier = { + add = 25 + has_trait = education_learning + } + + ################ + ## RELATIONSHIP + ################ + + # more likely to do it against friend and lover + modifier = { + add = 50 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + has_relation_soulmate = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + # boost against liege for Ambitious + modifier = { + add = 50 + scope:actor = { + has_trait = ambitious + is_vassal_of = scope:recipient + } + } + + # never target your rivals + modifier = { + add = -1000 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + ################ + ## STRUGGLE + ################ + + modifier = { + add = 100 + OR = { + AND = { + scope:recipient = { has_trait = fp3_struggle_supporter } + scope:actor = { + has_trait = fp3_struggle_detractor + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_turn_supporter_into_detractor + } + } + } + AND = { + scope:recipient = { has_trait = fp3_struggle_detractor } + scope:actor = { + has_trait = fp3_struggle_supporter + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_turn_detractor_into_supporter + } + } + } + } + } + } +} + + +################################### +# Request honorary titles +################################### +fp3_request_honorary_titles_interaction = { # todo_cd_polish add different option to pick different titles + interface_priority = 30 + category = interaction_category_religion + common_interaction = yes + desc = fp3_request_honorary_titles_interaction_desc + icon = honorary_titles + + greeting = positive + + auto_accept = yes + + cooldown = { years = 10 } + + cost = { + piety = { + value = major_piety_value + if = { + limit = { # cheaper for the actual liege + any_vassal = { + any_held_title = { + this = title:d_sunni + } + } + } + subtract = medium_piety_value + } + } + } + + is_shown = { + fp3_reward_from_vassalization_ending = yes + } + + is_valid = { + # honorary titles should be unique + custom_tooltip = { + text = one_of_the_title_is_available_tt + scope:actor = { + house ?= { + NAND = { + any_house_member = { + has_character_modifier = fp3_honorary_title_intrigue_modifier + } + any_house_member = { + has_character_modifier = fp3_honorary_title_scholarship_modifier + } + + any_house_member = { + has_character_modifier = fp3_honorary_title_stewardship_modifier + } + any_house_member = { + has_character_modifier = fp3_honorary_title_diplomacy_modifier + } + any_house_member = { + has_character_modifier = fp3_honorary_title_piety_modifier + } + any_house_member = { + has_character_modifier = fp3_honorary_title_prestige_modifier + } + any_house_member = { + has_character_modifier = fp3_honorary_title_martial_modifier + } + } + } + } + } + } + + send_option = { + flag = intrigue_option + localization = fp3_honorary_title_intrigue_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_intrigue_modifier + } + } + } + } + } + } + + send_option = { + flag = scholarship_option + localization = fp3_honorary_title_scholarship_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_scholarship_modifier + } + } + } + } + } + } + + send_option = { + flag = stewardship_option + localization = fp3_honorary_title_stewardship_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_stewardship_modifier + } + } + } + } + } + } + + send_option = { + flag = diplomacy_option + localization = fp3_honorary_title_diplomacy_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_diplomacy_modifier + } + } + } + } + } + } + + send_option = { + flag = piety_option + localization = fp3_honorary_title_piety_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_piety_modifier + } + } + } + } + } + } + + send_option = { + flag = prestige_option + localization = fp3_honorary_title_prestige_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_prestige_modifier + } + } + } + } + } + } + + send_option = { + flag = martial_option + localization = fp3_honorary_title_martial_modifier + is_valid = { + NOT = { + scope:actor = { + house ?= { + any_house_member = { + has_character_modifier = fp3_honorary_title_martial_modifier + } + } + } + } + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = new_honorary_title_acquired_title + left_icon = scope:recipient + + switch = { + trigger = yes + scope:intrigue_option = { + add_character_modifier = { + modifier = fp3_honorary_title_intrigue_modifier + } + } + scope:scholarship_option = { + add_character_modifier = { + modifier = fp3_honorary_title_scholarship_modifier + } + } + scope:stewardship_option = { + add_character_modifier = { + modifier = fp3_honorary_title_stewardship_modifier + } + } + scope:diplomacy_option = { + add_character_modifier = { + modifier = fp3_honorary_title_diplomacy_modifier + } + } + scope:piety_option = { + add_character_modifier = { + modifier = fp3_honorary_title_piety_modifier + } + } + scope:prestige_option = { + add_character_modifier = { + modifier = fp3_honorary_title_prestige_modifier + } + } + scope:martial_option = { + add_character_modifier = { + modifier = fp3_honorary_title_martial_modifier + } + } + } + } + } + } + + ai_frequency = 60 + + ai_potential = { + any_vassal = { + any_held_title = { + this = title:d_sunni + } + } + } + + ai_targets = { + # For the AI, we limit it to neighboring_rulers + ai_recipients = vassals + } + + ai_will_do = { + base = 100 + } +} + + +################################### +# Request house unity interference +################################### +fp3_request_house_unity_change_interaction = { + interface_priority = 30 + category = interaction_category_religion + common_interaction = yes + desc = fp3_request_house_unity_change_interaction_desc + icon = unity_harmonious + + greeting = positive + + + auto_accept = yes + + cooldown = { years = 10 } + + cost = { + piety = medium_piety_value + } + + is_shown = { + fp3_reward_from_vassalization_ending = yes + scope:actor = { + government_has_flag = government_is_clan + } + } + + is_valid = { + # only valid for the actual liege + custom_tooltip = { + text = you_are_the_liege_of_the_caliph_tt + scope:actor = { + is_liege_or_above_of = scope:recipient + } + scope:recipient = { + any_held_title = { + this = title:d_sunni + } + } + } + } + + send_option = { + flag = unity_gain + localization = INCREASE_HOUSE_UNITY + starts_enabled = { always = yes } + } + + send_option = { + flag = unity_loss + localization = DECREASE_HOUSE_UNITY + } + + on_accept = { + scope:recipient = { save_scope_as = unity_target } + scope:actor = { + save_scope_as = unity_character + house = { + add_unity_value = { + value = { + if = { + limit = { scope:unity_gain = yes } + add = medium_unity_gain + } + else_if = { + limit = { scope:unity_loss = yes } + add = medium_unity_loss + } + } + character = root + desc = clan_unity_caliph_interfered_with_unity.desc + } + } + } + } + + ai_frequency = 60 + + ai_potential = { + any_vassal = { + any_held_title = { + this = title:d_sunni + } + } + } + + ai_targets = { + # For the AI, we limit it to neighboring_rulers + ai_recipients = vassals + } + + ai_will_do = { + base = 100 + } +} diff --git a/common/character_interactions/00_gift.txt b/common/character_interactions/00_gift.txt new file mode 100644 index 00000000..1fd26d68 --- /dev/null +++ b/common/character_interactions/00_gift.txt @@ -0,0 +1,743 @@ +#Give characters money to improve their opinion of you +gift_interaction = { + icon = icon_gold + category = interaction_category_friendly + common_interaction = yes + interface_priority = 60 + 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_targets = { + ai_recipients = liege + } + ai_targets = { + 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 = 60 + + is_shown = { + NOT = { + 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 = { is_busy_in_events_localised = yes } + } + + 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 + } + } + + 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 = { + exists = dynasty + dynasty = { has_dynasty_perk = fp2_urbanism_legacy_4 } + } + scope:recipient = { + AND = { + is_vassal_of = scope:actor + government_has_flag = government_is_republic + } + } + NOT = { + 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 = { + is_independent_ruler = yes + 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 + } + ai_has_conqueror_personality = no + 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 + 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 + } + } + + modifier = { + factor = 0.1 + scope:recipient = { + has_relation_rival = scope:actor + } + } + } +} diff --git a/common/character_interactions/00_grant_titles_interaction.txt b/common/character_interactions/00_grant_titles_interaction.txt new file mode 100644 index 00000000..5aefa2ce --- /dev/null +++ b/common/character_interactions/00_grant_titles_interaction.txt @@ -0,0 +1,2109 @@ +#be aware that the actual granting of the title happens in code! +grant_titles_interaction = { + + category = interaction_category_vassal + common_interaction = yes + + desc = grant_titles_interaction_desc + + special_interaction = grant_titles_interaction + interface = grant_titles + target_type = title + target_filter = actor_domain_titles + interface_priority = 60 + + # actor character giving the titles + # recipient character receiving the titles + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:actor = { + NOT = { + government_has_flag = government_is_landless_adventurer + } + } + scope:recipient = { + OR = { + target_is_liege_or_above = scope:actor + is_pool_guest_of = scope:actor + AND = { + scope:actor.faith.religious_head = scope:recipient + is_independent_ruler = yes + } + } + } + trigger_if = { + limit = { + scope:actor = { government_allows = administrative } + } + scope:recipient = { NOT = { government_allows = administrative } } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + custom_tooltip = { + text = can_be_granted_titles_interaction_tt + OR = { + can_be_granted_titles_by = { RULER = scope:actor } + can_be_granted_theocratic_titles_by = { RULER = scope:actor } + AND = { + is_diarch_of_target = scope:actor + scope:actor = { has_diarchy_active_parameter = diarchy_is_co_rulership } + } + } + } + NOT = { is_at_war_with = scope:actor } + NOT = { has_trait = devoted } # Monks are disinherited, and should not have land granted to them + bp2_valid_for_standard_interactions_trigger = yes + is_busy_in_events_localised = yes + trigger_if = { + limit = { is_ruler = no } + is_imprisoned = no + } + # DON'T TAKE OTHER PLAYERS' ACCLAIMED KNIGHTS + custom_description = { + text = grant_title_stealing_acclaimed_knight + subject = scope:recipient + NOR = { + AND = { + is_acclaimed = yes + liege ?= { + is_ai = no + NOT = { this = scope:actor } + } + } + AND = { + is_acclaimed = yes + scope:actor = { is_ai = yes } + } + } + } + # Gallivanters won't accept additional responsibilities. + NOT = { has_trait = gallivanter } + } + custom_description = { + text = is_not_theocratic_court_chaplain + subject = scope:recipient + NAND = { + scope:actor.faith = { + has_doctrine = doctrine_theocracy_temporal + } + scope:recipient = { + faith = { + has_doctrine = doctrine_theocracy_temporal + } + has_council_position = councillor_court_chaplain + } + NOT = { scope:actor.faith.religious_head = scope:recipient } + } + } + scope:actor = { + any_held_title = { + count > 1 + } + } + } + + can_send = { + trigger_if = { + limit = { + scope:actor = { + highest_held_title_tier >= tier_kingdom + has_diarchy_active_parameter = primeminister_requires_duchy + diarch = scope:recipient + } + } + custom_tooltip = { + text = primeminister_requires_duchy.tt.blocked_grant + any_in_list = { + list = target_titles + tier >= tier_duchy + } + } + } + } + + can_be_picked_title = { + scope:target = { + is_leased_out = no + + trigger_if = { + limit = { is_noble_family_title = yes } + custom_tooltip = { + text = GRANT_TITLES_ITEM_CANT_GIVE_NOBLE_FAMILY + always = no + } + } + + trigger_if = { + limit = { + is_head_of_faith = yes + NOT = { + scope:recipient.faith.religious_head = scope:actor.faith.religious_head + } + } + custom_tooltip = { + text = GRANT_TITLES_ITEM_CANT_HEAD_OF_FAITH_TO_INFIDEL + scope:recipient.faith.religious_head = scope:actor.faith.religious_head + } + } + + trigger_if = { + limit = { + scope:recipient = scope:actor.player_heir + scope:actor = { has_partition_succession_realm_law_trigger = yes } + } + custom_description = { + text = partition_primary_heir_unfair + subject = scope:recipient + current_heir = scope:recipient + } + } + trigger_if = { + limit = { scope:target = title:k_fashion } + NOT = { scope:target = title:k_fashion } + } + } + + custom_description = { + text = grant_titles_interaction_can_only_give_diarch_de_jure_liege_to_diarch + subject = scope:actor.diarch + NAND = { + # Only applies if we have an active diarchy. + scope:actor = { has_active_diarchy = yes } + # Now, prevent us from giving away our diarch's land to invalidate them... + scope:target = { + any_dejure_vassal_title_holder = { this = scope:actor.diarch } + # ... _unless_ we're giving it _to_ the diarch. + NOT = { scope:recipient = scope:actor.diarch } + # Plus we only care if the title is below our tier. + tier < scope:actor.highest_held_title_tier + } + } + } + + custom_description = { + text = grant_titles_interaction_children_not_allowed_temple + subject = scope:recipient + NOR = { + AND = { + scope:recipient = { + is_adult = no + } + scope:target = { + tier = tier_barony + title_province = { has_building_with_flag = temple } + } + } + AND = { + scope:recipient = { + is_adult = no + } + scope:target = { + tier = tier_county + + title_province = { + is_county_capital = yes + has_building_with_flag = temple + } + } + } + } + } + + custom_description = { + text = grant_titles_interaction_title_being_wagered + NOT = { + scope:target = { has_variable = wagered_county } + } + } + } + + auto_accept = yes + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0110 + } + } + + on_accept = { + if = { + limit = { + scope:recipient = { + is_acclaimed = yes + liege = { + this = scope:actor + } + } + scope:target = { + tier > tier_barony + } + } + custom_tooltip = grant_title_landing_acclaimed_knight_warning + } + scope:recipient = { + if = { + limit = { + is_independent_ruler = yes + save_temporary_scope_as = recipient_is_independent + } + } + if = { + limit = { + NOT = { + has_relation_friend = scope:actor + } + } + if = { + # then verify the right struggle phase + limit = { + is_diff_faith_or_culture_trigger = { + CHAR = scope:actor + STATUS = involved + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = struggle_grant_titles_diff_faith_culture_to_leads_to_friendship + } + } + progress_towards_friend_effect = { + REASON = friend_granted_title + CHARACTER = scope:actor + OPINION = 0 + } + } + } + } + + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + culture = scope:recipient.culture + NOR = { + culture = scope:actor.culture + recent_history = { + type = granted + years = 10 + } + } + } + } + alternative_limit = { + any_in_list = { + list = target_titles + tier >= tier_duchy + title_capital_county = { + NOT = { culture = scope:actor.culture } + culture = scope:recipient.culture + } + NOT = { + recent_history = { + type = granted + years = 10 + } + } + } + } + scope:recipient.culture = { + change_cultural_acceptance = { + target = scope:actor.culture + value = grant_title_cultural_acceptance_impact + desc = cultural_acceptance_gain_granted_title + } + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + } + scope:actor.culture = { has_cultural_parameter = grants_to_lowborns_bonuses } + scope:recipient = { + is_lowborn = yes + } + } + every_in_list = { + list = target_titles + limit = { tier = tier_county } + change_county_control = 30 + } + scope:recipient = { + add_trait = peasant_leader + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier >= tier_county + } + scope:actor.culture = { has_cultural_parameter = landing_house_members_give_prestige } + exists = scope:actor.house + exists = scope:recipient.house + scope:actor.house = scope:recipient.house + } + scope:actor = { + add_prestige = { + value = 0 + every_in_list = { + list = target_titles + limit = { tier = tier_empire } + add = massive_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_kingdom } + add = major_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_duchy } + add = medium_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_county } + add = minor_prestige_gain + } + } + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier >= tier_county + } + scope:actor.culture = { has_cultural_parameter = landing_house_members_gives_renown } + exists = scope:actor.house + exists = scope:recipient.house + scope:actor.house = scope:recipient.house + } + scope:actor.dynasty = { + add_dynasty_prestige = { + value = 0 + every_in_list = { + list = target_titles + limit = { tier = tier_empire } + add = massive_dynasty_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_kingdom } + add = major_dynasty_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_duchy } + add = medium_dynasty_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_county } + add = minor_dynasty_prestige_gain + } + } + } + } + + # Iterate over all given titles + # - Add opinion modifiers + # - Collect titles that discontent reduction can later be derived from + every_in_list = { + list = target_titles + save_temporary_scope_as = this_title + if = { + limit = { + exists = scope:landed_title + } + scope:recipient = { + if = { + limit = { + scope:this_title.tier = tier_barony + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_barony + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + + else_if = { + limit = { + scope:this_title.tier = tier_county + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_county + } + if = { + limit = { + is_lowborn = yes + } + scope:actor = { + if = { + limit = { + is_ai = no + } + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -5 + } + } + } + else = { # Can't really stop the AI from landing lowborns, so throttle it a bit so that great conquerors don't annihilate their opinion + random = { + chance = 25 + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -5 + } + } + } + } + } + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + + else_if = { + limit = { + scope:this_title.tier = tier_duchy + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_duchy + } + if = { + limit = { + is_lowborn = yes + } + scope:actor = { + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -20 + } + } + } + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + + else_if = { + limit = { + scope:this_title.tier = tier_kingdom + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_kingdom + } + if = { + limit = { + is_lowborn = yes + } + scope:actor = { + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -50 + } + } + } + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + + else_if = { + limit = { + scope:this_title.tier = tier_empire + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_empire + } + if = { + limit = { + is_lowborn = yes + } + scope:actor = { + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -5 + } + } + } + } + if = { + limit = { + is_a_faction_member = yes + } + add_joined_faction_discontent = -60 + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + } + + #Promised a vassal this title they had a claim on (vassal.2901) + if = { + limit = { + scope:actor = { + exists = var:was_promised_title + var:was_promised_title = scope:recipient + } + } + if = { + limit = { + scope:recipient = { + exists = var:promised_title + } + scope:landed_title = scope:recipient.var:promised_title + } + scope:actor = { + trigger_event = { + id = vassal.2910 + days = { 7 14 } + } + } + } + } + } + if = { + limit = { + scope:recipient = { + has_trait = bastard + } + } + custom_tooltip = grant_title_to_bastard_dynasty_warning + } + } # every_in_list + + + # The accumulated discontent reduction of the recipient + scope:recipient = { + if = { + limit = { + is_a_faction_member = yes + } + add_joined_faction_discontent = grant_title_opinion_sum_discontent_calc + } + } + + # Viziers may be booted from their job. + scope:actor = { + if = { + limit = { + # Assuming this is relevant at all. + diarch ?= scope:recipient + # And that scope:actor can do without a supervisor atm. + can_leave_diarchy_trigger = yes + # Aaaaand that their diarchy supports this type of thing. + OR = { + has_diarchy_parameter = primeminister_requires_county + has_diarchy_parameter = primeminister_requires_duchy + } + } + # Is this a duchy? + if = { + limit = { + any_in_list = { + list = target_titles + tier >= tier_duchy + } + } + custom_tooltip = grant_titles_interaction.tt.primeminister_title_grant.duchy_sufficient + end_diarchy = yes + } + # Is this a county? + else_if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_county + } + } + # Is that insufficient? + if = { + limit = { has_diarchy_active_parameter = primeminister_requires_duchy } + custom_tooltip = grant_titles_interaction.tt.primeminister_title_grant.county_insufficient + } + # Is that sufficient? + else = { + custom_tooltip = grant_titles_interaction.tt.primeminister_title_grant.county_sufficient + end_diarchy = yes + } + } + # Is this a barony? + else_if = { + limit = { + any_in_list = { + list = target_titles + count = all + tier = tier_barony + } + } + custom_tooltip = grant_titles_interaction.tt.primeminister_title_grant.barony_doesnt_end + } + } + } + + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_empire + } + } + custom_tooltip = grant_title_modifier_stack_empires + } + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_kingdom + } + } + custom_tooltip = grant_title_modifier_stack_kingdoms + } + if = { + limit = { + any_in_list = { + list = titles_to_grant + tier = tier_duchy + } + } + custom_tooltip = grant_title_modifier_stack_duchies + } + if = { + limit = { + any_in_list = { + list = titles_to_grant + tier = tier_county + } + } + custom_tooltip = grant_title_modifier_stack_counties + } + if = { + limit = { + any_in_list = { + list = titles_to_grant + tier = tier_barony + } + } + custom_tooltip = grant_title_modifier_stack_baronies + } + if = { + limit = { + trigger_if = { + limit = { scope:actor = { is_ai = yes } } + scope:actor = { + any_vassal = { + has_vassal_stance = courtly + } + } + } + scope:recipient = { + is_lowborn = yes + } + any_in_list = { + list = titles_to_grant + tier >= tier_county + } + } + custom_tooltip = grant_title_modifier_courtly_lowborn_grant_penalty + } + if = { + limit = { + scope:recipient = { is_a_faction_member = yes } + } + custom_tooltip = grant_title_modifier_stack_discontent + } + + # Jealousy check + if = { + limit = { + any_in_list = { + list = titles_to_grant + any_claimant = { grant_title_rivalry_trigger = yes } + } + } + hidden_effect = { + random = { + chance = 25 + ordered_in_list = { + list = titles_to_grant + limit = { + any_claimant = { grant_title_rivalry_trigger = yes } + } + order_by = tier + save_scope_as = claim_title + ordered_claimant = { + limit = { grant_title_rivalry_trigger = yes } + order_by = primary_title.tier + save_scope_as = claim_vassal + if = { + limit = { + scope:recipient = { is_lowborn = yes } + } + scope:recipient = { save_scope_as = lowborn_scope } + } + else_if = { + limit = { + scope:recipient = { has_claim_on = scope:claim_title } + } + scope:recipient = { save_scope_as = claimant_scope } + } + scope:actor = { + trigger_event = { + id = bp1_yearly.8070 + days = 5 + } + } + } + } + } + } + } + + #Stress impact + scope:actor = { + if = { + limit = { + any_in_list = { + list = target_titles + trigger_if = { + limit = { tier = tier_barony } + title_province.barony = { + has_wrong_holding_type = no + } + } + count >= 1 + } + } + + # Generous characters enjoy giving away titles + if = { + limit = { + has_trait = generous + } + add_stress = generous_title_grant_value + } + + # Gnostics lose stress for giving away titles. + if = { + limit = { + scope:actor = { + faith = { + has_doctrine_parameter = granting_titles_gives_stress + } + } + } + scope:actor = { + add_stress = { + value = 0 + + # Base stress value scaled on title tier. + every_in_list = { + list = target_titles + + add = { + value = 0 + + if = { + limit = { this.tier = tier_county } + add = minor_stress_loss # 10 base + } + else_if = { + limit = { this.tier = tier_duchy } + add = { + value = medium_stress_loss + multiply = 1.25 # 25 base + } + } + else_if = { + limit = { this.tier = tier_kingdom } + add = { + value = major_stress_loss + multiply = 2 # 80 base + } + } + else_if = { + limit = { this.tier = tier_empire } + add = { + value = monumental_stress_loss + multiply = 2 # 200 base + } + } + + # Lose more stress for giving away titles of your primary tier; lose less stress for giving away titles far below your primary in tier. + multiply = { + value = this.tier + add = 1 + divide = scope:actor.primary_title.tier + } + + # Round to the nearest multiple of 5. + divide = 5 + round = yes + multiply = 5 + + # For a Duke, this will be x1.25 for Duchies (-30) and x1 for Counties(-10) + # For a King, this will be x1.25 for a Kingdom (-100), x1 for a Duchy (-25) and x0.75 for Counties(-10) + # For an Emperor, this will be x1.25 for an Empire(-200), x1 for a Kingdom(-80), x0.75 for a Duchy(-20) and x0.4 for a Counties (-5) + } + } + } + } + } + + # Greedy & ambitious ruler gain stress for giving away titles if they would normally be able to keep them. + if = { + limit = { + # Pre-filter + OR = { + has_trait = greedy + has_trait = ambitious + } + domain_size <= domain_limit # Not over my domain limit + any_in_list = { + list = target_titles + tier <= tier_county # At least 1 selected title counts toward domain limit + } + + # Special exemption for lieges who are over their held duchy limit, which are giving away that duchy (and associated counties) specifically + trigger_if = { + limit = { + has_too_many_held_duchies_trigger = yes + } + NOT = { + # Granting at least 1 duchy + any_in_list = { + list = target_titles + title_counts_towards_too_many_duchies_trigger = yes + save_temporary_scope_as = granted_duchy + + # All counties being granted are De Jure part of the duchy that is being granted + any_in_list = { + list = target_titles + count = all + trigger_if = { + limit = { tier = tier_county} + de_jure_liege = scope:granted_duchy + } + } + } + } + } + } + # Actual stress gain effects + if = { + limit = { + domain_size = domain_limit + } + stress_impact = { + greedy = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + } + else_if = { + limit = { + domain_size < domain_limit + } + stress_impact = { + greedy = medium_stress_impact_gain + ambitious = medium_stress_impact_gain + } + } + } + } + + # Maintenance for runestones + if = { + limit = { + # Use expanded version if we have FP1. + has_fp1_dlc_trigger = yes + fp1_remove_stele_new_holder_trigger = { + TITLE = scope:target + PREVIOUS_HOLDER = scope:actor + NEW_HOLDER = scope:recipient + } + } + # Actually removed in fp1_other_decisions.0113 + custom_tooltip = runestone_grant_title_warning + } + else_if = { + limit = { + scope:target = { + exists = var:ancestor_to_bury + has_county_modifier = county_raised_runestone_modifier + } + NOT = { scope:recipient.dynasty = var:ancestor_to_bury.dynasty } #We only have to change something if the new holder is of a different dynasty + } + # Actually removed in religious_decision.0312 + custom_tooltip = runestone_grant_title_warning + } + + if = { + limit = { + exists = scope:actor.dynasty + scope:actor.dynasty = { + has_dynasty_perk = ep1_culture_legacy_3 + } + scope:recipient = { + is_playable_character = no + NOT = { + culture = scope:actor.culture + } + any_in_list = { + list = target_titles + OR = { + tier = tier_county + tier = tier_barony + } + culture = scope:recipient.culture + } + } + } + scope:actor = { + if = { + limit = { + can_add_hook = { + target = scope:recipient + type = favor_hook + } + } + add_hook = { + type = favor_hook + target = scope:recipient + } + } + } + } + + #Feedback for actor + hidden_effect = { + if = { + limit = { + any_in_list = { + list = target_titles + count = 1 + NOT = { tier = scope:actor.highest_held_title_tier } + } + NOT = { exists = scope:recipient_is_independent } + scope:recipient = { + any_held_title = { + tier > tier_barony + NOT = { + is_in_list = target_titles + } + } + } + } + random_in_list = { + list = target_titles + save_temporary_scope_as = loc_title + } + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_titles_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect_2 + if = { + limit = { + exists = dynasty + is_diff_faith_or_culture_trigger = { + CHAR = scope:recipient + STATUS = involved + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = struggle_grant_titles_diff_faith_culture_gives_prestige + + } + } + dynasty = { + add_dynasty_prestige = minor_dynasty_prestige_gain + } + + } + } + } + else_if = { + limit = { + any_in_list = { + list = target_titles + count > 1 + NOT = { tier = scope:actor.highest_held_title_tier } + } + NOT = { exists = scope:recipient_is_independent } + scope:recipient = { + any_held_title = { + tier > tier_barony + NOT = { + is_in_list = target_titles + } + } + } + } + random_in_list = { + list = target_titles + save_temporary_scope_as = loc_title + } + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_titles_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect_3 + } + } + else_if = { + limit = { + exists = scope:recipient_is_independent + } + + random_in_list = { + list = target_titles + save_temporary_scope_as = loc_title + } + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_titles_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect_6 + } + } + else_if = { + limit = { + scope:recipient = { + any_in_list = { #Became independent from you, but still have the same liege + list = target_titles + tier = scope:actor.highest_held_title_tier + } + top_liege = scope:actor.top_liege + } + } + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_titles_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect_5 + } + } + else_if = { + limit = { + scope:recipient = { + any_in_list = { #Became independent + list = target_titles + tier = scope:actor.highest_held_title_tier + } + } + } + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_titles_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect_4 + } + } + else = { + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_titles_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect + } + } + } + } + + hidden_effect = { + # Struggle Catalyst + if = { + limit = { + 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 + } + } + } + } + } + + # Achievements. + scope:actor = { + if = { + limit = { + has_variable_list = candidate_a_knights_tale_achievement + is_target_in_variable_list = { + name = candidate_a_knights_tale_achievement + target = scope:recipient + } + } + set_global_variable = { + name = finished_a_knights_tale_achievement + value = yes + } + } + } + } +} + +#This interaction is referenced in code! If it's renamed you have to ping a coder +grant_title_to_new_random_character_interaction = { + hidden = yes + auto_accept = yes + special_interaction = grant_titles_interaction + use_diplomatic_range = no + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { + this = scope:recipient + } + any_held_title = { + count > 1 + } + } + scope:recipient = { is_busy_in_events_localised = yes } + } +} + +#be aware that the actual granting of the title happens in code! +grant_governorship_interaction = { + icon = grant_governorship + category = interaction_category_vassal + common_interaction = yes + + desc = grant_governorship_interaction_desc + + special_interaction = grant_governorship_interaction + interface = grant_titles + target_type = title + target_filter = actor_domain_titles + interface_priority = 60 + + # actor character giving the titles + # recipient character receiving the titles + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:recipient = { + OR = { + target_is_liege_or_above = scope:actor + is_pool_guest_of = scope:actor + } + } + scope:actor = { + government_allows = administrative + highest_held_title_tier >= tier_county + } + + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + } + scope:recipient = { + NOT = { any_parent = { is_ai = no } } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_adult = yes + NOT = { is_at_war_with = scope:actor } + bp2_valid_for_standard_interactions_trigger = yes + is_busy_in_events_localised = yes + trigger_if = { + limit = { is_ruler = no } + is_imprisoned = no + } + # Only the preferred gender can be appointed unless they hold titles already + trigger_if = { + limit = { + scope:actor = { + OR = { + has_realm_law = male_only_law + has_realm_law = male_preference_law + } + } + is_landed = no + } + is_female = no + } + trigger_if = { + limit = { + scope:actor = { + OR = { + has_realm_law = female_only_law + has_realm_law = female_preference_law + } + } + is_landed = no + } + is_female = yes + } + # DON'T TAKE OTHER PLAYERS' ACCLAIMED KNIGHTS + custom_description = { + text = grant_title_stealing_acclaimed_knight + subject = scope:recipient + NOR = { + AND = { + is_acclaimed = yes + liege ?= { + is_ai = no + NOT = { this = scope:actor } + } + } + AND = { + is_acclaimed = yes + scope:actor = { is_ai = yes } + } + } + } + trigger_if = { + limit = { is_landed = yes } + government_allows = administrative + } + is_clergy = no + # Gallivanters won't accept additional responsibilities. + NOT = { has_trait = gallivanter } + } + } + + can_send = { + scope:recipient = { + custom_tooltip = { + text = promote_candidate_interaction_existing_holder_tt + this != scope:target.holder + } + + trigger_if = { # Governors can only be appointed to certain titles + limit = { + is_governor = yes + scope:target = { is_noble_family_title = no } # For tooltip reasons, so we don't show more than necessary + } + custom_tooltip = { # Only one province of highest rank + text = only_one_province_of_highest_rank_tt + NAND = { + highest_held_title_tier = scope:target.tier + scope:target.tier >= tier_duchy + scope:target = { # We make an exception if recipient controls at least one de jure county + any_de_jure_county = { + count < 1 + OR = { + holder = scope:recipient + holder = { is_vassal_or_below_of = scope:recipient } + } + } + } + } + } + custom_tooltip = { + text = admin_must_be_de_jure_or_neighboring + any_held_title = { + OR = { + # The target title is part of your de jure structure + is_de_jure_liege_or_above_target = scope:target + target_is_de_jure_liege_or_above = scope:target + # Or is a neighboring county which de jure duchy is not part of your realm + AND = { + any_title_to_title_neighboring_county = { this = scope:target } + scope:target = { + tier = tier_county + duchy = { + OR = { + NOT = { exists = holder } + holder = { + NOR = { + is_vassal_or_below_of = scope:actor + this = scope:actor + } + } + } + } + } + } + } + } + } + } + trigger_if = { # If recipient is landless and only have a family title, target title must be a duchy or above + limit = { + is_landless_ruler = yes + any_held_title = { is_noble_family_title = yes } + } + scope:target = { NOT = { tier < tier_duchy } } + } + trigger_if = { # If recipient is a count, they can get only get counties within the same duchy + limit = { highest_held_title_tier = tier_county } + trigger_if = { + limit = { scope:target.tier = tier_county } + custom_tooltip = { + text = admin_count_grant_only_counties + any_held_title = { duchy = scope:target.duchy } + } + } + } + } + } + + can_be_picked_title = { + scope:target = { + is_leased_out = no + + NOT = { tier = tier_barony } + + scope:recipient = { + trigger_if = { # Governors can only be appointed to certain titles + limit = { + is_governor = yes + scope:target = { is_noble_family_title = no } # For tooltip reasons, so we don't show more than necessary + } + custom_tooltip = { # Only one province of highest rank + text = only_one_province_of_highest_rank_tt + NAND = { + highest_held_title_tier = scope:target.tier + scope:target.tier >= tier_duchy + scope:target = { # We make an exception if recipient controls at least one de jure county + any_de_jure_county = { + count < 1 + OR = { + holder = scope:recipient + holder = { is_vassal_or_below_of = scope:recipient } + } + } + } + } + } + custom_tooltip = { + text = admin_must_be_de_jure_or_neighboring + any_held_title = { + OR = { + # The target title is part of your de jure structure + is_de_jure_liege_or_above_target = scope:target + target_is_de_jure_liege_or_above = scope:target + # Or is a neighboring county which de jure duchy is not part of your realm + AND = { + any_title_to_title_neighboring_county = { this = scope:target } + scope:target = { + tier = tier_county + duchy = { + OR = { + NOT = { exists = holder } + holder = { + NOR = { + is_vassal_or_below_of = scope:actor + this = scope:actor + } + } + } + } + } + } + } + } + } + } + trigger_if = { # If recipient is landless and only have a family title, target title must be a duchy or above + limit = { + is_landless_ruler = yes + any_held_title = { is_noble_family_title = yes } + } + scope:target = { NOT = { tier < tier_duchy } } + } + trigger_if = { # If recipient is a count, they can get only get counties within the same duchy + limit = { highest_held_title_tier = tier_county } + trigger_if = { + limit = { scope:target.tier = tier_county } + custom_tooltip = { + text = admin_count_grant_only_counties + any_held_title = { duchy = scope:target.duchy } + } + } + } + } + + custom_tooltip = { + text = GRANT_TITLES_ITEM_CANT_GIVE_ADMIN_PRIMARY + NOT = { + this = scope:actor.capital_province.duchy + } + } + + trigger_if = { + limit = { is_noble_family_title = yes } + custom_tooltip = { + text = GRANT_TITLES_ITEM_CANT_GIVE_NOBLE_FAMILY + always = no + } + } + + trigger_if = { + limit = { + list_size:target_titles > 0 + } + custom_tooltip = { + text = GRANT_TITLES_ITEM_ADMIN_CANT_GIVE_MORE_THAN_ONE + any_in_list = { + list = target_titles + scope:target ?= this + } + } + } + + trigger_if = { + limit = { scope:target = title:k_fashion } + NOT = { scope:target = title:k_fashion } + } + } + + custom_description = { + text = grant_titles_interaction_can_only_give_diarch_de_jure_liege_to_diarch + subject = scope:actor.diarch + NAND = { + # Only applies if we have an active diarchy. + scope:actor = { has_active_diarchy = yes } + # Now, prevent us from giving away our diarch's land to invalidate them... + scope:target = { + any_dejure_vassal_title_holder = { this = scope:actor.diarch } + # ... _unless_ we're giving it _to_ the diarch. + NOT = { scope:recipient = scope:actor.diarch } + # Plus we only care if the title is below our tier. + tier < scope:actor.highest_held_title_tier + } + } + } + + custom_description = { + text = grant_titles_interaction_title_being_wagered + NOT = { + scope:target = { has_variable = wagered_county } + } + } + } + + auto_accept = yes + + on_auto_accept = { + scope:recipient = { + trigger_event = { + id = char_interaction.0111 + delayed = yes #this has to be delayed in case you grant it to someone that doesn't have an estate yet, for the change_government effect to work and generate the estate + } + } + } + + on_accept = { + if = { + limit = { + scope:recipient = { + is_acclaimed = yes + liege = { + this = scope:actor + } + } + } + custom_tooltip = grant_title_landing_acclaimed_knight_warning + } + + if = { + limit = { + any_in_list = { + list = target_titles + tier >= tier_duchy + title_capital_county = { + NOT = { culture = scope:actor.culture } + culture = scope:recipient.culture + } + NOT = { + recent_history = { + type = granted + years = 10 + } + } + } + } + scope:recipient.culture = { + change_cultural_acceptance = { + target = scope:actor.culture + value = grant_title_cultural_acceptance_impact + desc = cultural_acceptance_gain_granted_title + } + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier >= tier_county + } + scope:actor.culture = { has_cultural_parameter = landing_house_members_give_prestige } + exists = scope:actor.house + exists = scope:recipient.house + scope:actor.house = scope:recipient.house + } + scope:actor = { + add_prestige = { + value = 0 + every_in_list = { + list = target_titles + limit = { tier = tier_empire } + add = massive_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_kingdom } + add = major_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_duchy } + add = medium_prestige_gain + } + } + } + } + if = { + limit = { + any_in_list = { + list = target_titles + tier >= tier_county + } + scope:actor.culture = { has_cultural_parameter = landing_house_members_gives_renown } + exists = scope:actor.house + exists = scope:recipient.house + scope:actor.house = scope:recipient.house + } + scope:actor.dynasty = { + add_dynasty_prestige = { + value = 0 + every_in_list = { + list = target_titles + limit = { tier = tier_kingdom } + add = major_dynasty_prestige_gain + } + every_in_list = { + list = target_titles + limit = { tier = tier_duchy } + add = medium_dynasty_prestige_gain + } + } + } + } + + # Iterate over all given titles + # - Add opinion modifiers + # - Collect titles that discontent reduction can later be derived from + every_in_list = { + list = target_titles + save_temporary_scope_as = this_title + if = { + limit = { + exists = scope:landed_title + } + scope:recipient = { + if = { + limit = { + scope:this_title.tier = tier_duchy + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_duchy + } + if = { + limit = { + is_lowborn = yes + } + scope:actor = { + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -10 #less than usual because admin realms are more tolerant of bureaucratic "new" nobility + } + } + } + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + + else_if = { + limit = { + scope:this_title.tier = tier_kingdom + } + + hidden_effect = { + add_opinion = { + target = scope:actor + modifier = received_title_kingdom + } + if = { + limit = { + is_lowborn = yes + } + scope:actor = { + every_vassal = { + limit = { + has_vassal_stance = courtly + } + add_opinion = { + target = scope:actor + modifier = courtly_lowborn_grant_opinion + opinion = -30 #less than usual because admin realms are more tolerant of bureaucratic "new" nobility + } + } + } + } + } + + scope:this_title = { add_to_temporary_list = titles_to_grant } + } + } + + #Promised a vassal this title they had a claim on (vassal.2901) + if = { + limit = { + scope:actor = { + exists = var:was_promised_title + var:was_promised_title = scope:recipient + } + } + if = { + limit = { + scope:recipient = { + exists = var:promised_title + } + scope:landed_title = scope:recipient.var:promised_title + } + scope:actor = { + trigger_event = { + id = vassal.2910 + days = { 7 14 } + } + } + } + } + } + if = { + limit = { + scope:recipient = { + has_trait = bastard + } + } + custom_tooltip = grant_title_to_bastard_dynasty_warning + } + } # every_in_list + + # The accumulated discontent reduction of the recipient + scope:recipient = { + if = { + limit = { + is_a_faction_member = yes + } + add_joined_faction_discontent = grant_title_opinion_sum_discontent_calc + } + } + + if = { + limit = { + any_in_list = { + list = target_titles + tier = tier_kingdom + } + } + custom_tooltip = grant_title_modifier_stack_kingdoms + } + if = { + limit = { + any_in_list = { + list = titles_to_grant + tier = tier_duchy + } + } + custom_tooltip = grant_title_modifier_stack_duchies + } + if = { + limit = { + trigger_if = { + limit = { scope:actor = { is_ai = yes } } + scope:actor = { + any_vassal = { + has_vassal_stance = courtly + } + } + } + scope:recipient = { + is_lowborn = yes + } + any_in_list = { + list = titles_to_grant + tier >= tier_county + } + } + custom_tooltip = grant_title_modifier_courtly_lowborn_grant_penalty + } + if = { + limit = { + scope:recipient = { is_a_faction_member = yes } + } + custom_tooltip = grant_title_modifier_stack_discontent + } + + # Jealousy check + if = { + limit = { + any_in_list = { + list = titles_to_grant + any_claimant = { grant_title_rivalry_trigger = yes } + } + } + hidden_effect = { + random = { + chance = 25 + ordered_in_list = { + list = titles_to_grant + limit = { + any_claimant = { grant_title_rivalry_trigger = yes } + } + order_by = tier + save_scope_as = claim_title + ordered_claimant = { + limit = { grant_title_rivalry_trigger = yes } + order_by = primary_title.tier + save_scope_as = claim_vassal + if = { + limit = { + scope:recipient = { is_lowborn = yes } + } + scope:recipient = { save_scope_as = lowborn_scope } + } + else_if = { + limit = { + scope:recipient = { has_claim_on = scope:claim_title } + } + scope:recipient = { save_scope_as = claimant_scope } + } + scope:actor = { + trigger_event = { + id = bp1_yearly.8070 + days = 5 + } + } + } + } + } + } + } + + scope:actor = { + # Maintenance for runestones + if = { + limit = { + # Use expanded version if we have FP1. + has_fp1_dlc_trigger = yes + fp1_remove_stele_new_holder_trigger = { + TITLE = scope:target + PREVIOUS_HOLDER = scope:actor + NEW_HOLDER = scope:recipient + } + } + # Actually removed in fp1_other_decisions.0113 + custom_tooltip = runestone_grant_title_warning + } + else_if = { + limit = { + scope:target = { + exists = var:ancestor_to_bury + has_county_modifier = county_raised_runestone_modifier + } + NOT = { scope:recipient.dynasty = var:ancestor_to_bury.dynasty } #We only have to change something if the new holder is of a different dynasty + } + # Actually removed in religious_decision.0312 + custom_tooltip = runestone_grant_title_warning + } + + if = { + limit = { + dynasty ?= { has_dynasty_perk = ep1_culture_legacy_3 } + scope:recipient = { + is_playable_character = no + NOT = { culture = scope:actor.culture } + any_in_list = { + list = target_titles + OR = { + tier = tier_county + tier = tier_barony + } + culture = scope:recipient.culture + } + } + } + if = { + limit = { + can_add_hook = { + target = scope:recipient + type = favor_hook + } + } + add_hook = { + type = favor_hook + target = scope:recipient + } + } + } + + #Feedback for actor + hidden_effect = { + if = { + limit = { + NOT = { exists = scope:recipient_is_independent } + scope:recipient = { + any_held_title = { + tier > tier_barony + NOT = { is_in_list = target_titles } + } + } + } + set_variable = { + name = lower_count + value = { + value = -1 + every_in_list = { + list = target_titles + limit = { + NOT = { tier = scope:actor.highest_held_title_tier } + } + add = 1 + } + } + } + save_scope_value_as = { + name = equal_count + value = { + value = 0 + every_in_list = { + list = target_titles + limit = { tier = scope:actor.highest_held_title_tier } + add = 1 + } + } + } + ordered_in_list = { + list = target_titles + order_by = tier + save_temporary_scope_as = loc_title + } + send_interface_toast = { + type = event_toast_effect_neutral + title = grant_governorship_interaction_notification + left_icon = scope:recipient + right_icon = scope:loc_title + if = { + limit = { scope:actor.var:lower_count ?= 0 } + custom_tooltip = grant_governorship_interaction_notification_effect_2 + } + else_if = { + limit = { + exists = scope:actor.var:lower_count + scope:actor.var:lower_count > 1 + } + custom_tooltip = grant_governorship_interaction_notification_effect_3 + } + else_if = { + limit = { scope:actor.var:lower_count ?= 1 } + custom_tooltip = grant_governorship_interaction_notification_effect_4 + } + else_if = { + limit = { + scope:equal_count >= 1 + scope:recipient.top_liege ?= scope:actor.top_liege + } + custom_tooltip = grant_titles_interaction_notification_effect_5 + } + else = { custom_tooltip = grant_titles_interaction_notification_effect } + if = { + limit = { + exists = dynasty + is_diff_faith_or_culture_trigger = { + CHAR = scope:recipient + STATUS = involved + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = struggle_grant_titles_diff_faith_culture_gives_prestige + } + } + dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain } + } + remove_variable = lower_count + } + } + } + } + + hidden_effect = { + # Struggle Catalyst + if = { + limit = { + 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 + } + } + } + } + } + + # Achievements. + scope:actor = { + if = { + limit = { + has_variable_list = candidate_a_knights_tale_achievement + is_target_in_variable_list = { + name = candidate_a_knights_tale_achievement + target = scope:recipient + } + } + set_global_variable = { + name = finished_a_knights_tale_achievement + value = yes + } + } + } + } + + ai_will_do = { + base = 0 + + modifier = { + scope:recipient.house ?= scope:actor.house + add = 100 + } + modifier = { + scope:recipient = { + is_close_family_of = scope:actor + } + add = 100 + } + } +} diff --git a/common/character_interactions/00_heir.txt b/common/character_interactions/00_heir.txt new file mode 100644 index 00000000..57edd933 --- /dev/null +++ b/common/character_interactions/00_heir.txt @@ -0,0 +1,190 @@ + + + + +# Set one of your children as heir +#This interaction is referenced in code! If it's renamed you have to ping a coder +designate_heir_interaction = { + icon = heir + + category = interaction_category_diplomacy + + desc = designate_heir_interaction_desc + + is_shown = { + trigger_if = { + limit = { # Admin always has access to this - Recipient just need to be their child + scope:actor = { + government_allows = administrative + any_held_title = { + is_noble_family_title = yes + } + } + } + scope:recipient = { + is_child_of = scope:actor + } + } + trigger_else = { # Everyone else also needs to gain access to this interaction + scope:recipient = { + is_child_of = scope:actor + } + scope:actor = { + can_designate_heir_trigger = yes + } + } + NOR = { + scope:recipient = scope:actor.designated_heir + scope:recipient = scope:actor + } + trigger_if = { + limit = { + scope:actor = { NOT = { primary_title = title:e_byzantium } } + } + custom_description = { + text = "dynasty_member_leads_election" + scope:actor = { + NAND = { + primary_title = { + has_title_law_flag = elective_succession_law + } + dynasty = primary_heir.dynasty + } + } + } + } + } + + cost = { + prestige = { + value = { + add = { + if = { + limit = { + scope:actor = { + government_allows = administrative + any_held_title = { + is_noble_family_title = yes + } + } + } + value = designate_heir_admin_prestige_cost + } + else = { + value = designate_heir_cost + } + desc = BASE + } + if = { + limit = { + scope:actor = { + government_has_flag = government_is_landless_adventurer + } + } + multiply = { + value = 0 + desc = "[adventurer|E]" + } + } + } + } + influence = { + value = { + add = 0 + if = { + limit = { + scope:actor = { + government_allows = administrative + any_held_title = { + is_noble_family_title = yes + } + } + } + add = { + value = designate_heir_admin_influence_cost + desc = "[administrative_government|E]" + } + } + } + } + } + + is_valid_showing_failures_only = { + trigger_if = { + limit = { exists = scope:recipient } + scope:recipient = { + is_busy_in_events_localised = yes + is_eunuch_trigger = no + NOR = { + has_trait = disinherited + has_trait = devoted + has_trait = order_member + has_trait = bastard + } + } + } + scope:actor = { + trigger_if = { + limit = { + government_allows = administrative + any_held_title = { + is_noble_family_title = yes + } + } + prestige >= designate_heir_admin_prestige_cost + influence >= designate_heir_admin_influence_cost + + custom_tooltip = { + text = valid_co_emperor_candidate_liege_trigger + scope:recipient.top_liege = scope:actor.top_liege + } + } + trigger_else_if = { + limit = { + NOT = { government_has_flag = government_is_landless_adventurer } + } + prestige >= designate_heir_cost + } + trigger_else = {} + } + trigger_if = { + limit = { + scope:actor = { + government_has_flag = government_is_landless_adventurer + } + exists = scope:recipient + } + scope:recipient = { + is_adult = yes + } + } + custom_tooltip = { + text = designate_heir_interaction.tt.currently_coruling + scope:actor = { + NOT = { has_diarchy_active_parameter = diarchy_is_co_rulership } + } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0120 + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = designate_heir_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + set_designated_heir = scope:recipient + } + } + } + + auto_accept = yes +} diff --git a/common/character_interactions/00_house_head_interactions.txt b/common/character_interactions/00_house_head_interactions.txt new file mode 100644 index 00000000..da23c48a --- /dev/null +++ b/common/character_interactions/00_house_head_interactions.txt @@ -0,0 +1,1092 @@ +#Interactions relating to the head of the house + +call_house_member_to_war_interaction = { + category = interaction_category_diplomacy + icon = alliance + + + interface_priority = 60 + + desc = call_house_member_to_war_interaction_desc + + interface = call_ally + special_interaction = call_ally_interaction + popup_on_receive = yes + pause_on_receive = yes + + notification_text = CALL_HOUSE_MEMBER_NOTIFICATION + + is_shown = { + NOT = { scope:recipient = scope:actor } + + scope:actor = { + OR = { + is_house_head = yes + AND = { + exists = dynasty + # DLC checking + has_fp2_dlc_trigger = yes + # Standard check + dynasty = { has_dynasty_perk = fp2_coterie_legacy_3 } + } + } + religion = scope:recipient.religion + house = scope:recipient.house + any_character_war = { + is_war_leader = scope:actor + } + } + + scope:recipient = { + is_playable_character = yes + } + + scope:recipient = { + NOT = { + target_is_liege_or_above = scope:actor + } + } + } + + has_valid_target = { + exists = scope:target + } + + has_valid_target_showing_failures_only = { + scope:target = { + is_war_leader = scope:actor + } + joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { + WARRIOR = scope:actor + JOINER = scope:recipient + } + } + + is_valid_showing_failures_only = { + custom_description = { + text = "is_already_in_all_wars" + scope:actor = { + any_character_war = { + NOR = { + is_participant = scope:recipient + was_called = scope:recipient + } + OR = { + primary_attacker = scope:actor + primary_defender = scope:actor + } + } + } + } + } + + can_be_picked = { + can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = call_ally.0001 + } + } + + on_accept = { + call_house_member_to_war_interaction_effect = yes + + save_scope_value_as = { + name = call_house_member_to_war_interaction + value = yes + } + + if = { + limit = { + exists = scope:target + } + + scope:actor = { + trigger_event = call_ally.0100 + } + } + + scope:actor = { + if = { + limit = { NOT = { is_house_head = yes } } + add_prestige = medium_prestige_loss + } + } + + # If the Dynasty has the Unity Legacy perk, the recipient is rewarded with some Prestige + if = { + limit = { scope:actor.dynasty = { has_dynasty_perk = fp2_coterie_legacy_3 } } + scope:recipient = { add_prestige = medium_prestige_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 + } + } + } + else = { + scope:actor = { + add_opinion = { + modifier = rejected_call_to_defensive_war + target = 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 + } + } + + ai_accept = { + base = 20 + + 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 + } + + 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 + } + + 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 + NOT = { 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 = { # Happy to gain Prestige thanks to the Unity perk + add = 50 + dynasty = { has_dynasty_perk = fp2_coterie_legacy_3 } + desc = "UNITY_PERK_BONUS" + } + + fp3_struggle_resist_allied_wars_modifier = yes + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = 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 +} + + +#Head legitimizes child or actor requests from head to legitimize +legitimize_bastard_interaction = { + category = interaction_category_diplomacy + special_interaction = legitimize_bastard + icon = legitimized_bastard + + greeting = positive + notification_text = ASK_TO_legitimize_bastard_interaction + + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:actor.house.house_head = scope:actor } + desc = legitimize_bastard_interaction_desc_house_head + } + desc = legitimize_bastard_interaction_desc_not_house_head + } + } + + is_shown = { + scope:actor.house.house_head.faith = { + has_doctrine_parameter = bastards_legitimize + } + scope:actor.faith = { + has_doctrine_parameter = bastards_legitimize + } + scope:secondary_recipient = { + faith = { + has_doctrine_parameter = bastards_legitimize + } + has_trait = bastard + OR = { + father = scope:actor + mother = scope:actor + scope:actor.house.house_head = scope:actor + } + OR = { + house = scope:actor.house + AND = { + OR = { + father.house = scope:actor.house + mother.house = scope:actor.house + } + has_dynasty = no + } + } + } + scope:actor = { + is_lowborn = no + is_concubine = no + } + scope:recipient = { is_busy_in_events_localised = yes } + } + + is_valid_showing_failures_only = { + + } + + cost = { + prestige = { + value = bastard_legitimization_prestige_cost + } + } + + ai_accept = { + base = -50 + + modifier = { + trigger = { + NOT = { scope:actor = scope:actor.house.house_head } + } + add = { + value = scope:actor.prestige_level + multiply = 20 + } + desc = PRESTIGOUS_IN_OUR_HOUSE + } + + modifier = { + trigger = { + always = scope:hook + } + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + + opinion_modifier = { + trigger = { + NOT = { scope:actor = scope:actor.house.house_head } + } + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + } + + opinion_modifier = { + trigger = { + NOT = { scope:actor = scope:actor.house.house_head } + } + who = scope:recipient + opinion_target = scope:secondary_recipient + multiplier = 0.25 + } + + 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_decreasing_house_unity = { + VALUE = 100 + } + } + + auto_accept = { + OR = { + scope:actor = scope:actor.house.house_head + AND = { + always = scope:hook + scope:actor = { has_strong_hook = scope:recipient } + } + } + } + + on_accept = { + scope:actor = { + stress_impact = { + arrogant = minor_stress_impact_gain + } + + legitimize_bastard_interaction_opinions_effect = { + BASTARD = scope:secondary_recipient + HOUSE_HEAD = scope:actor.house.house_head + LEGITIMIZER = scope:actor + } + + if = { + limit = { always = scope:hook } + 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:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_bastardry.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = legitimize_bastard_interaction_decline_notification + + left_icon = scope:actor.house.house_head + right_icon = scope:secondary_recipient + } + } + + # 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_bastardry_refusal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + send_option = { + is_shown = { + NOT = { scope:actor = scope:recipient } + } + 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 +} + +accuse_of_decandence_interaction = { + icon = antagonistic + category = interaction_category_clan + interface_priority = 60 + common_interaction = yes + + cooldown = { years = 3 } + + desc = accuse_of_decandence_interaction_desc + + is_shown = { + scope:actor = { government_has_flag = government_is_clan } + NOT = { scope:recipient = scope:actor } + scope:actor.house.house_head ?= scope:actor + scope:recipient.house ?= scope:actor.house + scope:recipient = { + NOT = { + has_trait = decadent + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_adult = yes } + 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 } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0041 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + forgiving = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + send_interface_toast = { + type = event_toast_effect_neutral + title = accuse_of_decandence_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + add_stress = major_stress_gain + if = { + limit = { + has_trait = extolled + } + remove_trait = extolled + } + else = { + add_trait = decadent + } + add_opinion = { + modifier = accused_of_decadence_opinion + target = scope:actor + } + } + } + } + + # 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_decadence.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + cost = { + piety = { + value = { + add = minor_piety_value + if = { + limit = { + scope:recipient = { + num_virtuous_traits > 0 + } + } + add = { + value = minor_piety_value + multiply = scope:recipient.num_virtuous_traits + } + } + if = { + limit = { + scope:recipient = { + num_sinful_traits > 0 + } + } + add = { + value = minor_piety_value + multiply = 0.5 + multiply = scope:recipient.num_sinful_traits + min = 10 + } + } + } + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + government_has_flag = government_is_clan + house.house_head ?= this + is_adult = yes + NOT = { + has_trait = forgiving + } + } + + ai_targets = { + ai_recipients = dynasty + max = 30 + } + + ai_targets = { + ai_recipients = vassals + } + + ai_frequency = 36 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + modifier = { + add = 50 + scope:actor = { + ai_wants_low_unity = yes + NOT = { house ?= { has_house_unity_stage = antagonistic } } + } + scope:recipient = { + num_sinful_traits >= 1 + } + } + + modifier = { + add = 100 + scope:actor = { + ai_wants_low_unity = yes + NOT = { house ?= { has_house_unity_stage = antagonistic } } + } + scope:recipient = { + num_sinful_traits >= 2 + } + } + + modifier = { + add = 20 + scope:actor = { + ai_wants_low_unity = yes + NOT = { house ?= { has_house_unity_stage = antagonistic } } + } + scope:recipient = { + number_of_opposing_personality_traits = { + target = scope:actor + value >= 1 + } + } + } + + modifier = { + add = 100 + scope:actor = { + ai_wants_low_unity = yes + NOT = { house ?= { has_house_unity_stage = antagonistic } } + } + scope:recipient = { + number_of_opposing_personality_traits = { + target = scope:actor + value >= 2 + } + } + } + + modifier = { + add = 50 + scope:actor = { + ai_wants_low_unity = yes + NOT = { house ?= { has_house_unity_stage = antagonistic } } + } + OR = { + AND = { + scope:recipient = { + has_trait = incestuous + } + NOT = { is_incestuous_trigger = yes } + trait_is_criminal_in_faith_trigger = { TRAIT = incestuous FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = kinslayer + } + NOT = { has_trait = kinslayer } + } + AND = { + scope:recipient = { + has_trait = adulterer + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = adulterer FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = fornicator + } + NOR = { + has_trait = adulterer + has_trait = fornicator + } + trait_is_criminal_in_faith_trigger = { TRAIT = fornicator FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = deviant + } + NOT = { + is_deviant_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = witch + } + NOT = { + is_witch_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = sodomite + } + NOR = { + has_trait = sodomite + any_secret = { + secret_type = secret_homosexual + } + } + trait_is_criminal_in_faith_trigger = { TRAIT = sodomite FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + AND = { + scope:recipient = { + has_trait = cannibal + } + NOT = { + is_cannibal_trigger = yes + } + trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = scope:actor.faith GENDER_CHARACTER = scope:recipient } + } + } + } + + modifier = { + factor = 0.25 + scope:recipient = { + is_powerful_vassal_of = scope:actor + } + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + + modifier = { + factor = 0 + scope:recipient = { + is_primary_heir_of = scope:actor + } + } + } +} + +extoll_virtuousness_interaction = { + icon = unity_harmonious + category = interaction_category_clan + interface_priority = 60 + common_interaction = yes + + cooldown = { years = 3 } + + desc = extoll_virtuousness_interaction_desc + + is_shown = { + scope:actor = { government_has_flag = government_is_clan } + NOT = { scope:recipient = scope:actor } + scope:actor.house.house_head ?= scope:actor + scope:recipient.house ?= scope:actor.house + scope:recipient = { + NOT = { + has_trait = extolled + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_adult = yes } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0042 + } + } + + on_accept = { + scope:actor = { + stress_impact = { + sadistic = minor_stress_impact_gain + callous = minor_stress_impact_gain + } + send_interface_toast = { + type = event_toast_effect_neutral + title = extoll_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + if = { + limit = { + has_trait = decadent + } + remove_trait = decadent + } + else = { + add_trait = extolled + } + add_opinion = { + modifier = extolled_virtue_opinion + target = scope:actor + } + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = major_unity_gain + DESC = clan_unity_extolled.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + cost = { + piety = { + value = { + add = medium_piety_value + if = { + limit = { + scope:recipient = { + num_sinful_traits > 0 + } + } + add = { + value = medium_piety_value + multiply = scope:recipient.num_sinful_traits + } + } + if = { + limit = { + scope:recipient = { + num_virtuous_traits > 0 + } + } + add = { + value = medium_piety_value + multiply = 0.5 + multiply = scope:recipient.num_virtuous_traits + min = 10 + } + } + } + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = no + government_has_flag = government_is_clan + house.house_head ?= this + is_adult = yes + NOT = { + has_trait = paranoid + } + } + + ai_targets = { + ai_recipients = dynasty + max = 30 + } + + ai_targets = { + ai_recipients = vassals + } + + ai_frequency = 36 + + ai_will_do = { + base = 0 + + modifier = { + add = 100 + scope:actor = { + NOT = { ai_wants_low_unity = yes } + } + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + is_primary_heir_of = scope:actor + } + } + } + + modifier = { + add = 50 + scope:actor = { + ai_wants_high_unity = yes + NOT = { house ?= { has_house_unity_stage = harmonious } } + } + scope:recipient = { + num_virtuous_traits >= 1 + } + } + + modifier = { + add = 100 + scope:actor = { + ai_wants_high_unity = yes + NOT = { house ?= { has_house_unity_stage = harmonious } } + } + scope:recipient = { + num_virtuous_traits >= 2 + } + } + + modifier = { + add = 20 + scope:actor = { + ai_wants_high_unity = yes + NOT = { house ?= { has_house_unity_stage = harmonious } } + } + scope:recipient = { + number_of_personality_traits_in_common = { + target = scope:actor + value >= 1 + } + } + } + + modifier = { + add = 100 + scope:actor = { + ai_wants_high_unity = yes + NOT = { house ?= { has_house_unity_stage = harmonious } } + } + scope:recipient = { + number_of_personality_traits_in_common = { + target = scope:actor + value >= 2 + } + } + } + + modifier = { + factor = 1.5 + scope:recipient = { + is_vassal_of = scope:actor + } + } + + modifier = { + factor = 0 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + } +} diff --git a/common/character_interactions/00_invite_agent_to_scheme.txt b/common/character_interactions/00_invite_agent_to_scheme.txt new file mode 100644 index 00000000..cedb987d --- /dev/null +++ b/common/character_interactions/00_invite_agent_to_scheme.txt @@ -0,0 +1,683 @@ + +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: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 + } + } + 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: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 + } + } + custom_tooltip = offer_bribes.tt.window_jump_fix + } + # 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_vassal_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 } + } + } + # 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: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 + } + ## 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 } + 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 = { + NOT = { vassal_contract_has_flag = can_demand_council_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. + NOT = { 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. + NOT = { 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 = { count >= 1 } + } + 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 + } + # Cofaithists + ## Piety + send_option = { + flag = piety + is_shown = { + ## 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 + NOT = { + scope:recipient = { has_trait = cynical } + } + 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_invite_to_activity.txt b/common/character_interactions/00_invite_to_activity.txt new file mode 100644 index 00000000..ea6e1f09 --- /dev/null +++ b/common/character_interactions/00_invite_to_activity.txt @@ -0,0 +1,83 @@ +invite_to_activity_interaction = { + category = interaction_category_diplomacy + greeting = positive + notification_text = invite_to_activity_flavor + reply_item_key = invite_to_activity_reply_item_key + icon = activity_feast + common_interaction = yes + desc = invite_to_activity_interaction_desc + + ai_maybe = yes + can_send_despite_rejection = yes + + is_highlighted = { + always = yes + } + + is_shown = { + exists = scope:actor.involved_activity + scope:actor = scope:actor.involved_activity.activity_host + scope:actor.involved_activity = { + is_current_phase_active = no + OR = { + has_activity_type = activity_tournament + has_activity_type = activity_wedding + has_activity_type = activity_feast + has_activity_type = activity_hunt + has_activity_type = activity_chariot_race + } + } + scope:recipient = { can_join_activity = scope:actor.involved_activity } + } + + on_send = { + scope:recipient = { + invite_to_activity = scope:actor.involved_activity + } + } + + on_accept = { + # Acceptance handled by the activity system itself + scope:actor = { + send_interface_message = { + type = event_activity_good_with_text + title = invite_to_activity_accepted + desc = invite_to_activity_accepted_desc + left_icon = scope:actor + right_icon = scope:recipient + scope:recipient = { + accept_activity_invite = scope:actor.involved_activity + } + } + } + } + + on_decline = { + # Acceptance handled by the activity system itself + scope:actor = { + send_interface_message = { + type = event_activity_bad_with_text + title = invite_to_activity_refused + desc = invite_to_activity_refused_desc + left_icon = scope:actor + right_icon = scope:recipient + scope:recipient = { + decline_activity_invite = scope:actor.involved_activity + } + } + } + } + + ai_accept = { + base = 0 + + ## You should not add modifiers here! They won't show up in the UI + # If you want to add modifiers, they should be added to base_activity_modifier in 00_activity_scripted_modifiers.txt + # Any new activity should use base_activity_modifier = yes in their activity to get these default modifiers + + activity_modifier = { + object = scope:actor.involved_activity + target = scope:recipient + } + } +} diff --git a/common/character_interactions/00_lease_interactions.txt b/common/character_interactions/00_lease_interactions.txt new file mode 100644 index 00000000..2f60beb6 --- /dev/null +++ b/common/character_interactions/00_lease_interactions.txt @@ -0,0 +1,79 @@ +revoke_leased_title_interaction = { + category = interaction_category_uncategorized + hidden = yes + + desc = revoke_leased_title_interaction_desc + + target_type = title + target_filter = recipient_lessee_titles + + auto_accept = yes + + is_shown = { + scope:actor = { + any_sub_realm_barony = { + barony_is_valid_for_holy_order_lease_cancellation_trigger = yes + lessee ?= scope:recipient + } + } + } + + #is_valid = { + # scope:actor = { + # piety >= holy_order_revoke_lease_piety_cost + # } + #} + + has_valid_target_showing_failures_only = { + NOT = { scope:actor = { is_at_war_with = scope:recipient } } + #scope:target = { + # NOT = { + # recent_history = { + # type = leased_out + # years = 1 + # } + # } + #} + scope:target = { + has_revokable_lease = yes + lessee = scope:recipient + OR = { + county.holder = { is_ai = yes } + county.holder = scope:actor + } + } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + } + + on_accept = { + revoke_holy_order_lease_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + BARONY = scope:target + } + } + + # AI + ai_targets = { + ai_recipients = vassals + } + ai_frequency = 12 + + ai_potential = { + is_playable_character = yes + highest_held_title_tier > tier_barony + } + + ai_will_do = { + base = 0 + + # revoke titles leased to holy orders of the wrong faith + modifier = { + add = 100 + scope:recipient = { + government_has_flag = government_is_holy_order + NOT = { faith = scope:actor.faith } + } + } + } +} diff --git a/common/character_interactions/00_lover_interactions.txt b/common/character_interactions/00_lover_interactions.txt new file mode 100644 index 00000000..4791191e --- /dev/null +++ b/common/character_interactions/00_lover_interactions.txt @@ -0,0 +1,47 @@ +#Break up with your Lover +break_up_with_lover_interaction = { + category = interaction_category_hostile + use_diplomatic_range = no + icon = lover + + desc = break_up_with_lover_interaction_desc + + is_shown = { + scope:actor = { + has_relation_lover = scope:recipient + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + } + + on_accept = { + scope:actor = { + send_interface_message = { + type = event_sway_neutral + title = break_up_with_lover_interaction_notification + right_icon = scope:recipient + lover_breakup_effect = { + BREAKER = scope:actor + LOVER = scope:recipient + } + stress_impact = { + lustful = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_dramatic_breakup.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes +} diff --git a/common/character_interactions/00_marriage_interactions.txt b/common/character_interactions/00_marriage_interactions.txt new file mode 100644 index 00000000..20d84dfa --- /dev/null +++ b/common/character_interactions/00_marriage_interactions.txt @@ -0,0 +1,5295 @@ + + +### +# SPECIAL NOTE +# +# When evaluating whether or not the AI can send this interaction to the +# player, the AI will use the ai_accept value and send a proposal to the +# player IF AND ONLY IF the player, as an AI actor, would have positive +# ai_accept value. This is a special case for this specific interaction, +# and is being calculated specifically in code. +# +arrange_marriage_interaction = { + icon = icon_marriage + category = interaction_category_diplomacy + common_interaction = yes + + override_background = { reference = relaxing_room } + + special_interaction = arrange_marriage_interaction + interface = marriage + use_diplomatic_range = { + trigger_if = { + limit = { exists = scope:secondary_actor.betrothed } + NOT = { + scope:secondary_actor = { + betrothed = scope:secondary_recipient + } + } + } + } + + recipient_recieve_cooldown = { + years = marriage_recieve_proposal_cooldown + } + + ignore_recipient_recieve_cooldown = { + AND = { + is_ai = no + scope:recipient = { is_ai = no } + } + } + + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:actor = scope:recipient + } + desc = arrange_marriage_interaction_desc_ruler_at_own_court + } + triggered_desc = { + trigger = { + scope:actor = { + can_marry_character_trigger = { + CHARACTER = scope:recipient + } + } + scope:recipient = { is_ruler = yes } + } + desc = arrange_marriage_interaction_desc_both_rulers_can_marry + } + triggered_desc = { + trigger = { + scope:recipient = { + is_ruler = yes + can_marry_trigger = yes + } + } + desc = arrange_marriage_interaction_desc_both_rulers_recipient_only_can_marry + } + triggered_desc = { + trigger = { + scope:recipient = { + is_ruler = yes + } + } + desc = arrange_marriage_interaction_desc_both_rulers_recipient_neither_can_marry + } + triggered_desc = { + trigger = { + scope:actor = { + can_marry_character_trigger = { + CHARACTER = scope:recipient + } + } + } + desc = arrange_marriage_interaction_desc_one_ruler_can_marry + } + desc = arrange_marriage_interaction_desc_recipient_one_ruler_cannot_marry + } + } + + redirect = { + # If the define MARRIAGE_OWNER_IS_MATCHMAKER is set to yes, the actor must end up as the "matchmaker" link for courtiers + scope:actor = { + if = { + limit = { + exists = matchmaker + NOT = { this = matchmaker } + } + save_scope_as = secondary_actor + matchmaker = { + save_scope_as = actor + } + } + if = { + limit = { + is_betrothed = yes + betrothed = scope:recipient + } + + save_scope_as = secondary_actor + } + } + + scope:recipient = { + if = { + limit = { + is_betrothed = yes + betrothed.matchmaker = scope:actor + is_adult = yes + betrothed = { + is_adult = yes + } + } + + save_scope_as = secondary_recipient + matchmaker = { + save_scope_as = recipient + } + betrothed = { + save_scope_as = secondary_actor + } + } + if = { + limit = { + exists = matchmaker + NOT = { this = matchmaker } + } + save_scope_as = secondary_recipient + matchmaker = { + save_scope_as = recipient + } + } + } + } + + populate_actor_list = { + scope:actor = { + add_to_list = characters + every_courtier = { + limit = { + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_courtier_away = { + limit = { + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_child = { + even_if_dead = yes + if = { + limit = { + is_alive = yes + NOT = { is_in_list = characters } + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_child = { + even_if_dead = yes + if = { + limit = { + is_alive = yes + NOT = { is_in_list = characters } + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_child = { + if = { + limit = { + is_alive = yes + NOT = { is_in_list = characters } + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + } + } + } + } + } + + populate_recipient_list = { + scope:recipient = { + add_to_list = characters + every_courtier = { + add_to_list = characters + } + every_courtier_away = { + add_to_list = characters + } + every_child = { + limit = { + NOT = { is_in_list = characters } + } + add_to_list = characters + } + } + } + + interface_priority = 60 + + cost = { + prestige = { + value = 0 + if = { + limit = { + exists = scope:actor + exists = scope:recipient + exists = scope:secondary_recipient + exists = scope:secondary_actor + scope:secondary_actor = { is_close_family_of = scope:actor } + scope:recipient = { + OR = { + AND = { + vassal_contract_has_flag = vassal_contract_marriage_favor + is_allied_to = scope:actor + } + NOT = { vassal_contract_has_flag = vassal_contract_marriage_favor} + } + } + } + add = { + scope:actor = { + every_vassal = { + limit = { + vassal_contract_has_flag = vassal_contract_marriage_favor + NOT = { is_allied_to = scope:actor } + NOR = { + this = scope:recipient + this = scope:secondary_recipient + } + } + add = medium_prestige_value + } + } + desc = VASSAL_WITH_MARRIAGE_FAVOR + } + } + } + + piety = { + value = 0 + if = { + limit = { scope:piety_cost_reduction = yes } + add = scope:actor.medium_piety_value + desc = STRUGGLE_MARRIAGE_ACCEPTANCE_USING_PIETY_AS_CURRENCY + } + } + + influence = { + value = 0 + if = { + limit = { scope:influence_send_option = yes } + add = scope:actor.medium_influence_value + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + } + + # actor, recipient ... characters arranging the marriage + # secondary_actor, secondary_recipient ... characters that should marry + + is_shown = { + scope:actor = { + OR = { + is_ruler = yes #Can arrange marriages for others + #You're just a courtier? Only use the interaction on characters you can marry + can_marry_character_trigger = { CHARACTER = scope:recipient } + } + } + # Block further marriage proposals for people who have a pending grand wedding + NOR = { + scope:secondary_actor ?= { has_been_promised_grand_wedding = yes } + scope:secondary_recipient ?= { has_been_promised_grand_wedding = yes } + } + #If you're interacting with someone who isn't their own matchmaker, only show the interaction if they can get married. (If someone isn't their own matchmaker, they will be set as secondary_recipient by code and their matchmaker becomes recipient) + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { + OR = { + marriage_interaction_can_be_picked_trigger = yes #Can marry anyone + AND = { + ready_to_marry_betrothed_trigger = yes + OR = { + betrothed = scope:secondary_actor + trigger_if = { + limit = { exists = betrothed.liege } + betrothed.liege = scope:actor + } + } + } + } + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + } + #allow landless adventurers to marry only within their camp, or with Contact list courtiers (after using request_marriage option in contact_list_request_interaction), or prieviously betrothed characters + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + trigger_if = { + limit = { + OR = { + scope:actor = { + is_target_in_variable_list = { + name = contact_list_marriage + target = scope:recipient + } + } + scope:recipient = { + is_betrothed = yes + betrothed = { + OR = { + scope:actor = this + scope:secondary_actor ?= this + } + } + } + scope:secondary_recipient ?= { + is_betrothed = yes + betrothed = { + OR = { + scope:actor = this + scope:secondary_actor ?= this + } + } + } + } + } + always = yes + } + trigger_else = { + scope:recipient = scope:actor + } + } + } + + is_valid_showing_failures_only = { + #If we're opening this interaction through the interaction menu (i.e. not all scopes exist yet) + #This was giving double-warnings about a marry-able character existing so it's commented out for now + #custom_description = { + # text = character_to_marry_exists + # object = scope:recipient + # scope:recipient = { + # OR = { + # any_courtier = { + # is_at_home = yes + # marriage_interaction_can_be_picked_trigger= yes + # } + # any_child = { + # marriage_interaction_can_be_picked_trigger= yes + # } + # } + # } + #} + trigger_if = { + limit = { + NAND = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + } + } + #There is an available marriage + custom_description = { + text = "basic_can_marry_check_recipient" + subject = scope:actor + object = scope:recipient + scope:recipient = { + OR = { + AND = { + #Recipient can marry + can_marry_trigger = yes + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + AND = { + is_ruler = yes #(Following are only for rulers) + OR = { + any_child = { + matchmaker = scope:actor + OR = { + #Any of recipient's children can marry + AND = { + can_marry_trigger = yes + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + } + } + #Any of recipient's children are ready to marry their betrothed + AND = { + ready_to_marry_betrothed_trigger = yes + betrothed.matchmaker = scope:actor + } + } + } + any_courtier = { + OR = { + #Any of recipient's courtiers can marry + AND = { + can_marry_trigger = yes + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + } + } + #Any of recipient's courtiers are ready to marry their betrothed + AND = { + ready_to_marry_betrothed_trigger = yes + betrothed.matchmaker = scope:actor + } + } + } + } + } + } + } + } + } + #Diplomatic availability & prison + scope:recipient = { + is_busy_in_events_localised = yes + is_imprisoned = no + } + NOT = { + scope:actor = { + is_at_war_with = scope:recipient + } + } + trigger_if = { #(must be here because secondary_recipient can be set at the start) + limit = { + exists = scope:secondary_recipient + NOT = { scope:secondary_recipient = scope:recipient } + } + scope:secondary_recipient = { + is_busy_in_events_localised = yes + is_imprisoned = no + bp2_valid_for_standard_interactions_trigger = yes + } + } + trigger_if = { #(must be here because secondary_recipient can be set at the start) + limit = { + exists = scope:secondary_actor + NOT = { scope:secondary_actor = scope:actor } + } + scope:secondary_actor = { + is_busy_in_events_localised = yes + is_imprisoned = no + bp2_valid_for_standard_interactions_trigger = yes + } + } + # Account for regents being bolshy. + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_actor } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_recipient } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = actor } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = recipient } + } + + # 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 = { + OR = { + marriage_interaction_can_be_picked_trigger = yes + AND = { + exists = scope:secondary_actor + exists = scope:secondary_recipient + scope:secondary_actor.betrothed = scope:secondary_recipient + } + } + } + + #Is evaluated only after secondary_recipient and secondary_actor are both chosen + has_valid_target_showing_failures_only = { + marriage_interaction_valid_target_trigger = yes #Checks marriage status, betrothed, gender, consanguinity, faith hostility etc. + + #Blocks AI from marrying player guests + scope:secondary_recipient = { + trigger_if = { + limit = { + is_pool_guest = yes + host = { + is_ai = no + NOT = { this = scope:actor } + } + } + NOT = { is_pool_guest_of = host } + } + } + + #Blocks most AI's from marrying Evil faiths + trigger_if = { + limit = { + scope:actor = { + is_ai = yes + NOT = { has_trait = cynical } + #AI should honor betrothal even if faiths change + NOT = { scope:secondary_actor.betrothed = scope:secondary_recipient } + } + } + scope:recipient.faith = { + faith_hostility_level = { + target = scope:actor.faith + value < faith_hostility_prevents_marriage_level + } + } + } + + #Blocks AI from marrying single mayors in their area unless they are also mayors + trigger_if = { + limit = { + scope:actor = { + is_ai = yes + NOT = { government_has_flag = government_is_republic } + } + } + NOT = { + scope:recipient = { government_has_flag = government_is_republic } + } + } + + trigger_if = { # Cultural Traditions, for AI + limit = { + scope:actor = { + is_ai = yes + culture = { + has_cultural_parameter = dislikes_marrying_outside_of_culture + } + } + } + OR = { + scope:actor.culture = scope:recipient.culture + scope:actor.culture = scope:secondary_recipient.culture + } + } + } + + pre_auto_accept = { + if = { + limit = { + NOR = { + scope:recipient = scope:actor + scope:secondary_actor = { has_been_promised_grand_wedding = yes } + scope:secondary_recipient = { has_been_promised_grand_wedding = yes } + } + } + scope:recipient = { + if = { + limit = { scope:secondary_actor.betrothed = scope:secondary_recipient } + send_interface_toast = { + type = msg_betrothal_fulfilled + left_icon = scope:secondary_actor + right_icon = scope:secondary_recipient + } + } + else = { + send_interface_toast = { + type = msg_marriage_forced + left_icon = scope:secondary_actor + right_icon = scope:secondary_recipient + } + } + } + } + } + + on_send = { + if = { + limit = { + scope:grand_wedding_promise = yes + } + scope:actor = { + set_variable = { + name = grand_wedding_promise_pending + days = 10 + } + if = { + limit = { + is_ai = yes + } + remove_short_term_gold = ai_wedding_promise_gold_actor + } + #if = { # Activity count debugging, left in for QA purposes + # limit = { + # NOT = { + # exists = global_var:wedding_promise + # } + # } + # set_global_variable = { + # name = wedding_promise + # value = 1 + # } + #} + #else = { + # change_global_variable = { + # name = wedding_promise + # add = 1 + # } + #} + } + } + } + + on_accept = { + marriage_interaction_on_accept_effect = yes + scope:actor = { + if = { + limit = { + has_variable = grand_wedding_promise_pending + } + remove_variable = grand_wedding_promise_pending + } + if = { + limit = { + is_target_in_variable_list = { + name = contact_list_marriage + target = scope:recipient + } + } + remove_list_variable = { + name = contact_list_marriage + target = scope:recipient + } + } + } + } + + on_decline = { + scope:actor = { + if = { + limit = { NOT = { this = scope:recipient } } + trigger_event = marriage_interaction.0011 + } + if = { + limit = { + has_variable = grand_wedding_promise_pending + } + remove_variable = grand_wedding_promise_pending + } + } + scope:secondary_actor = { + add_character_flag = { + flag = player_declined_marriage + years = 5 + } + } + } + + auto_accept = { + marriage_interaction_auto_accept_trigger = yes #Strong hook conditions + } + + ai_accept = { + base = 0 + + marriage_ai_accept_modifier = yes + } + + # If you want the AI to set these options then it needs to be hooked into the code as well + send_option = { + flag = grand_wedding_promise + localization = GRAND_WEDDING_PROMISE + + is_shown = { + scope:actor = { #Can organize a Grand Wedding + highest_held_title_tier > tier_barony + is_landed_or_landless_administrative = yes + trigger_if = { + limit = { + is_ai = yes + } + is_at_war = no + } + # DLC locked + has_dlc_feature = tours_and_tournaments + has_dlc_feature = advanced_activities + } + } + + current_description = { + desc = "GRAND_WEDDING_PROMISE_INFO" + } + + is_valid = { + scope:actor = { + gold >= real_wedding_cost_actor_scope + is_available = yes + custom_tooltip = { + text = grand_wedding_already_promised_tt + NOR = { + AND = { + has_variable = promised_grand_wedding_marriage_countdown + var:promised_grand_wedding_marriage_countdown = { is_alive = yes } + } + has_variable = grand_wedding_promise_pending + } + } + } + trigger_if = { + limit = { + exists = scope:secondary_actor + } + custom_tooltip = { + text = grand_wedding_only_dominant_side + trigger_if = { + limit = { + scope:secondary_actor ?= { + is_female = yes + } + } + OR = { + scope:secondary_actor ?= { matrilinear_betrothal = yes } + scope:matrilineal = yes + } + } + trigger_else = { + NOR = { + scope:secondary_actor ?= { matrilinear_betrothal = yes } + scope:matrilineal = yes + } + } + } + custom_tooltip = { + text = grand_wedding_only_family + scope:secondary_actor ?= { + is_close_or_extended_family_of = scope:actor + } + } + # Cannot promise grand weddings with regents due to regency and travel limitations + custom_tooltip = { + text = grand_wedding_secondary_regent + NOT = { + scope:secondary_actor.liege = { + diarch = scope:secondary_actor + has_active_diarchy = yes + } + } + } + } + # Safety check because players shouldn't be spouse_2 + trigger_if = { + limit = { + has_multiple_players = yes + } + custom_tooltip = { + text = grand_wedding_mp_ai + trigger_if = { + limit = { + OR = { + scope:actor = { is_ai = no } + scope:secondary_actor ?= { is_ai = no } + } + } + scope:secondary_recipient ?= { + is_ai = yes + } + } + } + } + trigger_if = { + limit = { + exists = scope:secondary_recipient.liege + scope:secondary_recipient.liege = { + diarch = scope:secondary_recipient + has_active_diarchy = yes + } + } + # Cannot promise grand weddings with regents due to regency and travel limitations + custom_tooltip = { + text = grand_wedding_secondary_regent + NOT = { + scope:secondary_recipient.liege = { + diarch = scope:secondary_recipient + has_active_diarchy = yes + } + } + } + } + } + } + + send_option = { + flag = matrilineal + localization = MATRILINEAL_OFFER + is_shown = { + OR = { + NOT = { exists = scope:secondary_actor } + NOT = { exists = scope:secondary_recipient } + scope:secondary_actor = { sex_opposite_of = scope:secondary_recipient } + } + } + current_description = { + triggered_desc = { + trigger = { + exists = scope:secondary_actor + scope:secondary_actor = { + betrothed = scope:secondary_recipient + matrilinear_betrothal = yes + } + } + desc = "MATRILINEAL_OFFER_BETROTHAL_INFO" + } + } + can_be_changed = { + trigger_if = { + limit = { + exists = scope:secondary_actor + } + OR = { + NOT = { + exists = scope:secondary_recipient + } + scope:secondary_actor = { + NOT = { + betrothed = scope:secondary_recipient + } + } + } + } + } + starts_enabled = { + trigger_if = { + limit = { + exists = scope:secondary_actor + scope:secondary_actor = { + betrothed = scope:secondary_recipient + } + } + scope:secondary_actor = { + matrilinear_betrothal = yes + } + } + trigger_else_if = { + limit = { + exists = scope:secondary_actor + scope:actor = scope:secondary_actor + is_female = yes + is_ai = no + } + always = yes + } + trigger_else = { + scope:actor = { + OR= { + faith = { + has_doctrine = doctrine_gender_female_dominated + } + AND = { + this = scope:recipient + exists = scope:secondary_recipient + scope:secondary_recipient = { + is_female = yes + } + faith = { has_doctrine = doctrine_gender_equal } + } + AND = { + exists = scope:secondary_actor + scope:actor = scope:secondary_actor + is_female = yes + is_ai = no + } + } + } + } + } + } + + send_option = { + is_shown = { + scope:secondary_actor = { + NOT = { + betrothed = scope:secondary_recipient + } + } + } + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = hook + localization = MARRIAGE_HOOK + } + + send_option = { # FP3 + is_shown = { + scope:actor = { + any_character_struggle = { + is_struggle_type = persian_struggle + has_struggle_phase_parameter = can_trade_piety_for_marriage_acceptance + } + } + } + is_valid = { + scope:actor = { + any_character_struggle = { + involvement = involved + is_struggle_type = persian_struggle + } + } + scope:recipient = { + any_character_struggle = { + involvement = involved + is_struggle_type = persian_struggle + } + } + } + flag = piety_cost_reduction + localization = TRADE_PIETY_FOR_BETTER_AI_ACCEPTANCE + } + + 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 + } + + 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 = no + greeting = positive + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:secondary_actor = { + is_adult = yes + } + scope:secondary_recipient = { + is_adult = yes + } + NOR = { + scope:secondary_actor = { has_been_promised_grand_wedding = yes } + scope:secondary_recipient = { has_been_promised_grand_wedding = yes } + } + } + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + } + desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + } + desc = MARRIAGE_NOTIFICATION_MATRI + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + } + desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL + } + desc = MARRIAGE_NOTIFICATION + } + } + } + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + } + desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + } + desc = BETROTHAL_NOTIFICATION_MATRI + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + } + desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL + } + desc = BETROTHAL_NOTIFICATION + } + } + } + } +} + +#This interaction is referenced in code! If it's renamed you have to ping a coder +marry_off_interaction = { + icon = icon_marriage + category = interaction_category_diplomacy + common_interaction = yes + + desc = marry_off_interaction_desc + + send_name = marry_off_send + needs_recipient_to_open = no + special_interaction = arrange_marriage_interaction + interface = marriage + redirect = { + if = { + limit = { + exists = scope:secondary_actor + } + scope:recipient = { + save_scope_as = secondary_recipient + matchmaker = { + save_scope_as = recipient + } + } + + } + else = { + scope:recipient = { + save_scope_as = secondary_actor + } + clear_saved_scope = recipient + } + } + + populate_recipient_list = { + #populate only with your courtiers or children/grandchildren if you are a landless adventurer + if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + scope:secondary_actor = { + if = { + limit = { + NOT = { scope:actor = this } + } + add_to_list = characters + } + every_courtier = { + limit = { + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_courtier_away = { + limit = { + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_child = { + even_if_dead = yes + if = { + limit = { + is_alive = yes + NOT = { is_in_list = characters } + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_child = { + even_if_dead = yes + if = { + limit = { + is_alive = yes + NOT = { is_in_list = characters } + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + every_child = { + if = { + limit = { + is_alive = yes + NOT = { is_in_list = characters } + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + add_to_list = characters + } + } + } + } + } + } + #otherwise, populate with anyone eligible + else = { + scope:secondary_actor = { + if = { + limit = { + allowed_to_marry_same_sex_trigger = yes + } + every_opposite_sex_spouse_candidate = { + add_to_list = characters + } + every_same_sex_spouse_candidate = { + limit = { + NOT = { scope:secondary_actor = this } + } + add_to_list = characters + } + } + else = { + every_opposite_sex_spouse_candidate = { + add_to_list = characters + } + } + } + } + } + + cost = { + prestige = { + value = 0 + if = { + limit = { + exists = scope:actor + exists = scope:recipient + exists = scope:secondary_recipient + scope:recipient = { + OR = { + AND = { + vassal_contract_has_flag = vassal_contract_marriage_favor + is_allied_to = scope:actor + } + NOT = { vassal_contract_has_flag = vassal_contract_marriage_favor} + } + } + } + add = { + scope:actor = { + every_vassal = { + limit = { + vassal_contract_has_flag = vassal_contract_marriage_favor + NOT = { is_allied_to = scope:actor } + NOR = { + this = scope:recipient + this = scope:secondary_recipient + } + } + add = medium_prestige_value + } + } + desc = VASSAL_WITH_MARRIAGE_FAVOR + } + } + } + + influence = { + value = 0 + if = { + limit = { scope:influence_send_option = yes } + add = scope:actor.medium_influence_value + desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION + } + } + } + + interface_priority = 60 + + # actor, recipient ... characters arranging the marriage + # secondary_actor, secondary_recipient ... characters that should marry + + is_shown = { + # Enable only for yourself if you're a landless adventurer + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + scope:secondary_actor = { + scope:actor = this + } + } + scope:secondary_actor = { + #Is this someone I can marry off? + OR = { + is_courtier_of = scope:actor + AND = { + is_child_of = scope:actor + target_is_liege_or_above = scope:actor + } + scope:actor = this + } + #They can be married + can_marry_trigger = yes + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + # Block further marriage proposals for people who have a pending grand wedding + NOR = { + scope:secondary_actor ?= { has_been_promised_grand_wedding = yes } + scope:secondary_recipient ?= { has_been_promised_grand_wedding = yes } + } + } + + is_valid_showing_failures_only = { + #Diplomatic availability & prison + scope:secondary_actor = { + is_busy_in_events_localised = yes + is_imprisoned = no + bp2_valid_for_standard_interactions_trigger = yes + } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_actor } + trigger_if = { + limit = { + NOT = { scope:secondary_actor = scope:secondary_recipient } + } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = secondary_recipient } + } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = actor } + marriage_interaction_non_loyal_diarchs_refuse_secondary_marriage_trigger = { TARGET = recipient } + } + + has_valid_target_showing_failures_only = { + marriage_interaction_valid_target_trigger = yes #Checks marriage status, betrothed, gender, consanguinity, faith hostility etc. + + #Diplomatic availability & prison (located here because these will never be set at the start) + scope:recipient = { + is_busy_in_events_localised = yes + is_imprisoned = no + } + NOT = { + scope:actor = { + is_at_war_with = scope:recipient + } + } + trigger_if = { + limit = { NOT = { scope:recipient = scope:secondary_recipient } } + scope:secondary_recipient = { + is_busy_in_events_localised = yes + is_imprisoned = no + bp2_valid_for_standard_interactions_trigger = yes + } + } + #secondary_actor is checked above because they are always available + + #Blocks AI from marrying player guests + scope:secondary_recipient = { + trigger_if = { + limit = { + is_pool_guest = yes + host = { + is_ai = no + NOT = { this = scope:actor } + } + } + NOT = { is_pool_guest_of = host } + } + } + } + + on_send = { + if = { + limit = { + scope:grand_wedding_promise = yes + } + scope:actor = { + set_variable = { + name = grand_wedding_promise_pending + days = 10 + } + if = { + limit = { + is_ai = yes + } + remove_short_term_gold = ai_wedding_promise_gold_actor + } + #if = { # Activity count debugging, left in for QA purposes + # limit = { + # NOT = { + # exists = global_var:wedding_promise + # } + # } + # set_global_variable = { + # name = wedding_promise + # value = 1 + # } + #} + #else = { + # change_global_variable = { + # name = wedding_promise + # add = 1 + # } + #} + } + } + } + + on_accept = { + marriage_interaction_on_accept_effect = yes + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_marry_off.desc + REVERSE_NON_HOUSE_TARGET = no + } + + scope:actor = { + if = { + limit = { + has_variable = grand_wedding_promise_pending + } + remove_variable = grand_wedding_promise_pending + } + } + } + + on_decline = { + scope:actor = { + if = { + limit = { NOT = { this = scope:recipient } } + trigger_event = marriage_interaction.0011 + } + if = { + limit = { + has_variable = grand_wedding_promise_pending + } + remove_variable = grand_wedding_promise_pending + } + } + + # 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_marry_off_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + marriage_interaction_auto_accept_trigger = yes #Strong hook conditions + } + + ai_accept = { + base = 0 # Should be 0 for all interactions + + marriage_ai_accept_modifier = yes + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + send_option = { + flag = grand_wedding_promise + localization = GRAND_WEDDING_PROMISE + + is_shown = { + scope:actor = { #Can organize a Grand Wedding + highest_held_title_tier > tier_barony + is_landed_or_landless_administrative = yes + trigger_if = { + limit = { + is_ai = yes + } + is_at_war = no + } + # DLC locked + has_dlc_feature = tours_and_tournaments + has_dlc_feature = advanced_activities + } + } + + current_description = { + desc = "GRAND_WEDDING_PROMISE_INFO" + } + + is_valid = { + scope:actor = { + gold >= real_wedding_cost_actor_scope + is_available = yes + custom_tooltip = { + text = grand_wedding_already_promised_tt + NOR = { + AND = { + has_variable = promised_grand_wedding_marriage_countdown + var:promised_grand_wedding_marriage_countdown = { is_alive = yes } + } + has_variable = grand_wedding_promise_pending + } + } + } + custom_tooltip = { + text = grand_wedding_only_dominant_side + trigger_if = { + limit = { + scope:secondary_actor ?= { + is_female = yes + } + } + OR = { + scope:secondary_actor ?= { matrilinear_betrothal = yes } + scope:matrilineal = yes + } + } + trigger_else = { + NOR = { + scope:secondary_actor ?= { matrilinear_betrothal = yes } + scope:matrilineal = yes + } + } + } + custom_tooltip = { + text = grand_wedding_only_family + scope:secondary_actor ?= { + is_close_or_extended_family_of = scope:actor + } + } + } + } + + send_option = { + flag = matrilineal + localization = "MATRILINEAL_OFFER" + starts_enabled = { + scope:actor = { + OR = { + faith = { + has_doctrine = doctrine_gender_female_dominated + } + AND = { + scope:secondary_actor = { is_female = yes } + faith = { has_doctrine = doctrine_gender_equal } + } + AND = { + exists = scope:secondary_actor + scope:actor = scope:secondary_actor + is_female = yes + is_ai = no + } + } + } + } + } + + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = hook + localization = MARRIAGE_HOOK + } + #This option cannot be linked with the hook icon, because recipient isn't known in the right-click menu + + 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_options_exclusive = no + + show_effects_in_notification = no + greeting = positive + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:secondary_actor = { + is_adult = yes + } + scope:secondary_recipient = { + is_adult = yes + } + NOR = { + scope:secondary_actor = { has_been_promised_grand_wedding = yes } + scope:secondary_recipient = { has_been_promised_grand_wedding = yes } + } + } + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + } + desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + } + desc = MARRIAGE_NOTIFICATION_MATRI + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_BOTH_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + } + desc = MARRIAGE_NOTIFICATION_ACTOR_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_recipient = scope:recipient + } + desc = MARRIAGE_NOTIFICATION_RECIPIENT_PERSONAL + } + desc = MARRIAGE_NOTIFICATION + } + } + } + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_actor = scope:actor + } + desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL_MATRI + } + triggered_desc = { + trigger = { + scope:matrilineal = yes + } + desc = BETROTHAL_NOTIFICATION_MATRI + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_BOTH_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_actor = scope:actor + } + desc = BETROTHAL_NOTIFICATION_ACTOR_PERSONAL + } + triggered_desc = { + trigger = { + scope:secondary_recipient = scope:recipient + } + desc = BETROTHAL_NOTIFICATION_RECIPIENT_PERSONAL + } + desc = BETROTHAL_NOTIFICATION + } + } + } + } +} + +break_betrothal_interaction = { + category = interaction_category_diplomacy + special_interaction = break_betrothal_interaction + use_diplomatic_range = no + icon = icon_marriage + + is_shown = { + OR = { + #Betrothed to betrothed + scope:actor.betrothed = scope:recipient + + #Actor breaking recipient's betrothal with their courtier/vassal child + scope:actor = { + any_courtier = { + is_ai = yes + is_betrothed = yes + betrothed = { this = scope:recipient } + OR = { + is_playable_character = no + any_parent = { this = scope:actor } + } + } + } + + #Actor breaking the betrothal of their courtier/vassal child + scope:recipient = { + is_ai = yes + is_betrothed = yes + OR = { + AND = { + is_playable_character = no + liege = scope:actor + } + AND = { + is_child_of = scope:actor + NOT = { + matchmaker = { + is_parent_of = prev + NOT = { this = scope:actor } + } + } + OR = { + is_playable_character = no + target_is_liege_or_above = scope:actor + } + } + } + betrothed = { always = yes } + } + + #Break recipient's betrothal with actor's vassal child/courtier + scope:recipient = { + is_betrothed = yes + betrothed = { + is_ai = yes + OR = { + AND = { + is_child_of = scope:actor + target_is_liege_or_above = scope:actor + NOT = { + matchmaker = { + is_parent_of = prev + NOT = { this = scope:actor } + } + } + } + AND = { + is_playable_character = no + liege = scope:actor + } + } + } + } + + #Actor breaking their betrothal to recipient's courtier/vassal child + AND = { + scope:actor = { is_betrothed = yes } + scope:recipient = { + OR = { + #Check for courtiers + any_courtier = { + is_betrothed = yes + betrothed = scope:actor + liege = scope:recipient + } + #Check for vassal children + any_child = { + is_betrothed = yes + betrothed = scope:actor + OR = { + is_playable_character = no + target_is_liege_or_above = scope:recipient + } + NOT = { + matchmaker = { + is_parent_of = prev + NOT = { this = scope:actor } + } + } + } + } + } + } + } + } + + is_valid = { + + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + # Recipient is the betrothed + custom_description = { + text = break_betrothal_hook_used + object = scope:recipient + trigger_if = { + limit = { + exists = scope:recipient.betrothed + OR = { + scope:recipient.betrothed = scope:actor + scope:recipient.betrothed = { + is_ai = yes + OR = { + AND = { + is_child_of = scope:actor + target_is_liege_or_above = scope:actor + NOT = { + matchmaker = { + is_parent_of = prev + NOT = { this = scope:actor } + } + } + } + AND = { + is_playable_character = no + liege = scope:actor + } + } + } + } + exists = scope:recipient.var:hook_used_for_betrothal + } + scope:recipient.var:hook_used_for_betrothal = { + NOT = { this = scope:recipient.betrothed } + } + } + } + + custom_description = { + text = break_betrothal_hook_used + object = scope:recipient + trigger_if = { + limit = { + exists = scope:recipient.betrothed + OR = { + scope:recipient = scope:actor + scope:recipient = { + is_ai = yes + OR = { + AND = { + is_child_of = scope:actor + target_is_liege_or_above = scope:actor + NOT = { + matchmaker = { + is_parent_of = prev + NOT = { this = scope:actor } + } + } + } + AND = { + is_playable_character = no + liege = scope:actor + } + } + } + } + exists = scope:recipient.betrothed.var:hook_used_for_betrothal + } + scope:recipient.betrothed.var:hook_used_for_betrothal = { + NOT = { this = scope:recipient } + } + } + } + + # Secondary Recipient is the betrothed + custom_description = { + text = break_betrothal_hook_used + object = scope:recipient + trigger_if = { + limit = { + scope:recipient = { + OR = { + #Check for courtiers + any_courtier = { + is_betrothed = yes + betrothed = scope:actor + liege = scope:recipient + exists = var:hook_used_for_betrothal + var:hook_used_for_betrothal = { + this = scope:actor + } + } + #Check for vassal children + any_child = { + is_betrothed = yes + betrothed = scope:actor + OR = { + is_playable_character = no + target_is_liege_or_above = scope:recipient + } + NOT = { + matchmaker = { + is_parent_of = prev + NOT = { this = scope:actor } + } + } + exists = var:hook_used_for_betrothal + var:hook_used_for_betrothal = { + this = scope:actor + } + } + } + } + } + always = no + } + } + + # Secondary Actor and Recipient were promised a Grand Wedding, and the Activity has already been organized and is ongoing + custom_description = { + text = break_betrothal_gwedding_ongoing + trigger_if = { + limit = { + OR = { + scope:recipient = { has_been_promised_grand_wedding = yes } + scope:recipient.betrothed = { has_been_promised_grand_wedding = yes } + } + } + NOR = { + scope:recipient.involved_activity ?= { + has_activity_type = activity_wedding + OR = { + special_guest:spouse_1 ?= scope:recipient + special_guest:spouse_2 ?= scope:recipient + special_guest:spouse_1 ?= scope:recipient.betrothed + special_guest:spouse_2 ?= scope:recipient.betrothed + } + } + scope:recipient.betrothed.involved_activity ?= { + has_activity_type = activity_wedding + OR = { + special_guest:spouse_1 ?= scope:recipient + special_guest:spouse_2 ?= scope:recipient + special_guest:spouse_1 ?= scope:recipient.betrothed + special_guest:spouse_2 ?= scope:recipient.betrothed + } + } + } + } + } + } + + on_accept = { + #Identifies the "injured party" + scope:recipient = { + if = { + limit = { matchmaker = scope:actor } + betrothed = { save_scope_as = rejected_betrothed } + save_scope_as = rejecting_betrothed + } + else_if = { + limit = { + OR = { + #Check for courtiers + any_courtier = { + is_betrothed = yes + is_ai = yes + betrothed = scope:actor + liege = scope:recipient + } + #Check for vassal children + any_child = { + is_betrothed = yes + is_ai = yes + betrothed = scope:actor + target_is_liege_or_above = scope:recipient + } + } + } + scope:actor.betrothed = { + save_scope_as = rejected_betrothed + } + scope:actor = { + save_scope_as = rejecting_betrothed + } + } + + else = { + save_scope_as = rejected_betrothed + betrothed = { save_scope_as = rejecting_betrothed } + } + } + + # If it was a Grand Wedding, find the host + scope:rejecting_betrothed.var:promised_grand_wedding_by ?= { + save_scope_as = promising_host + } + + scope:recipient = { trigger_event = marriage_interaction.0020 } + + #Tooltip for betrothal breakage + show_as_tooltip = { + scope:rejected_betrothed = { + break_betrothal = scope:rejecting_betrothed + } + } + + #Figures out if the liege of rejected_betrothed cares + scope:rejected_betrothed = { + if = { + limit = { #The liege matter when assigning prestige/opinion hits + matchmaker = { + NOT = { this = scope:rejected_betrothed } + is_close_or_extended_family_of = scope:rejected_betrothed + } + } + + matchmaker = { save_scope_as = rejected_betrothal_owner } + } + + else = { #The liege doesn't matter, only the betrothed + save_scope_as = rejected_betrothal_owner + } + } + + if = { + limit = { #Only if you had no reason to break the betrothal + scope:rejected_betrothed = { is_eunuch_trigger = no } + scope:rejecting_betrothed = { is_eunuch_trigger = no } + NOR = { + scope:rejected_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejecting_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejected_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejecting_betrothed + } + scope:rejecting_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejected_betrothed + } + # Prestige loss for Grand Weddings is handled below in the specific effect + scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } + scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } + } + } + #Prestige penalty + if = { + limit = { + OR = { + scope:rejected_betrothed = { highest_held_title_tier = tier_empire } + scope:rejected_betrothal_owner = { highest_held_title_tier = tier_empire } + } + #Only applied for relevant characters + OR = { + scope:rejected_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:rejecting_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:actor = { + yields_alliance = { + candidate = scope:rejecting_betrothed + target = scope:rejected_betrothal_owner + target_candidate = scope:rejected_betrothed + } + } + } + } + scope:actor = { add_prestige = massive_prestige_loss } + } + + else_if = { + limit = { + OR = { + scope:rejected_betrothed = { highest_held_title_tier = tier_kingdom } + scope:rejected_betrothal_owner = { highest_held_title_tier = tier_kingdom } + } + #Only applied for relevant characters + OR = { + scope:rejected_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:rejecting_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:actor = { + yields_alliance = { + candidate = scope:rejecting_betrothed + target = scope:rejected_betrothal_owner + target_candidate = scope:rejected_betrothed + } + } + } + } + scope:actor = { add_prestige = major_prestige_loss } + } + + else_if = { + limit = { + OR = { + scope:rejected_betrothed = { highest_held_title_tier = tier_duchy } + scope:rejected_betrothal_owner = { highest_held_title_tier = tier_duchy } + } + #Only applied for relevant characters + OR = { + scope:rejected_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:rejecting_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:actor = { + yields_alliance = { + candidate = scope:rejecting_betrothed + target = scope:rejected_betrothal_owner + target_candidate = scope:rejected_betrothed + } + } + } + } + scope:actor = { add_prestige = medium_prestige_loss } + } + + else_if = { + limit = { + OR = { + scope:rejected_betrothed = { highest_held_title_tier = tier_county } + scope:rejected_betrothal_owner = { highest_held_title_tier = tier_county } + } + #Only applied for relevant characters + OR = { + scope:rejected_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:rejecting_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:actor = { + yields_alliance = { + candidate = scope:rejecting_betrothed + target = scope:rejected_betrothal_owner + target_candidate = scope:rejected_betrothed + } + } + } + } + scope:actor = { add_prestige = minor_prestige_loss } + } + + else_if = { + limit = { + OR = { + scope:rejected_betrothed = { highest_held_title_tier = tier_barony } + scope:rejected_betrothal_owner = { highest_held_title_tier = tier_barony } + } + #Only applied for relevant characters + OR = { + scope:rejected_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:rejecting_betrothed = { + OR = { + is_close_family_of = scope:actor + AND = { + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + } + } + } + scope:actor = { + yields_alliance = { + candidate = scope:rejecting_betrothed + target = scope:rejected_betrothal_owner + target_candidate = scope:rejected_betrothed + } + } + } + } + scope:actor = { add_prestige = miniscule_prestige_loss } + } + } + + ############################################ + # EP2 - Breaking a Grand Wedding Betrothal # + ############################################ + if = { + limit = { + # There is no forced reason for breaking the betrothal + scope:rejected_betrothed = { is_eunuch_trigger = no } + scope:rejecting_betrothed = { is_eunuch_trigger = no } + NOR = { + scope:rejected_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejecting_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejecting_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejected_betrothed + } + scope:rejected_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejecting_betrothed + } + } + # A Grand Wedding was promised + OR = { + scope:rejecting_betrothed = { + has_been_promised_grand_wedding = yes + } + scope:rejected_betrothed = { + has_been_promised_grand_wedding = yes + } + } + } + scope:actor = { break_grand_wedding_betrothal_effect = yes } + scope:rejected_betrothed = { trigger_event = marriage_interaction.0001 } + } + + ###################################### + # Opinion hits & notification events # + ###################################### + #Personal opinion hit for the rejected_betrothed + else_if = { + limit = { NOT = { scope:rejected_betrothed = scope:actor } } + scope:rejected_betrothed = { + if = { + limit = { + is_eunuch_trigger = no + scope:rejecting_betrothed = { is_eunuch_trigger = no } + NOR = { + has_trait_with_flag = can_not_marry + scope:rejecting_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejecting_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejected_betrothed + } + AND = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejecting_betrothed + } + } + } + show_as_tooltip = { + add_opinion = { + target = scope:actor + modifier = broke_betrothal_opinion + } + } + } + + hidden_effect = { trigger_event = marriage_interaction.0001 } + } + } + else = { + hidden_effect = { + scope:rejecting_betrothed = { + break_betrothal = scope:rejected_betrothed + } + } + } + + #Personal opinion hit for the rejected_betrothal_owner + if = { + limit = { + NOR = { + scope:rejected_betrothed = { + this = scope:rejected_betrothal_owner + } + scope:actor = { + this = scope:rejected_betrothal_owner + } + scope:actor = { + this = scope:rejected_betrothed + } + } + } + scope:rejected_betrothal_owner = { + if = { + limit = { + scope:rejected_betrothed = { is_eunuch_trigger = no } + scope:rejecting_betrothed = { is_eunuch_trigger = no } + NOR = { + scope:rejected_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejecting_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejected_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejecting_betrothed + } + scope:rejecting_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejected_betrothed + } + } + } + if = { + limit = { + NOR = { + scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } + scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } + } + } + show_as_tooltip = { + add_opinion = { + target = scope:actor + modifier = broke_betrothal_opinion + } + } + } + } + + hidden_effect = { trigger_event = marriage_interaction.0001 } + } + } + + if = { + limit = { + scope:rejected_betrothed = { is_eunuch_trigger = no } + scope:rejecting_betrothed = { is_eunuch_trigger = no } + NOR = { + scope:rejected_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejecting_betrothed = { has_trait_with_flag = can_not_marry } + scope:rejected_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejecting_betrothed + } + scope:rejecting_betrothed = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:rejected_betrothed + } + } + } + #Opinion hit for close relatives of the rejected_betrothed (that are not rejected_betrothed_owner) + if = { + limit = { + NOT = { scope:rejected_betrothed = scope:actor } + scope:rejected_betrothed = { + any_close_or_extended_family_member = { + NOT = { this = scope:rejected_betrothal_owner } + count >= 1 + } + } + } + if = { + limit = { + OR = { + scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } + scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } + } + } + scope:rejected_betrothed = { + every_close_or_extended_family_member = { + limit = { + NOT = { this = scope:rejected_betrothal_owner } + } + custom = all_family_members + + add_opinion = { + target = scope:actor + modifier = broke_betrothal_grand_wedding_opinion + opinion = -50 + } + } + } + } + else = { + scope:rejected_betrothed = { + every_close_or_extended_family_member = { + limit = { + NOT = { this = scope:rejected_betrothal_owner } + } + custom = all_family_members + add_opinion = { + target = scope:actor + modifier = broke_betrothal_opinion + } + } + } + } + } + + #Opinion hit for close relatives of the rejecting_betrothed (that are not also close relatives to rejected_betrothed) + if = { + limit = { + NOR = { + scope:rejecting_betrothed = scope:actor + scope:rejected_betrothed = scope:actor + } + scope:rejecting_betrothed = { + any_close_or_extended_family_member = { + NOR = { + is_close_or_extended_family_of = scope:rejected_betrothed + this = scope:rejected_betrothal_owner + this = scope:rejected_betrothed + } + count >= 1 + } + } + } + if = { + limit = { + OR = { + scope:rejected_betrothed = { has_been_promised_grand_wedding = yes } + scope:rejecting_betrothed = { has_been_promised_grand_wedding = yes } + } + } + scope:rejecting_betrothed = { + every_close_or_extended_family_member = { + limit = { + NOR = { + this = scope:rejected_betrothal_owner + is_close_or_extended_family_of = scope:rejected_betrothed + this = scope:rejected_betrothed + } + } + custom = all_family_members + + add_opinion = { + target = scope:actor + modifier = broke_betrothal_grand_wedding_opinion + opinion = -50 + } + } + } + } + else = { + scope:rejecting_betrothed = { + every_close_or_extended_family_member = { + limit = { + NOR = { + is_close_or_extended_family_of = scope:rejected_betrothed + this = scope:rejected_betrothal_owner + this = scope:rejected_betrothed + } + } + custom = all_family_members + add_opinion = { + target = scope:actor + modifier = broke_betrothal_opinion + } + } + } + } + } + } + + scope:actor = { + # Was the marriage of relevence to the player? + if = { + limit = { + scope:rejecting_betrothed = { + is_player_heir_of = scope:actor + } + } + hidden_effect = { + send_interface_toast = { + type = msg_break_betrothal_player_heir + title = msg_break_betrothal + left_icon = scope:rejecting_betrothed + right_icon = scope:rejected_betrothed + custom_tooltip = break_betrothal_hook_toast_desc + } + } + } + else_if = { + limit = { + NOT = { + scope:actor = scope:rejecting_betrothed + } + } + hidden_effect = { + send_interface_message = { + type = msg_break_betrothal + title = msg_break_betrothal + left_icon = scope:rejecting_betrothed + right_icon = scope:rejected_betrothed + custom_tooltip = break_betrothal_hook_toast_desc + } + } + } + + #Was the marriage promised to a vassal? + if = { + limit = { + exists = var:promised_to_marry_1 + var:promised_to_marry_1 = { + this = scope:rejected_betrothed + any_parent = { + is_vassal_of = scope:actor + } + } + exists = var:promised_to_marry_2 + var:promised_to_marry_2 = { + this = scope:rejecting_betrothed + is_close_family_of = scope:actor + } + } + remove_variable = promised_to_marry_1 + remove_variable = promised_to_marry_2 + trigger_event = clan.1002 + } + } + + # 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_betrothal_breakage.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes +} + +# Stripped down version of make_concubine_interaction for the AI +# Avoids redirection logic and recipient list building to improve performance +ai_make_concubine_interaction = { + hidden = yes + + ai_targets = { + ai_recipients = prisoners + } + ai_targets = { + ai_recipients = courtiers + } + ai_target_quick_trigger = { + adult = yes + owner_attracted = yes # Not optimal, but saves a lot of performance + } + ai_frequency = 12 + + ai_potential = { + is_playable_character = yes + is_adult = yes + fertility > 0 + allowed_more_concubines = yes + NOR = { + has_trait = chaste + has_trait = celibate + has_sexuality = asexual + } + } + + is_shown = { + make_concubine_is_shown_trigger = yes + } + + is_valid_showing_failures_only = { + make_concubine_is_valid_trigger = yes + } + + auto_accept = yes + + ai_will_do = { + base = 0 + + modifier = { # Basic Filtering + add = 100 + scope:actor = { + number_of_concubines < number_of_desired_concubines + } + scope:recipient = { + can_have_children_with = { CHARACTER = scope:actor } # Only if you can have kids since this is about fertility and genetic traits + fertility > 0.2 + is_young_character = yes + } + } + + modifier = { + add = 100 + scope:recipient = { + is_imprisoned_by = scope:actor + can_have_children_with = { CHARACTER = scope:actor } # Only if you can have kids since this is about fertility and genetic traits + OR = { + is_lowborn = no + num_of_good_genetic_traits > 0 + } + fertility > 0.1 + trigger_if = { + limit = { + is_female = yes + } + is_aging_character = no + } + } + } + + modifier = { + add = 100 + scope:actor = { + allowed_to_marry_same_sex_trigger = yes + sex_same_as = scope:recipient + is_attracted_to_gender_of = scope:recipient + OR = { #If they're not in need of kids, or someone who they can have kids with + any_child = { + count >= 2 + } + any_consort = { + can_have_children_with = { CHARACTER = scope:actor } + fertility > 0.1 + } + } + } + } + + modifier = { #Even if you're allowed to take same-sex concubines we don't want the AI to do so without a good reason if they're not attracted to the person + add = -200 + scope:actor = { + allowed_to_marry_same_sex_trigger = yes + sex_same_as = scope:recipient + NOT = { is_attracted_to_gender_of = scope:recipient } + } + } + + modifier = { # If they don't have a batch of kids and opposite sex consorts to handle that situation + add = -200 + scope:actor = { + allowed_to_marry_same_sex_trigger = yes + sex_same_as = scope:recipient + NOT = { + any_child = { + count >= 2 + } + } + NOT = { + any_consort = { + can_have_children_with = { CHARACTER = scope:actor } + fertility > 0.1 + } + } + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { # Incest Filtering: Hard NO! + factor = 0 + scope:actor = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:recipient } + NOR = { + accepts_incest_with_trigger = { CHARACTER = scope:recipient } + sexually_liberal_trigger = yes + AND = { + AND = { + exists = primary_heir + primary_heir = { NOT = { dynasty = root.dynasty } } + } + NOT = { + primary_title = { + any_title_heir = { dynasty = root.dynasty } + } + } + } + } + } + } + + modifier = { # Incest Filtering: Not likely, but keep the door open... + factor = 0.2 + scope:actor = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:recipient } + OR = { + accepts_incest_with_trigger = { CHARACTER = scope:recipient } + sexually_liberal_trigger = yes + AND = { + exists = primary_heir + primary_heir = { NOT = { dynasty = root.dynasty } } + NOT = { + primary_title = { + any_title_heir = { dynasty = root.dynasty } + } + } + } + } + } + } + + modifier = { # Less likely if married to a player and the target is the player heir + factor = 0.4 + scope:actor = { + any_spouse = { + is_ai = no + scope:recipient = { + OR = { + is_primary_heir_of = prev + is_heir_of = prev + } + } + } + } + } + } + + on_accept = { + scope:actor = { + save_scope_as = secondary_actor + } + scope:recipient = { + save_scope_as = secondary_recipient + } + concubine_on_accept_effect = yes + + # 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_concubinage.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} + +make_concubine_interaction = { + category = interaction_category_diplomacy + icon = concubine_icon + + desc = make_concubine_interaction_desc + + interface = concubine_list + + + needs_recipient_to_open = yes + + redirect = { + # The UI will open to the already filled left and right first if we don't tell it we've got both sides filled + scope:actor = { + save_scope_as = secondary_actor + } + scope:recipient = { + save_scope_as = secondary_recipient + } + } + + populate_recipient_list = { + scope:actor = { + every_courtier = { + limit = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + add_to_list = characters + } + every_prisoner = { + limit = { + NOT = { is_in_list = characters } + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + add_to_list = characters + } + } + } + + is_shown = { + make_concubine_is_shown_trigger = yes + } + + is_valid_showing_failures_only = { + make_concubine_is_valid_trigger = yes + } + + auto_accept = yes + + on_accept = { + concubine_on_accept_effect = yes + + # 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_concubinage.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} + +find_concubine = { + category = interaction_category_diplomacy + icon = concubine_icon + + desc = find_concubine_desc + + interface = concubine_list + + needs_recipient_to_open = no + + redirect = { + scope:actor = { # The UI will open to the already filled left first if we don't tell it we've got "our side" actor which is always ourselves + save_scope_as = secondary_actor + } + } + + populate_recipient_list = { + scope:actor = { + every_courtier = { + limit = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + add_to_list = characters + } + every_prisoner = { + limit = { + NOT = { is_in_list = characters } + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + add_to_list = characters + } + } + } + + is_shown = { + scope:actor = { + allowed_concubines = yes + is_adult = yes + trigger_if = { #So that we show the recipient list, but can also only use this on ourselves, we have to do this check in the beginning + limit = { + NOT = { exists = scope:secondary_recipient } + } + scope:actor = scope:recipient + } + } + trigger_if = { + limit = { + NOT = { scope:actor = scope:recipient } + } + scope:actor = { + trigger_if = { + limit = { + allowed_to_marry_same_sex_trigger = no + } + sex_opposite_of = scope:recipient + } + NOT = { relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:recipient } } + } + scope:recipient = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + is_adult = yes + OR = { + is_imprisoned_by = scope:actor + is_courtier_of = scope:actor + } + } + } + } + + is_valid_showing_failures_only = { + custom_description = { + text = take_concubine_allowed_more + object = scope:recipient + scope:actor = { + allowed_more_concubines = yes + } + } + custom_description = { + text = take_concubine_available_character_opp + object = scope:actor + scope:actor = { + OR = { + any_courtier = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + any_prisoner = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + } + } + } + trigger_if = { + limit = { + NOT = { scope:actor = scope:recipient } + } + scope:recipient = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + } + } + } + + can_be_picked = { + is_adult = yes + } + + auto_accept = yes + + ai_will_do = { + base = 0 + } + + on_accept = { + concubine_on_accept_effect = yes + + # 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_concubinage.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} + +offer_concubine = { + category = interaction_category_diplomacy + icon = concubine_icon + + desc = offer_concubine_desc + + ai_targets = { + ai_recipients = neighboring_rulers + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 144 + + greeting = positive + notification_text = OFFER_CONCUBINE_NOTIFICATION + + #interface = concubine_list + + needs_recipient_to_open = yes + + populate_actor_list = { + scope:actor = { + every_courtier = { + limit = { + can_be_offered_as_concubine_to_character_trigger = { + GIVER = scope:actor + CHARACTER = scope:recipient + } + } + add_to_list = characters + } + every_prisoner = { + limit = { + NOT = { is_in_list = characters } + can_be_offered_as_concubine_to_character_trigger = { + GIVER = scope:actor + CHARACTER = scope:recipient + } + } + add_to_list = characters + } + } + } + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:actor = { + OR = { + culture = { has_cultural_tradition = tradition_concubines } + faith = { has_doctrine = doctrine_concubines } + } + } + scope:recipient = { + allowed_concubines = yes + is_adult = yes + } + } + + is_valid_showing_failures_only = { + custom_description = { + text = take_concubine_available_character_opp + object = scope:recipient + scope:actor = { + OR = { + any_courtier = { + can_be_offered_as_concubine_to_character_trigger = { + GIVER = scope:actor + CHARACTER = scope:recipient + } + } + any_prisoner = { + can_be_offered_as_concubine_to_character_trigger = { + GIVER = scope:actor + CHARACTER = scope:recipient + } + } + } + } + } + custom_description = { + text = take_concubine_allowed_more + object = scope:recipient + scope:recipient = { + allowed_more_concubines = yes + } + } + } + + can_be_picked = { + is_adult = yes + } + + can_send = { + custom_description = { + text = character_unavailable_to_be_offered_as_concubine + object = scope:secondary_actor + scope:secondary_actor = { + can_be_offered_as_concubine_to_character_trigger = { + GIVER = scope:actor + CHARACTER = scope:recipient + } + } + } + } + + auto_accept = no + + ai_accept = { + base = 50 + + modifier = { + add = { + value = 50 + multiply = scope:secondary_actor.num_of_good_genetic_traits + } + scope:secondary_actor = { + 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_actor = { + 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_actor.num_of_bad_genetic_traits + } + scope:secondary_actor = { + 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_actor = { + 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_actor + multiplier = 0.25 + desc = AI_OPINION_REASON + } + + compare_modifier = { # Recipient is reluctant to marry old women (procreation is a key factor) + trigger = { + scope:secondary_actor = { + is_young_character = no + is_female = yes + } + } + target = scope:secondary_actor + 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_actor + } + 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_actor + 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_actor + } + desc = AI_ATTRACTION_REASON + } + + modifier = { # A Recipient is more likely to agree if you're their liege + add = 40 + + scope:recipient = { + target_is_liege_or_above = scope:actor + } + desc = LIEGE_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 = 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 + } + modifier = { + add = -250 + scope:secondary_actor = { + has_std_trigger = yes + } + desc = AI_STD_REASON + } + modifier = { + add = -250 + scope:secondary_actor = { + has_epidemic_disease_trigger = yes + } + desc = AI_CONTAGIOUS_REASON + } + modifier = { + add = -5000 + scope:secondary_actor = { + fertility <= 0 + } + desc = AI_FERTILITY_REASON + } + modifier = { + scope:hook = yes + add = 500 + scope:actor = { NOT = { has_strong_hook = scope:recipient } } + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:hook = yes + add = 1000 + scope:actor = { has_strong_hook = scope:recipient } + desc = SCHEME_STRONG_HOOK_USED + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + } + + ai_potential = { + is_adult = yes + NOT = { has_trait = incapable } + is_at_war = no + NOR = { + has_trait = greedy + ai_greed > very_high_positive_ai_value + } + OR = { + culture = { has_cultural_tradition = tradition_concubines } + faith = { has_doctrine = doctrine_concubines } + } + } + + ai_will_do = { + base = 0 + + modifier = { # Basic Filtering + add = 100 + scope:recipient = { + number_of_concubines < number_of_desired_concubines + } + scope:secondary_actor = { + trigger_if = { + limit = { + allowed_to_marry_same_sex_trigger = no + } + sex_opposite_of = scope:recipient + } + fertility > 0.2 + is_young_character = yes + NOR = { + is_councillor_of = scope:actor + is_of_major_interest_trigger = { + CHARACTER = scope:actor + } + is_concubine_of = scope:actor + } + } + } + + modifier = { # If secondary_actor is close to actor, a good character, or if actor should take them as concubine + add = -100 + scope:secondary_actor = { + is_of_minor_interest_trigger = { + CHARACTER = scope:actor + } + AND = { + can_become_concubine_of_character_trigger = { CHARACTER = scope:actor } + scope:actor = { number_of_concubines < number_of_desired_concubines } + } + } + } + + modifier = { # If secondary_actor could be an agent... + add = 25 + scope:actor = { + any_scheme = { + scheme_target_character = scope:recipient + save_temporary_scope_as = scheme_check + } + } + scope:secondary_actor = { + char_can_fit_into_scheme_trigger = { SCHEME = scope:scheme_check } + } + } + + modifier = { # More likely if it's a neighboring ruler that you want to like you + add = 50 + scope:recipient = { + any_neighboring_top_liege_realm_owner = { this = scope:actor } + max_military_strength > scope:actor.max_military_strength + } + } + + modifier = { # More likely if it's your friend and it's a nice concubine + add = 50 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + scope:secondary_actor = { + fertility > 0.2 + is_young_character = yes + OR = { + has_trait = lustful + num_of_good_genetic_traits > 0 + } + } + } + + modifier = { #Even if they're allowed to take same-sex concubines we don't want the AI to suggest it without a good reason if they're not attracted to the person + add = -200 + scope:recipient = { + allowed_to_marry_same_sex_trigger = yes + sex_same_as = scope:secondary_actor + NOT = { is_attracted_to_gender_of = scope:secondary_actor } + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + modifier = { # No if it's a same-sex concubinage and actor isn't accepting of it + factor = 0 + scope:actor = { + allowed_to_marry_same_sex_trigger = no + scope:recipient = { sex_same_as = scope:secondary_actor } + } + } + + modifier = { # No if it's a same-sex concubinage and recipient isn't accepting of it + factor = 0 + scope:recipient = { + allowed_to_marry_same_sex_trigger = no + sex_same_as = scope:secondary_actor + } + } + + modifier = { # Incest Filtering: Hard NO! + factor = 0 + scope:recipient = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_actor } + NOR = { + accepts_incest_with_trigger = { CHARACTER = scope:secondary_actor } + sexually_liberal_trigger = yes + } + } + } + + modifier = { # Incest Filtering: Not likely, but keep the door open... + factor = 0.2 + scope:recipient = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_actor } + OR = { + accepts_incest_with_trigger = { CHARACTER = scope:secondary_actor } + sexually_liberal_trigger = yes + } + } + } + + modifier = { # Faith considerations + factor = 0 + scope:recipient = { + faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_hostile_level + } + } + NOR = { + has_relation_friend = scope:actor + has_relation_best_friend = scope:actor + } + } + } + } + + 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 = { + concubine_offer_on_accept_effect = yes + + # 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_concubinage_offer.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = msg_concubine_offer_rejected_title + right_icon = scope:recipient + left_icon = scope:secondary_actor + custom_tooltip = msg_concubine_offer_rejected + } + } + + # 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_concubinage_offer_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + 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" +} + +dismiss_concubine_interaction = { + category = interaction_category_diplomacy + use_diplomatic_range = no + icon = concubine_icon + + is_shown = { + scope:recipient = { + is_concubine_of = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + } + + auto_accept = yes + + on_accept = { + scope:actor = { + stress_impact = { + compassionate = minor_stress_impact_gain + } + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = msg_concubine_dismissed_title + right_icon = scope:recipient + remove_concubine = scope:recipient + } + } + } + + scope:recipient = { + # No point in sending a notification since the player can't be an unlanded concubine in any case + # trigger_event = marriage_interaction.0050 + + # Being thrown aside is humiliating, even if you didn't want to be a concubine in the first place. + add_opinion = { + modifier = set_me_aside_opinion + target = scope:actor + } + if = { + limit = { scope:actor = { has_relation_lover = scope:recipient } } + lover_breakup_effect = { + BREAKER = scope:actor + LOVER = scope:recipient + } + } + + # Figure out where we should go now that we're no longer a concubine. + if = { + limit = { + is_councillor_of = scope:actor + } + # Then they should remain in court + } + else_if = { #Dismiss to relevant court, or to pool + limit = { + any_close_family_member = { + is_landed_or_landless_administrative = yes + } + } + random_close_family_member = { + limit = { + is_child_of = scope:recipient + is_landed_or_landless_administrative = yes + } + alternative_limit = { + is_parent_of = scope:recipient + is_landed_or_landless_administrative = yes + } + alternative_limit = { + is_landed_or_landless_administrative = yes + } + add_courtier = scope:recipient + } + } + else = { + move_to_pool = yes + } + } + + # 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_concubinage_dismissal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} + +divorce_character_interaction = { + category = interaction_category_diplomacy + use_diplomatic_range = no + icon = icon_marriage + + desc = divorce_character_interaction_desc + cost = { piety = divorce_cost } + + is_shown = { + scope:actor.faith = { + # We are not required to seek approval of a spiritual HoF + NAND = { + has_doctrine = doctrine_divorce_approval + has_doctrine = doctrine_spiritual_head + exists = religious_head + } + # We are not required to seek approval of a house head + NAND = { + has_doctrine = doctrine_divorce_approval + exists = scope:actor.house + exists = scope:actor.house.house_head + scope:actor = { is_house_head = no } + } + } + scope:recipient = { + is_spouse_of = scope:actor + is_concubine = no # Can set aside Concubines at any time + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + NOT = { + scope:actor.culture = { + has_cultural_parameter = cannot_divorce + } + } + text = CULTURE_FORBIDS_DIVORCE + } + NOT = { + scope:actor.faith = { + has_doctrine = doctrine_divorce_disallowed + } + } + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + } + + auto_accept = yes + + on_accept = { + scope:actor = { + divorce_effect = { + DIVORCER = scope:actor + DIVORCEE = scope:recipient + } + if = { + limit = { + allowed_concubines = yes + } + custom_tooltip = divorce_cannot_concubine_ex_wife + } + } + scope:recipient = { + trigger_event = marriage_interaction.0030 + } + + # 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_divorce.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI + ai_targets = { + ai_recipients = spouses + } + ai_frequency = 36 + + ai_potential = { + is_ruler = yes + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to divorce should they not have an heir that is their own child, and their spouse is infertile + add = 100 + scope:actor = { + fertility > 0.1 + NOT = { + any_child = { + is_heir_of = scope:actor + } + } + } + scope:recipient = { + is_ai = yes + fertility < 0.1 + } + } + + modifier = { # The AI will divorce if they're in a same-sex marriage and their faith changes its stance on the topic + add = 100 + scope:actor = { + sex_same_as = scope:recipient + allowed_to_marry_same_sex_trigger = no + } + } + } +} + +divorce_character_house_head_interaction = { + category = interaction_category_diplomacy + use_diplomatic_range = no + icon = icon_marriage + + cost = { + piety = divorce_cost + } + + redirect = { + scope:recipient = { + save_scope_as = secondary_recipient + } + if = { + limit = { + exists = scope:actor.house.house_head + } + scope:actor.house.house_head = { + save_scope_as = recipient + } + } + } + + greeting = positive + notification_text = ASK_FOR_DIVORCE_NOTIFICATION + + is_shown = { + exists = scope:actor.house.house_head + NOT = { scope:actor = scope:actor.house.house_head } # no need to ask yourself + scope:actor.faith = { + has_doctrine = doctrine_divorce_approval + } + NAND = { + exists = scope:actor.faith.religious_head + scope:actor.faith = { + has_doctrine = doctrine_spiritual_head + } + } + scope:secondary_recipient = { + is_spouse_of = scope:actor + is_concubine = no # Can set aside Concubines at any time + } + } + + is_valid_showing_failures_only = { + # Denounced trait? + scope:recipient = { is_busy_in_events_localised = yes } + scope:secondary_recipient = { is_busy_in_events_localised = yes } + custom_tooltip = { + NOT = { + scope:actor.culture = { + has_cultural_parameter = cannot_divorce + } + } + text = CULTURE_FORBIDS_DIVORCE + } + NOT = { + scope:secondary_recipient = { has_strong_hook = scope:actor } + } + } + + ai_accept = { + base = 0 # Should be 0 for all interactions + + divorce_character_ai_accept_modifier = yes + + modifier = { # Infertility + add = 20 + desc = DIVORCE_INFERTILE + scope:actor = { + fertility > 0.1 + } + scope:secondary_recipient = { + fertility < 0.1 + is_eunuch_trigger = no + NOT = { + any_child = { + is_child_of = scope:actor + } + } + } + } + + modifier = { # Negative for having given you children + add = -50 + desc = DIVORCE_GIVEN_CHILDREN + scope:secondary_recipient = { + any_child = { + count >= 3 + is_child_of = scope:actor + AND = { + exists = dynasty + dynasty = scope:actor.dynasty + } + } + } + } + + modifier = { # They are of the same dynasty as the House Head + trigger = { NOT = { scope:recipient = scope:secondary_recipient } } + add = -10 + desc = THEY_ARE_MY_DYNASTY_MEMBER + scope:recipient = { + is_lowborn = no + exists = dynasty + NOR = { + is_cousin_of = scope:secondary_recipient + is_close_or_extended_family_of = scope:secondary_recipient + } + dynasty = scope:secondary_recipient.dynasty + NOR = { + house = scope:secondary_recipient.house + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + AND = { + exists = scope:actor.dynasty + scope:recipient.dynasty = scope:actor.dynasty + } + } + } + } + + modifier = { # They are of the same house as the House Head + trigger = { NOT = { scope:recipient = scope:secondary_recipient } } + add = -20 + desc = THEY_ARE_MY_HOUSE_MEMBER + scope:recipient = { + is_lowborn = no + NOR = { + is_cousin_of = scope:secondary_recipient + is_close_or_extended_family_of = scope:secondary_recipient + } + house = scope:secondary_recipient.house + NOR = { + house = scope:actor.house + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.house = scope:actor.house + } + } + } + + modifier = { # They are close kin to the House Head + trigger = { NOT = { scope:recipient = scope:secondary_recipient } } + add = -35 + desc = THEY_ARE_MY_CLOSE_KIN + scope:recipient = { + OR = { + is_cousin_of = scope:secondary_recipient + is_close_or_extended_family_of = scope:secondary_recipient + } + } + } + + 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 + } + + modifier = { # You're in a same-sex marriage and your faith doesn't allow it + add = 100 + desc = SAME_SEX_MARRIAGE_FAITH_REASON_ACTOR + scope:actor.faith = scope:recipient.faith + scope:actor = { + sex_same_as = scope:secondary_recipient + allowed_to_marry_same_sex_trigger = no + } + } + + modifier = { # You're in a same-sex marriage and their faith doesn't allow it + add = 100 + desc = SAME_SEX_MARRIAGE_FAITH_REASON + scope:secondary_recipient.faith = scope:recipient.faith + scope:secondary_recipient = { + sex_same_as = scope:actor + allowed_to_marry_same_sex_trigger = no + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:divorce_hook = yes + } + } + + send_option = { + is_shown = { + NOT = { scope:actor = scope:recipient } + } + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = divorce_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" + + send_options_exclusive = no + + ai_min_reply_days = 1 + ai_max_reply_days = 5 + + on_accept = { + if = { + limit = { always = scope:divorce_hook } + scope:actor = { + if = { + limit = { + has_usable_hook = scope:recipient + } + use_hook = scope:recipient + } + } + } + if = { + limit = { + scope:actor = scope:actor.house.house_head + } + scope:actor = { + divorce_effect = { + DIVORCER = scope:actor + DIVORCEE = scope:secondary_recipient + } + } + } + else = { + show_as_tooltip = { + scope:actor = { + divorce_effect = { + DIVORCER = scope:actor + DIVORCEE = scope:secondary_recipient + } + } + } + scope:actor = { + trigger_event = religious_interaction.2 + } + } + + # 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_divorce_grant.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + send_interface_toast = { + type = event_toast_effect_bad + title = divorce_character_rel_head_interaction_decline_notification + right_icon = scope:actor.house.house_head + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_divorce_grant_refusal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI + ai_targets = { + ai_recipients = spouses + } + ai_frequency = 36 + + ai_potential = { + is_ruler = yes + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to divorce should they not have an heir that is their own child, and their spouse is infertile + add = 100 + scope:actor = { + fertility > 0.1 + NOT = { + any_child = { + is_heir_of = scope:actor + } + } + } + scope:secondary_recipient = { + is_ai = yes + fertility < 0.1 + } + } + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:divorce_hook = yes + add = -1 + } + + modifier = { # You're in a same-sex marriage and your faith doesn't allow it + add = 100 + scope:actor = { + sex_same_as = scope:secondary_recipient + allowed_to_marry_same_sex_trigger = no + } + } + } +} + +divorce_character_rel_head_interaction = { + category = interaction_category_diplomacy + use_diplomatic_range = no + icon = icon_marriage + + cost = { + piety = divorce_cost + } + + redirect = { + scope:recipient = { + save_scope_as = secondary_recipient + } + + if = { + limit = { + exists = scope:actor.faith.religious_head + } + scope:actor.faith.religious_head = { + save_scope_as = recipient + } + } + } + + greeting = positive + notification_text = ASK_FOR_DIVORCE_NOTIFICATION + + is_shown = { + exists = scope:actor.faith.religious_head + scope:actor.faith = { + has_doctrine = doctrine_spiritual_head + has_doctrine = doctrine_divorce_approval + } + scope:secondary_recipient = { + is_spouse_of = scope:actor + is_concubine = no # Can set aside Concubines at any time + } + } + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { has_trait = excommunicated } + } + scope:recipient = { is_busy_in_events_localised = yes } + scope:secondary_recipient = { is_busy_in_events_localised = yes } + custom_tooltip = { + NOT = { + scope:actor.culture = { + has_cultural_parameter = cannot_divorce + } + } + text = CULTURE_FORBIDS_DIVORCE + } + NOT = { + scope:secondary_recipient = { has_strong_hook = scope:actor } + } + } + + ai_accept = { + base = 0 # Should be 0 for all interactions + + divorce_character_ai_accept_modifier = yes + + modifier = { # Divine Family is part of the faith + add = -100 + desc = DIVORCE_INCESTUOUS + + scope:actor = { + is_close_or_extended_family_of = scope:secondary_recipient + faith = { has_doctrine = tenet_divine_marriage } + } + } + + modifier = { # More likely if the marriage is incestuous, unless Divine Family is part of the faith + add = 100 + desc = DIVORCE_INCESTUOUS + + scope:actor = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } + } + } + + modifier = { # They are of the same dynasty as the Head of Faith + add = -5 + desc = THEY_ARE_MY_DYNASTY_MEMBER + scope:recipient = { + is_lowborn = no + exists = dynasty + exists = scope:secondary_recipient.dynasty + dynasty = scope:secondary_recipient.dynasty + NOR = { + house = scope:secondary_recipient.house + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.dynasty = scope:actor.dynasty + } + } + } + + modifier = { # You are of the same dynasty as the Head of Faith + add = 5 + desc = YOU_ARE_MY_DYNASTY_MEMBER + scope:recipient = { + is_lowborn = no + exists = dynasty + exists = scope:actor.dynasty + dynasty = scope:actor.dynasty + NOR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.dynasty = scope:secondary_recipient.dynasty + } + } + } + + modifier = { # They are of the same house as the Head of Faith + add = -10 + desc = THEY_ARE_MY_HOUSE_MEMBER + scope:recipient = { + is_lowborn = no + exists = house + exists = scope:secondary_recipient.house + house = scope:secondary_recipient.house + NOR = { + house = scope:actor.house + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.house = scope:actor.house + } + } + } + + modifier = { # You are of the same house as the Head of Faith + add = 10 + desc = YOU_ARE_MY_HOUSE_MEMBER + scope:recipient = { + is_lowborn = no + exists = house + exists = scope:actor.house + house = scope:actor.house + NOR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.house = scope:secondary_recipient.house + } + } + } + + modifier = { # Related to the Head of Faith + add = 25 + desc = YOU_ARE_MY_RELATIVE + scope:recipient = { + OR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + } + NOT = { is_child_of = scope:actor } + } + } + + modifier = { # Parent of the Head of Faith + add = 50 + desc = PARENTS #YOU_ARE_MY_PARENT + scope:recipient = { + is_child_of = scope:actor + } + } + + modifier = { + add = { + add = 10 + multiply = scope:actor.num_virtuous_traits + } + scope:actor.num_virtuous_traits > 0 + desc = I_AM_VIRTUOUS + } + + modifier = { + add = { + add = -10 + multiply = scope:secondary_recipient.num_virtuous_traits + } + scope:secondary_recipient.num_virtuous_traits > 0 + desc = THEY_ARE_VIRTUOUS + } + + modifier = { + add = { + add = -10 + multiply = scope:actor.num_sinful_traits + } + scope:actor.num_sinful_traits > 0 + desc = I_AM_SINFUL + } + + modifier = { + add = { + add = 10 + multiply = scope:secondary_recipient.num_sinful_traits + } + scope:secondary_recipient.num_sinful_traits > 0 + desc = THEY_ARE_SINFUL + } + + modifier = { # You're in a same-sex marriage and your faith doesn't allow it + add = 100 + desc = SAME_SEX_MARRIAGE_FAITH_REASON_ACTOR + scope:actor.faith = scope:recipient.faith + scope:actor = { + sex_same_as = scope:secondary_recipient + allowed_to_marry_same_sex_trigger = no + } + } + + modifier = { # You're in a same-sex marriage and their faith doesn't allow it + add = 100 + desc = SAME_SEX_MARRIAGE_FAITH_REASON + scope:secondary_recipient.faith = scope:recipient.faith + scope:secondary_recipient = { + sex_same_as = scope:actor + allowed_to_marry_same_sex_trigger = no + } + } + + modifier = { # You have denounced them as impotent (ep2_wedding.1061) + add = 30 + desc = THEY_ARE_ACCUSED_IMPOTENCY + scope:secondary_recipient = { + has_character_modifier = wedding_accused_impotency_modifier + } + } + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:divorce_hook = yes + } + } + + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = divorce_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" + + send_options_exclusive = no + + ai_min_reply_days = 1 + ai_max_reply_days = 5 + + on_accept = { + if = { + limit = { always = scope:divorce_hook } + scope:actor = { + if = { + limit = { + has_usable_hook = scope:recipient + } + use_hook = scope:recipient + } + } + } + show_as_tooltip = { + scope:actor = { + divorce_effect = { + DIVORCER = scope:actor + DIVORCEE = scope:secondary_recipient + } + } + } + scope:actor = { + trigger_event = religious_interaction.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_alliance.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + send_interface_toast = { + type = event_toast_effect_bad + title = divorce_character_rel_head_interaction_decline_notification + + right_icon = scope:actor.faith.religious_head + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_alliance.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI + ai_targets = { + ai_recipients = spouses + } + ai_frequency = 36 + + ai_potential = { + is_ruler = yes + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to divorce should they not have an heir that is their own child, and their spouse is infertile + add = 100 + scope:actor = { + fertility > 0.1 + NOT = { + any_child = { + is_heir_of = scope:actor + } + } + } + scope:secondary_recipient = { + is_ai = yes + fertility < 0.1 + } + } + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:divorce_hook = yes + add = -1 + } + + modifier = { # You're in a same-sex marriage and your faith doesn't allow it + add = 100 + scope:actor = { + sex_same_as = scope:secondary_recipient + allowed_to_marry_same_sex_trigger = no + } + } + } +} + +divorce_character_dynast_request_interaction = { + category = interaction_category_diplomacy + use_diplomatic_range = no + icon = icon_dynasty + + desc = divorce_character_dynast_request_interaction_desc + + cost = { + piety = divorce_cost + renown = minor_dynasty_prestige_value + } + + redirect = { + scope:recipient = { + save_scope_as = secondary_actor + } + + if = { + limit = { + exists = scope:recipient.primary_spouse + } + scope:recipient.primary_spouse = { + save_scope_as = recipient + } + } + } + + is_shown = { + NOT = { scope:secondary_actor = scope:actor } + scope:secondary_actor.dynasty.dynast = scope:actor + + scope:actor.faith = { + # We are not required to seek approval of a spiritual HoF + NAND = { + has_doctrine = doctrine_divorce_approval + has_doctrine = doctrine_spiritual_head + exists = religious_head + } + } + OR = { + AND = { + NOT = { scope:actor.faith = scope:secondary_actor.faith } + # They are not required to seek approval of a spiritual HoF of the Dynasty Member + scope:secondary_actor.faith = { + NOT = { + has_doctrine = doctrine_divorce_approval + } + } + } + scope:actor.faith = scope:secondary_actor.faith + } + + scope:recipient = { + is_spouse_of = scope:secondary_actor + is_concubine = no # Can set aside Concubines at any time + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + NOT = { + scope:actor.culture = { + has_cultural_parameter = cannot_divorce + } + } + text = CULTURE_FORBIDS_DIVORCE + } + NOT = { + scope:actor.faith = { + has_doctrine = doctrine_divorce_disallowed + } + } + scope:actor.dynasty = { + dynasty_prestige >= minor_dynasty_prestige_value + } + + NOT = { + scope:secondary_actor.faith = { + has_doctrine = doctrine_divorce_disallowed + } + } + scope:secondary_actor = { is_busy_in_events_localised = yes } + scope:secondary_actor = { NOT = { has_strong_hook = scope:actor } } + trigger_if = { + limit = { + scope:secondary_actor = { + NOR = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + } + } + custom_description = { + scope:secondary_actor.top_liege = scope:actor.top_liege + text = "same_realm_as" + } + } + } + + auto_accept = yes + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = divorce_character_dynast_request_interaction_title + custom_tooltip = divorce_character_dynast_request_interaction_desc + + left_icon = scope:secondary_actor + right_icon = scope:recipient + } + } + + + scope:secondary_actor = { + divorce_effect = { + DIVORCER = scope:secondary_actor + DIVORCEE = scope:recipient + } + + add_opinion = { + modifier = forced_divorce_opinion + target = scope:actor + } + } + if = { + limit = { + NOT = { scope:recipient = scope:actor } + } + scope:recipient = { + trigger_event = marriage_interaction.0030 + + add_opinion = { + modifier = forced_divorce_opinion + target = scope:actor + } + } + } + } + + # AI + ai_targets = { + ai_recipients = dynasty + max = 10 + } + ai_frequency = 72 + + ai_potential = { + is_ruler = yes + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to force a divorce if their heir is not from their dynasty and current marriage within the dynasty are not promising + add = 100 + scope:secondary_actor = { + fertility > 0.1 + } + scope:recipient = { + is_ai = yes + fertility < 0.1 + } + exists = scope:actor.primary_heir + exists = scope:actor.primary_heir.dynasty + NOT = { scope:actor.primary_heir.dynasty = this.dynasty } + } + + #Players should not be targeted + modifier = { + add = -1000 + OR = { + scope:secondary_actor = { is_ai = no } + scope:recipient = { is_ai = no } + } + } + } +} + +divorce_character_dynast_request_rel_head_interaction = { + category = interaction_category_diplomacy + use_diplomatic_range = no + icon = icon_dynasty + + cost = { + piety = divorce_cost + renown = minor_dynasty_prestige_value + } + + redirect = { + scope:recipient = { + save_scope_as = secondary_actor + } + + if = { + limit = { + exists = scope:recipient.primary_spouse + } + scope:recipient.primary_spouse = { + save_scope_as = secondary_recipient + } + } + + if = { + limit = { + exists = scope:actor.faith.religious_head + } + scope:actor.faith.religious_head = { + save_scope_as = recipient + } + } + } + + greeting = positive + notification_text = ASK_FOR_DIVORCE_NOTIFICATION + + is_shown = { + NOT = { scope:secondary_actor = scope:actor } + scope:secondary_actor.dynasty.dynast = scope:actor + NOT = { + scope:secondary_actor = { is_spouse_of = scope:actor } + } + + exists = scope:secondary_recipient + + scope:actor.faith = scope:secondary_actor.faith + exists = scope:actor.faith.religious_head + scope:actor.faith = { + has_doctrine = doctrine_spiritual_head + has_doctrine = doctrine_divorce_approval + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + NOT = { + scope:actor.culture = { + has_cultural_parameter = cannot_divorce + } + } + text = CULTURE_FORBIDS_DIVORCE + } + scope:actor.dynasty = { + dynasty_prestige >= minor_dynasty_prestige_value + } + + scope:secondary_actor = { is_busy_in_events_localised = yes } + scope:secondary_actor = { NOT = { has_strong_hook = scope:actor } } + trigger_if = { + limit = { + scope:secondary_actor = { + NOR = { + is_child_of = scope:actor + is_grandchild_of = scope:actor + is_great_grandchild_of = scope:actor + } + } + } + custom_description = { + scope:secondary_actor.top_liege = scope:actor.top_liege + text = "same_realm_as" + } + } + } + + ai_accept = { + base = 0 # Should be 0 for all interactions + + divorce_character_ai_accept_modifier = yes + + modifier = { # Divine Family is part of the faith + add = -100 + desc = DIVORCE_INCESTUOUS + + scope:secondary_actor = { + is_close_or_extended_family_of = scope:secondary_recipient + faith = { has_doctrine = tenet_divine_marriage } + } + } + + modifier = { # More likely if the marriage is incestuous, unless Divine Family is part of the faith + add = 100 + desc = DIVORCE_INCESTUOUS + + scope:secondary_actor = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } + } + } + + modifier = { # You are of the same dynasty as the Head of Faith + add = 5 + desc = YOU_ARE_MY_DYNASTY_MEMBER + scope:recipient = { + is_lowborn = no + dynasty = scope:actor.dynasty + NOR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.dynasty = scope:secondary_recipient.dynasty + } + } + } + + + modifier = { # You are of the same house as the Head of Faith + add = 10 + desc = YOU_ARE_MY_HOUSE_MEMBER + scope:recipient = { + is_lowborn = no + house = scope:actor.house + NOR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.house = scope:secondary_recipient.house + } + } + } + + modifier = { # Related to the Head of Faith + add = 25 + desc = YOU_ARE_MY_RELATIVE + scope:recipient = { + OR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + } + NOT = { is_child_of = scope:actor } + } + } + + modifier = { # Parent of the Head of Faith + add = 50 + desc = PARENTS #YOU_ARE_MY_PARENT + scope:recipient = { + is_child_of = scope:actor + } + } + + modifier = { + add = { + add = 10 + multiply = scope:actor.num_virtuous_traits + } + scope:actor.num_virtuous_traits > 0 + desc = I_AM_VIRTUOUS + } + + modifier = { + add = { + add = -10 + multiply = scope:secondary_recipient.num_virtuous_traits + } + scope:secondary_recipient.num_virtuous_traits > 0 + desc = THEY_ARE_VIRTUOUS + } + + modifier = { + add = { + add = -10 + multiply = scope:actor.num_sinful_traits + } + scope:actor.num_sinful_traits > 0 + desc = I_AM_SINFUL + } + + modifier = { + add = { + add = 10 + multiply = scope:secondary_recipient.num_sinful_traits + } + scope:secondary_recipient.num_sinful_traits > 0 + desc = THEY_ARE_SINFUL + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:divorce_hook = yes + } + } + + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = divorce_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" + + send_options_exclusive = no + + ai_min_reply_days = 1 + ai_max_reply_days = 5 + + on_accept = { + if = { + limit = { always = scope:divorce_hook } + scope:actor = { + if = { + limit = { + has_usable_hook = scope:recipient + } + use_hook = scope:recipient + } + } + } + scope:actor = { + trigger_event = religious_interaction.6 + } + + scope:secondary_actor = { + divorce_effect = { + DIVORCER = scope:secondary_actor + DIVORCEE = scope:secondary_recipient + } + add_opinion = { + modifier = forced_divorce_opinion + target = scope:actor + } + } + + scope:secondary_recipient = { + add_opinion = { + modifier = forced_divorce_opinion + target = scope:actor + } + } + } + + on_decline = { + send_interface_toast = { + type = event_toast_effect_bad + title = divorce_character_dynast_request_rel_head_interaction_decline_notification + + right_icon = scope:actor.faith.religious_head + } + } + + # AI + ai_targets = { + ai_recipients = dynasty + max = 10 + } + ai_frequency = 72 + + ai_potential = { + is_ruler = yes + } + + ai_will_do = { + base = 0 + + modifier = { # The AI wants to force a divorce if their heir is not from their dynasty and current marriage within the dynasty are not promising + add = 100 + scope:secondary_actor = { + fertility > 0.1 + } + scope:secondary_recipient = { + is_ai = yes + fertility < 0.1 + } + exists = scope:actor.primary_heir + exists = scope:actor.primary_heir.dynasty + NOT = { scope:actor.primary_heir.dynasty = this.dynasty } + } + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:divorce_hook = yes + add = -1 + } + + #Players should not be targeted + modifier = { + add = -1000 + OR = { + scope:secondary_actor = { is_ai = no } + scope:secondary_recipient = { is_ai = no } + } + } + } +} + +elope_interaction = { + icon = icon_scheme_elope + category = interaction_category_friendly + + scheme = elope + + desc = elope_interaction_desc + + notification_text = elope_interaction_notification + + ai_targets = { + ai_recipients = realm_characters + chance = 0.25 + } + + ai_target_quick_trigger = { + adult = yes + attracted_to_owner = yes + owner_attracted = yes + } + ai_frequency = 72 + + redirect = { + scope:recipient = { + save_scope_as = secondary_recipient + } + } + + is_shown = { + scope:actor = { + OR = { + has_relation_lover = scope:recipient + has_relation_soulmate = scope:recipient + AND = { + is_landless_adventurer = yes + has_perk = accomplished_forger_perk + } + } + } + scope:recipient = { + is_adult = yes + is_courtier = yes + NOR = { + is_courtier_of = scope:actor + is_consort_of = scope:actor + } + could_marry_character_trigger = { CHARACTER = scope:actor } + } + } + + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { + can_start_scheme = { + type = elope + target_character = scope:recipient + } + } + } + + + ai_accept = { + base = 0 + + elopment_ai_accept_modifier = yes + } + + ai_potential = { + is_adult = yes + OR = { + num_of_relation_lover > 0 + num_of_relation_soulmate > 0 + } + NOR = { + has_trait = celibate + scheme_generic_ai_blocker_trigger = yes + } + } + + ai_min_reply_days = 1 + ai_max_reply_days = 3 + + on_accept = { + scope:actor = { + stress_impact = { + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + } + show_as_tooltip = { + elope_success_effect = { + TARGET = scope:recipient + OWNER = scope:actor + } + } + } + hidden_effect = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = elope_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + begin_scheme_basic_effect = { + SCHEME_TYPE = elope + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + } + + show_as_tooltip = { + stress_impact = { + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + } + } + } + } + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = elope_interaction_decline_toast + left_icon = scope:recipient + } + } + } + + ai_will_do = { + base = 100 + } +} diff --git a/common/character_interactions/00_modifiy_vassal_contract.txt b/common/character_interactions/00_modifiy_vassal_contract.txt new file mode 100644 index 00000000..179a1bb4 --- /dev/null +++ b/common/character_interactions/00_modifiy_vassal_contract.txt @@ -0,0 +1,1153 @@ +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 = "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 = { + NOT = { this = scope:actor } + exists = liege + liege = scope:actor + is_ruler = yes + vassal_contract_has_modifiable_obligations = yes + NOT = { has_government = administrative_government } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_busy_in_events_localised = yes + } + 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 = { + vassal_contract_is_blocked_from_modification = yes + } + } + scope:recipient = { + vassal_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_vassal_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 + } + } + + } + } + } + + # 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 = { + is_independent_ruler = no + NOT = { this = scope:actor } + liege = scope:actor + vassal_contract_has_modifiable_obligations = yes + NOT = { has_government = administrative_government } + } + } + + is_valid_showing_failures_only = { + scope:actor = { is_busy_in_events_localised = yes } + 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 = { + vassal_contract_is_blocked_from_modification = yes + } + } + scope:recipient = { + vassal_contract_is_blocked_from_modification = no + } + } + trigger_else = { + 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 } + } + + hidden_effect = { set_vassal_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 + + 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 } + } + 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 +} + +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 + OR = { + has_usable_hook = scope:recipient + AND = { + has_government = administrative_government + scope:recipient = { has_government = administrative_government } + } + } + } + scope:recipient = { + NOT = { this = scope:actor } + NOT = { + has_strong_hook = scope:actor + } + exists = liege + liege = scope:actor + is_ruler = yes + OR = { + vassal_contract_can_be_modified_trigger = yes + has_government = administrative_government + } + does_ai_liege_in_vassal_contract_desire_obligation_change = yes + } + scope:recipient = { is_busy_in_events_localised = yes } + NOT = { scope:actor = { is_at_war_with = scope:recipient } } + } + + on_accept = { + scope:actor = { + stress_impact = { + generous = minor_stress_impact_gain + } + } + + scope:recipient = { + set_vassal_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_has_flag = government_is_administrative } + } + is_at_war = no + } + } + + ai_targets = { + ai_recipients = vassals + } + ai_frequency = 24 + + 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_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 + is_independent_ruler = no + has_usable_hook = scope:recipient + vassal_contract_can_be_modified_trigger = yes + does_ai_vassal_in_vassal_contract_desire_obligation_change = yes + } + scope:recipient = { + NOT = { this = scope:actor } + is_ruler = yes + NOT = { + has_strong_hook = scope:actor + } + } + scope:recipient = { is_busy_in_events_localised = yes } + 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 = 24 + + 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_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 = admin_liege_modify_vassal_contract_interaction + desc = admin_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 } + exists = liege + liege = scope:actor + is_ruler = yes + vassal_contract_has_modifiable_obligations = yes + has_government = administrative_government + any_held_title = { + tier >= tier_duchy + is_noble_family_title = no + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_busy_in_events_localised = yes + } + 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 = { + vassal_contract_is_blocked_from_modification = yes + } + } + scope:recipient = { + vassal_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_vassal + scope:recipient = { + NOT = { has_variable = admin_contract_cooldown } + } + } + } + } + } + + 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 + } + } + + } + } + } + + # 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_admin + interface_priority = 65 + common_interaction = yes + icon = icon_contract_modification_single + + send_name = "admin_vassal_modify_vassal_contract_interaction_send" + desc = admin_vassal_modify_vassal_contract_interaction_desc + + is_shown = { + scope:actor = { + is_independent_ruler = no + NOT = { this = scope:recipient } + liege = scope:recipient + vassal_contract_has_modifiable_obligations = yes + has_government = administrative_government + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + NOT = { scope:recipient = { is_at_war_with = scope:actor } } + scope:actor = { + custom_tooltip = { + text = admin_vassal_not_holding_a_theme_desc + any_held_title = { + tier >= tier_duchy + is_noble_family_title = no + } + } + } + } + + can_send = { + any_in_list = { + list = changed_obligations + } + 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 = { + vassal_contract_is_blocked_from_modification = yes + } + } + scope:actor = { + vassal_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 } + } + } + } + + # 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 = { + 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 + } + } + } + } + } + + # 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 + } + } +} diff --git a/common/character_interactions/00_mongol_interactions.txt b/common/character_interactions/00_mongol_interactions.txt new file mode 100644 index 00000000..425ce3a3 --- /dev/null +++ b/common/character_interactions/00_mongol_interactions.txt @@ -0,0 +1,57 @@ +################### +# Demand Subjugation +# by Petter Vilberg +################### +mongol_demand_subjugation_interaction = { + category = interaction_category_hostile + icon = icon_dismiss_temporary_regency + + auto_accept = yes + use_diplomatic_range = yes + + desc = mongol_demand_subjugation_interaction_desc + + is_shown = { + scope:actor = { + any_owned_story = { + story_type = story_mongol_invasion + } + highest_held_title_tier = tier_empire + is_independent_ruler = yes + } + scope:recipient = { + NOT = { this = scope:actor } + is_landless_adventurer = no + is_independent_ruler = yes + any_neighboring_top_liege_realm_owner = { + this = scope:actor + } + } + } + + is_valid_showing_failures_only = { + OR = { + scope:recipient = { + highest_held_title_tier <= tier_kingdom + } + scope:actor = { + is_target_in_variable_list = { + name = subjugation_offer_under_consideration + target = scope:recipient + } + } + } + } + + on_accept = { + custom_tooltip = mongol_demand_subjugation_interaction_tooltip + hidden_effect = { + scope:actor = { + save_scope_as = mongol_emperor + } + scope:recipient = { + send_mongol_subjugation_demand_effect = yes + } + } + } +} diff --git a/common/character_interactions/00_perk_interactions.txt b/common/character_interactions/00_perk_interactions.txt new file mode 100644 index 00000000..91d54e07 --- /dev/null +++ b/common/character_interactions/00_perk_interactions.txt @@ -0,0 +1,1449 @@ +################### +# Claim Throne +# by Petter Vilberg +################### +claim_throne_interaction = { + icon = icon_scheme_claim_throne + category = interaction_category_hostile + + ai_targets = { + ai_recipients = liege + } + + auto_accept = yes + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + scheme = claim_throne + + desc = claim_throne_interaction_desc + + is_shown = { + exists = scope:actor.liege + scope:recipient = scope:actor.liege + scope:actor = { + is_landless_adventurer = no + highest_held_title_tier > tier_barony + OR = { + has_perk = meritocracy_perk + AND = { + is_diarch_of_target = scope:recipient + scope:recipient = { + NOT = { has_diarchy_parameter = can_be_instantly_dismissed } + } + } + AND = { + is_powerful_vassal_of = scope:recipient + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_claim_throne_for_powerful_vassals + is_secondary_character_involvement_involved_trigger = { + CHAR = scope:recipient + } + } + } + AND = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_claim_throne_for_all + is_secondary_character_involvement_involved_trigger = { + CHAR = scope:recipient + } + } + } + AND = { + exists = title:d_sunni.holder + is_vassal_of = title:d_sunni.holder + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_claim_throne_for_caliph_vassals + } + } + } + } + NOT = { scope:recipient = scope:actor } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_physically_able_adult = yes + can_start_scheme = { + target_character = scope:recipient + type = claim_throne + } + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Balanced agents. + send_option = { + flag = agent_focus_balance + current_description = claim_throne_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = claim_throne_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = claim_throne_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = claim_throne_interaction.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + stress_impact = { + content = medium_stress_impact_gain + just = medium_stress_impact_gain + } + send_interface_toast = { + type = event_toast_effect_good + title = claim_throne_interaction_toast + left_icon = scope:actor + right_icon = scope:recipient + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = claim_throne + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_diplomat + AGENT_2 = agent_diplomat + AGENT_3 = agent_scribe + # Speed. + AGENT_4 = agent_cleric + # Secrecy. + AGENT_5 = agent_justiciar + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = claim_throne + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_cleric + AGENT_2 = agent_socialite + AGENT_3 = agent_gabbler + # Success. + AGENT_4 = agent_diplomat + # Secrecy. + AGENT_5 = agent_justiciar + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = claim_throne + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_justiciar + AGENT_2 = agent_justiciar + AGENT_3 = agent_decoy + # Success. + AGENT_4 = agent_diplomat + # Speed. + AGENT_5 = agent_cleric + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = claim_throne + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_diplomat + AGENT_2 = agent_scribe + # Speed. + AGENT_3 = agent_cleric + AGENT_4 = agent_socialite + # Secrecy. + AGENT_5 = agent_decoy + } + } + + show_as_tooltip = { + stress_impact = { + content = medium_stress_impact_gain + just = medium_stress_impact_gain + } + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_throne_claim.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_potential = { + is_adult = yes + highest_held_title_tier > tier_barony + ai_greed >= medium_positive_ai_value + learning >= medium_skill_rating + intrigue >= mediocre_skill_rating + trigger_if = { + limit = { + liege = { save_temporary_scope_as = struggle_liege } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_claim_throne_for_all + is_secondary_character_involvement_involved_trigger = { + CHAR = scope:struggle_liege + } + } + } + is_powerful_vassal = yes + } + NOR = { + has_trait = content + opinion = { + target = liege + value >= high_positive_opinion + } + any_scheme = { + OR = { + scheme_type = murder + scheme_type = abduct + scheme_type = claim_throne + scheme_type = fabricate_hook + scheme_type = steal_back_artifact + } + } + } + } + + ai_frequency = 36 + + ai_will_do = { + base = 100 + + # 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 + } + has_trait = fp3_struggle_supporter + } + scope:recipient = { + has_trait = fp3_struggle_detractor + } + } + add = 100 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_gain_claim_on_title_fp3 + } + } + } + add = -100 + } + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + start_hostile_scheme_ai_base_modifiers = yes # At the end so Cowed can block it completely + } +} + + +################### +# Fabricate Hook +# by Petter Vilberg +################### +fabricate_hook_interaction = { + icon = icon_scheme_fabricate_hook + category = interaction_category_hostile + + auto_accept = yes + ignores_pending_interaction_block = yes + + scheme = fabricate_hook + + desc = fabricate_hook_interaction_desc + + is_shown = { + scope:actor = { + OR = { + has_perk = truth_is_relative_perk + AND = { + has_trait = vengeful + has_relation_rival = scope:recipient + } + AND = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_fabricate_hooks_for_all + is_secondary_character_involvement_either_trigger = { + CHAR = scope:recipient + } + } + } + AND = { + government_has_flag = government_is_clan + is_in_same_clan_as_trigger = { CHARACTER = scope:recipient } + house = { has_house_unity_stage = competitive } + } + } + } + NOT = { scope:recipient = scope:actor } + } + + is_valid = { + NOT = { scope:actor = { has_hook = scope:recipient } } + OR = { + scope:actor = { + OR = { + has_perk = truth_is_relative_perk # To display that it's available because of the Perk + AND = { + has_trait = vengeful + has_relation_rival = scope:recipient + } + AND = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_fabricate_hooks_for_all + is_secondary_character_involvement_either_trigger = { + CHAR = scope:recipient + } + } + } + AND = { + government_has_flag = government_is_clan + is_in_same_clan_as_trigger = { CHARACTER = scope:recipient } + house = { has_house_unity_stage = competitive } + } + } + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_physically_able_adult = yes + can_start_scheme = { + target_character = scope:recipient + type = fabricate_hook + } + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Balanced agents. + send_option = { + flag = agent_focus_balance + current_description = fabricate_hook_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = fabricate_hook_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = fabricate_hook_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = fabricate_hook_interaction.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + stress_impact = { + just = medium_stress_impact_gain + honest = medium_stress_impact_gain + compassionate = minor_stress_impact_gain + } + send_interface_toast = { + type = event_toast_effect_good + title = fabricate_hook_interaction_toast + left_icon = scope:actor + right_icon = scope:recipient + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = fabricate_hook + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_outcast + AGENT_2 = agent_diplomat + AGENT_3 = agent_thief + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = fabricate_hook + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_infiltrator + AGENT_2 = agent_footpad + AGENT_3 = agent_socialite + # Success. + AGENT_4 = agent_outcast + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = fabricate_hook + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_decoy + AGENT_3 = agent_justiciar + # Success. + AGENT_4 = agent_outcast + # Speed. + AGENT_5 = agent_footpad + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = fabricate_hook + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_outcast + AGENT_2 = agent_thief + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_footpad + # Secrecy. + AGENT_5 = agent_lookout + } + } + show_as_tooltip = { + stress_impact = { + just = medium_stress_impact_gain + honest = medium_stress_impact_gain + compassionate = minor_stress_impact_gain + } + } + } + } + } + + ai_targets = { + ai_recipients = liege + ai_recipients = vassals + } + + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + max = 10 + } + + ai_targets = { + ai_recipients = courtiers + max = 5 + } + + ai_targets = { + ai_recipients = realm_characters + ai_recipients = top_realm_domicile_owners + max = 30 + } + + ai_potential = { + is_adult = yes + ai_greed >= low_positive_ai_value + intrigue >= medium_skill_rating + NOR = { + has_trait = content + any_scheme = { + OR = { + scheme_type = murder + scheme_type = abduct + scheme_type = claim_throne + scheme_type = fabricate_hook + scheme_type = steal_back_artifact + } + } + } + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_frequency = 12 + + ai_will_do = { + base = 10 + + modifier = { + add = { + value = 20 + if = { + limit = { + exists = scope:recipient.cp:councillor_spymaster + scope:recipient.cp:councillor_spymaster = { intrigue < 10 } + } + add = 50 + } + } + + scope:recipient = { + is_vassal_of = scope:actor + vassal_contract_has_modifiable_obligations = yes + } + } + + modifier = { + add = -50 + + opinion = { + target = scope:recipient + value >= high_positive_opinion + } + } + + modifier = { + add = -40 + + scope:recipient = { + is_playable_character = yes + NOT = { + is_vassal_of = scope:actor + } + } + } + + modifier = { + add = 50 + + scope:recipient = { + is_playable_character = no + OR = { + liege = scope:actor.liege + liege = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + } + } + + modifier = { + factor = 0 + + scope:recipient = { + has_council_position = councillor_spymaster + } + } + start_hostile_scheme_ai_base_modifiers = yes # At the end so Cowed can block it completely + } +} + + +################### +# Demand Payment +# by Petter Vilberg +################### +demand_payment_interaction = { + category = interaction_category_diplomacy + icon = icon_gold + + auto_accept = yes + use_diplomatic_range = yes + + desc = demand_payment_interaction_desc + + is_shown = { + scope:actor = { + OR = { + has_perk = golden_obligations_perk + AND = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_demand_payments_for_all + is_secondary_character_involvement_either_trigger = { + CHAR = scope:recipient + } + } + } + } + } + scope:recipient = { + is_ai = yes + } + NOT = { scope:recipient = scope:actor } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_physically_able_adult = yes + NOT = { + is_at_war_with = scope:recipient + } + } + scope:recipient = { + is_imprisoned = no + } + scope:recipient = { + custom_description = { + text = demand_payment_too_little_gold + gold >= 1 + } + } + } + + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + + is_highlighted = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + + on_accept = { + if = { + limit = { + scope:recipient.gold < scope:recipient.golden_obligation_value + } + custom_tooltip = demand_payment_too_little_gold_tt + } + scope:actor = { + send_interface_toast = { + title = demand_payment_interaction_message + left_icon = scope:recipient + + scope:actor = { + use_hook = scope:recipient + } + scope:recipient = { + if = { + pay_short_term_gold = { + target = scope:actor + gold = golden_obligation_value + } + limit = { + gold > golden_obligation_value + } + } + else = { + pay_short_term_gold = { + target = scope:actor + gold = { + value = scope:recipient.gold + floor = yes + } + } + } + } + } + stress_impact = { + generous = medium_stress_impact_gain + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_demand_payment.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_potential = { + NOT = { + has_trait = generous + } + OR = { + ai_greed >= low_positive_ai_value + is_at_war = yes + } + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + ai_recipients = hooked_characters + } + + ai_frequency = 36 + + ai_will_do = { + base = 100 + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = -100 + } + + modifier = { #ai won't use the interaction if they'll get nothing out of it + factor = 0 + scope:recipient.gold < 8 + } + + modifier = { + factor = 0 + scope:actor = { + OR = { + has_relation_friend = scope:recipient + has_relation_lover = scope:recipient + has_relation_best_friend = scope:recipient + has_relation_soulmate = scope:recipient + } + } + } + } +} + + + +################## +# Buy Claim +# by Petter Vilberg +################## +buy_claim_interaction = { + category = interaction_category_diplomacy + icon = vassal_claim_liege_title_interaction + + desc = buy_claim_interaction_desc + target_type = title + target_filter = recipient_domain_titles + ignores_pending_interaction_block = yes + + is_shown = { + scope:actor = { + is_landless_adventurer = no + OR = { + has_perk = sanctioned_loopholes_perk + AND = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_buy_claim_for_all + is_secondary_character_involvement_either_trigger = { + CHAR = scope:recipient + } + } + } + } + NOT = { target_is_liege_or_above = scope:recipient } + } + NOT = { + scope:actor = scope:recipient + AND = { + scope:recipient = scope:actor.faith.religious_head + scope:actor.faith = { + NOT = { has_doctrine = doctrine_theocracy_temporal } + } + } + } + scope:recipient = { + is_playable_character = yes + primary_title.tier > tier_barony + NOT = { + target_is_liege_or_above = scope:actor + } + } + } + + can_be_picked_title = { + scope:target = { + tier >= tier_county + } + } + + is_valid_showing_failures_only = { + trigger_if = { # Can't request on titles you already have a claim on + limit = { + scope:target ?= { + any_claimant = { this = scope:actor } + } + } + custom_description = { + text = buy_claim_has_pressed_claim_already + always = no + } + } + trigger_if = { # Can't request claims on baronies + limit = { + scope:target ?= { tier = tier_barony } + } + custom_description = { + text = buy_claim_has_pressed_claim_already + always = no + } + } + trigger_if = { # Can't buy Kingdom or Empire Claims if you're a King + limit = { + scope:target ?= { tier = tier_kingdom } + scope:actor.highest_held_title_tier >= tier_kingdom + } + custom_description = { + text = buy_claim_no_king_or_emperor_kingdom + always = no + } + } + trigger_if = { # Can't buy Empire Claims if you're an Emperor + limit = { + scope:target ?= { tier = tier_empire } + scope:actor.highest_held_title_tier >= tier_empire + } + custom_description = { + text = buy_claim_no_emperor_empire + always = no + } + } + trigger_if = { # Can't buy claims on head of faith titles + limit = { + scope:target ?= { is_head_of_faith = yes } + } + custom_description = { + text = buy_claim_no_religious_titles + always = no + } + } + trigger_if = { # Can't buy claims on noble families + limit = { + scope:target ?= { is_noble_family_title = yes } + } + custom_description = { + text = buy_claim_no_noble_family_titles + always = no + } + } + trigger_if = { # Can't buy claims on landless adventurer titles + limit = { + scope:target ?= { has_variable = adventurer_creation_reason } + } + custom_description = { + text = buy_claim_no_landless_adventurer_title + always = no + } + } + scope:actor = { # Variable piety cost depending on tier + trigger_if = { + limit = { + exists = scope:target + scope:target = { + tier = tier_county + } + } + piety >= { + value = minor_buy_claim_piety_value + if = { + limit = { + government_allows = administrative + } + multiply = 1.5 + } + } + } + trigger_if = { + limit = { + exists = scope:target + scope:target = { + tier = tier_duchy + } + } + piety >= { + value = medium_buy_claim_piety_value + if = { + limit = { + government_allows = administrative + } + multiply = 1.5 + } + } + } + trigger_if = { + limit = { + exists = scope:target + scope:target = { + tier = tier_kingdom + } + } + piety >= { + value = major_buy_claim_piety_value + if = { + limit = { + government_allows = administrative + } + multiply = 1.5 + } + } + } + trigger_if = { + limit = { + exists = scope:target + scope:target = { + tier = tier_empire + } + } + piety >= { + value = massive_buy_claim_piety_value + if = { + limit = { + government_allows = administrative + } + multiply = 1.5 + } + } + } + } + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + } + + auto_accept = yes + + 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 + add_piety = { + value = 0 + if = { + limit = { + scope:target = { + tier = tier_county + } + } + add = minor_buy_claim_piety_loss + } + if = { + limit = { + scope:target = { + tier = tier_duchy + } + } + add = medium_buy_claim_piety_loss + } + if = { + limit = { + scope:target = { + tier = tier_kingdom + } + } + add = major_buy_claim_piety_loss + } + if = { + limit = { + scope:target = { + tier = tier_empire + } + } + add = massive_buy_claim_piety_loss + } + if = { + limit = { + government_allows = administrative + } + multiply = 1.5 + } + } + add_unpressed_claim = scope:target + } + stress_impact = { + just = medium_stress_impact_gain + honest = medium_stress_impact_gain + } + } + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = claimed_my_title_opinion + opinion = -40 + } + trigger_event = perk_interaction.0002 + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_bought_claim.desc + REVERSE_NON_HOUSE_TARGET = no + } + } +} + + + +################## +# Challenge Rival +# by Ewan Cowhig Croft +################## + +challenge_to_single_combat_interaction = { + icon = icon_combat + interface_priority = 30 + common_interaction = yes + category = interaction_category_hostile + ai_maybe = yes + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + desc = challenge_to_single_combat_interaction_desc + + greeting = negative + notification_text = REQUEST_TRIAL_BY_COMBAT_TEXT + + is_shown = { + # First, check for the perk. + scope:actor = { can_challenge_rival_to_single_combat_trigger = yes } + # Then, look to see if this character is a rival. + scope:actor = { has_relation_rival = scope:recipient } + # Can't duel yourself. + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + # Calc some stuff that might invalidate elsewhere before the bout is sorted. + rival_single_combat_shown_and_not_invalid_trigger = yes + # Scope:recipient must be able to fight personally. + scope:recipient = { can_start_single_combat_trigger = yes } + # Scope:recipient must not be banned from single combat. + scope:recipient = { + custom_description = { + text = fp1_tbc_recipient_banned_from_combat + can_start_single_combat_banned_checks_trigger = no + } + } + # Neither of the characters can be imprisoned. + scope:actor = { is_imprisoned = no } + scope:recipient = { is_imprisoned = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + cost = { prestige = medium_prestige_value } + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + # Set up the bout immediately. + ## First inform. + scope:actor = { + custom_tooltip = challenge_to_single_combat_interaction.enter_non_lethal_bout.tt + custom_tooltip = challenge_to_single_combat_interaction.victor_gets.tt + custom_tooltip = challenge_to_single_combat_interaction.loser_gets.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = perk_interaction.0101 + INVALIDATION_EVENT = perk_interaction.0102 + } + + # If we're a clan this interaction affects unity + if = { + limit = { + scope:actor = { + exists = scope:actor.house + house = { # But only if we have high unity! + OR = { + has_house_unity_stage = harmonious + has_house_unity_stage = friendly + } + } + } + } + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_loss + DESC = clan_unity_challenge_to_combat.desc + REVERSE_NON_HOUSE_TARGET = no + } + custom_description_no_bullet = { text = active_unity_level_description_tt } + } + } + + on_decline = { + # Scope:actor decline processing. + scope:actor = { + # Inform them of the decline & scope:recipient loses some prestige. + send_interface_toast = { + type = event_toast_effect_bad + title = challenge_to_single_combat_interaction.challenge_rejected.t + left_icon = scope:recipient + right_icon = scope:actor + scope:recipient = { add_prestige = medium_prestige_loss } + show_as_tooltip = { + add_prestige = medium_prestige_value + } + } + hidden_effect = { + add_prestige_no_experience = medium_prestige_value + } + # Cooldown is removed. + hidden_effect = { remove_interaction_cooldown = challenge_to_single_combat_interaction } + # Clear up hostile actions flag. + if = { + limit = { + has_character_flag = flag_hostile_actions_disabled_delay + } + remove_character_flag = flag_hostile_actions_disabled_delay + } + } + } + + auto_accept = no + + ai_accept = { + base = 0 # Try to make it 0 for most interactions + + # Relative fightan ability. + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:actor.prowess < scope:recipient.prowess + add = { + value = scope:recipient.prowess + subtract = scope:actor.prowess + multiply = 2 + } + } + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:recipient.prowess < scope:actor.prowess + add = { + value = scope:actor.prowess + subtract = scope:recipient.prowess + multiply = -2 + } + } + # Weight up for personality values. + ai_value_modifier = { + who = scope:recipient + ai_boldness = { + if = { + limit = { + scope:recipient = { + ai_boldness > 0 + ai_rationality < 0 + } + } + value = 2 + } + else_if = { + limit = { + scope:recipient = { + NOT = { ai_boldness = 0 } + } + } + value = 1 + } + } + ai_vengefulness = { + if = { + limit = { + scope:recipient = { + NOT = { ai_vengefulness = 0 } + } + } + value = 0.75 + } + } + ai_honor = { + if = { + limit = { + scope:recipient = { + ai_honor > 0 + } + } + value = 0.5 + } + } + } + # Apply tier differences. + ## King -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value >= 4 + } + } + add = 15 + } + ## Duke -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 3 + } + } + add = 10 + } + ## Count -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 2 + } + } + add = 5 + } + ## King <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -2 + } + } + add = -10 + } + ## Duke <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -3 + } + } + add = -20 + } + ## Count <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value <= -4 + } + } + add = -30 + } + # Nemesis modifier. + modifier = { + desc = offer_vassalization_interaction_aibehavior_nemesis_tt + trigger = { + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + add = 50 + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + } + + # AI + ai_potential = { + can_challenge_rival_to_single_combat_trigger = yes + NOT = { has_trait = craven } + num_of_relation_rival > 0 + is_imprisoned = no + can_start_single_combat_trigger = yes + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = scripted_relations + } + + ai_frequency = 60 + + ai_will_do = { + base = -50 + + # Factor for personality (excluding realism). + modifier = { + add = { + value = ai_boldness + multiply = 1 + } + } + modifier = { add = ai_vengefulness } + modifier = { + add = { + value = ai_energy + multiply = -0.25 + } + } + + # Unity modifiers + evaluate_action_decreasing_house_unity = { + VALUE = 100 + } + + # Don't challenge kinslayer-counting family, unless they're your nemesis. + modifier = { + scope:actor = { + murdering_character_is_kinslaying_in_faith_trigger = { + CHARACTER = scope:recipient + FAITH = scope:actor.faith + } + } + scope:recipient = { + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge your spouse, unless they're your nemesis. + modifier = { + scope:recipient = { + is_spouse_of = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge people hopelessly out of your league unless you're really, really not seeing things clearly. + modifier = { + scope:actor = { + prowess_diff = { + target = scope:recipient + value <= -15 + } + ai_rationality >= high_negative_ai_value + } + add = -1000 + } + } +} diff --git a/common/character_interactions/00_poetry_interactions.txt b/common/character_interactions/00_poetry_interactions.txt new file mode 100644 index 00000000..bdbdd7e1 --- /dev/null +++ b/common/character_interactions/00_poetry_interactions.txt @@ -0,0 +1,420 @@ +# Poetry + +################### +# Send a Poem +# by Ewan Cowhig Croft & Alexander Oltner +################### +send_poem_interaction = { + interface_priority = 30 + common_interaction = yes + category = interaction_category_friendly + popup_on_receive = yes + pause_on_receive = yes + desc = send_poem_interaction_desc + + is_shown = { + # Must be a poet. + scope:actor = { + OR = { + has_trait = poet + employs_court_position = master_bard_camp_officer + employs_court_position = laureate_camp_officer + } + } + # Cannot send self fan-poetry. Egoist. + NOT = { scope:actor = scope:recipient } + # May only write for adults. + scope:recipient = { is_adult = yes } + } + + is_valid_showing_failures_only = { + # Neither of the characters can be imprisoned. + scope:actor = { is_imprisoned = no } + scope:recipient = { is_imprisoned = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + send_options_exclusive = yes + + cost = { prestige = minor_prestige_value } + + cooldown = { years = 3 } + cooldown_against_recipient = { years = send_poem_cooldown_years_value } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + # Set up the poem subject. + scope:actor = { + # Set up a subject gender. + select_poem_subject_gender_effect = { + SUBJECT = flag:specific + SUBJECT_TARGET = scope:recipient + } + } + # Theme Effects + ## Romantic + if = { + limit = { always = scope:poem_theme_romance } + # As this is a positive poem, inform scope:actor that scope:recipient may simply accept it. + custom_tooltip = send_poem_interaction.positive_auto_accept.tt + # Show the potential duel. + show_as_tooltip = { + scope:recipient = { + send_poem_romance_duel_effect = { POV_TARGET = scope:actor } + } + } + # Set up the theme. + scope:actor = { select_poem_theme_romance_effect = yes } + # Send the response event to scope:recipient. + scope:recipient = { trigger_event = trait_specific_interactions.0001 } + } + ## Mourning + else_if = { + limit = { always = scope:poem_theme_mourning } + # As this is a positive poem, inform scope:actor that scope:recipient may simply accept it. + custom_tooltip = send_poem_interaction.positive_auto_accept.tt + # Show the potential duel. + show_as_tooltip = { + scope:recipient = { + send_poem_mourning_duel_effect = { POV_TARGET = scope:actor } + } + } + # Set up the theme. + scope:actor = { select_poem_theme_mourning_effect = yes } + # Send the response event to scope:recipient. + scope:recipient = { trigger_event = trait_specific_interactions.0011 } + } + ## Legacy + else_if = { + limit = { always = scope:poem_theme_legacy } + # As this is a positive poem, inform scope:actor that scope:recipient may simply accept it. + custom_tooltip = send_poem_interaction.positive_auto_accept.tt + # Show the potential duel. + show_as_tooltip = { + scope:recipient = { + send_poem_legacy_duel_effect = { POV_TARGET = scope:actor } + } + } + # Set up the theme. + scope:actor = { select_poem_theme_legacy_effect = yes } + # Send the response event to scope:recipient. + scope:recipient = { trigger_event = trait_specific_interactions.0021 } + } + ## Strife + else_if = { + limit = { always = scope:poem_theme_strife } + # As this is a positive poem, inform scope:actor that scope:recipient may simply accept it. + custom_tooltip = send_poem_interaction.positive_auto_accept.tt + # Show the potential duel. + show_as_tooltip = { + scope:recipient = { + send_poem_strife_duel_effect = { POV_TARGET = scope:actor } + } + } + # Set up the theme. + scope:actor = { select_poem_theme_strife_effect = yes } + # Send the response event to scope:recipient. + scope:recipient = { trigger_event = trait_specific_interactions.0031 } + } + ## Incompetence + else_if = { + limit = { always = scope:poem_theme_incompetence } + # Show the potential duel. + show_as_tooltip = { + scope:recipient = { + send_poem_incompetence_duel_effect = { POV_TARGET = scope:actor } + } + } + # Set up the theme. + scope:actor = { select_poem_theme_incompetence_effect = yes } + # Send the response event to scope:recipient. + scope:recipient = { trigger_event = trait_specific_interactions.0041 } + } + # Make sure the AI doesn't spam players + scope:recipient = { + if = { + limit = { + is_ai = no + } + add_character_flag = { + flag = ai_poem_block + years = 5 + } + } + } + # Clear up hostile actions flag. + 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 + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_gain + DESC = clan_unity_poetry.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # SEND OPTIONS + ## Send a romantic poem. + send_option = { + is_shown = { + # Only available if they'd be attracted to you. + scope:recipient = { is_attracted_to_gender_of = scope:actor } + # And the romance would be acceptable to both parties. + accepts_incest_with_each_other_trigger = { + CHARACTER_1 = scope:actor + CHARACTER_2 = scope:recipient + } + scope:recipient = { + freely_accepts_sodomy_with_trigger = { CHARACTER = scope:actor } + } + # Plus not if either of you have a soulmate, unless you're each other's soulmates. + scope:actor = { + OR = { + any_relation = { + type = soulmate + count = 0 + } + has_relation_soulmate = scope:recipient + faith = { has_doctrine_parameter = no_unfaithfulness_penalty_active } + } + } + scope:recipient = { + OR = { + any_relation = { + type = soulmate + count = 0 + } + has_relation_soulmate = scope:actor + faith = { has_doctrine_parameter = no_unfaithfulness_penalty_active } + } + } + # As this is a positive option, we restrict it to non-rivals and players. + scope:actor = { send_poem_positive_poem_lock_trigger = yes } + } + flag = poem_theme_romance + localization = "SEND_POEM_ROMANCE" + } + ## Send a poem about legacy. + send_option = { + is_shown = { + # Scope:recipient must be a ruler & at least _potentially_ concerned. + scope:recipient = { + is_ruler = yes + NOT = { has_trait = humble } + } + # As this is a positive option, we restrict it to non-rivals and players. + scope:actor = { send_poem_positive_poem_lock_trigger = yes } + } + flag = poem_theme_legacy + localization = "SEND_POEM_LEGACY" + } + ## Send a mourning poem. + send_option = { + # Scope:recipient must have at least one dead close family member. + is_shown = { + scope:recipient = { + any_close_family_member = { + even_if_dead = yes + is_alive = no + NOT = { # It's quite natural + is_grandparent_of = scope:recipient + } + } + } + } + flag = poem_theme_mourning + localization = "SEND_POEM_MOURNING" + } + ## Send a poem about strife. + send_option = { + is_shown = { + # Scope:recipient must be a ruler & at least _potentially_ concerned. + scope:recipient = { + is_ruler = yes + NOT = { has_trait = humble } + } + # As this is a positive option, we restrict it to non-rivals and players. + scope:actor = { send_poem_positive_poem_lock_trigger = yes } + } + flag = poem_theme_strife + localization = "SEND_POEM_STRIFE" + } + ## Send a poem about incompetence. + send_option = { + is_shown = { + # As this is a negative option, we restrict it to rivals and players. + scope:actor = { send_poem_negative_poem_lock_trigger = yes } + } + flag = poem_theme_incompetence + localization = "SEND_POEM_INCOMPETENCE" + } + + auto_accept = yes + + # AI + ai_potential = { + has_trait = poet + is_imprisoned = no + prestige >= 150 + is_at_war = no + } + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = top_realm_domicile_owners + max = 10 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_frequency = 60 + ai_will_do = { + base = 50 + + # Lustful characters prefer romance poems + modifier = { + add = 50 + OR = { + has_trait = lustful + has_focus = intrigue_temptation_focus + } + scope:poem_theme_romance = yes + } + + # Arrogant characters are prone to actually interact via public poetry publishing. + modifier = { + add = 20 + scope:actor = { has_trait = arrogant } + } + + # Certain personality types skew towards specific poem types + modifier = { + add = 10 + scope:actor = { + has_trait_benevolent_trigger = yes + } + scope:poem_theme_mourning = yes + } + modifier = { + add = 10 + scope:actor = { + has_trait_submissive_trigger = yes + } + scope:poem_theme_legacy = yes + } + modifier = { + add = 10 + scope:actor = { + has_trait_malicious_trigger = yes + } + scope:poem_theme_strife = yes + } + + ## Insult people you don't like + modifier = { + add = 50 + scope:poem_theme_incompetence = yes + scope:actor = { + OR = { + has_personality_malicious_trigger = yes + has_relation_potential_rival = scope:recipient + has_relation_rival = scope:recipient + } + } + } + ## Players enjoy receiving poetry! + modifier = { + add = 50 + scope:recipient = { + is_ai = no + } + } + + # Unity modifiers + evaluate_action_increasing_house_unity = { + VALUE = 100 + } + + # Characters who are not lustful don't send romantic poems to just anyone + modifier = { + factor = 0 + NOR = { + has_trait = lustful + has_focus = intrigue_temptation_focus + } + scope:recipient = { + NOR = { + has_relation_lover = scope:actor + is_consort_of = scope:actor + } + } + scope:poem_theme_romance = yes + } + + ## Don't use insulting poems willy-nilly + modifier = { + factor = 0 + scope:poem_theme_incompetence = yes + scope:actor = { + NOR = { + has_trait = arbitrary + has_trait = lunatic + has_relation_potential_rival = scope:recipient + has_relation_rival = scope:recipient + opinion = { + target = scope:recipient + value <= medium_negative_opinion + } + } + } + } + + ## Don't spam players while at war + modifier = { + factor = 0 + scope:recipient = { + is_ai = no + is_at_war = yes + } + } + + ## Don't spam players when the poetry block is active + modifier = { + factor = 0 + scope:recipient = { + has_character_flag = ai_poem_block + } + } + } +} diff --git a/common/character_interactions/00_prison_interactions.txt b/common/character_interactions/00_prison_interactions.txt new file mode 100644 index 00000000..1bcf63dc --- /dev/null +++ b/common/character_interactions/00_prison_interactions.txt @@ -0,0 +1,7534 @@ +imprison_interaction = { + interface_priority = 120 + common_interaction = yes + icon = prison + + category = interaction_category_hostile + highlighted_reason = 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 = { + NAND = { + is_landless_adventurer = yes + reverse_has_opinion_modifier = { + target = scope:actor + modifier = eviction_ignored_opinion + } + } + } + } + desc = imprison_decline_summary + } + } + + ai_potential = { + NOT = { has_realm_law_flag = cannot_imprison } + is_imprisoned = no + } + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:actor = { + 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 = { + allowed_to_imprison_character_trigger = { CHARACTER = scope:recipient } + } + 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 } + } + } + scope:recipient = { + trigger_if = { + limit = { + is_landless_adventurer = yes + reverse_has_opinion_modifier = { + target = scope:actor + modifier = eviction_ignored_opinion + } + } + is_travelling = no + } + } + } + + 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 + + cost = { + # Usually, this action is free, but during certain diarchies, we want it to cost. + prestige = liege_diarchy_surcharge_interaction_imprison_interaction_value + } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_auto_accept = { + 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 + } + scope:recipient = { + trigger_event = char_interaction.0233 + } + 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 } + } + } + + on_accept = { + 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 = { + is_landless_adventurer = yes + 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 + } + NOT = { 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 = { + NOT = { 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 = { + NOT = { 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 = 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_amkingtier_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_is_type = claimant_faction + faction_is_at_war = yes + exists = special_character + 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 = { + has_accolade_parameter = accolade_imprisonment_chance + } + } + desc = THUG_REASON + add = accolade_imprisonment_chance_value + } + modifier = { + scope:actor = { + any_active_accolade = { + has_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 + } + } + + # AI + ai_targets = { + ai_recipients = vassals + chance = 0.5 + } + ai_targets = { + ai_recipients = courtiers + chance = 0.25 + } + ai_frequency = 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 = { + add = 200 + scope:actor = { + has_imprisonment_reason = scope:recipient + } + } + + 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 + NOT = { 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 + } + } + } + + 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 = { is_busy_in_events_localised = yes } + scope:recipient = { + custom_description = { + text = "currently_being_tortured" + NOT = { has_character_flag = is_being_tortured } + } + } + } + + 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 = { + NOT = { 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 = 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 = { + exists = scope:actor.house + exists = scope:recipient.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.house.house_head + } + } + } + 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 = { is_busy_in_events_localised = yes } + scope:recipient = { + custom_description = { + text = "currently_being_tortured" + NOT = { has_character_flag = is_being_tortured } + } + } + } + + 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 = { + NOT = { 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 = yes + 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 + } + NOT = { + scope:actor = scope:recipient + } + } + + is_valid_showing_failures_only = { + trigger_if = { + limit = { + scope:invalid = yes + } + always = no + } + + scope:recipient = { is_busy_in_events_localised = yes } #Payer + scope:secondary_recipient = { is_busy_in_events_localised = yes } #Prisoner + 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 + } + } + + 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 = { + NOT = { 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 = { + exists = dynasty + 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 = { + exists = dynasty + 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 + } + + 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 + } + + 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 + } + NOT = { + 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 + } + NOT = { + scope:recipient = scope:secondary_recipient + } + scope:recipient.ai_greed <= medium_negative_ai_value + desc = AI_VALUE_MODIFIER_GENEROUS + } + modifier = { + add = -10 + NOT = { 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 + NOT = { 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 = 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 + AND = { + exists = liege + 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 = { + factor = 0 + 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 = yes + 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 = { + NOT = { + 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 + } + } + NOT = { + scope:actor = scope:recipient + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } #Imprisoner + scope:secondary_recipient = { is_busy_in_events_localised = yes } #Prisoner + 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 + } + } + + 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 = { + exists = dynasty + 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 = { + exists = dynasty + 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 = { + exists = dynasty + 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 = { + exists = dynasty + 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 + } + + #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 + } + + 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 + NOT = { 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 + } + } + + 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_targets = { + ai_recipients = spouses + } + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = liege + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + ai_recipients = top_realm_domicile_owners + max = 5 + } + ai_frequency = 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 + AND = { + exists = liege + 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 + AND = { + exists = liege + 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 + AND = { + exists = liege + 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:recipient = { is_busy_in_events_localised = yes } #Imprisoner + scope:actor = { is_busy_in_events_localised = yes } #Prisoner + 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 + } + } + + 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 = { + exists = dynasty + 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 = { + exists = dynasty + 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 + } + + #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 + } + + 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 = { + NOT = { 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 = { + exists = scope:actor.house + exists = scope:recipient.house + scope:recipient = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:actor.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:actor.house.house_head + } + } + } + desc = INTERACTION_FAMILY_FEUD_REVERSE_REASON + } + + modifier = { + add = 25 + scope:influence_send_option = yes + desc = INFLUENCE_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 = 24 + + 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 + } + } + } + } + + modifier = { + add = 100 + scope:favor = yes + scope:recipient = { + OR = { + is_vassal_of = scope:actor + AND = { + exists = liege + liege = scope:actor + } + } + } + } + + modifier = { + add = -100 + scope:favor = yes + scope:recipient = { + NOR = { + is_vassal_of = scope:actor + AND = { + exists = liege + 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 + 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 = { is_busy_in_events_localised = yes } #Prisoner + 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 + } + } + + 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 + NOT = { + has_character_flag = realm_priest + } + } + 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 + } + } + + # Take Vows + 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 + } + } + + # 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 + } + # 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 + } + } + } + scope:actor = { + 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 = { + NOT = { 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 + NOT = { + AND = { + 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 + AND = { + exists = liege + 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.faith = { + has_doctrine_parameter = take_vows_active + } + } + 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 = { + NOT = { 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 + exists = betrothed + betrothed = { + is_female = yes + matrilinear_betrothal = yes + } + } + custom_description = { + text = patrilinear_betrothal + subject = scope:recipient + exists = betrothed + 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 = { + 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_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 + } + + ai_accept = { + base = 0 + modifier = { + add = 100 + desc = "WANTS_FREEDOM_REASON" + } + 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" + } + 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 = -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" + } + 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" + } + 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 + } + modifier = { + add = { + value = -50 + if = { + limit = { + scope:recipient = { + ai_vengefulness > 0 + } + } + subtract = ai_vengefulness + } + } + trigger = { + scope:gain_hook = yes + } + desc = "GAIN_HOOK_NEGATIVE_REASON" + } + 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" + } + modifier = { + add = -10 + trigger = { + scope:recruit = yes + NOT = { + scope:actor = { + culture = { + has_cultural_parameter = can_recruit_prisoners_easily + } + } + } + } + desc = "RECRUITMET_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 + exists = scope:actor.house + exists = scope:recipient.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.house.house_head + } + } + } + #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 = 12 + + ai_potential = { + is_at_war = no + } + + ai_will_do = { + base = 0 + + opinion_modifier = { + trigger = { + NOT = { 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 + exists = holder + 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 + exists = holder + 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 + exists = holder + 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 + } + } + } + + 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 + } + } + } + #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 = { + OR = { + is_imprisoned_by = scope:actor + AND = { + is_diarch_of_target = scope:actor + scope:actor = { has_diarchy_active_parameter = diarchy_is_co_rulership } + } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } #Prisoner + 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 + } + } + } + } + } + + # 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 = { + limit = { + tier = 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 = { + is_landless_adventurer = yes + 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 + } + } + } + } + + # 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 + } + } + 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.faith = scope:recipient.faith + NOT = { + scope:actor.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 = { secret_type = secret_cannibal } + } + } + } + flag = execution_devour + localization = "EXECUTION_DEVOUR" + } + + send_option = { + is_shown = { + NOT = { + scope:actor.faith = scope:recipient.faith + scope:actor.faith = { has_doctrine_parameter = human_sacrifice_active } + } + } + 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 = { + is_landless_adventurer = yes + 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 + } + NOT = { + 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 = yes + 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 + } + } + + 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 = 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 + } + } + } + + auto_accept = yes + + # AI + ai_targets = { + ai_recipients = prisoners + } + + ai_frequency = 24 + + 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 + exists = scope:actor.house + exists = scope:recipient.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.house.house_head + } + } + 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 + } + } + + 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 + } + } + + 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 + exists = scope:actor.house + exists = scope:recipient.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.house.house_head + } + } + 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 = 36 +} + +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 + } + } + + 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 + } + } + } + + 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 + exists = scope:actor.house + exists = scope:recipient.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.house.house_head + } + } + 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 = 36 +} + +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 = { + has_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 = { + limit = { + has_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 + } + } + 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 = { + limit = { + scheme_type = laamp_prison_break_scheme + 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 = yes + 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 } + } + + #TODO_CD_EP3_POLISH; the copy in the below events could _really_ use some polishing up. It's okay but it's a bit meh, and it'd be nice if it reacted more to who you're maiming and why. + + # 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 + exists = scope:actor.house + exists = scope:recipient.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.house.house_head + } + } + add = 30 + } + modifier = { + scope:actor = { + has_opinion_modifier = { + modifier = tried_to_escape_from_prison_opinion + target = scope:recipient + } + } + add = 25 + } + } + + ai_frequency = 60 +} diff --git a/common/charcater_interactions/00_religious_interactions.txt b/common/character_interactions/00_religious_interactions.txt similarity index 100% rename from common/charcater_interactions/00_religious_interactions.txt rename to common/character_interactions/00_religious_interactions.txt diff --git a/common/character_interactions/00_revoke_title_interaction.txt b/common/character_interactions/00_revoke_title_interaction.txt new file mode 100644 index 00000000..cd124c38 --- /dev/null +++ b/common/character_interactions/00_revoke_title_interaction.txt @@ -0,0 +1,1372 @@ +revoke_title_interaction = { + category = interaction_category_vassal + common_interaction = yes + highlighted_reason = HIGHLIGHTED_HAS_REVOKE_TITLE_REASON + notification_text = REVOKE_TITLE_PROPOSAL + + name = { + first_valid = { + triggered_desc = { + trigger = { + scope:actor = { + government_allows = administrative + } + scope:recipient = { + government_allows = administrative + } + } + desc = revoke_governorship_interaction + } + desc = revoke_title_interaction + } + } + + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:actor = { + government_allows = administrative + } + scope:recipient = { + government_allows = administrative + } + } + desc = revoke_governorship_interaction_desc + } + desc = revoke_title_interaction_desc + } + } + + icon = { + trigger = { + scope:actor = { + government_allows = administrative + } + scope:recipient = { + government_allows = administrative + } + } + reference = revoke_governorship + } + icon = revoke_title + + special_interaction = revoke_title_interaction + interface = revoke_title + target_type = title + target_filter = recipient_domain_titles + 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 + + on_decline_summary = general_rebellion_decline_summary + + # actor character giving the titles + # recipient character receiving the titles + + is_shown = { + scope:recipient = { + is_landed_or_landless_administrative = yes + # should be shown but be disabled for indirect vassals + target_is_liege_or_above = scope:actor + # is_vassal_of = scope:actor + } + } + + is_valid_showing_failures_only = { + title_revocation_standard_valid_showing_failures_only_trigger = yes + # Plus make sure there's a legal right to revoke. + scope:actor = { + trigger_if = { + limit = { government_has_flag = government_is_tribal } + custom_description = { + text = "has_law_allowing_title_revocation_tribal" + has_realm_law_flag = title_revocation_allowed + } + } + trigger_else_if = { + limit = { government_allows = administrative } + } + trigger_else = { + custom_description = { + text = "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 = vassal_contract_forbids_revocation + scope:recipient = { + NOT = { vassal_contract_has_flag = vassal_contract_cannot_revoke_titles } + } + } + } + trigger_if = { + limit = { + scope:recipient = { + vassal_contract_has_flag = admin_cannot_revoke_titles_without_cause + } + scope:actor = { + NOT = { has_revoke_title_reason = scope:recipient } + } + } + custom_tooltip = { + text = admin_contract_forbids_revocation_desc + scope:recipient = { + NOT = { vassal_contract_has_flag = admin_cannot_revoke_titles_without_cause } + } + } + } + # And uhh... the sensible check. + scope:recipient = { + is_vassal_of = scope:actor + is_busy_in_events_localised = yes + NOT = { has_strong_hook = scope:actor } + } + custom_tooltip = { + text = cannot_take_overt_hostile_actions_against_diarch.tt + NOT = { scope:recipient ?= scope:actor.diarch } + } + custom_tooltip = { + text = protected_from_revocation.tt + NOT = { scope:recipient = { has_character_flag = titles_protected } } + } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + # Highlighted in the interaction menu when right-clicking a character + is_highlighted = { + OR = { + scope:actor = { + has_revoke_title_reason = scope:recipient + } + scope:recipient = { + any_held_title = { + scope:actor = { + has_claim_on = prev + } + } + NOT = { + any_ally = { + this = scope:actor + } + } + } + } + } + + can_be_picked_title = { + scope:target = { + title_revocation_standard_can_pick_title_trigger = yes + trigger_if = { + limit = { + scope:actor = { government_allows = administrative } + scope:recipient = { government_allows = administrative } + } + custom_description = { + text = "admin_revoke_primary_tier_only" + subject = scope:actor + object = scope:target + scope:target.tier = scope:recipient.highest_held_title_tier + } + } + } + } + + has_valid_target = { + scope:target = { + NOT = { is_noble_family_title = yes } + } + } + + #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 + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + cost = { + # Usually, this action is free, but during certain diarchies, we want it to cost. + prestige = liege_diarchy_surcharge_interaction_revoke_title_interaction_value + + # Admin has to pay an influence cost unless they have a revocation reason on the recipient + influence = { + value = 0 + if = { + limit = { + scope:actor = { + government_allows = administrative + NOT = { has_revoke_title_reason = scope:recipient } + } + scope:recipient = { + highest_held_title_tier >= tier_county + } + } + scope:recipient ?= { + if = { + limit = { + any_held_title = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + add = { + value = scope:recipient.massive_influence_value + multiply = 3 + } + desc = GOVERNOR_RESIGNATION_KINGDOM_COST + } + } + else_if = { + limit = { + any_held_title = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + add = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_DUCHY_COST + } + } + else = { + add = { + add = scope:recipient.major_influence_value + desc = concept_county + } + } + if = { + limit = { house ?= { is_powerful_family = yes } } + add = { + value = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_POWERFUL_COST + } + } + else_if = { + limit = { house ?= { is_dominant_family = yes } } + add = { + value = scope:recipient.monumental_influence_value + desc = GOVERNOR_RESIGNATION_DOMINANT_COST + } + } + if = { + limit = { scope:recipient.governor_efficiency < 1 } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + else_if = { + limit = { scope:recipient.governor_efficiency > 1 } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + if = { + limit = { + influence_level != 1 + } + add = { + value = { + value = influence_level + subtract = 1 + } + multiply = 50 + desc = GOVERNOR_RESIGNATION_INFLUENCE_LEVEL_COST + } + } + multiply = 1.25 + } + } + } + } + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0200 + } + } + + on_accept = { + save_scope_value_as = { + name = revoke_title_interaction + value = yes + } + if = { # Safety flag to ensure admin revocations behave properly + limit = { + scope:actor = { government_has_flag = government_is_administrative } + scope:recipient = { government_has_flag = government_is_administrative } + } + save_scope_value_as = { + name = administrative_revocation + value = yes + } + } + scope:actor = { + if = { # Admin has to pay an influence cost unless they have a revocation reason on the recipient + limit = { + government_allows = administrative + NOT = { has_revoke_title_reason = scope:recipient } + scope:recipient = { + highest_held_title_tier >= tier_county + } + } + show_as_tooltip = { # Actual cost is deducted in the the interaction cost + change_influence = { + scope:recipient ?= { + if = { + limit = { + any_held_title = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + add = { + value = scope:recipient.massive_influence_value + multiply = 3 + } + desc = GOVERNOR_RESIGNATION_KINGDOM_COST + } + } + else_if = { + limit = { + any_held_title = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + add = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_DUCHY_COST + } + } + else = { + add = { + add = scope:recipient.major_influence_value + desc = concept_county + } + } + if = { + limit = { house ?= { is_powerful_family = yes } } + add = { + value = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_POWERFUL_COST + } + } + else_if = { + limit = { house ?= { is_dominant_family = yes } } + add = { + value = scope:recipient.monumental_influence_value + desc = GOVERNOR_RESIGNATION_DOMINANT_COST + } + } + if = { + limit = { scope:recipient.governor_efficiency < 1 } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + else_if = { + limit = { scope:recipient.governor_efficiency > 1 } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + if = { + limit = { + influence_level != 1 + } + add = { + value = { + value = influence_level + subtract = 1 + } + multiply = 50 + desc = GOVERNOR_RESIGNATION_INFLUENCE_LEVEL_COST + } + } + } + multiply = -1.25 + } + } + } + trigger_event = char_interaction.0199 + } + revoke_title_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 } + } + + # 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 = { + scope:actor = { + if = { # Admin has to pay an influence cost unless they have a revocation reason on the recipient + limit = { + government_allows = administrative + NOT = { has_revoke_title_reason = scope:recipient } + scope:recipient = { + highest_held_title_tier >= tier_county + } + } + show_as_tooltip = { # Actual cost is deducted in the the interaction cost + change_influence = { + scope:recipient ?= { + if = { + limit = { + any_held_title = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + add = { + value = scope:recipient.massive_influence_value + multiply = 3 + } + desc = GOVERNOR_RESIGNATION_KINGDOM_COST + } + } + else_if = { + limit = { + any_held_title = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + add = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_DUCHY_COST + } + } + else = { + add = { + add = scope:recipient.major_influence_value + desc = concept_county + } + } + if = { + limit = { house ?= { is_powerful_family = yes } } + add = { + value = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_POWERFUL_COST + } + } + else_if = { + limit = { house ?= { is_dominant_family = yes } } + add = { + value = scope:recipient.monumental_influence_value + desc = GOVERNOR_RESIGNATION_DOMINANT_COST + } + } + if = { + limit = { scope:recipient.governor_efficiency < 1 } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + else_if = { + limit = { scope:recipient.governor_efficiency > 1 } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + if = { + limit = { + influence_level != 1 + } + add = { + value = { + value = influence_level + subtract = 1 + } + multiply = 50 + desc = GOVERNOR_RESIGNATION_INFLUENCE_LEVEL_COST + } + } + } + multiply = -1.25 + } + } + } + } + if = { + limit = { + scope:landed_title.tier != tier_barony + } + scope:actor = { + revocation_tyranny_effect = { VASSAL = scope:recipient } + title_revocation_stress_effect = { VASSAL = scope:recipient } + } + } + war_for_revoke_effect = { + LIEGE = scope:actor + REBEL = scope:recipient + } + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = revoked_title + } + } + if = { + limit = { + scope:actor = { has_realm_law_flag = vassal_refusal_is_treason } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = treasonous_revoke_refusal + } + } + } + + # 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_resistance_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_pacification_effect = { AMOUNT = harrying_minor_increase_value } + } + } + } + + if = { + limit = { + scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay } + } + scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay } + } + } + + auto_accept = { + scope:recipient = { + calc_true_if = { + amount >= 1 + custom_description = { + text = "baron_revocation" + highest_held_title_tier = tier_barony + } + custom_description = { + text = "prisoner_revocation" + 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 } + } + custom_description = { + text = "foreign_prison_revocation" + subject = scope:actor + object = scope:recipient + scope:recipient = { + is_imprisoned = yes + NOT = { is_imprisoned_by = scope:actor } + } + } + custom_tooltip = { + text = "has_admin_gov" + scope:actor = { government_allows = administrative } + scope:recipient = { + government_allows = administrative + highest_held_title_tier = tier_county + is_ai = yes + } + } + } + } + } + ai_accept = { + base = 0 # Try to make it 0 for most interactions + + modifier = { + scope:hook = yes + add = 40 + desc = SCHEME_WEAK_HOOK_USED + } + + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.8 + desc = AI_OPINION_REASON + } + + modifier = { + add = 20 + 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 + } + + modifier = { + 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 + } + add = 50 + desc = AI_TITLE_IS_REALM_CAPITAL + } + + modifier = { + exists = scope:actor.primary_title.title_capital_county + NOR = { + scope:landed_title = scope:actor.primary_title.title_capital_county + scope:landed_title = scope:actor.primary_title.title_capital_county.de_jure_liege + } + scope:landed_title.de_jure_liege = scope:actor.primary_title.title_capital_county.de_jure_liege + add = 30 + desc = AI_TITLE_IS_IN_CAPITAL_DUCHY + } + + modifier = { + add = 30 + scope:actor = { + has_claim_on = scope:landed_title + } + desc = AI_LIEGE_HAS_CLAIM_ON_TITLE + } + + ai_value_modifier = { + who = scope:recipient + ai_greed = { + if = { + limit = { + scope:recipient = { NOT = { ai_greed = 0 } } + } + value = -0.75 + } + } + 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.5 + } + } + } + modifier = { #I am a King! + desc = offer_vassalization_interaction_aibehavior_amkingtier_tt + trigger = { + scope:recipient = { highest_held_title_tier = tier_kingdom } + } + add = -20 + } + modifier = { #Title is part of vassal's primary title de-jure. Not relevant for Admin. + add = -25 + NOT = { scope:recipient = { government_allows = administrative } } + scope:recipient.primary_title.tier > tier_county + OR = { + scope:recipient.primary_title = { + is_de_jure_liege_or_above_target = scope:landed_title + } + scope:recipient.primary_title = scope:landed_title + } + desc = AI_REFUSAL_IS_DE_JURE_UNDER + } + 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 = 50 + max = 20 + } + } + modifier = { # Legalistic tradition + desc = tradition_legalistic_name + scope:actor = { + has_revoke_title_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 + ai_should_get_conqueror_bonuses = yes + } + } + 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 + } + } + + # AI + ai_targets = { + ai_recipients = vassals + } + ai_frequency = 0 # This is handled via code instead; see REVOKE_TITLE_TICK in the AI defines. All the logic for *if* to send a revoke though is scripted below + + 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 revoke just because we can, so this only gets us to -10 + # Certain characters will revoke despite tyranny, if their rationality is sufficiently low + modifier = { + scope:actor = { + OR = { + NOT = { + title_revocation_is_tyrannical_trigger = { VASSAL = scope:recipient } + } + AND = { + ai_rationality <= very_high_negative_ai_value + OR = { + has_trait = lunatic + has_trait = possessed + has_trait = arbitrary + } + } + } + } + + add = 990 + } + # Only certain rulers won't revoke vassals who have revolted against them + modifier = { + scope:actor = { + ai_compassion <= 75 + ai_greed >= -50 + ai_honor <= 50 + scope:recipient = { + is_imprisoned = yes + trigger_if = { + limit = { + NOT = { has_dlc_feature = landless_playable } + } + # Be kinder to players if they'd get game overed. + is_ai = yes + } + opinion = { + target = scope:actor + value <= 0 + } + } + NOT = { + title_revocation_is_tyrannical_trigger = { VASSAL = scope:recipient } + } + OR = { + has_opinion_modifier = { + modifier = rebellious_vassal_opinion + target = scope:recipient + } + has_opinion_modifier = { + modifier = vassal_lost_faction_revolt_war + target = scope:recipient + } + has_opinion_modifier = { + modifier = vassal_wp_faction_revolt_war + target = scope:recipient + } + } + } + add = { + value = 100 + add = scope:actor.ai_greed + add = { + value = scope:actor.ai_honor + multiply = -1 + } + if = { + limit = { + scope:actor.ai_vengefulness > 0 + } + add = scope:actor.ai_vengefulness + } + } + } + # Vengeful AI's want to revoke + modifier = { + scope:actor = { + ai_vengefulness > 0 + scope:recipient = { + is_imprisoned = yes + } + NOT = { + title_revocation_is_tyrannical_trigger = { VASSAL = scope:recipient } + } + } + add = { + value = scope:actor.ai_vengefulness + multiply = 2 + } + } + # Always revoke preferred capital and capital duchy + 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:landed_title = scope:actor.primary_title.title_capital_county + scope:landed_title = scope:actor.primary_title.title_capital_county.de_jure_liege + } + NAND = { # Don't revoke player titles tyranically, it must be possible to play and succeed as Ulm! + scope:landed_title.holder = { + is_ai = no + } + scope:actor = { + title_revocation_is_tyrannical_trigger = { VASSAL = 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 + 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 + } + } + scope:actor.domain_size < scope:actor.domain_limit + scope:actor.primary_title.tier > tier_county + trigger_if = { + limit = { + scope:actor = { + title_revocation_is_tyrannical_trigger = { VASSAL = scope:recipient } + 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:landed_title.tier = tier_county # Only Counties + OR = { # The AI gives away wrong-holding counties almost instantly, so we restrict to counties with holdings they can hold + scope:landed_title.title_province = { has_holding_type = castle_holding } # Everyone is valid for castles + AND = { + scope:actor = { + government_has_flag = government_is_tribal + } + scope:landed_title.title_province = { has_holding_type = tribal_holding } + } + AND = { + scope:actor = { + government_has_flag = government_is_republic + } + scope:landed_title.title_province = { has_holding_type = city_holding } + } + AND = { + scope:actor = { + OR = { + government_has_flag = government_is_clan + government_has_flag = government_is_theocracy + } + } + scope:landed_title.title_province = { has_holding_type = church_holding } + } + } + 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 + NOT = { + 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:landed_title.de_jure_liege = scope:actor.primary_title.title_capital_county.de_jure_liege # Under the same Duchy as your capital + + scope:recipient = { # Not from players + is_ai = yes + } + + OR = { # Tyranny tolerance 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 = { + AND = { + scope:recipient.primary_title.tier <= tier_county + scope:actor.primary_title.tier >= tier_duchy + } + 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 + } + # Revoke counties we're dejure liege of if below domain limit + modifier = { + scope:actor.domain_size < scope:actor.domain_limit + scope:landed_title.tier = tier_county + scope:landed_title.de_jure_liege.holder = scope:actor + add = 500 + } + # Revoke appropriate baronies if below domain limit, it's tyranny free + modifier = { + scope:actor.domain_size < scope:actor.domain_limit + scope:recipient = { highest_held_title_tier = tier_barony } + scope:landed_title.tier = tier_barony + OR = { + scope:landed_title.title_province = { has_holding_type = castle_holding } + AND = { + OR = { + scope:actor = { government_has_flag = government_is_clan } + scope:actor = { government_has_flag = government_is_theocracy } + } + scope:landed_title.title_province = { has_holding_type = church_holding } + } + AND = { + scope:actor = { government_has_flag = government_is_republic } + scope:landed_title.title_province = { has_holding_type = city_holding } + } + } + add = 1100 + } + # Revoke from vassals of the wrong faith if you can do it without tyranny + modifier = { + NOT = { scope:actor.faith = scope:recipient.faith } + OR = { + NOT = { scope:actor.faith.religion = scope:recipient.faith.religion } + scope:actor.ai_zeal >= low_negative_ai_value + NOT = { + scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic } + } + } + OR = { # Chill a bit until you've dealth with the ones already in your prison + scope:recipient = { + is_imprisoned_by = scope:actor + } + NOT = { + any_vassal = { + NOT = { faith = scope:actor.faith } + primary_title.tier > tier_barony + is_imprisoned_by = scope:actor + time_in_prison = { years < 1 } + } + } + } + add = 100 + } + # Revoke from characters you dislike if you can do it without tyranny + modifier = { + scope:actor = { + OR = { + has_relation_rival = scope:recipient + has_relation_nemesis = scope:recipient + } + } + add = 100 + } + # Slight preference for higher-tier titles + modifier = { + NOT = { + scope:actor = { government_allows = administrative } + } + add = scope:landed_title.tier + } + # 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_parent_of = scope:recipient + is_grandparent_of = scope:recipient + is_great_grandparent_of = scope:recipient + } + } + add = -5000 + } + # Do not revoke titles when the chance of success if exceedingly low + modifier = { + NOR = { + scope:recipient = { + is_imprisoned_by = scope:actor + } + scope:recipient = { + highest_held_title_tier = tier_barony + } + } + 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 always use a Hook if they can + scope:hook = yes + add = 1 + } + + modifier = { # The AI shouldn't ruin the player's fun + add = -5000 + scope:recipient = { has_character_flag = is_party_baron } + } + + modifier = { # Avoid triggering Tyranny wars mid-war + factor = 0 + scope:actor = { + is_at_war = yes + } + NOR = { + scope:recipient = { + is_imprisoned_by = scope:actor + } + scope:recipient = { + highest_held_title_tier = tier_barony + } + } + } + + # Clan Government: Avoid revoking titles from house members if the AI wants to have high unity + modifier = { + scope:actor = { + government_has_flag = government_is_clan + exists = house + ai_wants_high_unity = yes + } + scope:recipient = { + government_has_flag = government_is_clan + exists = house + house = scope:actor.house + } + add = -1000 + } + + 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 + } + } + } + + # Admin Government: Do not revoke titles from your house unless it's really needed + modifier = { + scope:actor = { government_allows = administrative } + scope:actor.house = scope:recipient.house + add = -500 + } + # Admin rulers should be less likely to revoke titles without a revocation reason, as they should prefer to depose governors + modifier = { + scope:actor = { + government_allows = administrative + NOT = { has_revoke_title_reason = scope:recipient } + } + scope:recipient = { + government_allows = administrative + highest_held_title_tier >= tier_duchy + } + factor = { # Honorable AI's will never revoke titles without a reason + value = 0 + if = { + limit = { + ai_honor < 0 + } + add = 0.5 + } + } + } + #Don't revoke titles from the frankokratia leader + modifier = { + scope:recipient = { + any_owned_story = { + story_type = frankokratia_story + NOT = { has_variable = franko_war_complete } + } + } + factor = 0 + } + } +} diff --git a/common/character_interactions/00_scheme_interactions.txt b/common/character_interactions/00_scheme_interactions.txt new file mode 100644 index 00000000..98ebdcbe --- /dev/null +++ b/common/character_interactions/00_scheme_interactions.txt @@ -0,0 +1,2707 @@ +#Character interactions relating to schemes + +start_murder_interaction = { + icon = icon_hostile + common_interaction = yes + interface_priority = 90 + category = interaction_category_hostile + + ignores_pending_interaction_block = yes + + scheme = murder + + send_name = START_SCHEME + + is_shown = { + NOT = { 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 + NOT = { 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 = { + is_landless_adventurer = yes + } + } + #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 = { + 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 = { + limit = { + scheme_type = murder + 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 + NOT = { 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 = { + is_landless_adventurer = yes + } + } + #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 = { + 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 = 60 + + 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 = 20 + + is_shown = { + scope:actor = { + can_use_befriend_scheme_trigger = { TARGET = scope:recipient } + } + NOT = { 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 = { + is_landless_adventurer = yes + } + } + #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 = { + 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 = { + limit = { + scheme_type = befriend + 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 + AND = { + exists = dynasty + 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 + } + } + 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 = { + is_independent_ruler = yes + 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 = { + is_independent_ruler = yes + 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 + has_focus = diplomacy_family_focus + } + + modifier = { + factor = 2 + scope:recipient.liege = scope:actor + } + + modifier = { + factor = 0.5 + NOT = { 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 = 90 + scheme = seduce + + 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 = 24 + + is_shown = { + NOT = { 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 + } + AND = { + exists = liege + 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 = { + is_landless_adventurer = yes + } + } + #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 = { + exists = primary_spouse + 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 = { + exists = primary_spouse + 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 + NOT = { + 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 + num_of_relation_soulmate > 0 + } + } + + modifier = { # Family Feud + add = 50 + exists = scope:actor.house + exists = scope:recipient.primary_spouse.house + scope:actor = { + house.house_head = { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.primary_spouse.house + } + } + has_opinion_modifier = { + modifier = house_feud_opinion + target = scope:recipient.primary_spouse.house.house_head + } + } + } + } +} + +court_interaction = { + icon = icon_scheme_romance + category = interaction_category_friendly + + send_name = START_SCHEME + + interface_priority = 90 + 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 = 25 + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:recipient = { is_adult = yes } + scope:actor = { is_adult = yes } + scope:actor = { is_attracted_to_gender_of = scope:recipient } + scope:recipient = { is_attracted_to_gender_of = scope:actor } + + 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 + } + AND = { + exists = liege + 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 = { + is_landless_adventurer = yes + } + } + #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 = { + num_of_relation_soulmate > 0 + } + } + + modifier = { + factor = 0.1 + scope:recipient = { + is_lowborn = yes + is_married = no + } + } + } +} + +sway_interaction = { + icon = icon_personal + category = interaction_category_friendly + common_interaction = yes + + send_name = START_SCHEME + + interface_priority = 120 + scheme = sway + 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_targets = { + ai_recipients = councillors + } + ai_frequency = 12 + + is_shown = { + NOT = { 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 = { + is_landless_adventurer = yes + } + } + #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 = { + primary_title.tier >= tier_county + NOR = { + scheme_generic_ai_blocker_trigger = yes + primary_title = { + is_mercenary_company = yes + } + } + } + + 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 = { + is_independent_ruler = yes + 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 = { + is_independent_ruler = yes + 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 = { + exists = joined_faction + joined_faction = { + faction_target = scope:actor + faction_is_type = liberty_faction + faction_is_at_war = no + } + } + } + + modifier = { + add = 20 + scope:recipient = { + exists = joined_faction + joined_faction = { + faction_target = scope:actor + faction_is_type = claimant_faction + faction_is_at_war = no + } + } + } + + modifier = { + add = 30 + scope:recipient = { + exists = joined_faction + 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 + NOT = { 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 = { + is_independent_ruler = yes + is_playable_character = yes + primary_title.tier >= tier_kingdom + } + } + } +} + +learn_language_interaction = { + icon = icon_scheme_learn_language + category = interaction_category_friendly + common_interaction = yes + + send_name = START_SCHEME + + interface_priority = 48 + 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 = 48 + + is_shown = { + scope:actor = { + NOT = { + culture = { + has_same_culture_language = scope:recipient.culture + } + } + } + NOT = { 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 = { + is_landless_adventurer = yes + } + } + #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 + } + is_independent_ruler = no + 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_test_interactions.txt b/common/character_interactions/00_test_interactions.txt new file mode 100644 index 00000000..ac7d29cc --- /dev/null +++ b/common/character_interactions/00_test_interactions.txt @@ -0,0 +1,1177 @@ + +debug_change_opinion_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = debug_good + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + } + + send_option = { + flag = love + localization = debug_make_love_me_interaction + } + send_option = { + flag = like + localization = debug_make_like_me_interaction + } + send_option = { + flag = dislike + localization = debug_make_dislike_me_interaction + } + send_option = { + flag = hate + localization = debug_make_hate_me_interaction + } + on_accept = { + scope:recipient = { + switch = { + trigger = yes + scope:love = { + add_opinion = { + modifier = love_opinion + target = scope:actor + opinion = 200 + } + } + scope:like = { + add_opinion = { + modifier = friendliness_opinion + target = scope:actor + opinion = 100 + } + } + scope:dislike = { + add_opinion = { + modifier = angry_opinion + target = scope:actor + opinion = -100 + } + } + scope:hate = { + add_opinion = { + modifier = hate_opinion + target = scope:actor + opinion = -200 + } + } + } + } + } + auto_accept = yes +} + +make_lover_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + NOT = { + scope:actor = { + has_relation_lover = scope:recipient + } + } + always = no # superseded by set_relation_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + set_relation_lover = { reason = test_lover_desc target = scope:recipient } + } + } +} + +make_soulmate_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + scope:actor = { has_relation_lover = scope:recipient } + NOT = { + scope:actor = { + has_relation_soulmate = scope:recipient + } + } + always = no # superseded by set_relation_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + set_relation_soulmate = { reason = test_soulmate_desc copy_reason = lover target = scope:actor } + } + } +} + +make_rival_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + NOT = { + scope:actor = { + any_relation = { + type = rival + this = scope:recipient + } + } + } + always = no # superseded by set_relation_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + set_relation_rival = { + target = scope:recipient + reason = rival_debug + } + } + } +} + +make_nemesis_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + scope:actor = { has_relation_rival = scope:recipient } + NOT = { + scope:actor = { + has_relation_nemesis = scope:recipient + } + } + always = no # superseded by set_relation_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + set_relation_nemesis = { + reason = test_nemesis_desc + copy_reason = rival + target = scope:recipient + } + } + } +} + +remove_rival_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + scope:actor = { + has_relation_rival = scope:recipient + } + always = no # superseded by set_relation_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + remove_relation_rival = scope:recipient + } + } +} + +make_friend_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + NOT = { + scope:actor = { + any_relation = { + type = friend + this = scope:recipient + } + } + } + always = no # superseded by set_relation_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + set_relation_friend = { reason = test_friend_desc target = scope:recipient } + } + } +} + + +learn_secrets_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + common_interaction = yes + icon = icon_discovered_scheme + interface_priority = -3 + + is_shown = { + debug_only = yes + + scope:recipient = { + any_secret = { + NOT = { + is_known_by = scope:actor + } + } + } + } + on_accept = { + scope:recipient = { + every_secret = { + reveal_to = scope:actor + } + } + } + + auto_accept = yes +} + +make_dynasty_house_head_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + icon = icon_dynasty + + is_shown = { + debug_only = yes + scope:recipient = { + exists = scope:recipient.house + NOT = { scope:recipient.house.house_head = scope:recipient } + } + } + + auto_accept = yes + + on_accept = { + debug_log_scopes = yes + scope:recipient.house = { + set_house_head = scope:recipient + } + } +} + +take_title_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + target_type = title + target_filter = recipient_domain_titles + + icon = debug_take_title + + is_shown = { + debug_only = yes + scope:recipient = { is_landed_or_landless_administrative = yes } + NOT = { scope:recipient = scope:actor } + } + + can_be_picked_title = { + trigger_if = { + limit = { + scope:landless_title = yes + } + scope:target = { + is_landless_type_title = yes + is_noble_family_title = no + } + } + trigger_else = { + scope:target = { is_landless_type_title = no } + } + } + + send_option = { + flag = title_only + localization = take_title_interaction + } + send_option = { + flag = title_and_vassals + localization = take_title_and_vassals_interaction + } + send_option = { + flag = landless_title + localization = take_landless_title_interaction + } + + auto_accept = yes + + on_accept = { + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + scope:target = { + switch = { + trigger = yes + scope:title_only = { + change_title_holder = { + holder = scope:actor + change = scope:change + } + } + scope:title_and_vassals = { + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:change + } + } + scope:landless_title = { + change_title_holder = { + holder = scope:actor + change = scope:change + } + } + } + } + resolve_title_and_vassal_change = scope:change + } +} + +take_domain_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + scope:recipient = { is_landed_or_landless_administrative = yes } + NOT = { + scope:recipient = scope:actor + } + always = no + } + + auto_accept = yes + + on_accept = { + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + scope:recipient = { + every_held_title = { + limit = { + is_landless_type_title = no + } + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:change + } + } + } + resolve_title_and_vassal_change = scope:change + } +} + +take_realm_interaction = { + category = interaction_debug_main + common_interaction = yes + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + icon = grant_titles_interaction + + is_shown = { + debug_only = yes + scope:recipient = { is_landed_or_landless_administrative = yes } + NOT = { + scope:recipient = scope:actor + } + } + + auto_accept = yes + + send_option = { + flag = domain + localization = take_domain_interaction + } + send_option = { + flag = realm + localization = take_realm_interaction + } + send_option = { + is_valid = { + scope:actor.highest_held_title_tier < scope:recipient.liege.highest_held_title_tier + scope:recipient = { is_independent_ruler = no } + } + flag = domain_as_vassal + localization = take_domain_as_vassal_interaction + } + send_option = { + is_valid = { + scope:actor.highest_held_title_tier < scope:recipient.liege.highest_held_title_tier + scope:recipient = { is_independent_ruler = no } + } + flag = realm_as_vassal + localization = take_realm_as_vassal_interaction + } + + on_accept = { + scope:recipient.liege = { save_scope_as = new_liege } + if = { + limit = { + OR = { + scope:realm = yes + scope:realm_as_vassal = yes + } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + scope:recipient = { + every_sub_realm_title = { + limit = { + tier >= tier_county + is_noble_family_title = no + is_landless_type_title = no + NOT = { holder ?= scope:actor } + } + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:change + take_baronies = no + } + } + } + resolve_title_and_vassal_change = scope:change + } + else_if = { + limit = { + OR = { + scope:domain = yes + scope:domain_as_vassal = yes + } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + scope:recipient = { + every_held_title = { + limit = { + tier >= tier_county + is_noble_family_title = no + is_landless_type_title = no + } + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:change + take_baronies = no + } + } + } + resolve_title_and_vassal_change = scope:change + } + if = { + limit = { + OR = { + scope:realm_as_vassal = yes + scope:domain_as_vassal = yes + } + } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + scope:actor = { + change_liege = { + liege = scope:new_liege + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + } +} + +take_vassal_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + icon = icon_liege + + is_shown = { + debug_only = yes + scope:recipient = { + NOT = { is_vassal_of = scope:actor } + highest_held_title_tier >= tier_county + highest_held_title_tier < scope:actor.highest_held_title_tier + } + NOT = { scope:recipient = scope:actor } + scope:actor = { has_any_landed_title_trigger = yes } + } + + auto_accept = yes + + on_accept = { + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no + } + scope:recipient = { + change_liege = { + liege = scope:actor + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } +} + +make_independent_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + icon = independence + + is_shown = { + debug_only = yes + scope:recipient = { + is_independent_ruler = no + highest_held_title_tier >= tier_county + } + } + + auto_accept = yes + + on_accept = { + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + scope:recipient = { + becomes_independent = { change = scope:change } + } + resolve_title_and_vassal_change = scope:change + } +} + +start_pregnancy_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = pregnant + + is_shown = { + debug_only = yes + scope:recipient = { is_adult = yes } + scope:actor = { is_adult = yes } + scope:recipient = { is_pregnant = no } + scope:actor = { is_pregnant = no } + + OR = { + AND = { + scope:recipient = { is_female = yes } + scope:actor = { is_male = yes } + } + AND = { + scope:recipient = { is_male = yes } + scope:actor = { is_female = yes } + } + } + } + + on_accept = { + scope:actor = { trigger_event = debug.0002 } + } + + auto_accept = yes +} + +get_claim_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = vassal_claim_liege_title_interaction + + target_type = title + target_filter = recipient_domain_titles + + is_shown = { + debug_only = yes + scope:recipient = { is_landed_or_landless_administrative = yes } + NOT = { scope:recipient = scope:actor } + } + + can_be_picked_title = { + scope:target = { + is_noble_family_title = no + is_landless_type_title = no + } + trigger_if = { + limit = { + scope:actor = { has_claim_on = scope:target } + } + scope:pressed = yes + scope:actor = { has_weak_claim_on = scope:target } + } + } + + send_option = { + flag = pressed + localization = add_pressed_claim_interaction + } + send_option = { + flag = unpressed + localization = add_unpressed_claim_interaction + } + + auto_accept = yes + + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:pressed = { add_pressed_claim = scope:target } + scope:unpressed = { add_unpressed_claim = scope:target } + } + } + } +} + +claim_all_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_claim_pressed + + is_shown = { + debug_only = yes + scope:recipient = { is_landed_or_landless_administrative = yes } + NOT = { scope:recipient = scope:actor } + } + + send_option = { + flag = pressed + localization = add_pressed_claim_interaction + } + send_option = { + flag = unpressed + localization = add_unpressed_claim_interaction + } + + auto_accept = yes + + on_accept = { + scope:recipient = { + every_held_title = { + limit = { + is_landless_type_title = no + is_noble_family_title = no + trigger_if = { + limit = { + scope:actor = { has_claim_on = scope:target } + } + scope:pressed = yes + scope:actor = { has_weak_claim_on = scope:target } + } + tier >= tier_county + } + save_temporary_scope_as = title_temp + scope:actor = { + switch = { + trigger = yes + scope:pressed = { add_pressed_claim = scope:title_temp } + scope:unpressed = { add_unpressed_claim = scope:title_temp } + } + } + } + } + } +} + +get_claim_on_all_creatable_interaction = { + category = interaction_debug_main + icon = icon_claim_pressed + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + scope:recipient = scope:actor + } + + auto_accept = yes + + on_accept = { + scope:actor = { + every_alert_creatable_title = + { + scope:actor = { + add_pressed_claim = prev + } + } + } + } +} + +test_dynasty_prestige_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + scope:recipient = scope:actor + always = no + } + + auto_accept = yes + + on_accept = { + scope:actor.dynasty = { + add_dynasty_prestige_level = 1 + add_dynasty_prestige = 1000 + } + } +} + +debug_start_era_of_great_holy_wars_interaction = { + category = interaction_debug_main + icon = religious + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + interface_priority = -100 + + is_shown = { + debug_only = yes + } + + send_option = { + flag = crusade + localization = debug_start_era_of_crusades_interaction + is_valid = { + NOT = { exists = faith:catholic.religion.var:variable_ghw_unlocked } + } + } + send_option = { + flag = jihad + localization = debug_start_era_of_jihads_interaction + is_valid = { + NOT = { exists = faith:ashari.religion.var:variable_ghw_unlocked } + } + } + + send_option = { + flag = ghw_natural + localization = debug_launch_natural_crusade_interaction + is_valid = { + scope:recipient.faith = { + NOR = { + exists = great_holy_war + exists = var:variable_ghw_cooldown + exists = religion.var:variable_first_ghw_cooldown # Do not event spam after Crusades have been just unlocked. + } + exists = religion.var:variable_ghw_unlocked #Activated by event for every religion. + } + } + } + + send_option = { + flag = ghw + localization = debug_start_great_holy_war_interaction + is_valid = { + NOT = { scope:recipient.faith = scope:actor.faith } + scope:actor.faith = { + NOR = { + exists = great_holy_war + exists = var:variable_ghw_cooldown + exists = religion.var:variable_first_ghw_cooldown # Do not event spam after Crusades have been just unlocked. + } + exists = religion.var:variable_ghw_unlocked #Activated by event for every religion. + } + } + } + + auto_accept = yes + + on_accept = { + hidden_effect = { + switch = { + trigger = yes + scope:crusade = { + faith:catholic = { save_scope_as = awakening_faith } + } + scope:jihad = { + faith:ashari = { save_scope_as = awakening_faith } + } + scope:ghw_natural = { + hidden_effect = { + scope:recipient.faith = { + change_fervor = { + value = 200 + desc = test_interaction_fervor_gain + } + trigger_event = great_holy_war.0001 + } + } + } + scope:ghw = { + scope:actor.faith = { + start_great_holy_war = { + target_character = scope:recipient + target_title = scope:recipient.primary_title + delay = 30 + } + } + } + } + scope:awakening_faith ?= { + change_fervor = { + value = 200 + desc = test_interaction_fervor_gain + } + if = { + limit = { exists = religious_head } + religious_head = { save_scope_as = ghw_first_sponsor } + } + else = { + random_theocratic_ruler = { + limit = { faith = root } + save_scope_as = ghw_first_sponsor + } + } + if = { # Fallback + limit = { + NOT = { exists = scope:ghw_first_sponsor } + } + random_ruler = { + limit = { faith = root } + save_scope_as = ghw_first_sponsor + } + } + religion = { + set_variable = { + name = variable_ghw_unlocked # Crusades + value = yes + } + } + every_player = { trigger_event = great_holy_war.0011 } # Flavor fluff for various Faiths. + } + } + } +} + +debug_change_council_task_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_valid_showing_failures_only = { + scope:actor = { + cp:councillor_spymaster = { + NOT = { councillor_task_target = scope:recipient } + } + } + } + + is_shown = { + debug_only = yes + exists = scope:actor.cp:councillor_spymaster.councillor_task_target + always = no + } + + auto_accept = yes + + on_accept = { + scope:actor = { + cp:councillor_spymaster = { + set_council_task = { + task_type = task_find_secrets + target = scope:recipient + } + } + } + } +} + +debug_trigger_localization_testing_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_valid_showing_failures_only = { + + } + + is_valid = { + scope:actor.father = scope:actor.father + scope:actor.father.killer = scope:actor + scope:actor.capital_county.holder = scope:actor + scope:actor.capital_county.faith = scope:actor.faith + scope:actor.faith.religion = faith:catholic.religion + scope:actor.capital_county.kingdom = title:k_england + scope:recipient.liege = scope:actor + + + } + + is_shown = { + always = no # This interaction has no purpose beyond debugging trigger localization. As such, it can be disabled unless somebody is actively working on that. + debug_only = yes + } + + auto_accept = yes + + on_accept = { + add_gold = 100 + } +} + +# DEBUG INTERACTION! +create_betrothal_interaction = { + category = interaction_debug_main + + is_shown = { + debug_only = yes + scope:actor = { + is_married = no + is_betrothed = no + allowed_to_marry_character_gender_trigger = { CHARACTER = scope:recipient } + OR = { + is_adult = no + scope:recipient = { is_adult = no } + } + scope:recipient = { + is_married = no + is_betrothed = no + } + } + } + + + on_accept = { + scope:actor = { + create_betrothal = scope:recipient + } + } + + ai_accept = { + base = 70 + modifier = { + add = 100 + scope:recipient = { + opinion = { target = scope:actor value >= 0 } + } + } + } +} + +set_relation_interaction = { + category = interaction_debug_main + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { scope:recipient = scope:actor } + always = no # deprecated + } + + on_accept = { + scope:actor = { trigger_event = debug.350 } + } + + auto_accept = yes +} + +designate_diarch_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_dismiss_entrenched_regency + + is_shown = { + debug_only = yes + NOT = { + scope:actor = scope:recipient + } + } + on_accept = { + scope:actor = { + designate_diarch = scope:recipient + } + } + + auto_accept = yes +} + +start_diarchy_interaction = { + icon = icon_entrench_regency + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + scope:recipient = { + basic_eligible_for_diarchy_trigger = yes + has_active_diarchy = no + } + } + on_accept = { + scope:recipient = { start_diarchy = regency } + } + + auto_accept = yes +} + +end_diarchy_interaction = { + category = interaction_debug_main + icon = "icon_dismiss_entrenched_regency" + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + scope:recipient = { has_active_diarchy = yes } + } + on_accept = { + scope:recipient = { end_diarchy = yes } + } + + auto_accept = yes +} + +test_cooldown_category_10_days = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + category_cooldown = { days = 10 } + + is_shown = { + debug_only = yes + always = no # Comment out this line to test + } + + auto_accept = yes + on_accept = {} +} + + +test_cooldown_category_against_30_days = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + category_cooldown_against_recipient = { days = 30 } + + is_shown = { + debug_only = yes + always = no # Comment out this line to test + } + + auto_accept = yes + on_accept = {} +} + +take_hostage_interaction = { + category = interaction_debug_main + icon = icon_hostage + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { + scope:actor = scope:recipient + } + scope:recipient = { + is_ruler = no + is_hostage = no + } + } + + on_accept = { + scope:actor = { + take_hostage = scope:recipient + } + } + + auto_accept = yes +} + +release_hostage_interaction = { + category = interaction_debug_main + + use_diplomatic_range = no + ignores_pending_interaction_block = yes + + is_shown = { + debug_only = yes + NOT = { + scope:actor = scope:recipient + } + scope:recipient = { + is_hostage = yes + } + } + + on_accept = { + scope:recipient = { + return_hostage = yes + } + } + + auto_accept = yes +} diff --git a/common/character_interactions/00_tradition_interactions.txt b/common/character_interactions/00_tradition_interactions.txt new file mode 100644 index 00000000..a4f1022f --- /dev/null +++ b/common/character_interactions/00_tradition_interactions.txt @@ -0,0 +1,411 @@ +spar_with_knight_interaction = { + icon = icon_combat + interface_priority = 30 + common_interaction = yes + category = interaction_category_friendly + ai_min_reply_days = 0 + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + desc = spar_with_knight_interaction_desc + + greeting = positive + notification_text = REQUEST_SPARRING_TEXT + + is_shown = { + scope:actor = { + culture = { + has_cultural_parameter = can_use_sparring_duel + } + } + scope:recipient = { + is_knight_of = scope:actor + } + # Can't duel yourself. + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + scope:actor = { can_start_single_combat_trigger = yes } + scope:actor = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:actor } } + # Scope:recipient must be able to fight personally. + scope:recipient = { can_start_single_combat_trigger = yes } + # Scope:recipient must not be banned from single combat. + scope:recipient = { + custom_description = { + text = fp1_tbc_recipient_banned_from_combat + can_start_single_combat_banned_checks_trigger = no + } + } + # Neither of the characters can be imprisoned. + scope:actor = { is_imprisoned = no } + scope:recipient = { is_imprisoned = no } + + scope:actor = { is_at_war = no } + scope:recipient = { is_at_war = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + cost = { prestige = medium_prestige_value } + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + # Set up the bout immediately. + ## First inform. + scope:actor = { + custom_tooltip = challenge_to_single_combat_interaction.enter_non_lethal_bout.tt + custom_tooltip = spar_with_knight_interaction.effect.tt + custom_tooltip = spar_with_knight_interaction.negative_effect.tt + } + scope:recipient = { + custom_tooltip = spar_with_knight_interaction.effect.tt + custom_tooltip = spar_with_knight_interaction.negative_effect.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = army_camp + OUTPUT_EVENT = culture_tradition_events.0001 + INVALIDATION_EVENT = perk_interaction.0102 + } + } + + ai_accept = { + base = 10 # Try to make it 0 for most interactions + + modifier = { + desc = CTSC_RELATIVE_PROWESS + scope:recipient.prowess < scope:actor.prowess + add = { + value = scope:actor.prowess + subtract = scope:recipient.prowess + multiply = -2 + } + } + + # Personality values + ai_value_modifier = { + who = scope:recipient + ai_boldness = 0.5 + ai_honor = { + if = { + limit = { + scope:recipient = { + ai_honor > 0 + } + } + value = 0.25 + } + } + } + modifier = { + desc = AI_REFUSAL_WOUNDED + scope:recipient = { + OR = { + has_trait = wounded + has_trait = maimed + } + } + add = -200 + } + } + + # AI + ai_potential = { + culture = { + has_cultural_parameter = can_use_sparring_duel + } + NOT = { has_trait = craven } + is_imprisoned = no + can_start_single_combat_trigger = yes + number_of_knights > 0 + primary_title.tier > tier_barony + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_targets = { + ai_recipients = courtiers + max = 10 + } + + ai_frequency = 60 + + ai_will_do = { + base = -25 + + # Factor for personality (excluding realism). + modifier = { + add = { + value = ai_boldness + multiply = 1 + } + } + modifier = { + add = { + value = ai_energy + multiply = 0.5 + } + } + modifier = { + add = -50 + prowess <= low_skill_rating + } + modifier = { + factor = 0 + OR = { + has_trait = wounded + has_trait = maimed + } + } + } +} + + +#Appointing a Podesta over a Commune - Turning a one county holder into a Republican Vassal +#Local culture must have the parameter, as does the granting character. +#Recipient does not need to have local culture. +appoint_podesta_interaction = { + icon = grant_titles_interaction + interface_priority = 30 + common_interaction = yes + category = interaction_category_vassal + ai_min_reply_days = 0 + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + desc = appoint_podesta_desc + + greeting = positive + notification_text = REQUEST_REPUBLIC_TEXT + + is_shown = { + NOT = { scope:actor = scope:recipient } # Can't make yourself a Podesta. + scope:actor = { + culture = { + has_cultural_parameter = can_make_republican_vassals + } + any_held_title = { + count > 1 + } + } + scope:recipient = { + is_ai = yes + is_landed = yes + target_is_liege_or_above = scope:actor + NOT = { government_has_flag = government_is_republic } + + } + } + + is_valid_showing_failures_only = { + scope:recipient = { can_be_granted_titles_by = { RULER = scope:actor } } + NOT = { scope:actor = { is_at_war_with = scope:recipient } } + + custom_description = { + text = too_many_republics + scope:actor = { + any_vassal = { + count < 4 #Use Script Value + highest_held_title_tier >= tier_county + government_has_flag = government_is_republic + } + } + } + + + scope:recipient = { + target_is_liege_or_above = scope:actor + NOT = { government_has_flag = government_is_republic } + is_claimant = no + + custom_description = { + text = must_be_one_county_count + any_held_title = { + count = 1 + tier = tier_county + } + } + + custom_description = { + text = must_not_have_landed_relatives + NOT = { + any_close_or_extended_family_member = { + is_landed_or_landless_administrative = yes + } + } + } + + custom_description = { + text = must_not_be_heir_to_any_title + scope:recipient = { + any_heir_title = { + count < 1 + tier >= tier_county + } + } + } + + custom_description = { #The county must be developed or have at least one city + text = county_must_have_city + any_held_title = { + count = 1 + tier = tier_county + OR = { + any_county_province = { + has_holding_type = city_holding + } + development_level > 20 + } + } + } + custom_description = { #County must be of a culture that has the tradition parameter + text = county_must_have_culture + any_held_title = { + count = 1 + tier = tier_county + any_county_province = { + culture = { + has_cultural_parameter = can_make_republican_vassals + } + } + } + } + } + + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { + scope:recipient = { + is_ruler = no + } + } + scope:recipient = { + is_imprisoned = no + } + } + } + + cost = { prestige = minor_prestige_value } + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + on_accept = { + scope:actor = { + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_neutral + title = appoint_podesta_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + show_as_tooltip = { + change_government = republic_government + create_title_and_vassal_change = { + type = returned + save_scope_as = change + add_claim_on_loss = no + } + every_vassal = { + limit = { + government_has_flag = government_is_republic + } + every_held_title = { + change_title_holder = { + holder = scope:recipient + change = scope:change + take_baronies = yes + } + } + } + resolve_title_and_vassal_change = scope:change + } + } + } + } + } + scope:recipient = { + change_government = republic_government + create_title_and_vassal_change = { + type = returned + save_scope_as = change + add_claim_on_loss = no + } + every_vassal = { + limit = { + government_has_flag = government_is_republic + } + every_held_title = { + change_title_holder = { + holder = scope:recipient + change = scope:change + take_baronies = yes + } + } + } + resolve_title_and_vassal_change = scope:change + } + + # 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_podesta.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes + + # AI + ai_potential = { + culture = { + has_cultural_parameter = can_make_republican_vassals + has_cultural_era_or_later = culture_era_high_medieval + } + primary_title.tier > tier_county + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = vassals + } + + ai_frequency = 240 + + ai_will_do = { + base = 100 + } +} diff --git a/common/character_interactions/00_trait_interactions.txt b/common/character_interactions/00_trait_interactions.txt new file mode 100644 index 00000000..ee5ee603 --- /dev/null +++ b/common/character_interactions/00_trait_interactions.txt @@ -0,0 +1,750 @@ +#FORGIVING INTERACTION +abandon_hook_interaction = { + interface_priority = 120 + common_interaction = yes + category = interaction_category_friendly + icon = forgiving + + desc = abandon_hook_interaction_desc + + is_shown = { + OR = { + scope:actor = { + has_trait = forgiving + } + #Struggle + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_abandon_hook_for_all + is_secondary_character_involvement_involved_trigger = { + CHAR = scope:recipient + } + } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { + has_usable_hook = scope:recipient + } + custom_description = { + scope:actor = { + NOT = { + has_hook_of_type = { + target = scope:recipient + type = house_head_hook + } + } + } + text = need_non_house_head_hook + } + custom_description = { + scope:actor = { + NOT = { + has_hook_of_type = { + target = scope:recipient + type = ritual_best_friend_hook + } + } + } + text = need_non_best_friend_hook + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = msg_abandon_hook_interaction_title + left_icon = scope:actor + right_icon = scope:recipient + + use_hook = scope:recipient + if = { + limit = { + has_strong_hook = scope:recipient + } + stress_impact = { + forgiving = major_stress_impact_loss + } + } + else = { + stress_impact = { + forgiving = medium_stress_impact_loss + } + } + + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = forgiven_opinion + } + } + } + } + + # 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_abandon_hook.desc + REVERSE_NON_HOUSE_TARGET = no + } + + hidden_effect = { + # Struggle Catalysts + scope:actor = { + if = { + limit = { + fp3_struggle_involves_one_supporter_and_one_detractor = { + FIRST = scope:actor + SECOND = scope:recipient + } + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_abandon_hook_on_supporter_detractor + } + } + every_character_struggle = { + involvement = involved + activate_struggle_catalyst = { + catalyst = catalyst_abandon_hook_on_supporter_detractor + character = scope:actor + } + log_debug_variable_for_persian_struggle_effect = { VAR = concession_catalyst_abandon_hook_on_supporter_detractor } + } + } + } + } + } + + + ai_frequency = 60 + + ai_targets = { + ai_recipients = guests + ai_recipients = courtiers + max = 10 + } + + ai_targets = { + ai_recipients = liege + } + + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_potential = { + stress_level >= 1 + } + + ai_will_do = { + base = 100 + } + + auto_accept = yes +} + +#ARBITRARY INTERACTION +dismiss_strong_hook_interaction = { + interface_priority = 120 + common_interaction = yes + category = interaction_category_hostile + icon = arbitrary + + cost = { + prestige = monumental_prestige_value + } + + desc = dismiss_strong_hook_interaction_desc + + is_shown = { + scope:actor = { + has_trait = arbitrary + } + + scope:recipient = { + is_vassal_of = scope:actor + has_strong_hook = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:actor = { + prestige >= monumental_prestige_value + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = msg_dismiss_hook_interaction_title + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + remove_hook = { target = scope:actor } + add_opinion = { + target = scope:actor + modifier = lost_strong_hook_opinion + } + } + + add_tyranny = 35 + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_dismiss_strong_hook.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_frequency = 60 + + ai_potential = { + dread >= 50 + } + + ai_will_do = { + base = 100 + } + + ai_targets = { + ai_recipients = guests + ai_recipients = courtiers + max = 10 + } + + ai_targets = { + ai_recipients = liege + } + + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_target_quick_trigger = { + adult = yes + } + + auto_accept = yes +} + +dismiss_weak_hook_interaction = { + interface_priority = 120 + common_interaction = yes + category = interaction_category_hostile + icon = arbitrary + + cost = { + prestige = major_prestige_value + } + + desc = dismiss_weak_hook_interaction_desc + + is_shown = { + scope:actor = { + has_trait = arbitrary + } + + scope:recipient = { + is_vassal_of = scope:actor + has_usable_hook = scope:actor + NOT = { has_strong_hook = scope:actor } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + prestige >= major_prestige_value + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = msg_dismiss_hook_interaction_title + left_icon = scope:actor + right_icon = scope:recipient + + scope:recipient = { + remove_hook = { target = scope:actor } + add_opinion = { + target = scope:actor + modifier = lost_weak_hook_opinion + } + progress_towards_rival_effect = { + CHARACTER = scope:actor + REASON = rival_dismissed_weak_hook + OPINION = default_rival_opinion + } + } + + add_tyranny = 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_dismiss_weak_hook.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_targets = { + ai_recipients = guests + ai_recipients = courtiers + max = 10 + } + + ai_targets = { + ai_recipients = liege + } + + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_frequency = 60 + + ai_potential = { + dread >= 50 + } + + ai_will_do = { + base = 100 + } + + auto_accept = yes +} + +#WRATHFUL DUELING +force_duel_criminals_interaction = { + interface_priority = 30 + common_interaction = yes + category = interaction_category_hostile + ai_maybe = yes + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + desc = force_duel_criminals_interaction_desc + icon = wrathful + + greeting = negative + notification_text = REQUEST_TRIAL_BY_COMBAT_TEXT + + is_shown = { + #First, verify if the actor is Wrathful + scope:actor = { has_trait = wrathful } + #Then, look to see if this character is a criminal. + scope:actor = { + OR = { + has_imprisonment_reason = scope:recipient + has_banish_reason = scope:recipient + has_execute_reason = scope:recipient + } + basic_allowed_to_imprison_character_trigger = { # And if you are allowed to imprison the target. + CHARACTER = scope:recipient + } + } + # Can't duel yourself. + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + # Calc some stuff that might invalidate elsewhere before the bout is sorted. + rival_single_combat_shown_and_not_invalid_trigger = yes + # Scope:recipient must be able to fight personally. + scope:recipient = { can_start_single_combat_trigger = yes } + # Scope:recipient must not be banned from single combat. + scope:recipient = { + custom_description = { + text = fp1_tbc_recipient_banned_from_combat + can_start_single_combat_banned_checks_trigger = no + } + } + # Neither of the characters can be imprisoned. + scope:actor = { is_imprisoned = no } + scope:recipient = { is_imprisoned = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + cooldown_against_recipient = { years = 10 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + # Set up the bout immediately. + #Starting with the strongest punishment in case more than one reason is valid + if = { + limit = { + scope:actor = { has_execute_reason = scope:recipient } + } + ## First inform. + scope:actor = { + custom_tooltip = force_duel_criminals_interaction.execute_punishment.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = trait_specific_interactions.0155 + INVALIDATION_EVENT = fp1_tbc.0102 + } + } + else_if = { + limit = { + scope:actor = { has_banish_reason = scope:recipient } + } + ## First inform. + scope:actor = { + custom_tooltip = force_duel_criminals_interaction.banish_punishment.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = trait_specific_interactions.0153 + INVALIDATION_EVENT = fp1_tbc.0102 + } + } + else_if = { + limit = { + scope:actor = { has_imprisonment_reason = scope:recipient } + } + scope:actor = { + custom_tooltip = force_duel_criminals_interaction.imprison_punishment.tt + } + + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = trait_specific_interactions.0151 + INVALIDATION_EVENT = fp1_tbc.0102 + } + } + + } + + auto_accept = yes + + # AI + ai_potential = { + has_trait = wrathful + is_imprisoned = no + can_start_single_combat_trigger = yes + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + ai_recipients = courtiers + ai_recipients = guests + max = 10 + } + + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_targets = { + ai_recipients = family + max = 10 + } + + + ai_frequency = 120 + + ai_will_do = { + base = -50 + + # Factor for personality (excluding realism). + modifier = { + add = { + value = ai_boldness + multiply = 1 + } + } + modifier = { add = ai_vengefulness } + modifier = { + add = { + value = ai_energy + multiply = -0.25 + } + } + # Don't challenge kinslayer-counting family, unless they're your nemesis. + modifier = { + scope:actor = { + murdering_character_is_kinslaying_in_faith_trigger = { + CHARACTER = scope:recipient + FAITH = scope:actor.faith + } + } + scope:recipient = { + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge your spouse, unless they're your nemesis. + modifier = { + scope:recipient = { + is_spouse_of = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge people hopelessly out of your league unless you're really, really not seeing things clearly. + modifier = { + scope:actor = { + prowess_diff = { + target = scope:recipient + value <= -15 + } + ai_rationality >= high_negative_ai_value + } + add = -1000 + } + } +} + +#IRRITABLE DUELING +force_duel_anyone_interaction = { + #need to have a stress level >= 1 + interface_priority = 30 + common_interaction = yes + category = interaction_category_hostile + ai_maybe = yes + ai_max_reply_days = 0 + popup_on_receive = yes + pause_on_receive = yes + desc = force_duel_anyone_interaction_desc + icon = irritable + + greeting = negative + notification_text = REQUEST_TRIAL_BY_COMBAT_TEXT + + is_shown = { + #Just, verify if the actor is Wrathful + scope:actor = { has_trait = irritable } + # Can't duel yourself. + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + # Need to be stressed to be able to force a Duel + scope:actor = { + custom_description = { + stress_level >= 1 + text = not_enough_stress + } + } + # Calc some stuff that might invalidate elsewhere before the bout is sorted. + rival_single_combat_shown_and_not_invalid_trigger = yes + # Scope:recipient must be able to fight personally. + scope:recipient = { can_start_single_combat_trigger = yes } + # Scope:recipient must not be banned from single combat. + scope:recipient = { + custom_description = { + text = fp1_tbc_recipient_banned_from_combat + can_start_single_combat_banned_checks_trigger = no + } + } + # Neither of the characters can be imprisoned. + scope:actor = { is_imprisoned = no } + scope:recipient = { is_imprisoned = no } + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + cost = { prestige = medium_prestige_value } + cooldown_against_recipient = { years = 10 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + # Set up the bout immediately. + ## First inform. + scope:actor = { + add_tyranny = 5 + add_dread = 5 + + custom_tooltip = challenge_to_single_combat_interaction.victor_gets.tt + custom_tooltip = challenge_to_single_combat_interaction.loser_gets.tt + } + ## Finally, begin. + configure_start_single_combat_effect = { + SC_INITIATOR = scope:actor + SC_ATTACKER = scope:actor + SC_DEFENDER = scope:recipient + FATALITY = no + FIXED = no + LOCALE = terrain_scope + OUTPUT_EVENT = perk_interaction.0101 + INVALIDATION_EVENT = fp1_tbc.0102 + } + + # 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_released_anger.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes + + # AI + ai_potential = { + has_trait = irritable + stress_level >= 1 + is_imprisoned = no + can_start_single_combat_trigger = yes + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + ai_recipients = prisoners + ai_recipients = courtiers + ai_recipients = guests + max = 1 + } + + ai_targets = { + ai_recipients = family + max = 10 + } + + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_frequency = 120 + + ai_will_do = { + base = -50 + + # Factor for personality (excluding realism). + modifier = { + add = { + value = ai_boldness + multiply = 1 + } + } + modifier = { add = ai_vengefulness } + modifier = { + add = { + value = ai_energy + multiply = -0.25 + } + } + # Don't challenge kinslayer-counting family, unless they're your nemesis. + modifier = { + scope:actor = { + murdering_character_is_kinslaying_in_faith_trigger = { + CHARACTER = scope:recipient + FAITH = scope:actor.faith + } + } + scope:recipient = { + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge your spouse, unless they're your nemesis. + modifier = { + scope:recipient = { + is_spouse_of = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + add = -1000 + } + # Don't challenge people hopelessly out of your league unless you're really, really not seeing things clearly. + modifier = { + scope:actor = { + prowess_diff = { + target = scope:recipient + value <= -15 + } + ai_rationality >= high_negative_ai_value + } + add = -1000 + } + } + +} diff --git a/common/character_interactions/00_tribal_interactions.txt b/common/character_interactions/00_tribal_interactions.txt new file mode 100644 index 00000000..8888106c --- /dev/null +++ b/common/character_interactions/00_tribal_interactions.txt @@ -0,0 +1,297 @@ +feudalize_tribal_holding_interaction = { + category = interaction_category_uncategorized + hidden = yes + special_interaction = feudalize_tribal_holding + + desc = feudalize_tribal_holding_interaction_desc + + target_type = title + target_filter = actor_domain_titles + + auto_accept = yes + + is_shown = { + scope:actor = { + this = scope:recipient + NOT = { 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 = { + has_holding_type = tribal_holding + } + } + trigger_else = { + custom_description = { + text = "feudalize_tribal_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 = { + add = { + value = feudalize_tribal_holding_interaction_cost + desc = BASE + } + if = { + limit = { # More expensive for admin to make barbarians civilized... + government_has_flag = government_is_administrative + } + add = { + value = feudalize_tribal_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_tribal_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_tribal_holding_interaction_notification + + right_icon = scope:actor + + if = { + limit = { exists = scope:target.title_province } + scope:target.title_province = { + set_holding_type = castle_holding + } + } + } + } + } + + 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 = { + NOT = { government_has_flag = government_is_tribal } + } + scope:recipient = { + target_is_liege_or_above = scope:actor + NOT = { government_has_flag = government_is_tribal } + NOT = { this = scope:actor } + any_held_title = { + tier <= tier_county + title_province = { + has_holding_type = tribal_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 = { + has_holding_type = tribal_holding + } + } + trigger_else = { + custom_description = { + text = "feudalize_tribal_holding_interaction_title_not_county_or_below" + always = no + } + } + } + } + + cost = { + gold = { + scope:actor = { + add = { + value = feudalize_tribal_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_tribal_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_tribal_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_tribal_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 = 15 + } + + # Notify actor and recipient + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = feudalize_tribal_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 + } + } + } + } + } + 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 = 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_tribal_holding_interaction_cost multiply = 4 } + # Warring AI don't do this - They want to spend their gold on war! + ai_has_warlike_personality = no + ai_has_conqueror_personality = no + } + + ai_will_do = { + base = 25 + modifier = { + scope:actor = { ai_has_economical_boom_personality = yes } + add = 50 + } + } +} diff --git a/common/character_interactions/00_vassal_interactions.txt b/common/character_interactions/00_vassal_interactions.txt new file mode 100644 index 00000000..ec86c6e3 --- /dev/null +++ b/common/character_interactions/00_vassal_interactions.txt @@ -0,0 +1,3226 @@ +#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 = { + NOT = { 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 = { + is_independent_ruler = yes + } + } + } + scope:recipient.highest_held_title_tier > tier_barony + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { is_landed_or_landless_administrative = yes } + # Gallivanters won't accept additional responsibilities. + scope:recipient = { + 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:secondary_actor = { is_busy_in_events_localised = yes } + scope:recipient.primary_title.tier > scope:secondary_actor.primary_title.tier + } + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + exists = scope:secondary_actor + } + 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 + } + } + } + } + } + + can_be_picked = { + NOT = { 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 } + 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 = { + has_government = administrative_government + } + 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 + } + } + } + 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 } + } + } + } + } + + 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 + + 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 = { + NOT = { 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 = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { is_busy_in_events_localised = yes } + } + 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 = { + 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 = 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 + NOT = { + 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 + } + } + NOT = { + 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 = { + NOT = { 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_is_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 = { + NOT = { 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_is_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_is_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 = { + limit = { + faction_is_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 + use_diplomatic_range = no + + desc = create_claimant_faction_against_interaction_desc + + special_interaction = create_claimant_faction_against_interaction + interface = create_claimant_faction_against + + is_shown = { + NOT = { scope:actor = scope:secondary_actor } + scope:actor.liege = scope:secondary_actor + scope:actor = { + 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 = { + scope:actor = { NOT = { 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_is_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 = { has_government = administrative_government } + } + scope:secondary_actor = { is_independent_ruler = yes } + } + + # Byzantium does not brook + trigger_if = { + limit = { + scope:landed_title ?= { + OR = { + has_title_law = acclamation_succession_law + holder ?= { has_realm_law = acclamation_succession_law } + } + } + } + scope:recipient = { + is_eunuch_trigger = no + NOT = { has_trait = blind } + } + } + } + + 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 = { NOT = { 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 + 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 = { + NOT = { scope:recipient = scope:actor } + scope:actor = { + liege = scope:recipient + NOT = { + is_councillor = yes + } + } + + 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 + } + } + 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 = { + NOT = { vassal_contract_has_flag = can_demand_council_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 } + } + 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 } + } + 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 } + } + 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 } + } + 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 } + } + modifier = { + factor = learning + } + modifier = { + trigger = { highest_skill = learning } + factor = 10 + } + scope:recipient.council_task:councillor_court_chaplain = { + save_scope_as = target + } + } + } + } + } + + ai_potential = { + is_independent_ruler = no + is_councillor = no + } + + ai_targets = { + ai_recipients = liege + } + ai_frequency = 36 + + 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 = { + NOT = { scope:recipient = scope:actor } + scope:recipient = { + exists = liege + 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 + NOT = { 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 + NOT = { 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 = { + NOT = { scope:recipient = scope:actor } + scope:recipient = { + exists = liege + 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 + NOT = { 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 + NOT = { 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 + + + desc = ask_for_pardon_interaction_desc + + notification_text = ASK_FOR_PARDON_NOTIFICATION + + is_shown = { + ask_for_pardon_available_trigger = { ACTOR = scope:actor } + scope:actor.top_liege = scope:recipient + } + + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + NOT = { is_imprisoned_by = scope:recipient }#Then you use the regular ransom interactions + } + } + + is_highlighted = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + + 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 = { #FP3 Addition. TODO FP3 CD: Find a way to test this. + if = { + limit = { + culture = { + has_cultural_parameter = pardoning_gives_prestige + } + } + add_prestige = minor_prestige_gain + } + } + + # 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 = 12 + + 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 = { + culture = { + has_cultural_parameter = pardoning_gives_prestige + } + } + } + desc = pardon_interaction_has_jirga_desc + } + desc = pardon_interaction_desc + } + } + + is_shown = { + scope:actor = { + has_imprisonment_reason = scope:recipient + } + scope:recipient = { + target_is_liege_or_above = scope:actor + } + } + + auto_accept = yes + + on_accept = { + 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 + } + } + + send_interface_toast = { + type = event_toast_effect_neutral + title = pardon_interaction_toast + left_icon = scope:actor + } + } + + # 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 = 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_diplomacy + 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 = { + NOT = { 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 = { + tier >= tier_duchy + NOR = { + has_title_law = noble_family_succession_law + has_title_law = landless_adventurer_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_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + } + } + + is_valid_showing_failures_only = { + custom_description = { + scope:recipient = { + any_held_title = { + tier >= 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 = 24 + + 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 + } + NOT = { + 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 + + desc = give_vassal_directive_interaction_desc + + auto_accept = yes + + is_shown = { + scope:recipient = { + trigger_if = { + limit = { + scope:actor = { has_government = administrative_government } + } + is_vassal_or_below_of = scope:actor + } + trigger_else = { + is_vassal_of = scope:actor + } + is_landed = yes + 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 = { + has_government = administrative_government + } + } + is_valid = { + scope:recipient = { + highest_held_title_tier >= tier_duchy + } + } + } + + send_option = { + flag = train_commanders + is_shown = { + scope:recipient = { + has_government = administrative_government + } + } + is_valid = { + } + } + + send_option = { + flag = build_maa + is_shown = { + scope:recipient = { + has_government = administrative_government + } + } + is_valid = { + } + } + + send_option = { + flag = convert_faith + is_shown = { + } + is_valid = { + scope:recipient = { + custom_tooltip = { + text = subrealm_has_county_of_other_faith + any_sub_realm_county = { + NOT = { faith = scope:recipient.faith } + } + } + } + } + } + + send_option = { + flag = convert_culture + is_shown = { + } + 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 = improve_cultural_acceptance + is_shown = { + } + is_valid = { + scope:recipient = { + highest_held_title_tier >= tier_duchy + custom_tooltip = { + text = subrealm_has_county_of_other_culture + any_sub_realm_county = { + NOT = { culture = scope:recipient.culture } + } + } + } + } + } + + send_option = { + flag = building_focus_fortification + is_shown = { + } + is_valid = { + } + } + + send_option = { + flag = building_focus_military + is_shown = { + } + is_valid = { + } + } + + send_option = { + flag = building_focus_economy + is_shown = { + } + 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 + } + } + } + } + } + + on_accept = { + scope:recipient = { + 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:remove_directive ?= { + custom_tooltip = { + text = vassal_directive_remove_directive + remove_vassal_directives = yes + } + } + } + } + } + + ai_potential = { + has_government = administrative_government + highest_held_title_tier >= tier_kingdom + } + ai_targets = { + ai_recipients = vassals + } + ai_frequency = 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 + } + } + } + } +} diff --git a/common/character_interactions/00_war.txt b/common/character_interactions/00_war.txt new file mode 100644 index 00000000..88ca27c5 --- /dev/null +++ b/common/character_interactions/00_war.txt @@ -0,0 +1,1980 @@ +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 = { + NOT = { + 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 = { + NOT = { has_trait = incapable } + can_attack_in_hierarchy = scope:recipient + NOT = { + has_raised_armies = yes + } + has_any_display_cb_on = scope:recipient + NOT = { + is_allied_in_war = scope:recipient + } + custom_description = { + text = "is_not_bankrupt" + gold > 0 + } + 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 + } + } + } + } + } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + scope:recipient = { + trigger_if = { + limit = { is_imprisoned = yes } + NOT = { + imprisoner = scope:actor + } + } + } + scope:actor = { + trigger_if = { + limit = { + NOT = { government_allows = administrative } + liege ?= { + has_realm_law_flag = vassal_all_wars_banned_permanent + NOT = { 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 } + NOT = { top_liege = scope:recipient } + } + 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 + is_independent_ruler = no + 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 + } + } + } + scope:actor = { + trigger_if = { + limit = { is_landless_adventurer = yes } + 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 } + } + } + } + } + } + } + + 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 + NOT = { 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 = { count >= 1 } + } + } + } + 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 = 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 = { + NOT = { this = scope:defender_loser } + } + } + every_vassal = { + limit = { NOT = { 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 = { NOT = { this = scope:attacker_winner } } + } + every_vassal = { + limit = { + NOT = { 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 = { + attacker_war_score >= 90 + root = { + has_perk = peacemaker_perk + } + primary_defender = { + is_ai = yes + } + } + primary_defender = { + is_ai = yes + ai_has_conqueror_personality = yes + } + } + } + } + + ai_will_do = { + base = 0 + + modifier = { + scope:war = { + primary_attacker = scope:actor + OR = { + attacker_war_score >= 100 + AND = { + attacker_war_score >= 90 + scope:actor = { + has_perk = peacemaker_perk + } + primary_defender = { + is_ai = yes + } + } + AND = { + NOR = { + using_cb = undirected_great_holy_war + using_cb = mongol_invasion_war + using_cb = mongol_realm_invasion_war + } + primary_defender = { + is_ai = yes + ai_has_conqueror_personality = yes + } + } + } + } + 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 + NOT = { this = scope:recipient } + } + } + + add = peacemaker_value + + desc = "PEACEMAKER_PERK_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 + ai_has_conqueror_personality = yes + 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 = { + tier = 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 = 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 = { NOT = { this = scope:defender_white_peace } } + } + every_vassal = { + limit = { + NOT = { 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 = { NOT = { this = scope:attacker_white_peace } } + } + every_vassal = { + limit = { + NOT = { 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 = { + NOT = { 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 + } + 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 + } + 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 + ai_has_conqueror_personality = yes + } + 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 + } + 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 = { + NOT = { 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" + } + + # 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" + } + + # 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 = 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 = { + NOT = { this = scope:defender_winner } + } + } + every_vassal = { + limit = { + NOT = { 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 = { NOT = { this = scope:attacker_loser } } + } + every_vassal = { + limit = { + NOT = { 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 = { + defender_war_score >= 90 + root = { + OR = { + has_perk = peacemaker_perk + culture = { + has_cultural_parameter = can_end_defensive_wars_earlier + } + } + } + primary_attacker = { + is_ai = yes + } + } + } + } + } + + 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 + } + } + } + } + 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 + NOT = { this = scope:recipient } + } + } + + add = peacemaker_value + + desc = "PEACEMAKER_PERK_MODIFIER" + } + modifier = { + scope:war.casus_belli = { + primary_defender = { + culture = { + has_cultural_parameter = can_end_defensive_wars_earlier + } + NOT = { 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/00_witch_interactions.txt b/common/character_interactions/00_witch_interactions.txt new file mode 100644 index 00000000..a3a2fc3f --- /dev/null +++ b/common/character_interactions/00_witch_interactions.txt @@ -0,0 +1,311 @@ + +convert_to_witchcraft_interaction = { + icon = icon_scheme_convert_to_witchcraft + category = interaction_category_friendly + + interface_priority = 90 + scheme = convert_to_witchcraft + + send_name = START_SCHEME + + desc = convert_to_witchcraft_interaction_desc + + is_shown = { + scope:actor = { + can_start_scheme = { + type = convert_to_witchcraft + target_character = scope:recipient + } + } + NOT = { scope:actor = scope:recipient } + } + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + can_start_scheme = { + type = convert_to_witchcraft + target_character = scope:recipient + } + } + custom_description = { + text = has_a_witch_secret_known_by_character + subject = scope:recipient + object = scope:actor + scope:recipient = { #If they are a secret witch I must not know about it + trigger_if = { + limit = { + any_secret = { + secret_type = secret_witch + } + } + any_secret = { + secret_type = secret_witch + NOT = { any_secret_knower = { this = scope:actor } } + } + } + } + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = convert_to_witchcraft_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + begin_scheme_basic_effect = { + SCHEME_TYPE = convert_to_witchcraft + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + } + } + } + } + + auto_accept = yes + + #AI will do + + ai_potential = { + is_witch_trigger = yes + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + ai_recipients = family + max = 5 + } + ai_targets = { + ai_recipients = guests + ai_recipients = courtiers + ai_recipients = liege + ai_recipients = vassals + chance = 0.2 + } + + ai_frequency = 72 + + + ai_will_do = { + base = -45 + + # Do I like recipient & are they trustworthy + opinion_modifier = { + who = scope:actor + opinion_target = scope:recipient + multiplier = 0.5 + } + compatibility_modifier = { + who = scope:actor + compatibility_target = scope:recipient + multiplier = 0.2 + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + } + ai_value_modifier = { + who = scope:recipient + ai_honor = 0.2 + ai_compassion = 0.1 + ai_rationality = 0.2 + ai_greed = 0.2 + ai_sociability = 0.1 + } + ai_value_modifier = { + trigger = { trait_is_shunned_or_criminal_in_faith_trigger = { FAITH = scope:recipient.faith TRAIT = witch GENDER_CHARACTER = scope:actor } } + ai_zeal = -0.5 + max = 20 + } + + # Are they important (to me) + modifier = { + add = { + value = scope:recipient.highest_held_title_tier + subtract = scope:actor.highest_held_title_tier + multiply = 10 + } + } + modifier = { + OR = { + is_close_family_of = scope:recipient + is_consort_of = scope:recipient + has_relation_lover = scope:recipient + has_relation_friend = scope:recipient + } + add = 20 + } + modifier = { + OR = { + has_relation_best_friend = scope:recipient + has_relation_soulmate = scope:recipient + } + add = 30 + } + modifier = { + exists = house + exists = scope:recipient.house + house = scope:recipient.house + add = 10 + } + + # Do I want to spread the word + ai_value_modifier = { + ai_sociability = 0.2 + ai_compassion = 0.1 + ai_boldness = 0.4 + min = -20 + } + } +} + +reveal_as_witch_interaction = { + category = interaction_category_friendly + icon = icon_scheme_convert_to_witchcraft + + interface_priority = 100 + + desc = reveal_as_witch_interaction_desc + notification_text = witch.2900.desc + + is_shown = { + scope:actor = { + is_adult = yes + any_secret = { + secret_type = secret_witch + NOT = { is_known_by = scope:recipient } + } + knows_about_character_being_witch_trigger = { CHARACTER = scope:recipient } + } + scope:actor.faith = scope:recipient.faith + scope:recipient = { + is_adult = yes + } + } + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + } + } + + on_accept = { + scope:actor = { + #Secret reveals. + random_secret = { + limit = { + secret_type = secret_witch + NOT = { is_known_by = scope:recipient } + } + save_scope_as = witch_secret + reveal_to = scope:recipient + } + #Send a reply. + trigger_event = witch.2901 + #Opinion effects. + reverse_add_opinion = { + target = scope:recipient + modifier = trust_opinion + opinion = 20 + } + hidden_effect = { + if = { + limit = { + can_set_relation_potential_friend_trigger = { CHARACTER = scope:recipient } + } + set_relation_potential_friend = scope:recipient + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_witch_reveal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes + force_notification = yes + + #AI will do + + ai_potential = { + always = yes + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_targets = { + ai_recipients = liege + ai_recipients = known_secrets + } + ai_targets = { + ai_recipients = vassals + ai_recipients = peer_vassals + chance = 0.2 + } + ai_frequency = 144 + + + ai_will_do = { + base = -45 + + # Do I like recipient & are they trustworthy + opinion_modifier = { + who = scope:actor + opinion_target = scope:recipient + multiplier = 0.5 + } + compatibility_modifier = { + who = scope:actor + compatibility_target = scope:recipient + multiplier = 0.2 + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + } + ai_value_modifier = { + who = scope:recipient + ai_honor = 0.2 + ai_compassion = 0.1 + } + + # Are they important + modifier = { + add = { + value = scope:recipient.highest_held_title_tier + subtract = scope:actor.highest_held_title_tier + multiply = 10 + max = 30 + } + } + + #Do I want to tell anyone + ai_value_modifier = { + ai_sociability = 0.2 + ai_compassion = 0.1 + min = -20 + } + + modifier = { + has_trait = paranoid + add = -40 + } + } +} diff --git a/common/character_interactions/01_fp1_interactions.txt b/common/character_interactions/01_fp1_interactions.txt new file mode 100644 index 00000000..5e9d1647 --- /dev/null +++ b/common/character_interactions/01_fp1_interactions.txt @@ -0,0 +1,1033 @@ +# Character Interactions from FP1 + +################## +# Designate someone as your chief sacrifice at a blot. +# by Ewan Cowhig Croft +################## +designate_gruesome_festivals_sacrifice_interaction = { + icon = icon_scheme_abduct + interface_priority = 30 + category = interaction_category_religion + desc = designate_gruesome_festivals_sacrifice_interaction_desc + + is_shown = { + scope:actor = { has_character_flag = gruesome_festivals_can_pick_human_sacrifice } + scope:recipient = { + is_imprisoned_by = scope:actor + NOT = { has_character_modifier = gruesome_festivals_designated_sacrifice_fp1_modifier } + } + } + + is_valid_showing_failures_only = { + } + + on_accept = { + scope:actor = { + hidden_effect = { + every_prisoner = { + limit = { has_character_modifier = gruesome_festivals_designated_sacrifice_fp1_modifier } + save_scope_value_as = { + name = removal_type + value = flag:override + } + designate_gruesome_festivals_sacrifice_modifier_removed_effect = { DESIGNATOR = scope:actor } + } + } + } + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = designate_gruesome_festivals_sacrifice_interaction.recipient.notification.t + left_icon = scope:actor + designate_gruesome_festivals_sacrifice_interaction_effect = yes + custom_tooltip = designate_gruesome_festivals_sacrifice_interaction.recipient.notification.tt + } + } + + # 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_human_sacrifice.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes +} + +################## +# Give someone reprieve from being HumSac'd. +# by Ewan Cowhig Croft +################## +remove_designated_gruesome_festivals_sacrifice_interaction = { + icon = icon_scheme_abduct + interface_priority = 30 + category = interaction_category_religion + desc = remove_designated_gruesome_festivals_sacrifice_interaction_desc + + is_shown = { + scope:actor = { has_character_flag = gruesome_festivals_can_pick_human_sacrifice } + scope:recipient = { has_character_modifier = gruesome_festivals_designated_sacrifice_fp1_modifier } + } + + is_valid_showing_failures_only = { + } + + on_accept = { + scope:recipient = { + save_scope_value_as = { + name = removal_type + value = flag:manual + } + designate_gruesome_festivals_sacrifice_modifier_removed_effect ={ DESIGNATOR = scope:actor } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_human_sacrifice_removal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = yes +} + +################## +# Challenge a cur to combat for their crimes! +# by Ewan Cowhig Croft +################## +challenge_to_trial_by_combat_interaction = { + icon = icon_combat + interface_priority = 30 + common_interaction = yes + category = interaction_category_hostile + popup_on_receive = yes + pause_on_receive = yes + desc = challenge_to_trial_by_combat_interaction_desc + highlighted_reason = challenge_to_trial_by_combat_interaction_HIGHLIGHTED + + greeting = negative + notification_text = REQUEST_TRIAL_BY_COMBAT_TEXT + + is_shown = { + # Early out on whether you have the DLC or not. + has_fp1_dlc_trigger = yes + # First, evaluate culture to trim down our potentials list. + can_have_trial_by_combat_trigger = yes + # And obviously never against yourself. + NOT = { scope:actor = scope:recipient } + # Then, look to see if scope:actor has good cause. + scope:actor = { + # Check there are no lieges involved. + NOR = { + # Must not be in a position to imprison scope:recipient standardly. + target_is_liege_or_above = scope:recipient + # Can't be used against anyone who has authority over you. + scope:recipient = { target_is_liege_or_above = scope:actor } + } + # Scope:recipient cannot be a landless character in scope:actor's sub-realm. + scope:recipient = { + is_landed_or_landless_administrative = yes + NAND = { + exists = court_owner + court_owner = { + OR = { + this = scope:actor + any_liege_or_above = { this = scope:actor } + } + } + } + } + } + } + + is_highlighted = { + trial_by_combat_is_valid_trigger = yes + } + + + is_valid_showing_failures_only = { + trial_by_combat_is_valid_trigger = yes + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + # Will scope:recipient need to choose a champion? + if = { + limit = { + scope:recipient = { + OR = { + can_start_single_combat_eligibility_checks_trigger = no + NOT = { + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:recipient } + } + } + } + } + scope:recipient = { trigger_event = fp1_tbc.0101 } + # Inform both characters that scope:recipient will have a chance to choose a champion. + custom_tooltip = fp1_tbc_recipient_will_designate_champion + } + # Else we skip straight to scope:actor's setup event. + else = { + # Stopping only briefly to clarify that scope:recipient will be fighting the bout themselves. + scope:recipient = { save_scope_as = champion } + scope:actor = { trigger_event = fp1_tbc.0001 } + } + # Inform of the consequences. + ## Death - one of you will die. + if = { + limit = { always = scope:tbc_death } + show_as_tooltip = { + random_list = { + 50 = { + show_chance = no + desc = fp1_tbc_winner_actor + fp1_tbc_death_effect = { + TBC_VICTOR = scope:actor + TBC_LOSER = scope:recipient + } + scope:actor = { + add_kinslayer_trait_or_nothing_effect = { VICTIM = scope:recipient } + } + } + 50 = { + show_chance = no + desc = fp1_tbc_winner_recipient + fp1_tbc_death_effect = { + TBC_VICTOR = scope:recipient + TBC_LOSER = scope:actor + } + scope:recipient = { + add_kinslayer_trait_or_nothing_effect = { VICTIM = scope:actor } + } + } + } + } + } + ## Gold - scope:recipient will have to pay gold, or scope:actor will take stress. + if = { + limit = { always = scope:tbc_gold } + show_as_tooltip = { + random_list = { + 50 = { + show_chance = no + desc = fp1_tbc_winner_actor + fp1_tbc_gold_effect = { + TBC_VICTOR = scope:actor + TBC_LOSER = scope:recipient + } + } + 50 = { + show_chance = no + desc = fp1_tbc_winner_recipient + fp1_tbc_actor_defeated_effect = { TBC_LOSER = scope:actor } + } + } + } + } + ## Hook - scope:recipient will concede a hook, or scope:actor will take stress. + if = { + limit = { always = scope:tbc_weak_hook } + show_as_tooltip = { + random_list = { + 50 = { + show_chance = no + desc = fp1_tbc_winner_actor + fp1_tbc_hook_effect = { + TBC_VICTOR = scope:actor + TBC_LOSER = scope:recipient + } + } + 50 = { + show_chance = no + desc = fp1_tbc_winner_recipient + fp1_tbc_actor_defeated_effect = { TBC_LOSER = scope:actor } + } + } + } + } + ## Humiliation - scope:recipient will gain an immense amount of stress, or scope:actor will take some stress. + if = { + limit = { always = scope:tbc_humiliation } + show_as_tooltip = { + random_list = { + 50 = { + show_chance = no + desc = fp1_tbc_winner_actor + fp1_tbc_humiliation_effect = { TBC_LOSER = scope:recipient } + } + 50 = { + show_chance = no + desc = fp1_tbc_winner_recipient + fp1_tbc_actor_defeated_effect = { TBC_LOSER = scope:actor } + } + } + } + } + # Clear up hostile actions flag. + 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 + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_loss + DESC = clan_unity_trial_by_combat.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:recipient loses some prestige. + scope:recipient = { add_prestige = medium_prestige_loss } + # Scope:actor decline processing. + scope:actor = { + # Inform them of the declination. + trigger_event = fp1_tbc.0031 + # Cooldown is removed. + hidden_effect = { remove_interaction_cooldown = challenge_to_trial_by_combat_interaction } + # Clear up hostile actions flag. + if = { + limit = { + has_character_flag = flag_hostile_actions_disabled_delay + } + remove_character_flag = flag_hostile_actions_disabled_delay + } + } + } + + # Demand it to the death. + send_option = { + # Only tribals fight to the death. + is_shown = { + scope:actor = { government_has_flag = government_is_tribal } + # And there's no real sense doing it if you can't fight your opponent directly. + scope:recipient = { + NOR = { + can_start_single_combat_eligibility_checks_trigger = no + NOT = { + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:recipient } + } + } + } + } + flag = tbc_death + localization = "TBC_DEATH" + } + # Demand gold. + send_option = { + # Always available. + is_shown = { always = yes } + flag = tbc_gold + localization = "TBC_GOLD" + } + # Demand a hook. + send_option = { + # Must not have a better hook. + is_shown = { + NOT = { + scope:actor = { has_strong_hook = scope:recipient } + } + } + flag = tbc_weak_hook + localization = "TBC_WEAK_HOOK" + } + # Demand humiliation. + send_option = { + #Should not be used on children + is_shown = { + scope:recipient = { is_adult = yes } + } + flag = tbc_humiliation + localization = "TBC_HUMILIATION" + } + + auto_accept = no + + ai_accept = { + base = 0 # Try to make it 0 for most interactions + + # Fightan abilities of both sides. + modifier = { + add = { + value = scope:actor.prowess + multiply = -0.5 + } + desc = TBC_PROWESS_ACTOR + } + modifier = { + add = { + value = scope:recipient.prowess + multiply = 0.5 + } + desc = TBC_PROWESS_RECIPIENT + } + # Who doesn't like punching a bastard? + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = -1 + desc = AI_OPINION_REASON + } + # Weight up for personality values. + 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 = { + NOT = { ai_honor = 0 } + } + } + value = 0.5 + } + } + } + # Specific settlement preferences. + ## Death: disliked by people who feel that disputes can always be settled more amicably. + ### Craven hates. + modifier = { + add = -10 + has_trait = craven + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_CRAVEN + } + ### Forgiving hates. + modifier = { + add = -10 + has_trait = forgiving + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_FORGIVING + } + ### Compassionate dislikes. + modifier = { + add = -10 + has_trait = compassionate + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_COMPASSIONATE + } + ### Brave loves. + modifier = { + add = 20 + has_trait = brave + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_BRAVE + } + ### Vengeful loves. + modifier = { + add = 20 + has_trait = vengeful + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_VENGEFUL + } + ### Callous likes. + modifier = { + add = 10 + has_trait = callous + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_CALLOUS + } + ### Sadistic loves. + modifier = { + add = 20 + has_trait = sadistic + scope:tbc_death = yes + desc = TBC_OPINION_DEATH_TRAIT_SADISTIC + } + ## Gold: disliked by people who think wealth is sacrosanct. + ### Greedy dislikes. + modifier = { + add = -10 + has_trait = greedy + scope:tbc_gold = yes + desc = TBC_OPINION_GOLD_TRAIT_GREEDY + } + ### Generous likes. + modifier = { + add = 10 + has_trait = generous + scope:tbc_gold = yes + desc = TBC_OPINION_GOLD_TRAIT_GENEROUS + } + ## Weak Hook: disliked by people who don't like nebulous favours or being indebted to their lessers. + ### Arrogant dislikes. + modifier = { + add = -10 + has_trait = arrogant + scope:tbc_weak_hook = yes + desc = TBC_OPINION_WEAK_HOOK_TRAIT_ARROGANT + } + ### Paranoid dislikes. + modifier = { + add = -10 + has_trait = paranoid + scope:tbc_weak_hook = yes + desc = TBC_OPINION_WEAK_HOOK_TRAIT_PARANOID + } + ### Arbitray dislikes. + modifier = { + add = -10 + has_trait = arbitrary + scope:tbc_weak_hook = yes + desc = TBC_OPINION_WEAK_HOOK_TRAIT_ARBITRARY + } + ### Humble likes. + modifier = { + add = 10 + has_trait = humble + scope:tbc_weak_hook = yes + desc = TBC_OPINION_WEAK_HOOK_TRAIT_HUMBLE + } + ### Trusting likes. + modifier = { + add = 10 + has_trait = trusting + scope:tbc_weak_hook = yes + desc = TBC_OPINION_WEAK_HOOK_TRAIT_TRUSTING + } + ### Just likes. + modifier = { + add = 10 + has_trait = just + scope:tbc_weak_hook = yes + desc = TBC_OPINION_WEAK_HOOK_TRAIT_JUST + } + ## Humiliation: *hated* by people obsessed with public image or weightier consequences. + ### Arrogant hates. + modifier = { + add = -20 + has_trait = arrogant + scope:tbc_humiliation = yes + desc = TBC_OPINION_HUMILIATION_TRAIT_ARROGANT + } + ### Vengeful hates. + modifier = { + add = -20 + has_trait = vengeful + scope:tbc_humiliation = yes + desc = TBC_OPINION_HUMILIATION_TRAIT_VENGEFUL + } + ### Stubborn hates. + modifier = { + add = -20 + has_trait = stubborn + scope:tbc_humiliation = yes + desc = TBC_OPINION_HUMILIATION_TRAIT_STUBBORN + } + ### Humble likes. + modifier = { + add = 10 + has_trait = humble + scope:tbc_humiliation = yes + desc = TBC_OPINION_HUMILIATION_TRAIT_HUMBLE + } + ### Forgiving likes. + modifier = { + add = 10 + has_trait = forgiving + scope:tbc_humiliation = yes + desc = TBC_OPINION_HUMILIATION_TRAIT_FORGIVING + } + ### Fickle likes. + modifier = { + add = 10 + has_trait = fickle + scope:tbc_humiliation = yes + desc = TBC_OPINION_HUMILIATION_TRAIT_FICKLE + } + # Apply tier differences. + ## King -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value >= 4 + } + } + add = 15 + } + ## Duke -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 3 + } + } + add = 10 + } + ## Count -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 2 + } + } + add = 5 + } + ## King <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -2 + } + } + add = -10 + } + ## Duke <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -3 + } + } + add = -20 + } + ## Count <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value <= -4 + } + } + add = -30 + } + # Rivalry modifier. + modifier = { + desc = offer_vassalization_interaction_aibehavior_rival_tt + trigger = { + scope:recipient = { + has_relation_rival = scope:actor + NOT = { has_relation_nemesis = scope:actor } + } + } + add = 50 + } + # Nemesis modifier. + modifier = { + desc = offer_vassalization_interaction_aibehavior_nemesis_tt + trigger = { + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + add = 100 + } + } + + # AI + + ai_potential = { + basic_can_have_trial_by_combat_trigger = yes + NOT = { + has_trait = craven + } + is_imprisoned = no + can_start_single_combat_trigger = yes + } + + ai_target_quick_trigger = { + adult = yes + } + ai_targets = { + ai_recipients = scripted_relations + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + chance = 0.25 + } + + ai_frequency = 36 + + ai_will_do = { + base = -50 + + # Factor for opinion. + modifier = { + add = 100 + scope:actor = { + opinion = { + target = scope:recipient + value <= very_high_negative_opinion + } + } + } + modifier = { + add = 50 + scope:actor = { + opinion = { + target = scope:recipient + value <= medium_negative_opinion + } + } + } + modifier = { + add = -50 + scope:actor = { + opinion = { + target = scope:recipient + value >= medium_positive_opinion + } + } + } + modifier = { + add = -100 + scope:actor = { + opinion = { + target = scope:recipient + value >= very_high_positive_opinion + } + } + } + # Don't challenge kinslayer-counting family, unless they're a rival or nemesis. + modifier = { + scope:actor = { + murdering_character_is_kinslaying_in_faith_trigger = { + CHARACTER = scope:recipient + FAITH = scope:actor.faith + } + } + scope:recipient = { + NOR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + add = -1000 + } + # Don't challenge your spouse, unless they're your rival or nemesis. + modifier = { + scope:recipient = { + is_spouse_of = scope:actor + NOR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + add = -1000 + } + # Don't challenge people hopelessly out of your league unless you're really, really not seeing things clearly. + modifier = { + scope:actor = { + prowess_diff = { + target = scope:recipient + value <= -15 + } + ai_rationality >= high_negative_ai_value + } + add = -1000 + } + } +} + +################## +# Designate a Shieldmaiden +# by Alexander Oltner +################## +designate_shieldmaiden_interaction = { + icon = designate_shieldmaiden_interaction + category = interaction_category_friendly + common_interaction = yes + + send_name = SEND_PROPOSAL + + interface_priority = 120 + + ai_targets = { + ai_recipients = courtiers + } + ai_frequency = 180 + + is_shown = { + scope:actor = { + has_fp1_dlc_trigger = yes + is_physically_able_adult = yes + #Has access to the appropriate cultural parameter. + culture = { has_cultural_parameter = has_access_to_shieldmaidens } + trigger_if = { # Determined by Cultural Pillars + limit = { has_dlc_feature = diverge_culture } + culture = { + NOT = { has_cultural_parameter = martial_custom_equal_combatant } + } + } + trigger_else = { + NOT = { + faith = { has_doctrine = doctrine_gender_equal } + } + } + } + scope:recipient = { + NOT = { has_trait = incapable } + is_courtier_of = scope:actor + is_close_family_of = scope:actor + NOT = { has_trait = shieldmaiden } + trigger_if = { # Determined by Cultural Pillars + limit = { has_dlc_feature = diverge_culture } + OR = { + AND = { + is_female = yes + culture = { has_cultural_parameter = martial_custom_male_only_combatant } + } + AND = { + is_male = yes + culture = { has_cultural_parameter = martial_custom_female_only_combatant } + } + } + } + trigger_else = { + OR = { # Does not have the Royal Court and thus combatant is governed by faith + AND = { + is_female = yes + faith = { has_doctrine_parameter = combatant_must_be_male_if_no_roco } + } + AND = { + is_male = yes + faith = { has_doctrine_parameter = combatant_must_be_female_if_no_roco } + } + } + } + + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + prowess >= decent_skill_rating + is_adult = yes + is_imprisoned = no + } + } + + desc = designate_shieldmaiden_interaction_desc + + on_accept = { + scope:actor = { + stress_impact = { + arrogant = medium_stress_impact_gain + paranoid = minor_stress_impact_gain + } + } + scope:recipient = { + add_trait = shieldmaiden + + add_opinion = { + target = scope:actor + modifier = fp1_accepted_my_sword_opinion + } + } + if = { + limit = { always = scope:hook } + scope:actor = { use_hook = scope:recipient } + } + hidden_effect = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = designate_shieldmaiden_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + show_as_tooltip = { + scope:recipient = { + add_trait_force_tooltip = shieldmaiden + } + stress_impact = { + arrogant = medium_stress_impact_gain + paranoid = minor_stress_impact_gain + } + } + } + } + scope:recipient = { + if = { + limit = { has_character_flag = fp1_dreams_of_shieldpersondom } + remove_character_flag = fp1_dreams_of_shieldpersondom + } + } + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + AND = { + always = scope:hook + scope:actor = { has_strong_hook = scope:recipient } + } + } + } + + 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 + + cost = { + prestige = scope:actor.minor_prestige_value + } + + ai_potential = { + #Has access to the appropriate cultural parameter. + culture = { has_cultural_parameter = has_access_to_shieldmaidens } + prestige > major_prestige_value + has_fp1_dlc_trigger = yes + is_physically_able_adult = yes + } + + auto_accept = no + + ai_accept = { + base = 0 + + modifier = { + trigger = { + always = scope:hook + } + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + + modifier = { + trigger = { + has_education_martial_trigger = yes + } + add = 20 + desc = INTERACTION_MARTIAL_EDUCATION + } + + # Weight up for personality values. + ai_value_modifier = { + who = scope:recipient + ai_boldness = { + if = { + limit = { + scope:recipient = { + NOT = { ai_boldness = 0 } + } + } + value = 0.5 + } + } + ai_compassion = { + if = { + limit = { + scope:recipient = { + NOT = { ai_compassion = 0 } + } + } + value = -0.5 + } + } + } + + modifier = { + add = -1000 + has_trait = craven + desc = INTERACTION_CRAVEN + } + + modifier = { + add = -50 + has_trait = content + desc = INTERACTION_CONTENT + } + + modifier = { + add = -50 + has_trait = humble + desc = INTERACTION_HUMBLE + } + + modifier = { + add = -50 + has_trait = lazy + desc = INTERACTION_LAZY + } + + modifier = { + add = 100 + has_trait = brave + desc = INTERACTION_BRAVE + } + + modifier = { + add = 25 + has_trait = ambitious + desc = INTERACTION_AMBITIOUS + } + } + + ai_will_do = { + base = 100 + } +} diff --git a/common/character_interactions/02_ep1_interactions.txt b/common/character_interactions/02_ep1_interactions.txt new file mode 100644 index 00000000..7fdf79ca --- /dev/null +++ b/common/character_interactions/02_ep1_interactions.txt @@ -0,0 +1,468 @@ +# Character Interactions for EP1 + +################## +# Fund someone's inspiration +# by Linnéa Thimrén +################## +fund_inspiration_interaction = { + icon = inspiration + interface_priority = 30 + common_interaction = yes + category = interaction_category_vassal + desc = fund_inspiration_interaction_desc + + is_shown = { + scope:recipient = { + is_ruler = no + exists = inspiration + inspiration = { + NOT = { + exists = inspiration_sponsor + } + } + } + scope:actor = { + any_courtier_or_guest = { + this = scope:recipient + } + } + } + + is_highlighted = { + always = yes + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_physically_able = yes + is_ruler = no + trigger_if = { + limit = { + NOT = { is_courtier_of = scope:actor } + } + can_recruit_character_to_court_trigger = { + RECRUITER = scope:actor + RECRUITEE = scope:recipient + } + } + } + scope:actor = { + can_sponsor_inspiration = scope:recipient.inspiration + gold >= scope:recipient.inspiration.base_inspiration_gold_cost + } + } + + on_accept = { + fund_inspiration_effect = yes + + if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = weapon_inspiration } } + custom_description_no_bullet = { text = weapon_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = armor_inspiration } } + custom_description_no_bullet = { text = armor_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = book_inspiration } } + custom_description_no_bullet = { text = book_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = weaver_inspiration } } + custom_description_no_bullet = { text = weaver_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = adventure_inspiration } } + custom_description_no_bullet = { text = adventure_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = artisan_inspiration } } + custom_description_no_bullet = { text = artisan_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = smith_inspiration } } + custom_description_no_bullet = { text = smith_inspiration_cost_tt } + } + else_if = { + limit = { scope:recipient.inspiration = { has_inspiration_type = alchemy_inspiration}} + custom_description_no_bullet = { text = alchemy_inspiration_cost_tt } + } + + # Add a flag on AI to have an extra cooldown of 3 years + if = { + limit = { + scope:actor = { + is_ai = yes + NOT = { + gold >= 1000 + } + OR = { + short_term_gold < ai_inspiration_desired_gold_value + ai_greed >= 50 + } + } + } + scope:actor = { + add_character_flag = { + flag = recently_fund_inspiration + years = 3 + } + } + + } + + # 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_inspo.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + custom_description = { + text = auto_accept_interaction_ai + object = scope:recipient + scope:recipient = { + is_ai = yes + } + } + } + + ai_frequency = 10 + + ai_targets = { + ai_recipients = guests + ai_recipients = courtiers + } + + ai_target_quick_trigger = { + adult = yes + } + + ai_potential = { + is_at_war = no + OR = { + has_royal_court = yes + government_has_flag = government_is_landless_adventurer + } + gold > ai_inspiration_desired_gold_value + NOT = { has_character_flag = recently_fund_inspiration } + ai_has_conqueror_personality = no + ai_should_focus_on_building_in_their_capital = no + } + + ai_will_do = { + base = 100 + + modifier = { # Not as likely to fund inspirations if they already have some going (max three for very prestigious courts) + add = { + if = { + limit = { + highest_held_title_tier >= tier_empire + any_sponsored_inspiration = { + count >= 3 + } + } + add = -50 + } + else_if = { + limit = { + highest_held_title_tier >= tier_kingdom + any_sponsored_inspiration = { + count >= 2 + } + } + add = -50 + } + } + } + + # Do not pointlessly fund inspirations you do not need + modifier = { # Weapons + factor = 0 + scope:recipient.inspiration = { + has_inspiration_type = weapon_inspiration + } + OR = { + any_character_artifact = { # Has a fantastic item already + artifact_slot_type = primary_armament + rarity = illustrious + } + AND = { # Have a lot of artifacts already, and the inspired person isn't even very good + scope:recipient = { + weapon_inspiration_average_skill_value < 15 + } + any_character_artifact = { + count >= 2 + artifact_slot_type = primary_armament + } + } + } + } + modifier = { # Armor + factor = 0 + scope:recipient.inspiration = { + has_inspiration_type = armor_inspiration + } + OR = { + any_character_artifact = { # Has a fantastic item already + artifact_slot_type = armor + rarity = illustrious + } + AND = { # Have a lot of artifacts already, and the inspired person isn't even very good + scope:recipient = { + armor_inspiration_average_skill_value < 15 + } + any_character_artifact = { + count >= 2 + artifact_slot_type = armor + } + } + } + } + modifier = { # Warlike AI's only sponsor if they've been at peace for a long time + factor = 0 + ai_has_warlike_personality = yes + days_of_continuous_peace < 1825 # 5 years + } + modifier = { # Cautious AI's only sponsor if they feel safe enough + factor = 0 + ai_has_cautious_personality = yes + war_chest_gold < cautious_ai_minimum_war_chest_gold + } + } +} + +################## +# Indebt Guest +# by Ewan Cowhig Croft +################## + +indebt_guest_interaction = { + icon = icon_hostile + interface_priority = 120 + common_interaction = yes + ai_max_reply_days = 0 + cooldown = { years = 5 } + + category = interaction_category_hostile + ai_maybe = yes + + desc = indebt_guest_interaction_desc + + greeting = negative + 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 + + ai_potential = { + # Repeat some is_shown triggers for performance gains. + indebt_guest_interaction_basic_checks_trigger = { ACTOR = this } + } + + is_shown = { + NOT = { scope:actor = scope:recipient } + # Repeat some ai_potential triggers for performance gains. + indebt_guest_interaction_basic_checks_trigger = { ACTOR = scope:actor } + # Scope:recipient must be a guest. + scope:recipient = { is_pool_guest_of = scope:actor } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:actor = { is_imprisoned = no } + scope:actor = { is_commanding_army = no } + # Scope:actor can't have a hook of any kind on scope:recipient already. + NOT = { + scope:actor = { has_hook = scope:recipient } + } + # Scope:actor must be able to afford the cost of the decision going wrong. + scope:actor.court_grandeur_current >= indebt_guest_interaction_lost_test_grandeur_cost_value + } + + can_send = { + scope:actor = { + custom_description = { + text = "character_interactions_hostile_actions_disabled_delay" + NOT = { has_character_flag = flag_hostile_actions_disabled_delay } + } + } + } + + on_send = { + scope:actor = { + add_character_flag = { + flag = flag_hostile_actions_disabled_delay + days = 10 + } + } + } + + on_accept = { + scope:actor = { + # On accept, you gain a hook & lose some opinion. + ## Which we only show as a tooltip for now, since it's applied in the event. + show_as_tooltip = { indebt_guest_interaction_accepted_effect = yes } + # Pop the event. + trigger_event = ep1_character_interaction.0001 + # Reminder that you'll have a chance to direct where they go. + custom_tooltip = indebt_guest_interaction.tt.direct_indebted_guest + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_indebt_guest.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Send a toast. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = indebt_guest_interaction.tt.failure + left_icon = scope:recipient + # On decline, scope:recipient leaves your court... + scope:recipient = { select_and_move_to_pool_effect = yes } + # ... and you lose a bit of extra grandeur for your audacity. + change_current_court_grandeur = indebt_guest_interaction_lost_test_grandeur_cost_value + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_indebt_guest_failure.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = no + + ai_accept = { + base = 50 + + # Standard intrigue duel. + modifier = { + add = { + value = scope:actor.intrigue + multiply = 2 + } + desc = INDEBT_GUEST_INTRIGUE_ACTOR + } + modifier = { + add = { + value = scope:recipient.intrigue + multiply = -1 + } + desc = INDEBT_GUEST_INTRIGUE_RECIPIENT + } + # Weight it a bit more in your favour for every point of excess CGV you have. + modifier = { + add = scope:actor.current_cgv_above_expected_exact_value + desc = INDEBT_GUEST_CURRENT_CGV_ABOVE_EXPECTED + scope:actor.current_cgv_above_expected_exact_value >= 1 + } + # Some traits may also affect the chances for scope:actor... + modifier = { + add = 10 + scope:actor = { has_trait = schemer } + } + modifier = { + add = 10 + scope:actor = { has_trait = education_intrigue } + } + modifier = { + add = 5 + scope:actor = { has_trait = deceitful } + } + modifier = { + add = 5 + scope:actor = { has_trait = vengeful } + } + modifier = { + add = -10 + scope:actor = { has_trait = honest } + } + modifier = { + add = -5 + scope:actor = { has_trait = forgiving } + } + # ... or else for scope:recipient. + modifier = { + add = -10 + scope:recipient = { has_trait = schemer } + } + modifier = { + add = -5 + scope:recipient = { has_trait = education_intrigue } + } + modifier = { + add = -5 + scope:recipient = { has_trait = deceitful } + } + modifier = { + add = 10 + scope:recipient = { has_trait = honest } + } + } + + # AI + ai_targets = { + ai_recipients = guests + chance = 0.5 + } + ai_frequency = 10 + + ai_will_do = { + base = -100 + + # This is a silly way for the AI to spend its CGV, so we keep 'em off it most of the time. + # Unless they've got a scheme on the go at their nemesis' court... + modifier = { + add = 100 + scope:actor = { + any_relation = { + type = nemesis + count >= 1 + } + any_scheme = { + count >= 1 + scheme_target_character = { + any_relation = { + type = nemesis + count >= 1 + this = scope:actor + } + } + } + } + } + # ... *and* they're likely to win due to having higher intrigue, but without scope:recipient being too terrible. + modifier = { + add = 25 + indebt_guest_interaction_get_intrigue_difference_value >= indebt_guest_interaction_likely_success_control_value + scope:recipient = { intrigue >= high_skill_rating } + } + modifier = { + add = 25 + indebt_guest_interaction_get_intrigue_difference_value >= indebt_guest_interaction_likely_success_control_value + scope:recipient = { intrigue >= very_high_skill_rating } + } + modifier = { + add = 50 + indebt_guest_interaction_get_intrigue_difference_value >= indebt_guest_interaction_likely_success_control_value + scope:recipient = { intrigue >= extremely_high_skill_rating } + } + } +} diff --git a/common/character_interactions/03_fp2_interactions.txt b/common/character_interactions/03_fp2_interactions.txt new file mode 100644 index 00000000..42318e32 --- /dev/null +++ b/common/character_interactions/03_fp2_interactions.txt @@ -0,0 +1,5432 @@ +# Character Interactions for FP2 + +################################################## +# Share secrets +# by Maxence Voleau +################################################## +share_known_secrets_interaction = { + icon = secret + category = interaction_category_friendly + common_interaction = yes + + send_name = SEND_PROPOSAL + + interface_priority = 120 + + ai_targets = { + ai_recipients = dynasty + } + + ai_frequency = 180 + + is_shown = { + scope:actor = { + # DLC checking + has_fp2_dlc_trigger = yes + # Standard check + # Has access to the appropriate legacy perk. + dynasty = { has_dynasty_perk = fp2_coterie_legacy_4 } + + # they are from the same house + house = scope:recipient.house + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = share_known_secrets_interaction.tt.no_secrets_to_share + # We try to keep the criteria vague to obfuscate things. + scope:actor = { any_known_secret = { count > 0 } } # Must have a secret to share + OR = { + scope:actor = { + # At least one secret is unknown from recipient + any_known_secret = { + NOT = { is_known_by = scope:recipient } + } + } + scope:recipient = { + # At least one secret is unknown from actor + any_known_secret = { + NOT = { is_known_by = scope:actor } + } + } + } + } + } + + desc = share_known_secrets_interaction_desc + + on_accept = { + scope:actor = { + if = { + limit = { + scope:recipient = { + any_known_secret = { + count >= 7 + NOT = { is_known_by = scope:actor } + } + } + } + add_prestige = major_prestige_loss + + custom_description = { + text = many_secrets_exchanged + } + } + else_if = { + limit = { + scope:recipient = { + any_known_secret = { + count >= 3 + NOT = { is_known_by = scope:actor } + } + } + } + add_prestige = medium_prestige_loss + custom_description = { + text = several_secrets_exchanged + } + } + else = { + add_prestige = minor_prestige_loss + custom_description = { + text = few_secrets_exchanged + } + } + + # Stress impact + stress_impact = { + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + } + + scope:recipient = { + if = { + limit = { + scope:actor = { + any_known_secret = { + count >= 7 + NOT = { is_known_by = scope:recipient } + OR = { + NOR = { + secret_owner = scope:recipient + AND = { + exists = secret_target + secret_target = scope:recipient + } + } + scope:recipient = { + OR = { + has_trait = dull + has_trait = intellect_bad + has_trait = contrite + } + } + } + } + } + } + add_prestige = major_prestige_loss + + custom_description = { + text = many_secrets_exchanged + } + } + else_if = { + limit = { + scope:actor = { + any_known_secret = { + count >= 3 + NOT = { is_known_by = scope:recipient } + OR = { + NOR = { + secret_owner = scope:actor + AND = { + exists = secret_target + secret_target = scope:actor + } + } + scope:actor = { + OR = { + has_trait = dull + has_trait = intellect_bad + has_trait = contrite + } + } + } + } + } + } + add_prestige = medium_prestige_loss + + custom_description = { + text = several_secrets_exchanged + } + } + else = { + add_prestige = minor_prestige_loss + + custom_description = { + text = few_secrets_exchanged + } + } + + # Stress impact + stress_impact = { + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + } + + hidden_effect = { + scope:recipient = { save_scope_as = END_TARGET } # This should make the loc work 2-ways, as notifs do not update themselves + scope:actor = { + if = { # Recipient has no secrets to share + limit = { + scope:recipient = { + any_known_secret = { + NOT = { is_known_by = scope:actor } + OR = { + NOR = { + secret_owner = scope:recipient + AND = { + exists = secret_target + secret_target = scope:recipient + } + } + scope:recipient = { + OR = { + has_trait = dull + has_trait = intellect_bad + has_trait = contrite + } + } + } + count = 0 + } + } + } + send_interface_message = { + type = event_intrigue_bad_with_text + title = share_known_secrets_interaction_outcome_notif_title + desc = share_known_secrets_interaction_recipient_had_no_secrets + left_icon = scope:recipient + } + } + else = { # They had secrets to share + send_interface_message = { + type = event_intrigue_good_with_text + title = share_known_secrets_interaction_outcome_notif_title + desc = share_known_secrets_interaction_desc_intro + left_icon = scope:recipient + + scope:recipient = { + every_known_secret = { + limit = { + NOT = { is_known_by = scope:actor } + OR = { + NOR = { + secret_owner = scope:recipient + AND = { + exists = secret_target + secret_target = scope:recipient + } + } + scope:recipient = { + OR = { + has_trait = dull + has_trait = intellect_bad + has_trait = contrite + } + } + } + } + reveal_to = scope:actor + } + } + } + } + } + + scope:actor = { save_scope_as = END_TARGET } + scope:recipient = { + if = { # actor has no secrets to share + limit = { + scope:actor = { + any_known_secret = { + NOT = { is_known_by = scope:recipient } + OR = { + NOR = { + secret_owner = scope:actor + AND = { + exists = secret_target + secret_target = scope:actor + } + } + scope:actor = { + OR = { + has_trait = dull + has_trait = intellect_bad + has_trait = contrite + } + } + } + count = 0 + } + } + } + send_interface_message = { + type = event_intrigue_bad_with_text + title = share_known_secrets_interaction_outcome_notif_title + desc = share_known_secrets_interaction_recipient_had_no_secrets + left_icon = scope:actor + } + } + else = { # They had secrets to share + send_interface_message = { + type = event_intrigue_good_with_text + title = share_known_secrets_interaction_outcome_notif_title + desc = share_known_secrets_interaction_desc_intro + left_icon = scope:actor + + scope:actor = { + every_known_secret = { + limit = { + NOT = { is_known_by = scope:recipient } + OR = { + NOR = { + secret_owner = scope:actor + AND = { + exists = secret_target + secret_target = scope:actor + } + } + scope:actor = { + OR = { + has_trait = dull + has_trait = intellect_bad + has_trait = contrite + } + } + } + } + reveal_to = scope:recipient + } + hidden_effect = { add_prestige = major_prestige_loss } + } + } + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_secret_sharing.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + AND = { + always = scope:hook + scope:actor = { has_strong_hook = scope:recipient } + } + } + } + + send_option = { + is_valid = { + scope:actor = { has_strong_hook = scope:recipient } + } + flag = hook + localization = SCHEME_HOOK + } + should_use_extra_icon = { + scope:actor = { has_strong_hook = scope:recipient } + } + extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" + + send_options_exclusive = no + + ai_potential = { + #Has access to the appropriate cultural parameter. + AND = { + exists = dynasty + dynasty = { has_dynasty_perk = fp2_coterie_legacy_4 } + } + prestige > major_prestige_value + } + + auto_accept = no + + ai_accept = { + # AI should accept by default + base = 10 + + modifier = { + trigger = { + always = scope:hook + } + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + + modifier = { + trigger = { + has_education_intrigue_trigger = yes + } + add = 20 + desc = INTERACTION_INTRIGUE_EDUCATION + } + + modifier = { + add = -100 + has_trait = honest + desc = INTERACTION_HONEST + } + + modifier = { + add = -50 + has_trait = just + desc = INTERACTION_JUST + } + + modifier = { + add = -50 + has_trait = paranoid + desc = INTERACTION_PARANOID + } + + modifier = { + add = 100 + has_trait = fickle + desc = INTERACTION_FICKLE + } + + modifier = { + add = 100 + has_trait = deceitful + desc = INTERACTION_DECEITFUL + } + + modifier = { + add = 25 + has_trait = ambitious + desc = INTERACTION_AMBITIOUS + } + + } + + ai_will_do = { + base = 100 + } +} + +################################################## +# Propose Best Friendship +# by Ewan Cowhig Croft +################################################## + +# Elevate a friendship to become a *best* friendship. +propose_best_friendship_interaction = { + interface_priority = 30 + icon = icon_personal + category = interaction_category_friendly + common_interaction = yes + desc = propose_best_friendship_interaction_desc + + greeting = positive + notification_text = PROPOSE_BEST_FRIENDSHIP_NOTIFICATION + popup_on_receive = yes + ai_maybe = yes + + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + is_shown = { + # Scope:actor needs to have a suitable CulTrad. + scope:actor = { + culture = { has_cultural_parameter = may_propose_best_friendship } + } + # Scope:actor needs to have scope:recipient as a friend. + scope:actor = { has_relation_friend = scope:recipient } + } + + is_valid_showing_failures_only = { + # Both characters must be available adults. + scope:actor = { is_available_adult = yes } + scope:recipient = { is_available_adult = yes } + # We can't do most of the standard checks for can_set_relation_best_friend_trigger, but we do the relevant ones individually. + custom_tooltip = { + text = propose_best_friendship_interaction.tt.already_best_friends + scope:actor = { + NOT = { has_relation_best_friend = scope:recipient } + } + } + trigger_if = { + limit = { + NOT = { + scope:actor = { has_relation_best_friend = scope:recipient } + } + } + custom_tooltip = { + text = propose_best_friendship_interaction.tt.actor_has_best_friend + scope:actor = { num_of_relation_best_friend = 0 } + } + } + trigger_if = { + limit = { + NOT = { + scope:recipient = { has_relation_best_friend = scope:actor } + } + } + custom_tooltip = { + text = propose_best_friendship_interaction.tt.recipient_has_best_friend + scope:recipient = { num_of_relation_best_friend = 0 } + } + } + } + + on_accept = { + # Notifications with most effects. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = propose_best_friendship_interaction.accept.actor.tt + left_icon = scope:recipient + # Become best friends. + show_as_tooltip = { set_relation_best_friend = scope:recipient } + # Gain some strong opinion bonuses as a result. + reverse_add_opinion = { + target = scope:recipient + modifier = friendliness_opinion + opinion = 50 + } + # The hookening. + ## Due to some weird order-of-operations stuff, we enclose this in an if statement. + if = { + limit = { + NOT = { + has_hook_of_type = { + target = scope:recipient + type = ritual_best_friend_hook + } + } + can_add_hook = { + target = scope:recipient + type = ritual_best_friend_hook + } + } + add_hook = { + type = ritual_best_friend_hook + target = scope:recipient + } + } + } + } + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = propose_best_friendship_interaction.accept.recipient.tt + left_icon = scope:actor + # Become best friends. + show_as_tooltip = { set_relation_best_friend = scope:actor } + # Gain some strong opinion bonuses as a result. + reverse_add_opinion = { + target = scope:actor + modifier = friendliness_opinion + opinion = 50 + } + # The hookening part #2. + ## Due to some weird order-of-operations stuff, we enclose this in an if statement. + if = { + limit = { + NOT = { + has_hook_of_type = { + target = scope:actor + type = ritual_best_friend_hook + } + } + can_add_hook = { + target = scope:actor + type = ritual_best_friend_hook + } + } + add_hook = { + type = ritual_best_friend_hook + target = scope:actor + } + } + } + } + # Then we apply the actual friendship. + hidden_effect = { + scope:actor = { + if = { + limit = { + NOT = { has_relation_best_friend = scope:recipient } + } + set_relation_best_friend = { reason = best_friend_sworn copy_reason = friend target = scope:recipient } + } + } + } + + # 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_oath_of_true_friendship.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:actor gains some stress over the whole ordeal. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = propose_best_friendship_interaction.decline.actor.tt + left_icon = scope:recipient + add_stress = medium_stress_gain + } + } + # Scope:actor loses opinion of scope:recipient. + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = propose_best_friendship_interaction.decline.recipient.tt + left_icon = scope:actor + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = hurt_opinion + opinion = -50 + } + } + } + } + # And set up a little hidden drama for later... + hidden_effect = { + scope:recipient = { + if = { + limit = { + # We don't use the standard check for this, since they'll already be friends by definition, so the trigger would always return as false. + # Instead, we just check to make sure they're not *already* potential rivals; this can happen regardless, so really we're just setting them up for drama if the friendship ever falters. + NOT = { has_relation_potential_rival = scope:actor } + } + set_relation_potential_rival = scope:actor + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_declined_true_friendship.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI + ## Standard Acceptance stuff + ai_accept = { + # Try to make it 0 for most interactions + base = 0 + + fp2_ritual_best_friendship_interactions_ai_accept_modifier = yes + + # People without the appropriate CulTrad don't quite *get* it. + modifier = { + add = -75 + NOT = { + culture = { has_cultural_parameter = may_propose_best_friendship } + } + desc = PROPOSE_BEST_FRIEND_OPINION_LACKING_CULTURAL_PARAMETER + } + } + ## Performance-enhancement + ai_potential = { is_imprisoned = no } + ai_target_quick_trigger = { adult = yes } + ai_targets = { ai_recipients = scripted_relations } + ## Frequency + ai_frequency = 36 + ai_will_do = { + base = -50 + + fp2_ritual_best_friendship_interactions_ai_chance_modifier = yes + } +} + +################################################## +# Re-Affirmed Best Friendship +# by Ewan Cowhig Croft +################################################## + +# You've already got a best friend, but you feel you should have hooks on each other. +reaffirm_best_friendship_interaction = { + interface_priority = 30 + icon = icon_personal + category = interaction_category_friendly + common_interaction = yes + desc = reaffirm_best_friendship_interaction_desc + + greeting = positive + notification_text = REAFFIRM_BEST_FRIENDSHIP_NOTIFICATION + popup_on_receive = yes + ai_maybe = yes + + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + is_shown = { + # Scope:actor needs to have a suitable CulTrad. + scope:actor = { + culture = { has_cultural_parameter = may_propose_best_friendship } + } + # Scope:actor needs to have scope:recipient for their best friend. + scope:actor = { has_relation_best_friend = scope:recipient } + # Either friend lacks a strong hook on the other. + NOR = { + scope:actor = { has_strong_hook = scope:recipient } + scope:recipient = { has_strong_hook = scope:actor } + } + } + + is_valid_showing_failures_only = { + # Both characters must be available adults. + scope:actor = { is_available_adult = yes } + scope:recipient = { is_available_adult = yes } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = reaffirm_best_friendship_interaction.accept.actor.tt + left_icon = scope:recipient + # Pretty happy about the reaffirmation. + reverse_add_opinion = { + target = scope:recipient + modifier = friendliness_opinion + opinion = 25 + } + # The hookening. + if = { + limit = { + NOT = { has_strong_hook = scope:recipient } + } + add_hook = { + type = ritual_best_friend_hook + target = scope:recipient + } + } + } + } + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = reaffirm_best_friendship_interaction.accept.recipient.tt + left_icon = scope:actor + # Pretty happy about the reaffirmation. + reverse_add_opinion = { + target = scope:actor + modifier = friendliness_opinion + opinion = 25 + } + # The hookening part #2. + if = { + limit = { + NOT = { has_strong_hook = scope:actor } + } + add_hook = { + type = ritual_best_friend_hook + target = scope:actor + } + } + } + } + + # 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_friendship_is_magic.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:actor gains some stress over the whole ordeal. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = reaffirm_best_friendship_interaction.decline.actor.tt + left_icon = scope:recipient + # Actual effects handled in scope:recipient's toast. + show_as_tooltip = { remove_relation_best_friend = scope:recipient } + } + } + # Scope:actor loses opinion of scope:recipient. + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = reaffirm_best_friendship_interaction.decline.recipient.tt + left_icon = scope:actor + remove_relation_best_friend = scope:actor + } + } + # And set up a little hidden drama for later... + hidden_effect = { + scope:recipient = { + if = { + limit = { + # We don't use the standard check for this, since they'll already be friends by definition, so the trigger would always return as false. + # Instead, we just check to make sure they're not *already* potential rivals; this can happen regardless, so really we're just setting them up for drama if the friendship ever falters. + NOT = { has_relation_potential_rival = scope:actor } + } + set_relation_potential_rival = scope:actor + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_friendship_is_not_magic.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # AI + ## Standard Acceptance stuff + ai_accept = { + # Try to make it 0 for most interactions + base = 0 + + fp2_ritual_best_friendship_interactions_ai_accept_modifier = yes + + # People with the appropriate CulTrad understand that this is essentially required of them. + modifier = { + add = 50 + culture = { has_cultural_parameter = may_propose_best_friendship } + desc = REAFFIRM_BEST_FRIEND_OPINION_HAS_CULTURAL_PARAMETER + } + } + ## Performance-enhancement + ai_potential = { is_imprisoned = no } + ai_target_quick_trigger = { adult = yes } + ai_targets = { ai_recipients = scripted_relations } + ## Frequency + ai_frequency = 36 + ai_will_do = { + base = -50 + + fp2_ritual_best_friendship_interactions_ai_chance_modifier = yes + } +} + +################################################## +# Synergise Friendship +# by Ewan Cowhig Croft +################################################## + +# Work together with your best friend to gain bonuses! +synergise_friendship_interaction = { + interface_priority = 30 + icon = icon_personal + category = interaction_category_friendly + common_interaction = yes + desc = synergise_friendship_interaction_desc + + greeting = positive + notification_text = SYNERGISE_FRIENDSHIP_NOTIFICATION + popup_on_receive = yes + ai_maybe = yes + + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + is_shown = { + # Scope:actor needs to have a suitable CulTrad. + scope:actor = { + culture = { has_cultural_parameter = may_select_friendship_synergy_bonus } + } + # Scope:actor needs to have scope:recipient for their best friend. + scope:actor = { has_relation_best_friend = scope:recipient } + } + + is_valid_showing_failures_only = { + # Both characters must be available adults. + scope:actor = { is_available_adult = yes } + scope:recipient = { is_available_adult = yes } + } + + on_accept = { + # First, we send out some notifications. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = synergise_friendship_interaction.accept.actor.tt + left_icon = scope:recipient + # Pretty happy about the reaffirmation. + reverse_add_opinion = { + target = scope:recipient + modifier = friendliness_opinion + opinion = 10 + } + # Show the bonuses. + ## Hidden effect so that the modifiers don't show twice in the UI. + hidden_effect = { + show_as_tooltip = { synergise_friendship_interaction_actual_effect = yes } + } + } + } + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = synergise_friendship_interaction.accept.recipient.tt + left_icon = scope:actor + # Pretty happy about the reaffirmation. + reverse_add_opinion = { + target = scope:actor + modifier = friendliness_opinion + opinion = 10 + } + # Show the bonuses. + ## Hidden effect so that the modifiers don't show twice in the UI. + hidden_effect = { + show_as_tooltip = { synergise_friendship_interaction_actual_effect = yes } + } + } + } + # Then remove any existing synergy modifiers they've got. + scope:actor = { remove_every_best_friend_synergy_bonus_modifier_effect = yes } + scope:recipient = { remove_every_best_friend_synergy_bonus_modifier_effect = yes } + # Finally, calc the actual modifiers received. + synergise_friendship_interaction_actual_effect = yes + + # 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_synergized_friendship.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:actor gains some stress over the whole ordeal. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = synergise_friendship_interaction.decline.actor.tt + left_icon = scope:recipient + add_stress = minor_stress_gain + } + } + # Scope:actor loses opinion of scope:recipient. + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = synergise_friendship_interaction.decline.recipient.tt + left_icon = scope:actor + reverse_add_opinion = { + target = scope:actor + modifier = hurt_opinion + opinion = -20 + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = minor_unity_loss + DESC = clan_unity_synergized_friendship_declined.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # Synergy Types + ## Scope:actor's education + send_option = { + flag = synergy_bonus_actor + localization = "SYNERGY_BONUS_ACTOR" + } + ## Scope:recipient's education + send_option = { + flag = synergy_bonus_recipient + is_valid = { + custom_description = { + text = synergise_friendship_interaction_cannot_share_education + NOT = { + characters_have_same_education_group_trigger = { + CHARACTER_1 = scope:actor + CHARACTER_2 = scope:recipient + } + } + } + } + localization = "SYNERGY_BONUS_RECIPIENT" + } + ## Scope:a mix of both educations + send_option = { + flag = synergy_bonus_mixed + localization = "SYNERGY_BONUS_MIXED" + } + + # AI + ## Standard Acceptance stuff + ai_accept = { + # Try to make it 0 for most interactions + base = 0 + + fp2_ritual_best_friendship_interactions_ai_accept_modifier = yes + } + ## Performance-enhancement + ai_potential = { is_imprisoned = no } + ai_target_quick_trigger = { adult = yes } + ai_targets = { ai_recipients = scripted_relations } + ## Frequency + ai_frequency = 36 + ai_will_do = { + base = -50 + + fp2_ritual_best_friendship_interactions_ai_chance_modifier = yes + } +} + +################################################## +# Challenge to Chess +# by Ewan Cowhig Croft +################################################## + +# Play someone at a game of chess, perhaps with a small wager. +challenge_to_2p_chess_interaction = { + interface_priority = 30 + icon = icon_gaming + category = interaction_category_friendly + desc = challenge_to_2p_chess_interaction_desc + common_interaction = yes + + greeting = positive + notification_text = CHALLENGE_TO_2P_CHESS_INTERACTION_NOTIFICATION + ai_maybe = yes + + cooldown = { years = 1 } + cooldown_against_recipient = { years = 10 } + + is_shown = { + scope:actor = { + # Actor needs to either have a CulTrad or be a fan of board games + OR = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + has_perk = befriend_perk + has_character_modifier = fp3_chess_playing_monkey_modifier #addition from FP3 + } + # Plus be able to start & continue such a game generally. + bg_can_start_board_game_trigger = yes + # ... no, I'm sorry, you can't play yourself at board games. + NOT = { this = scope:recipient } + } + } + + is_valid_showing_failures_only = { + # Both characters must be available (adults or old-enough children) + scope:actor = { + is_available = yes + can_start_board_game_eligibility_checks_trigger = yes + } + scope:recipient = { + is_available = yes + can_start_board_game_eligibility_checks_trigger = yes + } + # Neither of you can be currently engaged in a board game. + scope:recipient = { + custom_description = { + text = fp2_bg_recipient_banned_from_board_games + bg_can_start_board_game_is_scope_banned_checks_trigger = no + } + } + #limit range for landless adventurers + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + #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 + } + } + } + + on_send = { + # We want to set this up in advance to stop scope:actor from giving away a county for opinion that they've already wagered. + if = { + limit = { always = scope:chess_land } + challenge_to_2p_chess_interaction_lock_in_actor_stake_land_effect = yes + } + # Plus lock in the game type. + challenge_to_2p_chess_interaction_lock_in_game_type_effect = { GAME_TYPE_SETTER = scope:actor } + } + + on_accept = { + # Save gold & land stakes. + if = { + limit = { always = scope:chess_gold } + save_scope_value_as = { + name = bg_stake_gold + value = challenge_to_chess_gold_change_value + } + } + if = { + limit = { always = scope:chess_land } + # We check scope:actor's county in the on_send block to stop them sneakily giving the county away after they've staked it. + show_as_tooltip = { challenge_to_2p_chess_interaction_lock_in_actor_stake_land_effect = yes } + scope:recipient = { + save_temporary_scope_as = ordering_char_temp + ordered_held_title = { + limit = { + bg_stake_land_valid_neighbouring_county_to_trade_trigger = { NEIGHBOUR = scope:actor } + } + order_by = bg_stake_land_evaluate_appropriate_county_ordering_value + save_scope_as = bg_stake_land_recipient + set_variable = wagered_county + } + } + } + # Proceed with general set-up & preamble. + scope:actor = { + # Log scope:actor as having taken the interaction for the purposes of invalidation + add_character_flag = taken_challenge_to_chess_interaction + # Fire the actual first event for scope:actor. + ## Sort some placeholder scopes so the UI doesn't freak out. + show_as_tooltip = { + challenge_to_2p_chess_interaction_lock_in_game_type_effect = { GAME_TYPE_SETTER = scope:actor } + } + ## Pachisi + if = { + limit = { scope:bg_interaction_game_type = flag:pachisi } + configure_start_board_game_effect = { + BG_INITIATOR = scope:actor + BG_ATTACKER = scope:actor + BG_DEFENDER = scope:recipient + SYSTEM = pachisi + LOCALE = random_nice_day + OUTPUT_EVENT = perk_interaction.0121 + INVALIDATION_EVENT = board_games.0021 + } + } + ## Hnefatafl + if = { + limit = { scope:bg_interaction_game_type = flag:hnefatafl } + configure_start_board_game_effect = { + BG_INITIATOR = scope:actor + BG_ATTACKER = scope:actor + BG_DEFENDER = scope:recipient + SYSTEM = hnefatafl + LOCALE = random_nice_day + OUTPUT_EVENT = perk_interaction.0121 + INVALIDATION_EVENT = board_games.0021 + } + } + ## Tabula + if = { + limit = { scope:bg_interaction_game_type = flag:tabula } + configure_start_board_game_effect = { + BG_INITIATOR = scope:actor + BG_ATTACKER = scope:actor + BG_DEFENDER = scope:recipient + SYSTEM = tabula + LOCALE = random_nice_day + OUTPUT_EVENT = perk_interaction.0121 + INVALIDATION_EVENT = board_games.0021 + } + } + ## Go + if = { + limit = { scope:bg_interaction_game_type = flag:go } + configure_start_board_game_effect = { + BG_INITIATOR = scope:actor + BG_ATTACKER = scope:actor + BG_DEFENDER = scope:recipient + SYSTEM = go + LOCALE = random_nice_day + OUTPUT_EVENT = perk_interaction.0121 + INVALIDATION_EVENT = board_games.0021 + } + } + ## Fidchell + if = { + limit = { scope:bg_interaction_game_type = flag:fidchell } + configure_start_board_game_effect = { + BG_INITIATOR = scope:actor + BG_ATTACKER = scope:actor + BG_DEFENDER = scope:recipient + SYSTEM = fidchell + LOCALE = random_nice_day + OUTPUT_EVENT = perk_interaction.0121 + INVALIDATION_EVENT = board_games.0021 + } + } + ## Chess + if = { + limit = { scope:bg_interaction_game_type = flag:chess } + configure_start_board_game_effect = { + BG_INITIATOR = scope:actor + BG_ATTACKER = scope:actor + BG_DEFENDER = scope:recipient + SYSTEM = chess + LOCALE = random_nice_day + OUTPUT_EVENT = perk_interaction.0121 + INVALIDATION_EVENT = board_games.0021 + } + } + } + # Notify that the game will start immediately. + custom_tooltip = challenge_to_2p_chess_interaction.accept.game_commences.tt + # Stakes. + ## Friendlies bet opinion & stress. + if = { + limit = { always = scope:chess_friendly } + show_as_tooltip = { + random_list = { + # You win. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.actor + fp2_bg_stake_friendly_effect = { + VICTOR = scope:actor + LOSER = scope:recipient + } + } + # You lose. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.recipient + fp2_bg_stake_friendly_effect = { + VICTOR = scope:recipient + LOSER = scope:actor + } + } + } + } + } + ## Prestige bets capital. + if = { + limit = { always = scope:chess_prestige } + show_as_tooltip = { + random_list = { + # You win. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.actor + fp2_bg_stake_fame_effect = { + VICTOR = scope:actor + LOSER = scope:recipient + } + } + # You lose. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.recipient + fp2_bg_stake_fame_effect = { + VICTOR = scope:recipient + LOSER = scope:actor + } + } + } + } + } + ## Gold bets capital. + if = { + limit = { always = scope:chess_gold } + show_as_tooltip = { + random_list = { + # You win. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.actor + fp2_bg_stake_fortune_effect = { + VICTOR = scope:actor + LOSER = scope:recipient + } + } + # You lose. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.recipient + fp2_bg_stake_fortune_effect = { + VICTOR = scope:recipient + LOSER = scope:actor + } + } + } + } + } + ## Land bets a neighbouring title. + if = { + limit = { always = scope:chess_land } + show_as_tooltip = { + random_list = { + # You win. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.actor + fp2_bg_stake_titles_effect = { VICTOR = scope:actor } + } + # You lose. + 50 = { + show_chance = no + desc = fp2_bg_interaction.winner.recipient + fp2_bg_stake_titles_effect = { VICTOR = scope:recipient } + } + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = miniscule_unity_loss + DESC = clan_unity_shatranj.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:actor is a little put out. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = challenge_to_2p_chess_interaction.decline.actor.tt + left_icon = scope:recipient + add_stress = minor_stress_gain + } + } + # Scope:actor loses opinion of scope:recipient. + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = challenge_to_2p_chess_interaction.decline.recipient.tt + left_icon = scope:actor + reverse_add_opinion = { + target = scope:actor + modifier = unfriendly_opinion + opinion = -20 + } + } + } + + # Failsafe: Ensure that all set variables are removed + hidden_effect = { + if = { + limit = { exists = scope:bg_stake_land_recipient } + scope:bg_stake_land_recipient = { remove_variable = wagered_county } + } + if = { + limit = { exists = scope:bg_stake_land_actor } + scope:bg_stake_land_actor = { remove_variable = wagered_county } + } + } + + # 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_shatranj_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # Wagers + ## A friendly match + send_option = { + flag = chess_friendly + localization = "CHESS_FRIENDLY" + } + ## Bet prestige + send_option = { + flag = chess_prestige + localization = "CHESS_PRESTIGE" + is_valid = { # Children should not be able to gamble with fame, but gold and land are fine + scope:actor = { is_available_adult = yes } + scope:recipient = { is_available_adult = yes } + } + } + ## Bet gold + send_option = { + is_valid = { + custom_tooltip = { + scope:actor = { gold > minor_gold_value } + text = bet_gold_actor_not_enough_gold + } + custom_tooltip = { + scope:recipient = { gold > minor_gold_value } + text = bet_gold_recipient_not_enough_gold + } + } + flag = chess_gold + localization = "CHESS_GOLD" + } + ## Bet land + send_option = { + # Only actual gaming nut cultures will bet something as serious as land. + is_shown = { + scope:actor = { + culture = { has_cultural_parameter = may_wager_land_on_board_games } + } + scope:recipient = { + culture = { has_cultural_parameter = may_wager_land_on_board_games } + } + } + # But you need to have bordering land for it to work. + is_valid = { + custom_tooltip = { + text = challenge_to_2p_chess_interaction.need_bordering_non_capital_domains.tt + scope:actor = { + any_held_title = { + bg_stake_land_valid_neighbouring_county_to_trade_trigger = { NEIGHBOUR = scope:recipient } + } + } + scope:recipient = { + any_held_title = { + bg_stake_land_valid_neighbouring_county_to_trade_trigger = { NEIGHBOUR = scope:actor } + } + } + } + } + flag = chess_land + localization = "CHESS_LAND" + } + + # AI + ## Standard Acceptance stuff + ai_accept = { + # Try to make it 0 for most interactions + base = 0 + + # Weight up for personality values. + ## Shy characters may not generally be sociable, but they're usually down for board games. + ai_value_modifier = { + who = scope:recipient + trigger = { has_trait = shy } + ai_boldness = { + if = { + limit = { + scope:recipient = { + NOT = { ai_boldness = 0 } + } + } + value = 1 + } + } + ai_sociability = { + if = { + limit = { + scope:recipient = { + NOT = { ai_honor = 0 } + } + } + value = -0.5 + } + } + } + ## Otherwise, calc as normal. + ai_value_modifier = { + who = scope:recipient + trigger = { + NOT = { has_trait = shy } + } + ai_boldness = { + if = { + limit = { + scope:recipient = { + NOT = { ai_boldness = 0 } + } + } + value = 1 + } + } + ai_sociability = { + if = { + limit = { + scope:recipient = { + NOT = { ai_honor = 0 } + } + } + value = 0.5 + } + } + } + # Weight up for opinion. + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + desc = AI_OPINION_REASON + } + # Weight up for estimated skill. + modifier = { + add = { + add = scope:recipient.martial + add = scope:recipient.intrigue + add = scope:recipient.learning + # + } + desc = BG_OPINION_OWN_SKILL_ASSESSMENT + } + # Specific wager preferences. + ## Friendlies: for folks who want a calm game with nothing more at stake than peace of mind. + modifier = { + add = 20 + always = scope:chess_friendly + # Exempt characters with traits that dislike low stakes. + scope:recipient = { + NOR = { + has_trait = callous + has_trait = greedy + has_trait = arrogant + } + } + desc = BG_OPINION_STAKES_ARE_LOW + } + ### Gregarious loves. + modifier = { + add = 40 + scope:recipient = { has_trait = gregarious } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_GREGARIOUS + } + ### Humble loves. + modifier = { + add = 40 + scope:recipient = { has_trait = humble } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_HUMBLE + } + ### Shy likes. + modifier = { + add = 20 + scope:recipient = { has_trait = shy } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_SHY + } + ### Compassionate likes. + modifier = { + add = 20 + scope:recipient = { has_trait = compassionate } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_COMPASSIONATE + } + ### Callous dislikes. + modifier = { + add = -20 + scope:recipient = { has_trait = callous } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_CALLOUS + } + ### Greedy hates. + modifier = { + add = -40 + scope:recipient = { has_trait = greedy } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_GREEDY + } + ### Arrogant hates. + modifier = { + add = -40 + scope:recipient = { has_trait = arrogant } + always = scope:chess_friendly + desc = BG_OPINION_FRIENDLY_TRAIT_ARROGANT + } + ## Prestige: want a little more drama in your life without breaking the bank? Gamble your reputation! + ### Brave loves. + modifier = { + add = 40 + scope:recipient = { has_trait = brave } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_BRAVE + } + ### Arrogant loves. + modifier = { + add = 40 + scope:recipient = { has_trait = arrogant } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_ARROGANT + } + ### Gregarious likes. + modifier = { + add = 20 + scope:recipient = { has_trait = gregarious } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_GREGARIOUS + } + ### Ambitious likes. + modifier = { + add = 20 + scope:recipient = { has_trait = ambitious } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_AMBITIOUS + } + ### Content dislikes. + modifier = { + add = -20 + scope:recipient = { has_trait = content } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_CONTENT + } + ### Shy dislikes. + modifier = { + add = -20 + scope:recipient = { has_trait = shy } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_SHY + } + ### Humble hates. + modifier = { + add = -40 + scope:recipient = { has_trait = humble } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_HUMBLE + } + ### Craven hates. + modifier = { + add = -40 + scope:recipient = { has_trait = craven } + always = scope:chess_prestige + desc = BG_OPINION_PRESTIGE_TRAIT_CRAVEN + } + ## Gold: what is life without risk? Play it bold or don't play at all! + ### Profligate adores. + modifier = { + add = 60 + scope:recipient = { has_trait = profligate } + always = scope:chess_gold + desc = BG_OPINION_GOLD_TRAIT_PROFLIGATE + } + ### Greedy loves. + modifier = { + add = 40 + scope:recipient = { has_trait = greedy } + always = scope:chess_gold + desc = BG_OPINION_GOLD_TRAIT_GREEDY + } + ### Ambitious likes. + modifier = { + add = 20 + scope:recipient = { has_trait = ambitious } + always = scope:chess_gold + desc = BG_OPINION_GOLD_TRAIT_AMBITIOUS + } + ### Generous likes - I mean, from their perspective, what does the money matter? + modifier = { + add = 20 + scope:recipient = { has_trait = generous } + always = scope:chess_gold + desc = BG_OPINION_GOLD_TRAIT_GENEROUS + } + ### Lazy likes. + modifier = { + add = 20 + scope:recipient = { has_trait = lazy } + always = scope:chess_gold + desc = BG_OPINION_GOLD_TRAIT_LAZY + } + ### Diligent hates. + modifier = { + add = -40 + scope:recipient = { has_trait = diligent } + always = scope:chess_gold + desc = BG_OPINION_GOLD_TRAIT_DILIGENT + } + ## Land: you need to stop buying new board games, Jesse. You're way too into them. + ### Profligate adores. + modifier = { + add = 60 + scope:recipient = { has_trait = profligate } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_PROFLIGATE + } + ### Arbitrary loves. + modifier = { + add = 40 + scope:recipient = { has_trait = arbitrary } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_ARBITRARY + } + ### Ambitious likes. + modifier = { + add = 20 + scope:recipient = { has_trait = ambitious } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_AMBITIOUS + } + ### Brave likes. + modifier = { + add = 20 + scope:recipient = { has_trait = brave } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_BRAVE + } + ### Craven dislikes. + modifier = { + add = -20 + scope:recipient = { has_trait = craven } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_CRAVEN + } + ### Content dislikes. + modifier = { + add = -20 + scope:recipient = { has_trait = content } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_CONTENT + } + ### Just loathes - this is *categorically* not how the feudal system, or really any form of loyalty, is supposed to work. + modifier = { + add = -60 + scope:recipient = { has_trait = just } + always = scope:chess_land + desc = BG_OPINION_LAND_TRAIT_JUST + } + ### Greedy deliberately left off; they don't want to risk their own stuff but they *do* want to nab everyone else's. + # Relationships + ## Mildly positive relationships like to play against each other. + modifier = { + add = 20 + scope:recipient = { + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:actor } + } + desc = BG_OPINION_RELATIONSHIP_GOOD_MILD + } + ## Positive relationships like to play against each other. + modifier = { + add = 40 + scope:recipient = { + has_any_only_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:actor } + } + desc = BG_OPINION_RELATIONSHIP_GOOD_MODERATE + } + ## Really positive relationships love to play against each other. + modifier = { + add = 60 + scope:recipient = { + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:actor } + } + desc = BG_OPINION_RELATIONSHIP_GOOD_MAJOR + } + ## Negative relationships dislike playing each other... + ### ... either mildly... + modifier = { + add = -20 + scope:recipient = { + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } + NOT = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + } + desc = BG_OPINION_RELATIONSHIP_BAD_MILD + } + ### ... moderately... + modifier = { + add = -40 + scope:recipient = { + has_any_only_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } + NOT = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + } + desc = BG_OPINION_RELATIONSHIP_BAD_MODERATE + } + ### ... or majorly... + modifier = { + add = -60 + scope:recipient = { + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } + NOT = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + } + desc = BG_OPINION_RELATIONSHIP_BAD_MAJOR + } + ## ... unless they take their board games far too seriously, in which case, they're always down... + ### ... either mildly... + modifier = { + add = 20 + scope:recipient = { + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + desc = BG_OPINION_RELATIONSHIP_BAD_SRSGMR_MILD + } + ### ... moderately... + modifier = { + add = 40 + scope:recipient = { + has_any_only_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + desc = BG_OPINION_RELATIONSHIP_BAD_SRSGMR_MODERATE + } + ### ... or majorly. + modifier = { + add = 60 + scope:recipient = { + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + desc = BG_OPINION_RELATIONSHIP_BAD_SRSGMR_MAJOR + } + # Apply tier differences. + ## King -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value >= 4 + } + } + add = 15 + } + ## Duke -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 3 + } + } + add = 10 + } + ## Count -> Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = 2 + } + } + add = 5 + } + ## King <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -2 + } + } + add = -10 + } + ## Duke <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value = -3 + } + } + add = -20 + } + ## Count <- Baron. + modifier = { + desc = AI_REFUSAL_RANK_DIFFERENCE + scope:actor = { + tier_difference = { + target = scope:recipient + value <= -4 + } + } + add = -30 + } + } + ## Performance-enhancement + ai_potential = { + OR = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + has_perk = befriend_perk + } + is_imprisoned = no + } + ai_target_quick_trigger = { adult = yes } # AI will only challenge adults + ai_targets = { + ai_recipients = scripted_relations + max = 5 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + max = 10 + } + ## Frequency + ai_frequency = 100 + ai_will_do = { + base = -50 + + # Everyone likes to play boardgames with people they like + opinion_modifier = { + opinion_target = scope:recipient + trigger = { + NOT = { culture = { has_cultural_parameter = may_challenge_to_board_games } } + } + } + + # Boardgame nerds like to challenge people they dislike... + opinion_modifier = { + opinion_target = scope:recipient + trigger = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + opinion = { + target = scope:recipient + value < 0 + } + } + + multiplier = -1 + } + + # ...but they ALSO like to play with people they like + opinion_modifier = { + opinion_target = scope:recipient + trigger = { + culture = { has_cultural_parameter = may_challenge_to_board_games } + opinion = { + target = scope:recipient + value > 0 + } + } + } + + # If you are my rival and my culture likes to play board games, I'll see you as a good opponent. + modifier = { + add = 50 + scope:actor = { + has_relation_rival = scope:recipient + culture = { has_cultural_parameter = may_challenge_to_board_games } + } + } + + # Aaaaand boredom. + modifier = { + add = 10 + scope:actor.days_of_continuous_peace >= 365 + } + modifier = { + add = 10 + scope:actor.days_of_continuous_peace >= 730 + } + modifier = { + add = 10 + scope:actor.days_of_continuous_peace >= 1095 + } + modifier = { + add = 10 + scope:actor.days_of_continuous_peace >= 1460 + } + modifier = { + add = 10 + scope:actor.days_of_continuous_peace >= 1825 + } + # Plus if scope:actor isn't at all interesting to scope:recipient, then tell them to just sit quietly. + modifier = { + factor = 0 + scope:recipient = { + NOR = { + is_of_major_or_minor_interest_trigger = { CHARACTER = scope:actor } + highest_held_title_tier >= tier_duchy + sub_realm_size >= 4 + } + } + } + } +} + +################################################## +# Purchase Truce +# by Ewan Cowhig Croft +################################################## + +# Wars are expensive, so why not purchase a little peace preemptively? +purchase_truce_interaction = { + interface_priority = 30 + category = interaction_category_diplomacy + common_interaction = yes + desc = purchase_truce_interaction_desc + icon = icon_retreat + + greeting = positive + notification_text = PURCHASE_TRUCE_NOTIFICATION + popup_on_receive = yes + ai_maybe = yes + + cooldown = { years = 5 } + cooldown_against_recipient = { years = 10 } + + is_shown = { + NOT = { scope:actor = scope:recipient } + # Scope:actor needs to either be involved in certain struggle types or else have a specific perk. + scope:actor = { + is_landless_adventurer = no + OR = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_truce_purchasing_interaction + } + has_perk = defensive_measures_perk + } + + # if you are not independent you should not be able to purchase truce with other fellow vassals only + trigger_if = { + limit = { is_independent_ruler = no } + top_liege = scope:recipient.top_liege + } + } + # Scope:recipient must be landed, and neither over or under scope:actor. + scope:recipient = { + is_playable_character = yes + NOR = { + any_liege_or_above = { this = scope:actor } + any_vassal_or_below = { this = scope:actor } + } + } + } + + is_valid_showing_failures_only = { + # Scope:actor must be an available (adult or child). + scope:actor = { is_available = yes } + # Scope:recipient must be at least available. + scope:recipient = { is_available = yes } + # Make sure that scope:actor is going into this with a clean, no-recent/active/forbidden hostilities mindset. + scope:actor = { + NOR = { + # Involved characters can't be on opposite sides in an active war. + is_at_war_with = scope:recipient + # Allied characters aren't allowed to do this because it _should_ be redundant. Unless you're planning something. Which you shouldn't announce like that. + is_allied_to = scope:recipient + # And we should just disallow anyone who already has a truce with you, even though I guess you might technically want to replace it. + any_truce_holder = { this = scope:recipient } + } + } + #limit range for landless adventurers + trigger_if = { + limit = { + scope:actor = { + is_landless_adventurer = yes + } + } + #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 + } + } + } + + on_accept = { + # Notifications with most effects. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = purchase_truce_interaction.accept.actor.tt + left_icon = scope:recipient + show_as_tooltip = { + purchase_truce_interaction_work_out_truce_days_effect = { TARGET = scope:recipient } + } + } + show_as_tooltip = { purchase_truce_interaction_work_out_purchase_cost_effect = yes } + # Outside of the notification, since we'll send a separate one anyway, we want to point out the catalyst activation (if relevant). + show_as_tooltip = { purchase_truce_interaction_activate_catalyst_effect = yes } + } + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = purchase_truce_interaction.accept.recipient.tt + left_icon = scope:actor + show_as_tooltip = { + purchase_truce_interaction_work_out_truce_days_effect = { TARGET = scope:actor } + } + } + } + # Then we apply the actual truce. + hidden_effect = { + scope:actor = { + purchase_truce_interaction_work_out_truce_days_effect = { TARGET = scope:recipient } + purchase_truce_interaction_activate_catalyst_effect = yes + # Variable used for checking if we should apply the "Recently Waged War" ai behavior in ai_acceptance modifiers, specifically in the Offer Vassalization interaction + if = { + limit = { always = scope:pt_sum_small } + add_to_bought_truce_list = { + TARGET = scope:recipient + DAYS = purchase_truce_interaction_truce_days_small_value + } + } + else_if = { + limit = { always = scope:pt_sum_large } + add_to_bought_truce_list = { + TARGET = scope:recipient + DAYS = purchase_truce_interaction_truce_days_large_value + } + } + else = { + add_to_bought_truce_list = { + TARGET = scope:recipient + DAYS = purchase_truce_interaction_truce_days_medium_value + } + } + } + purchase_truce_interaction_work_out_purchase_cost_effect = yes + } + + # 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_purchased_truce.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:actor gains some stress over the whole ordeal. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = purchase_truce_interaction.decline.actor.tt + left_icon = scope:recipient + add_stress = minor_stress_gain + } + } + # Scope:actor loses opinion of scope:recipient. + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = purchase_truce_interaction.decline.recipient.tt + left_icon = scope:actor + reverse_add_opinion = { + target = scope:actor + modifier = warmonger_opinion + } + } + } + + # 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_purchased_truce_refusal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # Send Options + ## Small Sum + send_option = { + is_shown = { always = yes } + is_valid = { + scope:actor = { gold >= pt_sum_small_value } + } + flag = pt_sum_small + localization = "PT_SUM_SMALL" + } + ## Medium Sum + send_option = { + is_shown = { + # We use the most expensive of scope:actor or scope:recipient's income, so we check both. + scope:actor = { + can_make_expensive_purchase_trigger = { PRICE = scope:actor.purchase_truce_interaction_medium_sum } + can_make_expensive_purchase_trigger = { PRICE = scope:recipient.purchase_truce_interaction_medium_sum } + } + } + is_valid = { + scope:actor = { gold >= pt_sum_medium_value } + } + flag = pt_sum_medium + starts_enabled = { always = yes } + localization = "PT_SUM_MEDIUM" + } + ## Large Sum + send_option = { + is_shown = { + # We use the most expensive of scope:actor or scope:recipient's income, so we check both. + scope:actor = { + can_make_expensive_purchase_trigger = { PRICE = scope:actor.purchase_truce_interaction_major_sum } + can_make_expensive_purchase_trigger = { PRICE = scope:recipient.purchase_truce_interaction_major_sum } + } + } + is_valid = { + scope:actor = { gold >= pt_sum_large_value } + } + flag = pt_sum_large + localization = "PT_SUM_LARGE" + } + + # AI + ## Standard Acceptance stuff + ai_accept = { + # Try to make it 0 for most interactions. + base = 0 + + # Struggle + modifier = { + trigger_if = { + limit = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + } + } + trigger_else = { + always = no + } + add = { + value = 0 + if = { + limit = { + scope:recipient = { + any_character_struggle = { + phase_has_catalyst = catalyst_sign_truce_outside_war + } + has_character_flag = agenda_towards_escalation + } + } + add = -50 + } + else_if = { + limit = { + scope:recipient = { + any_character_struggle = { + phase_has_catalyst = catalyst_sign_truce_outside_war + } + } + } + add = 100 + } + } + desc = AI_STRUGGLE_INTENT + } + + # Factor up or down based on the sum offered. + ## Small. + modifier = { + add = -10 + always = scope:pt_sum_small + desc = PT_AMOUNT_OF_GOLD_OFFERED + } + ## Medium. + modifier = { + add = 25 + always = scope:pt_sum_medium + desc = PT_AMOUNT_OF_GOLD_OFFERED + } + ## Large. + modifier = { + add = 75 + always = scope:pt_sum_large + desc = PT_AMOUNT_OF_GOLD_OFFERED + } + ## Plus a bit of base-line acceptance if the AI's coffers are currently pretty anaemic. + modifier = { + add = 30 + gold <= scope:recipient.yearly_character_income + desc = PT_COULD_USE_SOME_POCKET_MONEY + } + # AI take opinion into account, but reduced so they'll at least occasionally accept from folks they dislike. + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + desc = AI_OPINION_REASON + } + # Greedy AI like gold. + modifier = { + add = { + value = ai_greed + multiply = 2 + } + ai_greed >= 1 + desc = AI_VALUE_MODIFIER_GREED + } + # Boldness always plays a factor. + modifier = { + add = { + value = ai_boldness + multiply = -0.5 + } + NOT = { ai_boldness = 0 } + desc = AI_VALUE_MODIFIER_BOLDNESS + } + # Ambitious AI like freedom. + modifier = { + add = -50 + has_trait = ambitious + desc = PT_AI_LIKES_FREEDOM_TO_WAR_REASON + } + # AI who are in debt will take whatever windfalls they can. + modifier = { + add = { + value = debt_level + # Our first rank is 0, so we add one to always get a positive number. + add = 1 + multiply = 10 + } + debt_level >= 0 + desc = PT_AI_IS_IN_DEBT + } + # Pacifist AI are happy to avoid war. + modifier = { + add = 25 + faith = { has_doctrine_parameter = pacifist_opinion_active } + desc = PT_AI_IS_PACIFIST_FAITH + } + modifier = { + add = 25 + culture = { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith } + desc = PT_AI_IS_PACIFIST_CULTURE + } + # War likeliness. + ## This is primarily intended to mitigate conquest, invasion, and religious CBs, so we don't account for them. + ## Scope:recipient has some claim to scope:actor's lands. + modifier = { + add = -20 + any_claim = { + count = 1 + exists = holder + holder = scope:actor + } + desc = PT_AI_PERSONALLY_CLAIMS_YOUR_LAND + } + ## Scope:recipient has decent claim to scope:actor's lands. + modifier = { + add = -40 + OR = { + any_claim = { + count >= 2 + exists = holder + holder = scope:actor + } + any_claim = { + count = 1 + exists = holder + holder = scope:actor + save_temporary_scope_as = claim_temp + scope:recipient = { has_strong_claim_on = scope:claim_temp } + } + } + desc = PT_AI_PERSONALLY_CLAIMS_YOUR_LAND + } + ## Scope:recipient has strong claim to scope:actor's lands. + modifier = { + add = -60 + any_claim = { + count >= 2 + exists = holder + holder = scope:actor + save_temporary_scope_as = claim_temp + scope:recipient = { has_strong_claim_on = scope:claim_temp } + } + desc = PT_AI_PERSONALLY_CLAIMS_YOUR_LAND + } + ## Scope:recipient can de jure grab your land. + ### Dukes don't take much. + modifier = { + add = -30 + highest_held_title_tier = tier_duchy + purchase_truce_interaction_recipient_can_de_jure_war_actor_trigger = yes + scope:actor = { + any_sub_realm_county = { + count >= 3 + any_this_title_or_de_jure_above = { holder = scope:actor } + } + } + desc = PT_AI_DE_JURE_CLAIMS_YOUR_LAND + } + ### Kings need a lot more. + modifier = { + add = -30 + highest_held_title_tier = tier_kingdom + purchase_truce_interaction_recipient_can_de_jure_war_actor_trigger = yes + scope:actor = { + any_sub_realm_county = { + count >= 10 + any_this_title_or_de_jure_above = { holder = scope:actor } + } + } + desc = PT_AI_DE_JURE_CLAIMS_YOUR_LAND + } + ### Emperors take quite a bit to get fussed. + modifier = { + add = -30 + highest_held_title_tier = tier_empire + purchase_truce_interaction_recipient_can_de_jure_war_actor_trigger = yes + scope:actor = { + any_sub_realm_county = { + count >= 20 + any_this_title_or_de_jure_above = { holder = scope:actor } + } + } + desc = PT_AI_DE_JURE_CLAIMS_YOUR_LAND + } + # Relative power. + ## Scope:actor has far fewer levies than scope:recipient. + modifier = { + add = -30 + scope:actor.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_far_weaker_value + desc = PT_AI_RECIPIENT_IS_MUCH_STRONGER + } + ## Scope:actor has fewer levies than scope:recipient. + modifier = { + add = -10 + scope:actor.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_far_weaker_value + scope:actor.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_somewhat_weaker_value + desc = PT_AI_RECIPIENT_IS_SOMEWHAT_STRONGER + } + ## Scope:actor has roughly equal levies with scope:recipient. + modifier = { + add = 10 + scope:actor.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_somewhat_weaker_value + scope:actor.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_somewhat_stronger_value + desc = PT_AI_RECIPIENT_IS_ROUGHLY_EQUAL + } + ## Scope:actor has more levies than scope:recipient. + modifier = { + add = 25 + scope:actor.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_somewhat_stronger_value + scope:actor.max_military_strength <= scope:recipient.purchase_truce_interaction_recipient_far_stronger_value + desc = PT_AI_RECIPIENT_IS_SOMEWHAT_WEAKER + } + ## Scope:actor has far more levies than scope:recipient. + modifier = { + add = 50 + scope:actor.max_military_strength > scope:recipient.purchase_truce_interaction_recipient_far_stronger_value + desc = PT_AI_RECIPIENT_IS_MUCH_WEAKER + } + + # Struggle + modifier = { + desc = AI_STRUGGLE_INTENT + 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_sign_truce_outside_war + } + has_character_flag = agenda_towards_escalation + } + } + add = -50 + } + else_if = { + limit = { + scope:recipient = { + any_character_struggle = { + phase_has_catalyst = catalyst_sign_truce_outside_war + } + } + } + add = 100 + } + } + } + } + ## Performance-enhancement + ai_potential = { + is_playable_character = yes + is_at_war = no + is_imprisoned = no + # Matches the regular minimum triggers. + OR = { + any_character_struggle = { involvement = involved } + has_perk = defensive_measures_perk + } + # Might actually be wurf evaluating the costs. + can_make_expensive_purchase_trigger = { PRICE = purchase_truce_interaction_small_sum } + } + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + max = 10 + } + ## Frequency + ai_frequency = 60 + ai_will_do = { + base = 0 + + # Some personalities & traits just don't want to fight. + ## Cravens (who aren't also ambitious). + modifier = { + add = 25 + has_trait = craven + NOT = { has_trait = ambitious } + } + ## Those with chronically low boldness (who aren't also ambitious). + modifier = { + add = 25 + ai_boldness <= very_high_negative_ai_value + NOT = { has_trait = ambitious } + } + ## Pacifists. + modifier = { + add = 25 + faith = { has_doctrine_parameter = pacifist_opinion_active } + } + modifier = { + add = 25 + culture = { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith } + } + ## Wrathful or ambitious characters don't like to bother. + modifier = { + add = -25 + has_trait = ambitious + } + modifier = { + add = -25 + has_trait = wrathful + } + ## Arbitrary characters don't get truces to begin with. + modifier = { + add = -50 + has_trait = arbitrary + } + ## We deliberately avoid warlike faiths *not* doing it; there's plenty of examples of such bought truces amongst these faiths, so we let them keep at it if they match other criteria. + # Various gradients of having money to burn. + ## You've got a goodly amount stashed away. + modifier = { + add = 50 + can_make_expensive_purchase_trigger = { PRICE = purchase_truce_interaction_medium_sum } + } + ## You're somewhat loaded. + modifier = { + add = 50 + can_make_expensive_purchase_trigger = { PRICE = purchase_truce_interaction_major_sum } + } + ## You're absolutely loaded. + modifier = { + add = 50 + can_make_expensive_purchase_trigger = { PRICE = purchase_truce_interaction_massive_sum } + } + # Force checks. + ## Try to buy truces from somewhat stronger realms... + modifier = { + add = 50 + scope:recipient.max_military_strength >= scope:actor.purchase_truce_interaction_recipient_somewhat_stronger_value + } + ## ... and much stronger realms. + modifier = { + add = 50 + scope:recipient.max_military_strength >= scope:actor.purchase_truce_interaction_recipient_far_stronger_value + } + + # Struggle + 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_sign_truce_outside_war + } + has_character_flag = agenda_towards_escalation + } + } + add = -50 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_sign_truce_outside_war + } + } + } + add = 100 + } + } + } + # Finally, calculate factors. + ## Only buy truces from weaker/roughly-equal realms if you're craven have been at war forever. + modifier = { + factor = 0 + max_military_strength <= scope:actor.purchase_truce_interaction_recipient_somewhat_weaker_value + NOR = { + has_trait = craven + days_of_continuous_war <= 3650 + } + } + ## Never buy a truce from someone who actually can't declare war on you. + modifier = { + factor = 0 + scope:recipient = { + NOT = { has_any_cb_on = scope:actor } + } + } + ## Don't buy truces from people who are likely going to be dead soon, or if you yourself will die soon, since they'll be wasted. + modifier = { + factor = 0 + OR = { + health <= poor_health + scope:recipient = { health <= poor_health } + } + } + } +} + +################################################## +# Incite Revolts +# by Maxence Voleau +################################################## Updated for FP3 + +incite_revolts_interaction = { + interface_priority = 30 + category = interaction_category_hostile + common_interaction = yes + desc = incite_revolts_interaction_desc + icon = faction + + greeting = positive + + auto_accept = yes + + cost = { + gold = { + add = { + value = 0 + # Gold spent will provide 10x levies, e.g. 25 provides 250 - not automated yet + if = { + limit = { scope:small_investment_in_revolt = yes } + add = 25 + } + if = { + limit = { scope:medium_investment_in_revolt = yes } + add = 75 + } + if = { + limit = { scope:high_investment_in_revolt = yes } + add = 200 + } + } + } + } + + is_shown = { + NOT = { scope:recipient = scope:actor } + OR = { + scope:actor = { + is_landless_adventurer = yes + OR = { + any_claim = { + holder = scope:recipient + } + has_relation_rival = scope:recipient + } + } + AND = { + has_dlc_feature = the_fate_of_iberia + # Only available during Opportunity, Hostility and Tension phases + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_incite_revolts_interaction + # Can only target involved + is_secondary_character_involvement_involved_trigger = { CHAR = scope:recipient } + } + } + } + AND = { + has_fp3_dlc_trigger = yes + scope:actor = { + has_trait = fp3_struggle_detractor + any_character_struggle = { + involvement = involved + is_struggle_type = persian_struggle + } + } + scope:recipient = { + any_character_struggle = { + is_struggle_type = persian_struggle + involvement = involved + } + } + } + } + } + + is_valid_showing_failures_only = { + + custom_description = { + text = at_least_one_county_with_neutral_negative_opinion + scope:recipient = { + any_sub_realm_county = { + count > 0 + holder = scope:recipient + county_opinion < 0 + NOR = { + has_county_modifier = small_investment_in_revolt_modifier + has_county_modifier = medium_investment_in_revolt_modifier + has_county_modifier = high_investment_in_revolt_modifier + } + } + } + } + } + + can_send = { + custom_tooltip = { + text = must_select_an_investment + OR = { + scope:actor = { is_ai = yes } # Temporary until we get a code fix + scope:small_investment_in_revolt = yes + scope:medium_investment_in_revolt = yes + scope:high_investment_in_revolt = yes + } + } + } + + send_options_exclusive = yes + + # Small investment + send_option = { + flag = small_investment_in_revolt + localization = small_investment + } + + # Medium investment + send_option = { + flag = medium_investment_in_revolt + localization = medium_investment + starts_enabled = { always = yes } + } + + # High investment + send_option = { + flag = high_investment_in_revolt + localization = high_investment + } + + on_accept = { + # Select the random county + hidden_effect = { + scope:recipient = { + random_sub_realm_county = { + limit = { + NOR = { + has_county_modifier = small_investment_in_revolt_modifier + has_county_modifier = medium_investment_in_revolt_modifier + has_county_modifier = high_investment_in_revolt_modifier + } + county_opinion < 0 + holder = scope:recipient + } + weight = { + base = 1 + # More likely to finance county of your own Faith or Culture + modifier = { + add = 2 + OR = { + faith = scope:actor.faith + culture = scope:actor.culture + } + } + # More likely to finance county prone to trigger populist factions + modifier = { + add = 5 + NAND = { + faith = scope:recipient.faith + culture = scope:recipient.culture + } + } + # More likely to finance county bordering your Realm + modifier = { + add = 5 + any_neighboring_county = { + holder = scope:actor + } + } + } + save_scope_as = chosen_county + } + } + } + + scope:actor = { + stress_impact = { + just = medium_stress_impact_gain + honest = medium_stress_impact_gain + trusting = medium_stress_impact_gain + greedy = minor_stress_impact_gain + } + if = { + limit = { + scope:actor = { + OR = { + has_relation_rival = scope:recipient + has_relation_nemesis = scope:recipient + } + } + } + stress_impact = { + vengeful = medium_stress_impact_loss + } + } + if = { + limit = { + scope:actor = { + is_vassal_of = scope:recipient + } + } + stress_impact = { + ambitious = medium_stress_impact_loss + } + } + } + + # FP3 Polish (Hugo) + scope:actor = { + duel = { + skill = intrigue + value = scope:recipient.intrigue + + 10 = { # Failure + desc = incite_revolts_interaction_notif_failure + compare_modifier = { + value = scope:duel_value + multiplier = -1.5 + } + show_as_tooltip = { + if = { + limit = { scope:small_investment_in_revolt = yes } + custom_tooltip = apply_small_investment_in_revolt_on_random_county + } + else_if = { + limit = { scope:medium_investment_in_revolt = yes } + custom_tooltip = apply_medium_investment_in_revolt_on_random_county + } + else_if = { + limit = { scope:high_investment_in_revolt = yes } + custom_tooltip = apply_high_investment_in_revolt_on_random_county + } + reverse_add_opinion = { + target = scope:recipient + modifier = angry_opinion + opinion = -50 + } + } + + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_bad + title = incite_revolts_interaction_result.tt + left_icon = scope:chosen_county + right_icon = scope:recipient + + scope:chosen_county = { + if = { + limit = { scope:small_investment_in_revolt = yes } + add_county_modifier = { + modifier = small_investment_in_revolt_modifier + years = 10 + } + } + else_if = { + limit = { scope:medium_investment_in_revolt = yes } + add_county_modifier = { + modifier = medium_investment_in_revolt_modifier + years = 10 + } + } + else_if = { + limit = { scope:high_investment_in_revolt = yes } + add_county_modifier = { + modifier = high_investment_in_revolt_modifier + years = 10 + } + } + } + reverse_add_opinion = { + target = scope:recipient + modifier = angry_opinion + opinion = -50 + } + hidden_effect = { + scope:recipient = { + progress_towards_rival_effect = { + CHARACTER = scope:actor + REASON = fp2_progress_towards_rival_funded_revolt_against_me + OPINION = 0 + } + } + } + } + } + } + 10 = { # Success + desc = incite_revolts_interaction_notif_success + compare_modifier = { + value = scope:duel_value + multiplier = 1.5 + } + + show_as_tooltip = { + if = { + limit = { scope:small_investment_in_revolt = yes } + custom_tooltip = apply_small_investment_in_revolt_on_random_county + } + else_if = { + limit = { scope:medium_investment_in_revolt = yes } + custom_tooltip = apply_medium_investment_in_revolt_on_random_county + } + else_if = { + limit = { scope:high_investment_in_revolt = yes } + custom_tooltip = apply_high_investment_in_revolt_on_random_county + } + } + + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_good + title = incite_revolts_interaction_result.tt + left_icon = scope:chosen_county + + scope:chosen_county = { + if = { + limit = { scope:small_investment_in_revolt = yes } + add_county_modifier = { + modifier = small_investment_in_revolt_modifier + years = 10 + } + } + else_if = { + limit = { scope:medium_investment_in_revolt = yes } + add_county_modifier = { + modifier = medium_investment_in_revolt_modifier + years = 10 + } + } + else_if = { + limit = { scope:high_investment_in_revolt = yes } + add_county_modifier = { + modifier = high_investment_in_revolt_modifier + years = 10 + } + } + } + } + } + } + } + } + + # for landless adventurers, add the county to a variable list to unlock a unique cb + scope:actor = { + if = { + limit = { + government_has_flag = government_is_landless_adventurer + } + laamp_rewards_apply_criminal_xp_effect = { + TRACK = bandit + XP_MIN = gallowsbait_xp_minor_gain + XP_MAX = gallowsbait_xp_medium_gain + } + add_to_variable_list = { + name = war_supported_counties_list + target = scope:chosen_county + } + } + } + + # 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_forment_revolt.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_frequency = 60 + + ai_potential = { + OR = { + any_character_struggle = { + has_struggle_phase_parameter = unlocks_incite_revolts_interaction + involvement = involved + OR = { + is_struggle_phase = struggle_iberia_phase_opportunity + is_struggle_phase = struggle_iberia_phase_hostility + } + } + any_character_struggle = { + is_struggle_type = persian_struggle + involvement = involved + } + } + short_term_gold >= medium_gold_value + } + + ai_targets = { + # For the AI, we limit it to neighboring_rulers + ai_recipients = neighboring_rulers + } + + ai_will_do = { + base = -50 # Let's limit it to specific character to avoid pure chaos + + ############### + ## BASE + ############### + + # ai values + modifier = { + ai_vengefulness > 0 + add = ai_vengefulness + } + modifier = { + add = { + value = ai_compassion + multiply = -1 + } + } + + modifier = { + add = { + value = ai_honor + multiply = -1 + } + } + + # intrigue skill points + modifier = { + add = { + value = intrigue + multiply = 3 + } + } + + # diff faith + modifier = { + add = 25 + NOT = { faith = scope:recipient.faith } + } + + # diff culture + modifier = { + add = 25 + + NOT = { + culture = { + OR = { + this = scope:recipient.culture + cultural_acceptance = { target = scope:recipient.culture value >= 90 } + } + } + } + } + + ############### + ## TRAITS + ############### + + # schemer + modifier = { + add = 25 + has_trait = schemer + } + + # intrigue education + modifier = { + add = 25 + OR = { + has_trait = education_intrigue_1 + has_trait = education_intrigue_2 + has_trait = education_intrigue_3 + has_trait = education_intrigue_4 + } + } + + ################ + ## RELATIONSHIP + ################ + + # more likely to do it against rival or nemesis + modifier = { + add = 50 + scope:recipient = { + OR = { + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + } + } + } + + # boost against liege for Ambitious + modifier = { + add = 50 + scope:actor = { + has_trait = ambitious + is_vassal_of = scope:recipient + } + } + + # never target your friends + modifier = { + add = -1000 + scope:recipient = { + OR = { + has_relation_friend = scope:actor + has_relation_lover = scope:actor + has_relation_soulmate = scope:actor + has_relation_best_friend = scope:actor + } + } + } + } +} + +################################################## +# Contract Assistance +# by Joe Parkin +################################################## + +contract_assistance_interaction = { + category = interaction_category_diplomacy + interface_priority = 15 + common_interaction = yes + interface = interfere_in_war + special_interaction = interfere_in_war_interaction + popup_on_receive = yes + pause_on_receive = yes + + ai_maybe = yes + desc = contract_assistance_interaction_desc + icon = icon_gold + + greeting = positive + notification_text = contract_assistance_interaction_notification + + cooldown_against_recipient = { years = 5 } + + is_shown = { + # Actor is Involved in Struggle + scope:actor = { + OR = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_contract_assistance_interaction + } + is_landless_adventurer = yes + } + } + # Recipient is Involved in Struggle, at war, and not at war with Actor + scope:recipient = { + trigger_if = { + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_contract_assistance_interaction + } + } + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_contract_assistance_interaction + } + } + is_at_war = yes + NOR = { + this = scope:actor + is_at_war_with = scope:actor + } + } + } + + has_valid_target = { + exists = scope:target + } + + has_valid_target_showing_failures_only = { + scope:target = { is_war_leader = scope:recipient } + } + + is_valid_showing_failures_only = { + scope:recipient = { + # Cannot demand gold from allies + NOT = { is_allied_to = scope:actor } + # Cannot rejoin a war you decided to leave + 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 + } + } + } + } + + # Recipient is not in (any) war against your liege(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 } } + } + } + } + + # Cannot join wars with raised armies + scope:actor = { + has_raised_armies = no + + trigger_if = { + limit = { + is_landless_adventurer = yes + } + custom_tooltip = { + text = reinforce_soldiers_any_regiment_tt + maa_regiments_count >= 1 + } + } + } + + # Can only contract one war at a time + custom_tooltip = { + text = contract_assistance_war_already_contracted_tt + scope:actor = { NOT = { has_variable = owed_contract_assistance_war } } + } + + # 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 = { + # Recipient is war leader in chosen war + scope:target = { + is_war_leader = scope:recipient + # Cannot contract against allies + trigger_if = { + limit = { + any_war_attacker = { this = scope:recipient } + } + NOT = { + any_war_defender = { is_allied_to = scope:actor } + } + } + trigger_else = { + NOT = { + any_war_attacker = { is_allied_to = scope:actor } + } + } + # not already in target war + custom_description = { + text = join_war_interaction_already_in_target_war + NOR = { + any_war_attacker = { this = scope:actor } + any_war_defender = { this = scope:actor } + } + } + } + # Liege checks + can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:recipient JOINER = scope:actor } + } + + is_highlighted = { + scope:actor = { + has_realm_law = camp_purpose_mercenaries + } + } + on_accept = { + # Add Actor to Recipient's war + scope:target = { + hidden_effect = { set_called_to = scope:actor } + if = { + limit = { is_attacker = scope:recipient } + add_attacker = scope:actor + } + else = { add_defender = scope:actor } + } + # Actor effects + scope:actor = { + save_scope_as = contract_assistance_helper + set_variable = { + name = owed_contract_assistance_war + value = scope:target + } + set_variable = { + name = owed_contract_assistance_contribution + value = offer_assistance_interaction_war_contribution_value + } + set_variable = { + name = owed_contract_assistance_gold + value = scope:recipient.offer_assistance_interaction_gold_value + } + stress_impact = { + craven = medium_stress_impact_gain + shy = minor_stress_impact_gain + } + + # Struggle Catalyst + if = { + limit = { + # Verify if vassal used to be independent + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_join_war_as_assisant + CHAR = scope:recipient + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_join_war_as_assisant + CHAR = scope:recipient + } + } + activate_struggle_catalyst = { + catalyst = catalyst_join_war_as_assisant + character = scope:actor + } + } + } + } + # Recipient effects + scope:recipient = { + stress_impact = { + greedy = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + custom_tooltip = contract_assistance_interaction_condition_tt + show_as_tooltip = { + pay_short_term_gold = { + target = scope:actor + gold = offer_assistance_interaction_gold_value + } + } + } + + # 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_contract_assistance.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Refusal notification + scope:actor = { trigger_event = char_interaction.0236 } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:recipient + TARGET = scope:actor + VALUE = minor_unity_gain + DESC = clan_unity_contract_assistance_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_accept = { + base = 0 # Reluctant to spend money without good reason + # Recipient already winning war + modifier = { + add = -50 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_winning_trigger = yes } + } + trigger_else = { + any_character_war = { + count = all # So predicted negative modifiers are treated seperately + fp2_struggle_contract_assistance_war_winning_trigger = yes + } + } + desc = OA_AI_WINNING_WAR_REASON + } + # Recipient losing war + modifier = { + add = 50 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_losing_trigger = yes } + } + trigger_else = { + any_character_war = { fp2_struggle_contract_assistance_war_losing_trigger = yes } + } + desc = OA_AI_LOSING_WAR_REASON + } + # Recipient already significantly outnumbers enemy + modifier = { + add = -50 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_outnumbering_trigger = yes } + } + trigger_else = { + any_character_war = { + count = all # So predicted negative modifiers are treated seperately + fp2_struggle_contract_assistance_war_outnumbering_trigger = yes + } + } + desc = OA_AI_OUTNUMBER_ENEMY_REASON + } + # Recipient is outnumbered + modifier = { + add = 50 + trigger_if = { + limit = { exists = scope:target } + scope:target = { + fp2_struggle_contract_assistance_war_outnumbered_minor_trigger = yes + NOT = { fp2_struggle_contract_assistance_war_outnumbered_trigger = yes } + } + } + trigger_else = { + any_character_war = { + fp2_struggle_contract_assistance_war_outnumbered_minor_trigger = yes + NOT = { fp2_struggle_contract_assistance_war_outnumbered_trigger = yes } + } + } + desc = OA_AI_OUTNUMBERED_MINOR_REASON + } + # Recipient is very outnumbered + modifier = { + add = 125 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_outnumbered_trigger = yes } + } + trigger_else = { + any_character_war = { fp2_struggle_contract_assistance_war_outnumbered_trigger = yes } + } + desc = OA_AI_OUTNUMBERED_REASON + } + # Recipient has low cash + modifier = { + add = { + value = -50 + if = { + limit = { + gold < 0 + } + add = -100 + } + if = { + limit = { + debt_level >= 2 + } + add = -200 + } + if = { # Very generous or vengeful characters *will* make poor decisions + limit = { + OR = { + ai_greed <= -50 + ai_vengefulness >= 50 + } + } + multiply = 0.5 + } + } + gold < offer_assistance_interaction_gold_value + desc = OA_AI_CANNOT_AFFORD_REASON + } + # Recipient has a lot of cash + modifier = { + add = { + value = 25 + if = { + limit = { + gold >= { + value = offer_assistance_interaction_gold_value + multiply = 2 + } + } + add = 50 + } + if = { + limit = { + gold >= { + value = offer_assistance_interaction_gold_value + multiply = 3 + } + } + add = 50 + } + } + gold >= offer_assistance_interaction_gold_value + desc = OA_AI_EXTRA_GOLD_REASON + } + # Actor's troops would be little help + modifier = { + add = -50 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_insufficient_trigger = yes } + } + trigger_else = { + any_character_war = { + count = all # So predicted negative modifiers are treated seperately + fp2_struggle_contract_assistance_war_insufficient_trigger = yes + } + } + desc = OA_AI_FEW_TROOPS_REASON + } + # Recipient is fighting a defensive war + modifier = { + add = 25 + trigger_if = { + limit = { exists = scope:target } + scope:target.casus_belli.primary_defender = scope:recipient + } + trigger_else = { + scope:recipient = { + any_character_war = { primary_defender = scope:recipient } + } + } + desc = OA_AI_DEFENSIVE_WAR_REASON + } + # Recipient is not interested in help for certain wars + modifier = { + add = -300 + exists = scope:target + scope:target = { + OR = { + using_cb = peasant_war + using_cb = fp2_border_raid + } + } + desc = OA_AI_UNINTERESTED_WAR_REASON + } + modifier = { + add = { + value = scope:actor.martial + multiply = 2 + } + scope:actor = { martial >= 12 } + desc = OA_AI_MARTIAL_REASON + } + modifier = { + add = -50 + scope:actor = { has_character_flag = fp2_contract_assistance_failure } + desc = OA_AI_FAILURE_REASON + } + # Opinion Factor + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.25 + desc = AI_OPINION_REASON + } + + modifier = { + add = { + value = ai_greed + multiply = -0.2 + } + ai_greed <= 0.5 + desc = AI_VALUE_MODIFIER_GREED + } + + modifier = { + add = { + value = ai_boldness + multiply = -0.2 + } + NOT = { ai_boldness = 0 } + desc = AI_VALUE_MODIFIER_BOLDNESS + } + + modifier = { + add = 50 + desc = camp_purpose_mercenaries_reason + scope:actor = { + has_realm_law = camp_purpose_mercenaries + } + } + # Allegiances + # fp2_contracting_ally_modifier = { + # WARMONGER = scope:recipient + # WARJOINER = scope:actor + # } + } + + ai_potential = { + is_imprisoned = no + is_at_war = no + ai_boldness >= -25 + } + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = neighboring_rulers + } + + ai_set_target = { + scope:recipient = { + ordered_character_war = { #We offer our services for the war where the character is losing the most + limit = { + is_war_leader = prev + NOR = { + any_war_attacker = { this = scope:actor } + any_war_defender = { this = scope:actor } + } + save_temporary_scope_as = target + can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:recipient JOINER = scope:actor } + } + order_by = { + value = 0 + add = { + if = { + limit = { any_war_attacker = { this = scope:recipient } } + subtract = attacker_war_score + } + else = { + subtract = defender_war_score + } + } + } + save_scope_as = target + } + } + } + + ai_targets = { + ai_recipients = peer_vassals + } + ai_frequency = 24 # We need a quite high frequency as wars do not last forever + + ai_will_do = { + base = 0 + + modifier = { # Increase chance if recipient is losing a war + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_losing_trigger = yes } + } + add = 25 + } + + modifier = { # Increase chance with amount of gold of recipient over interaction cost + factor = offer_assistance_interaction_gold_modifier_value + } + + modifier = { # Increase chance if likes recipient more than enemy + scope:actor = { + save_temporary_opinion_value_as = { + name = contract_assistance_actor_opinion + target = scope:recipient + } + } + trigger_if = { + limit = { exists = scope:target } + scope:target = { + any_war_participant = { + is_leader_in_war = scope:target + NOT = { this = scope:recipient } + reverse_opinion = { + target = scope:actor + value < scope:contract_assistance_actor_opinion + } + } + } + } + add = 25 + } + + modifier = { # Increase chance for family + scope:recipient = { + OR = { + dynasty = scope:actor.dynasty + is_consort_of = scope:actor + } + } + add = 25 + } + + modifier = { # Decrease chance if army is small + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_insufficient_trigger = yes } + } + add = -50 + } + + modifier = { # Increase chance for rivalry + trigger_if = { + limit = { exists = scope:target } + scope:target = { + any_war_participant = { + is_leader_in_war = scope:target + NOT = { this = scope:recipient } + has_relation_rival = scope:actor + } + } + } + add = 25 + } + + # Higher chance to target a human player + modifier = { + scope:recipient = { is_ai = no } + factor = 2 + } + } +} + +################################################## +# Request Contract Assistance +# by Maxence Voleau +################################################## + +request_contract_assistance_interaction = { + category = interaction_category_diplomacy + interface_priority = 15 + common_interaction = yes + interface = call_ally + special_interaction = call_ally_interaction + popup_on_receive = yes + pause_on_receive = yes + + ai_maybe = yes + desc = request_contract_assistance_interaction_desc + icon = icon_gold + + greeting = positive + notification_text = request_contract_assistance_interaction_notification + + cooldown_against_recipient = { years = 5 } + + is_shown = { + # Actor is Involved in Struggle + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_contract_assistance_interaction + } + is_at_war = yes + NOR = { + this = scope:recipient + is_at_war_with = scope:recipient + } + } + # Recipient is Involved in Struggle, at war, and not at war with Actor + scope:recipient = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_contract_assistance_interaction + } + } + } + + has_valid_target = { + exists = scope:target + } + + has_valid_target_showing_failures_only = { + scope:target = { + is_war_leader = scope:actor + + # Cannot contract against allies + trigger_if = { + limit = { + any_war_attacker = { this = scope:recipient } + } + NOT = { + any_war_defender = { is_allied_to = scope:actor } + } + } + trigger_else = { + NOT = { + any_war_attacker = { is_allied_to = scope:actor } + } + } + } + + # Adventurers can't join wars in places they're exiled from. + trigger_if = { + limit = { + scope:actor = { is_independent_ruler = no } + } + custom_tooltip = { + text = the_wake_1 + NOT = { + is_laamp_exiled_from_province_trigger = { + PROVINCE = scope:actor.capital_province + LAAMP = scope:recipient + } + } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + # Cannot demand gold from allies + NOT = { is_allied_to = scope:actor } + } + # Actor is not in (any) war against Recipient's liege(s) + trigger_if = { + limit = { exists = scope:recipient.liege } + custom_description = { + text = join_war_interaction_recipient_warring_with_my_liege + subject = scope:actor + scope:recipient = { + NOT = { + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + } + } + + # Cannot join wars with raised armies + scope:recipient = { has_raised_armies = no } + + # Can only contract one war at a time + custom_tooltip = { + text = contract_assistance_war_already_contracted_tt + scope:recipient = { + NOT = { has_variable = owed_contract_assistance_war } + } + } + } + + can_be_picked = { + # Recipient is war leader in chosen war + 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 } + } + } + } + # Liege checks + can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } + } + + on_accept = { + # Add Actor to Recipient's war + scope:target = { + hidden_effect = { set_called_to = scope:recipient } + if = { + limit = { is_attacker = scope:actor } + add_attacker = scope:recipient + } + else = { add_defender = scope:recipient } + } + # Actor effects + scope:recipient = { + save_scope_as = contract_assistance_helper + set_variable = { + name = owed_contract_assistance_war + value = scope:target + } + set_variable = { + name = owed_contract_assistance_contribution + value = offer_assistance_interaction_war_contribution_value + } + set_variable = { + name = owed_contract_assistance_gold + value = offer_assistance_interaction_gold_value + } + stress_impact = { + craven = medium_stress_impact_gain + shy = minor_stress_impact_gain + } + + + # Struggle Catalyst + if = { + limit = { + # Verify if vassal used to be independent + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_join_war_as_assisant + CHAR = scope:recipient + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_join_war_as_assisant + CHAR = scope:recipient + } + } + activate_struggle_catalyst = { + catalyst = catalyst_join_war_as_assisant + character = scope:recipient + } + } + } + } + # Recipient effects + scope:actor = { + stress_impact = { + greedy = medium_stress_impact_gain + arrogant = medium_stress_impact_gain + } + custom_tooltip = request_contract_assistance_interaction_condition_tt + show_as_tooltip = { + pay_short_term_gold = { + target = scope:recipient + gold = offer_assistance_interaction_gold_value + } + } + } + + # 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_request_assistance.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Refusal notification + scope:actor = { trigger_event = char_interaction.0236 } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:recipient + TARGET = scope:actor + VALUE = minor_unity_gain + DESC = clan_unity_request_assistance_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_accept = { + base = 0 # Reluctant to spend money without good reason + + # Recipient has low cash + modifier = { + add = { + value = 25 + if = { + limit = { + gold < 0 + } + add = { + value = 25 + multiply = debt_level + } + } + if = { # Very generous or vengeful characters *will* make poor decisions + limit = { + OR = { + ai_greed <= -50 + ai_vengefulness >= 50 + } + } + multiply = 0.5 + } + } + desc = AI_VALUE_MODIFIER_GREED + } + # Recipient has a lot of cash + modifier = { + add = { + value = -25 + if = { + limit = { + gold >= { + value = offer_assistance_interaction_gold_value + multiply = 2 + } + } + add = -50 + } + if = { + limit = { + gold >= { + value = offer_assistance_interaction_gold_value + multiply = 3 + } + } + add = -50 + } + } + gold >= offer_assistance_interaction_gold_value + desc = OA_AI_EXTRA_GOLD_REASON + } + # Recipient is not interested in help for certain wars + modifier = { + add = -500 + exists = scope:target + scope:target = { + OR = { + using_cb = peasant_war + using_cb = fp2_border_raid + } + } + desc = OA_AI_UNINTERESTED_WAR_REASON + } + modifier = { + add = { + value = scope:actor.martial + multiply = 2 + } + scope:actor = { martial >= 12 } + desc = OA_AI_MARTIAL_REASON + } + modifier = { + add = -50 + scope:recipient = { has_character_flag = fp2_contract_assistance_failure } + desc = OA_AI_FAILURE_REASON + } + # Opinion Factor + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.25 + desc = AI_OPINION_REASON + } + + modifier = { + add = { + value = ai_greed + multiply = 0.2 + } + ai_greed <= 0.5 + desc = AI_VALUE_MODIFIER_GREED + } + + modifier = { + add = { + value = ai_boldness + multiply = 0.2 + } + NOT = { ai_boldness = 0 } + desc = AI_VALUE_MODIFIER_BOLDNESS + } + + # Allegiances + fp2_contracting_ally_modifier = { + WARMONGER = scope:actor + WARJOINER = scope:recipient + } + } + + ai_potential = { + # the AI cannot use it for now so let's block it + is_imprisoned = no + is_at_war = no + gold >= ai_war_chest_desired_gold_value + } + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = neighboring_rulers + } + + ai_set_target = { + scope:actor = { + ordered_character_war = { #We offer our services for the war where the character is losing the most + limit = { + is_war_leader = prev + NOR = { + any_war_attacker = { this = scope:recipient } + any_war_defender = { this = scope:recipient } + } + save_temporary_scope_as = target + can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:actor JOINER = scope:recipient } + } + order_by = { + value = 0 + add = { + if = { + limit = { any_war_attacker = { this = scope:actor } } + subtract = attacker_war_score + } + else = { + subtract = defender_war_score + } + } + } + save_scope_as = target + } + } + } + + ai_targets = { + ai_recipients = peer_vassals + } + ai_frequency = 36 + + ai_will_do = { + base = 0 + + modifier = { # AI is losing the war + trigger_if = { + limit = { exists = scope:target } + scope:target = { + trigger_if = { + limit = { + scope:actor = { is_attacker_in_war = prev } + } + defender_war_score >= offer_assistance_interaction_already_losing_value + } + trigger_else = { attacker_war_score >= offer_assistance_interaction_already_losing_value } + } + } + add = 15 + } + + modifier = { # Increase chance for asking family + scope:recipient = { + OR = { + dynasty = scope:actor.dynasty + is_consort_of = scope:actor + } + } + factor = 2 + } + + modifier = { # Decrease chance if army is small + trigger_if = { + limit = { exists = scope:target } + scope:target = { + trigger_if = { + limit = { + scope:recipient = { is_attacker_in_war = prev } + } + scope:actor.max_military_strength < war_defender_total_strength_tenth_value + } + trigger_else = { scope:actor.max_military_strength < war_attacker_total_strength_tenth_value } + } + } + add = -50 + } + + modifier = { # Increase chance for rivalry + trigger_if = { + limit = { exists = scope:target } + scope:target = { + any_war_participant = { + is_leader_in_war = scope:target + NOT = { this = scope:actor } + has_relation_rival = scope:recipient + } + } + } + add = 25 + } + + modifier = { # AI is extremely rich + short_term_gold >= ai_war_chest_desired_gold_value + add = 50 + } + } +} + +################################################## +# Enforce Truce +# by Joe Parkin +################################################## + +enforce_truce_interaction = { + category = interaction_category_diplomacy + interface_priority = 30 + common_interaction = yes + interface = interfere_in_war + special_interaction = interfere_in_war_interaction + popup_on_receive = yes + desc = enforce_truce_interaction_desc + icon = icon_retreat + + greeting = positive + notification_text = enforce_truce_interaction_notification + + cooldown = { years = 5 } + + is_shown = { + OR = { + # During the Struggle + AND = { + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_enforce_truces_interaction + + } + primary_title.tier >= tier_duchy + } + scope:recipient = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_enforce_truces_interaction + + } + tier_difference = { + target = scope:actor + value <= 0 + } + } + } + # Comrpomise ending + AND = { + scope:actor = { + primary_title.tier >= tier_duchy + exists = house + house = { + has_house_modifier = fp2_struggle_compromise_house_reward_modifier + } + } + scope:recipient = { # Primary title in Iberia + exists = house + house = { + has_house_modifier = fp2_struggle_compromise_house_reward_modifier + } + tier_difference = { + target = scope:actor + value <= 0 + } + } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_at_war = yes + trigger_if = { + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_enforce_truces_interaction + is_secondary_character_involvement_involved_trigger = { CHAR = scope:recipient } + } + } + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_enforce_truces_interaction + } + } + trigger_else = { + exists = house + house = { + has_house_modifier = fp2_struggle_compromise_house_reward_modifier + } + } + + custom_tooltip = { + text = fp2_enforce_truce_liege_or_independent_tt + OR = { + is_independent_ruler = yes + top_liege = scope:actor.top_liege + any_character_war = { + primary_attacker = { + NOR = { + this = scope:recipient + this = scope:actor + } + OR = { + is_independent_ruler = yes + top_liege = scope:actor.top_liege + } + } + } + any_character_war = { + primary_defender = { + NOR = { + this = scope:recipient + this = scope:actor + } + OR = { + is_independent_ruler = yes + top_liege = scope:actor.top_liege + } + } + } + } + } + } + } + + can_be_picked = { + # Recipient is war leader in chosen war + exists = scope:target + scope:target = { + is_war_leader = scope:recipient + is_civil_war = no + NOT = { using_cb = fp2_border_raid } + trigger_if = { + limit = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + } + } + trigger_if = { + limit = { primary_attacker = scope:recipient } + primary_defender = { fp2_struggle_enforce_truce_war_leader_trigger = yes } + } + trigger_else = { + primary_attacker = { fp2_struggle_enforce_truce_war_leader_trigger = yes } + } + } + trigger_else = { + scope:recipient = { + capital_county.title_province = { geographical_region = world_europe_west_iberia } + } + } + + } + } + + on_accept = { + # End war and apply opinion/stress + if = { + limit = { exists = scope:target } + scope:target = { + primary_attacker = { save_scope_as = truce_1 } + primary_defender = { save_scope_as = truce_2 } + } + show_as_tooltip = { + scope:truce_1 = { add_prestige = minor_prestige_loss } + scope:truce_2 = { add_prestige = minor_prestige_loss } + } + scope:actor = { + fp2_enforce_truce_opinion_effect = yes + # Best format for interaction interface + show_as_tooltip = { + scope:truce_1 = { + add_truce_one_way = { + character = scope:truce_2 + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + } + scope:truce_2 = { + add_truce_one_way = { + character = scope:truce_1 + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + } + } + custom_tooltip = fp2_enforce_truce_peacemaker_tt + hidden_effect = { + add_truce_one_way = { + character = scope:target.primary_attacker + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + add_truce_one_way = { + character = scope:target.primary_defender + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + # Best format for toast + send_interface_message = { + type = event_truce_neutral + title = enforce_truce_interaction_actor_toast + left_icon = scope:truce_1 + right_icon = scope:truce_2 + show_as_tooltip = { fp2_enforce_truce_opinion_effect = yes } + custom_tooltip = fp2_enforce_truce_other_tt + custom_tooltip = fp2_enforce_truce_peacemaker_tt + } + } + } + hidden_effect = { + scope:truce_1 = { + send_interface_message = { + type = event_truce_neutral + title = enforce_truce_interaction_toast + left_icon = scope:actor + right_icon = scope:truce_2 + add_prestige = minor_prestige_loss + show_as_tooltip = { + scope:target = { end_war = white_peace } + add_truce_both_ways = { + character = scope:truce_2 + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + scope:actor = { + add_truce_one_way = { + character = scope:truce_1 + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + } + } + stress_impact = { + wrathful = minor_stress_impact_gain + brave = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + } + } + scope:truce_2 = { + send_interface_message = { + type = event_truce_neutral + title = enforce_truce_interaction_toast + left_icon = scope:actor + right_icon = scope:truce_1 + add_prestige = minor_prestige_loss + show_as_tooltip = { + scope:target = { end_war = white_peace } + add_truce_both_ways = { + character = scope:truce_1 + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + scope:actor = { + add_truce_one_way = { + character = scope:truce_2 + years = fp2_enforce_truce_duration_value + name = TRUCE_ENFORCE_TRUCE + } + } + } + stress_impact = { + wrathful = minor_stress_impact_gain + brave = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + } + } + } + scope:target = { end_war = white_peace } + if = { + limit = { + scope:actor = { + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_truce_was_enforced + CHAR = scope:target + } + } + } + } + every_character_struggle = { + involvement = involved + activate_struggle_catalyst = { + catalyst = catalyst_truce_was_enforced + character = scope:actor + } + } + + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_enforce_truce.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Refusal notification + scope:actor = { trigger_event = char_interaction.0236 } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:recipient + TARGET = scope:actor + VALUE = medium_unity_loss + DESC = clan_unity_enforce_truce_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_accept = { + base = -50 # Reluctant to end war without reason + # Recipient only just begun + modifier = { + add = -25 + trigger_if = { + limit = { exists = scope:target } + scope:target.war_days < 180 + } + trigger_else = { always = no } + desc = ET_AI_WAR_NEW_REASON + } + # Recipient drags on + modifier = { + add = 25 + trigger_if = { + limit = { exists = scope:target } + scope:target.war_days > 1095 + } + trigger_else = { always = no } + desc = ET_AI_WAR_OLD_REASON + } + # Recipient is defender + modifier = { + add = 25 + trigger_if = { + limit = { exists = scope:target } + scope:recipient = scope:target.primary_defender + } + trigger_else = { always = no } + desc = OA_AI_DEFENSIVE_WAR_REASON + } + # Recipient drags on + modifier = { + add = 25 + scope:recipient = { is_allied_to = scope:actor } + desc = ET_AI_ALLY_REASON + } + # Recipient is vassal + modifier = { + add = 25 + scope:recipient = { target_is_liege_or_above = scope:actor } + desc = ET_AI_LIEGE_REASON + } + # Recipient is losing + modifier = { + add = 25 + trigger_if = { + limit = { exists = scope:target } + trigger_if = { + limit = { scope:recipient = scope:target.primary_defender } + scope:target = { attacker_war_score >= fp2_enforce_truce_war_score_value } + } + trigger_else = { + scope:target = { defender_war_score >= fp2_enforce_truce_war_score_value } + } + } + trigger_else = { always = no } + desc = OA_AI_LOSING_WAR_REASON + } + # Recipient is very outnumbered + modifier = { + add = 25 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_outnumbered_trigger = yes } + } + trigger_else = { + any_character_war = { fp2_struggle_contract_assistance_war_outnumbered_trigger = yes } + } + desc = OA_AI_OUTNUMBERED_REASON + } + # Recipient is very outnumbered + modifier = { + add = -25 + trigger_if = { + limit = { exists = scope:target } + scope:target = { fp2_struggle_contract_assistance_war_outnumbering_trigger = yes } + } + trigger_else = { + any_character_war = { fp2_struggle_contract_assistance_war_outnumbering_trigger = yes } + } + desc = OA_AI_OUTNUMBER_ENEMY_REASON + } + # Actor cannot enforce truce + modifier = { + add = -50 + trigger_if = { + limit = { exists = scope:target } + OR = { + scope:target.war_attacker_total_strength_halved_value > scope:actor.max_military_strength + scope:target.war_defender_total_strength_halved_value > scope:actor.max_military_strength + } + } + trigger_else = { always = no } + desc = ET_AI_SMALL_ARMY_REASON + } + # Recipient holy war + modifier = { + add = -25 + trigger_if = { + limit = { exists = scope:target } + scope:recipient = { + NOT = { has_trait = cynical } + } + scope:target = { + OR = { + using_cb = minor_religious_war + using_cb = religious_war + using_cb = major_religious_war + } + } + } + trigger_else = { always = no } + desc = ET_AI_HOLY_WAR_REASON + } + # Actor is religious head + modifier = { + add = 25 + scope:recipient.faith.religious_head = scope:actor + desc = ET_AI_HOF_REASON + } + # Dynasty head + modifier = { + add = 50 + scope:recipient.dynasty.dynast = scope:actor + desc = ET_AI_DYNAST_REASON + } + # House head + modifier = { + add = 25 + NOT = { scope:recipient.dynasty.dynast = scope:actor } + scope:recipient.house.house_head = scope:actor + desc = ET_AI_HOUSE_HEAD_REASON + } + # Opinion Factor + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + # Honor factor + ai_value_modifier = { + ai_boldness = -0.5 + max = 0 + } + } + + ai_potential = { + is_imprisoned = no + } + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + max = 15 + } + ai_frequency = 36 +} + +################################################## +# Bargain Fealty +# by Joe Parkin +################################################## + +bargain_fealty_interaction = { + category = interaction_category_diplomacy + desc = bargain_fealty_interaction_desc + interface_priority = 60 + interface = call_ally + special_interaction = call_ally_interaction + popup_on_receive = yes + pause_on_receive = yes + + icon = icon_vassal + greeting = positive + notification_text = bargain_fealty_interaction_notification + + cooldown_against_recipient = { years = 5 } + + is_shown = { + # Actor is Involved in Struggle + scope:actor = { + any_character_struggle = { + involvement = involved + struggle_can_access_unlocks_bargain_fealty_interaction_trigger = yes + } + is_independent_ruler = yes + is_at_war = yes + any_character_war = { + is_war_leader = prev + primary_defender = prev + } + trigger_if = { + limit = { + scope:recipient = { + is_landless_ruler = no + } + } + tier_difference = { + target = scope:recipient + value <= -1 + } + } + trigger_else = { + tier_difference = { + target = scope:recipient + value <= -2 + } + } + } + # Recipient is not at war with Actor + scope:recipient = { + any_neighboring_and_across_water_top_liege_realm_owner = { this = scope:actor } + primary_title = { is_mercenary_company = no } + NOR = { + this = scope:actor + is_at_war_with = scope:actor + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = unlocks_bargain_fealty_interaction + } + } + } + + can_be_picked = { + # Actor is war leader in chosen war + exists = scope:target + scope:target = { + is_war_leader = scope:actor + primary_defender = scope:actor + custom_tooltip = { + text = bargain_fealty_border_raid_tt + NOT = { using_cb = fp2_border_raid } + } + custom_tooltip = { + text = bargain_fealty_struggle_clash_tt + NOT = { using_cb = county_struggle_cb } + } + } + # Actor is not involved in a war involving Recipient + joiner_not_already_in_another_war_with_any_target_war_participants_trigger = { + WARRIOR = scope:actor + JOINER = scope:recipient + } + } + + on_accept = { + if = { + limit = { exists = scope:target } + # Add Recipient to Actor's war + scope:target = { + hidden_effect = { set_called_to = scope:recipient } + if = { + limit = { is_attacker = scope:actor } + add_attacker = scope:recipient + } + else = { add_defender = scope:recipient } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + } + scope:actor = { + change_liege = { + liege = scope:recipient + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + # Actor effects + scope:actor = { + stress_impact = { + arrogant = medium_stress_impact_gain + craven = medium_stress_impact_gain + } + } + # Recipient effects + scope:recipient = { + stress_impact = { + greedy = medium_stress_impact_gain + craven = medium_stress_impact_gain + } + } + } + else = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = war_ended_before_response + left_icon = 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_gain + DESC = clan_unity_bargained_fealty.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Refusal notification + scope:actor = { trigger_event = char_interaction.0236 } + + # 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_bargain_fealty_refusal.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + ai_accept = { + base = 25 + # Recipient would be very outnumbered + modifier = { + add = -75 + exists = scope:target + scope:target = { fp2_bargain_fealty_war_outnumbered_trigger = yes } + desc = BF_AI_OUTNUMBERED_REASON + } + # Actor is same culture as recipient + modifier = { + add = -10 + NOT = { scope:actor.culture = scope:recipient.culture } + desc = BF_AI_DIFFERENT_CULTURE_REASON + } + # Actor is same faith as recipient + modifier = { + add = -15 + NOT = { scope:actor.faith = scope:recipient.faith } + desc = BF_AI_DIFFERENT_FAITH_REASON + } + # Actor is de jure vassal of recipient + modifier = { + add = 25 + scope:actor = { + any_held_title = { target_is_de_jure_liege_or_above = scope:recipient.primary_title } + } + desc = BF_AI_DE_JURE_REASON + } + # Actor is de jure vassal of recipient + modifier = { + add = 25 + scope:actor.dynasty = scope:recipient.dynasty + desc = BF_AI_SAME_DYNASTY_REASON + } + # Too big to be vassal + modifier = { + add = -50 + scope:actor.realm_size >= fp2_bargain_fealty_half_realm_size_value + desc = BF_AI_TOO_LARGE_REASON + } + # Opinion Factor + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + + ai_value_modifier = { + ai_boldness = 1 + max = 0 + } + + ai_value_modifier = { + ai_greed = 1 + max = 0 + } + + modifier = { + add = { + value = ai_greed + multiply = 2 + } + ai_greed >= 1 + desc = AI_VALUE_MODIFIER_GREED + } + + modifier = { + add = { + value = ai_boldness + multiply = 2 + } + NOT = { ai_boldness = 0 } + desc = AI_VALUE_MODIFIER_BOLDNESS + } + } + ai_will_do = { + base = 5 + modifier = { + add = 20 + any_character_war = { + is_war_leader = prev + primary_defender = prev + NOR = { + using_cb = fp2_border_raid + using_cb = county_struggle_cb + } + casus_belli = { + any_target_title = { holder = scope:actor } + } + } + } + modifier = { + factor = 2 + any_character_war = { + is_war_leader = prev + primary_defender = prev + NOR = { + using_cb = fp2_border_raid + using_cb = county_struggle_cb + } + war_defender_total_strength_value < war_attacker_total_strength_halved_value + } + } + } + ai_potential = { is_imprisoned = no } + ai_target_quick_trigger = { adult = yes } + ai_targets = { ai_recipients = neighboring_rulers } + ai_frequency = 36 +} + +################################################## +# Invite Foreign Ruler to Feast / Hunt +# by Maxence Voleau +################################################## + +invite_foreign_ruler_to = { + interface_priority = 30 + category = interaction_category_diplomacy + common_interaction = yes + desc = invite_foreign_ruler_to_desc + icon = activity_feast + greeting = positive + notification_text = INVITE_FOREIGN_RULER_TO_NOTIFICATION + popup_on_receive = yes + ai_maybe = yes + + cooldown = { years = 1 } + cooldown_against_recipient = { years = 5 } + + is_shown = { + # Interaction deprecated by new activity planning system + always = no + + NOT = { scope:actor = scope:recipient } + # Scope:actor needs to either be involved in certain struggle types or else have a specific perk. + scope:actor = { + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + } + } + # Scope:recipient must be landed, and neither over or under scope:actor. + scope:recipient = { + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + } + is_playable_character = yes + NOR = { + any_liege_or_above = { this = scope:actor } + any_vassal_or_below = { this = scope:actor } + } + } + } + + is_valid_showing_failures_only = { + # Scope:actor must be an available adult. + scope:actor = { is_available_adult = yes } + # Scope:recipient must be at least available. + scope:recipient = { is_available_adult = yes } + # Make sure that scope:actor is going into this with a clean, no-recent/active/forbidden hostilities mindset. + scope:actor = { + NOT = { + is_at_war_with = scope:recipient + # Involved characters can't be on opposite sides in an active war. + } + } + + # Verify that you can start one of the decision + # interaction deprecated by new activity planning system + # custom_description = { + # text = no_activity_available + # scope:actor = { + # OR = { + # can_execute_decision = start_hunt_decision + # can_execute_decision = host_feast_decision + # } + # } + # } + } + + on_accept = { + # Notifications with most effects. + if = { + limit = { scope:invite_to_hunt = yes } + scope:actor = { + set_variable = { + name = special_guest + value = scope:recipient + } + show_as_tooltip = { + remove_short_term_gold = hunt_activity_base_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = invited_to_hunt.accept.actor.tt + left_icon = scope:recipient + progress_towards_friend_effect = { + REASON = friend_invited_to_hunt + CHARACTER = scope:recipient + OPINION = 0 + } + custom_tooltip = invite_foreign_ruler_to.hunt.tooltip + # interaction deprecated by new activity planning system + #execute_decision = start_hunt_decision + } + } + scope:recipient = { + send_interface_toast = { + title = invited_to_hunt.accept.recipient.tt + left_icon = scope:actor + } + } + } + else_if = { + limit = { scope:invite_to_feast = yes } + scope:actor = { + set_variable = { + name = special_guest + value = scope:recipient + } + show_as_tooltip = { + remove_short_term_gold = feast_activity_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = invited_to_feast.accept.actor.tt + left_icon = scope:recipient + progress_towards_friend_effect = { + REASON = friend_invited_to_feast + CHARACTER = scope:recipient + OPINION = 0 + } + custom_tooltip = invite_foreign_ruler_to.feast.tooltip + # interaction deprecated by new activity planning system + #execute_decision = host_feast_decision + } + } + scope:recipient = { + send_interface_toast = { + title = invited_to_feast.accept.recipient.tt + left_icon = scope:actor + } + } + } + + # If we're a clan this interaction affects unity + add_clan_unity_interaction_effect = { + CHARACTER = scope:actor + TARGET = scope:recipient + VALUE = medium_unity_gain + DESC = clan_unity_feast_invite.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + on_decline = { + # Scope:actor gains some stress over the whole ordeal. + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = invite_foreign_ruler_to.decline.actor.tt + left_icon = scope:recipient + add_prestige = medium_prestige_loss + } + } + # Scope:actor loses opinion of scope:recipient. + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = invite_foreign_ruler_to.decline.recipient.tt + left_icon = scope:actor + reverse_add_opinion = { + target = scope:actor + modifier = refusal_opinion + opinion = -50 + } + } + } + + # 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_feast_invite_decline.desc + REVERSE_NON_HOUSE_TARGET = no + } + } + + # Send Options + ## Invite to Hunt + send_option = { + is_valid = { + scope:actor = { + # TODO_CD_EP2: commented to prevent errors + # interaction deprecated by new activity planning system? + #can_execute_decision = start_hunt_decision + } + # as an AI, don't invite human players to Hunt as we are lacking interesting content + trigger_if = { + limit = { scope:actor = { is_ai = yes } } + scope:recipient = { is_ai = yes } + } + } + flag = invite_to_hunt + starts_enabled = { always = yes } + localization = "INVITE_TO_HUNT" + } + ## Invite to Feast + send_option = { + is_valid = { + scope:actor = { + # interaction deprecated by new activity planning system + #can_execute_decision = host_feast_decision + } + } + flag = invite_to_feast + starts_enabled = { always = yes } + localization = "INVITE_TO_FEAST" + } + # AI + ## Standard Acceptance stuff + ai_accept = { + # Try to make it 0 for most interactions. + base = 0 + + # more likely if lower rank than actor + modifier = { + add = 20 + scope:actor.primary_title.tier > primary_title.tier + desc = RANK_DIFFERENCE_REASON + } + + # less likely if that's the opposite + modifier = { + add = -20 + scope:actor.primary_title.tier < primary_title.tier + desc = RANK_DIFFERENCE_REASON + } + + # AI take opinion into account + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + + # sociability plays a lot as well + ai_value_modifier = { + ai_sociability = 1 + } + + # is rival or nemesis + modifier = { + add = -50 + has_relation_rival = scope:actor + desc = WE_ARE_RIVALS + } + + modifier = { + add = -100 + has_relation_nemesis = scope:actor + desc = WE_ARE_NEMESES + } + + + # is friend + modifier = { + add = 25 + has_relation_friend = scope:actor + desc = WE_ARE_FRIENDS + } + + + # is best friend + modifier = { + add = 50 + has_relation_best_friend = scope:actor + desc = WE_ARE_BEST_FRIENDS + } + + modifier = { + add = 100 + OR = { + has_relation_lover = scope:actor + has_relation_soulmate = scope:actor + } + desc = WE_ARE_LOVERS + } + + # hunters love to hunt + modifier = { + add = 25 + scope:invite_to_hunt = yes + has_trait = lifestyle_hunter + desc = AI_RELEVANT_TRAITS + } + + # reveler loves feasts + modifier = { + add = 25 + scope:invite_to_feast = yes + has_trait = lifestyle_reveler + desc = AI_RELEVANT_TRAITS + } + + # Struggle agenda + modifier = { + desc = AI_STRUGGLE_INTENT + scope:invite_to_feast = yes + scope:recipient = { + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_invite_diff_faith_culture_to_feast + } + } + scope:actor = { + any_character_struggle = { + involvement = involved + phase_has_catalyst = catalyst_invite_diff_faith_culture_to_feast + } + } + NAND = { + scope:actor.faith = scope:recipient.faith + scope:actor.culture = scope:recipient.culture + } + 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 = -100 + } + } + } + } + ## Performance-enhancement + ai_potential = { + is_playable_character = yes + is_available_at_peace_ai_adult = yes + is_imprisoned = no + # Matches the regular minimum triggers. + OR = { + any_character_struggle = { involvement = involved } + } + short_term_gold > standard_activity_cost + } + + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = peer_vassals + max = 10 + } + ## Frequency + ai_frequency = 60 + ai_will_do = { + base = 0 + + # sociability plays a lot as well + ai_value_modifier = { + ai_sociability = 1 + } + + # hunters love to hunt + modifier = { + add = 25 + scope:invite_to_hunt = yes + has_trait = lifestyle_hunter + } + + # small boost if no firends + modifier = { + add = 25 + num_of_relation_friend = 0 + } + # reveler loves feasts + modifier = { + add = 25 + scope:invite_to_feast = yes + has_trait = lifestyle_reveler + } + + # From Hunt decision + ai_value_modifier = { + ai_energy = 1 + ai_greed = -0.5 + ai_compassion = -0.5 + } + + modifier = { + add = 10 + scope:invite_to_hunt = yes + has_trait_rank = { + trait = education_martial + rank > 0 + } + } + modifier = { + add = 10 + scope:invite_to_hunt = yes + has_trait_rank = { + trait = education_martial + rank > 2 + } + } + + modifier = { + scope:invite_to_hunt = yes + add = 35 + stress > low_stress + } + + # Struggle agenda + modifier = { + scope:recipient = { + any_character_struggle = { + involvement = involved + } + } + scope:actor = { + any_character_struggle = { + involvement = involved + } + } + NAND = { + scope:actor.faith = scope:recipient.faith + scope:actor.culture = scope:recipient.culture + } + add = { + value = 0 + if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_invite_diff_faith_culture_to_feast + + } + has_character_flag = agenda_towards_escalation + } + } + add = -100 + } + else_if = { + limit = { + scope:actor = { + any_character_struggle = { + phase_has_catalyst = catalyst_invite_diff_faith_culture_to_feast + } + } + } + add = 100 + } + } + } + } +} diff --git a/common/character_interactions/04_ep2_interactions.txt b/common/character_interactions/04_ep2_interactions.txt new file mode 100644 index 00000000..251ca82f --- /dev/null +++ b/common/character_interactions/04_ep2_interactions.txt @@ -0,0 +1,110 @@ +find_suitable_accolade_successor_interaction = { + + desc = find_suitable_accolade_successor_interaction_desc + icon = icon_combat + + cooldown = { days = 730 } + + hidden = yes # we use this via the accolade view only + + is_shown = { + has_dlc_feature = accolades + } + + is_valid_showing_failures_only = { + scope:recipient = { + accolade ?= { + NOT = { exists = accolade_successor } + has_potential_accolade_successors = no + NOT = { + primary_type = { + this = accolade_type:house_knight_attribute + } + } + } + } + scope:actor = { + highest_held_title_tier >= tier_county + } + scope:actor = { + NOT = { government_has_flag = government_is_theocracy } + } + } + + on_accept = { + custom_tooltip = find_suitable_accolade_successor_interaction.tt + scope:actor = { + save_scope_as = accolade_owner + } + scope:recipient = { + save_scope_as = knight_in_need + } + scope:recipient.accolade = { + save_scope_as = accolade_in_need + } + scope:actor = { + if = { + limit = { + is_ai = yes + } + trigger_event = { + id = accolade.0006 + } + } + else = { + trigger_event = { + id = accolade.0006 + days = { 60 180 } + } + } + } + } + + auto_accept = yes + + cost = { + prestige = { + value = 75 + if = { + limit = { + scope:actor = { + highest_held_title_tier >= tier_empire + } + } + add = 100 + } + else_if = { + limit = { + scope:actor = { + highest_held_title_tier = tier_kingdom + } + } + add = 50 + } + else_if = { + limit = { + scope:actor = { + highest_held_title_tier = tier_duchy + } + } + add = 25 + } + } + } + + ai_targets = { + ai_recipients = courtiers + ai_recipients = vassals + } + + ai_frequency = 36 + + ai_will_do = { + base = 100 + } + + ai_potential = { + highest_held_title_tier >= tier_county + has_dlc_feature = accolades + } +} diff --git a/common/character_interactions/05_bp2_interactions.txt b/common/character_interactions/05_bp2_interactions.txt new file mode 100644 index 00000000..37c12620 --- /dev/null +++ b/common/character_interactions/05_bp2_interactions.txt @@ -0,0 +1,4904 @@ +#Interactions relating to hostages + +### Offer hostage - unilateral +# actor = offerer +# recipient = receiver +# secondary_actor = hostage +offer_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 + + 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 = { + # Cannot exchange hostages with self + NOT = { scope:recipient = scope:actor } + # Only significant rulers use hostages + scope:actor.highest_held_title_tier > tier_barony + scope:recipient.highest_held_title_tier > tier_barony + # Laamps can't do anything with hostages but return/recall them. + NOR = { + scope:actor = { is_landless_adventurer = yes } + scope:recipient = { is_landless_adventurer = yes } + } + } + + is_valid_showing_failures_only = { + # Must be available + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { is_busy_in_events_localised = 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 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 } + } + } + } + + 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 + } + NOT = { 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 ?= { + ai_has_conqueror_personality = yes + } + 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 = 120 + + ai_potential = { + highest_held_title_tier >= tier_county + ai_has_conqueror_personality = no + } + + 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 + + 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 + NOT = { scope:recipient = scope:actor } + # 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 = { is_landless_adventurer = yes } + scope:recipient = { is_landless_adventurer = yes } + } + } + + 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 available + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { is_busy_in_events_localised = yes } + } + # 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 } + } + } + } + + 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 + } + NOT = { 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 ?= { + ai_has_conqueror_personality = yes + } + 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 = 120 + + ai_potential = { + highest_held_title_tier >= tier_county + ai_has_conqueror_personality = no + } + + 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 + + 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 + NOT = { scope:recipient = scope:actor } + # 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 = { is_landless_adventurer = yes } + scope:recipient = { is_landless_adventurer = yes } + } + } + + 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 available + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_actor } + scope:secondary_actor = { is_busy_in_events_localised = yes } + } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { is_busy_in_events_localised = 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_has_your_hostage_tt" + scope:recipient = { + any_warden_hostage = { home_court ?= scope:actor } + } + } + 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:recipient + object = scope:actor + 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 + } + } + } + } + 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_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 = { + 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 + 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 } + } + } + } + } + # 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 } + } + } + } + + 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 + } + NOT = { 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 + } + NOT = { 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 + } + } + } + + 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 ?= { + ai_has_conqueror_personality = yes + } + 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 = 140 + + ai_potential = { + is_adult = yes + highest_held_title_tier >= tier_county + ai_has_conqueror_personality = no + } + + 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 + NOT = { 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 = { + # Must be available + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_actor } + scope:secondary_actor = { is_busy_in_events_localised = yes } + } + 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 = 36 + + ai_will_do = { + base = 0 + modifier = { + NOR = { + # Alliances + is_allied_to = scope:recipient + is_spouse_of = scope:recipient + # Protected by liege + AND = { + OR = { + is_independent_ruler = no + scope:recipient = { is_independent_ruler = no } + } + NOT = { 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 } + } + NAND = { + 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 + } + } + + 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 + NOT = { 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 = { + # Must be available + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { is_busy_in_events_localised = yes } + } + 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 + } + } + + 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 + } + is_busy_in_events_localised = yes + #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 + is_busy_in_events_localised = 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 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 + count >= 1 + } + } + ai_frequency = 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/06_ep3_interactions.txt b/common/character_interactions/06_ep3_interactions.txt new file mode 100644 index 00000000..ae344299 --- /dev/null +++ b/common/character_interactions/06_ep3_interactions.txt @@ -0,0 +1,12277 @@ +# PLAYER ONLY - AI uses the two separate interactions below this ( Promote/Harm Candidacy) +influence_candidacy_interaction = { + icon = support_candidacy + category = interaction_category_admin + common_interaction = yes + interface_priority = 100 + desc = influence_candidacy_interaction_desc + + target_type = title + target_filter = recipient_de_jure_titles + + custom_character_sort = { governor_efficiency candidate_score } + + populate_recipient_list = { + scope:actor = { + house ?= { + every_house_member = { + limit = { + is_independent_ruler = no + has_government = administrative_government + top_liege = scope:actor.top_liege + any_valid_title_to_grant_trigger = { + CANDIDATE = this + TOP_LIEGE = scope:actor.top_liege + } + } + add_to_list = characters + } + } + if = { + limit = { primary_title.tier >= tier_kingdom } + every_courtier_or_guest = { + limit = { + is_independent_ruler = no + has_government = administrative_government + top_liege = scope:actor.top_liege + any_valid_title_to_grant_trigger = { + CANDIDATE = this + TOP_LIEGE = scope:actor.top_liege + } + } + add_to_list = characters + } + } + } + } + + can_be_picked_title = { + trigger_if = { + limit = { exists = scope:secondary_recipient } + is_appointment_valid_trigger = { + TITLE = scope:target + CANDIDATE = scope:secondary_recipient + TOP_LIEGE = scope:recipient + } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + exists = holder + is_noble_family_title = no + holder = { + top_liege = scope:recipient + OR = { + has_realm_law = acclamation_succession_law + has_realm_law = appointment_succession_law + } + } + } + } + + is_shown = { + scope:actor = { + is_ai = no + has_government = administrative_government + } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { + is_independent_ruler = no + has_government = administrative_government + top_liege = scope:actor.top_liege + } + } + } + + is_valid_showing_failures_only = { + } + + can_send = { + trigger_if = { + limit = { + OR = { + scope:as_much_as_needed_influence_option = yes + scope:major_influence_option = yes + scope:medium_influence_option = yes + } + } + scope:actor = { + custom_tooltip = { + text = support_candidacy_cap_reached_tt + succession_appointment_score_invested = { + title = scope:target + candidate = scope:secondary_recipient + value < scope:actor.appointment_investment_cap + } + } + } + + # Check if the target is available or if they have decided to not compete for the throne + trigger_if = { + limit = { + exists = scope:target + scope:target.tier = scope:recipient.highest_held_title_tier + } + scope:secondary_recipient = { + custom_tooltip = { + text = admin_renounce_throne_desc + NOR = { + has_character_modifier = ep3_admin_renounce_throne_personal + house ?= { has_house_modifier = ep3_admin_renounce_throne_house } + } + } + } + } + } + } + + redirect = { + scope:recipient = { + if = { + limit = { + NOT = { this = scope:actor.top_liege } + } + save_scope_as = secondary_recipient + scope:actor.top_liege = { + save_scope_as = recipient + } + } + } + } + + auto_accept = yes + + send_option = { + flag = as_much_as_needed_influence_option + localization = "as_much_as_needed_influence_option_desc" + } + send_option = { + flag = major_influence_option + localization = "major_influence_option_desc" + } + send_option = { + flag = medium_influence_option + localization = "medium_influence_option_desc" + starts_enabled = { always = yes } + } + send_option = { + flag = medium_influence_loss_option + localization = "medium_influence_loss_option_desc" + } + send_option = { + flag = major_influence_loss_option + localization = "major_influence_loss_option_desc" + } + + cost = { + influence = { + # Base cost + switch = { + trigger = yes + scope:as_much_as_needed_influence_option = { + add = { + if = { + limit = { exists = scope:secondary_recipient } + value = { + add = { + value = "scope:target.current_heir.appointment_candidate_score(scope:target)" + multiply = 1.1 + } + subtract = "scope:secondary_recipient.appointment_candidate_score(scope:target)" + multiply = 5 + min = 20 # We do this to prevent cases when the default score of the candidate is already much higher than that the heir + } + } + else = { value = 20 } # Show the default cost if there is no candidate selected yet + desc = BASE + } + } + scope:major_influence_option = { + add = { + value = appointment_major_influence_cost + desc = BASE + } + } + scope:medium_influence_option = { + add = { + value = appointment_medium_influence_cost + desc = BASE + } + } + scope:medium_influence_loss_option = { + add = { + value = appointment_medium_influence_cost + desc = BASE + } + } + scope:major_influence_loss_option = { + add = { + value = appointment_major_influence_cost + desc = BASE + } + } + } + + save_temporary_value_as = calculated_base_cost + + # Gender modifiers + if = { + limit = { + scope:secondary_recipient ?= { + top_liege = { has_realm_law = male_preference_law } + is_female = yes + } + } + if = { + limit = { + OR = { + scope:medium_influence_loss_option = yes + scope:major_influence_loss_option = yes + } + } + add = { + value = scope:calculated_base_cost + multiply = -0.5 + desc = male_preference_law + } + } + else = { + add = { # Double the (base) cost + value = scope:calculated_base_cost + desc = male_preference_law + } + } + } + else_if = { + limit = { + scope:secondary_recipient ?= { + top_liege = { has_realm_law = female_preference_law } + is_female = no + } + } + if = { + limit = { + OR = { + scope:medium_influence_loss_option = yes + scope:major_influence_loss_option = yes + } + } + add = { + value = scope:calculated_base_cost + multiply = -0.5 + desc = female_preference_law + } + } + else = { + add = { # Double the (base) cost + value = scope:calculated_base_cost + desc = female_preference_law + } + } + } + + + # Local bonuses + if = { + limit = { + scope:actor = { + domicile ?= { + domicile_location.county = { + scope:target ?= { is_de_jure_liege_or_above_target = prev } + } + } + } + scope:target ?= { tier < tier_empire } + } + add = { + value = scope:calculated_base_cost + multiply = { + value = -0.25 + if = { + limit = { # Increase the bonus if you have the "office" estate upgrade + scope:actor = { + domicile ?= { has_domicile_parameter = estate_local_theme_cost_reduction } + } + } + add = estate_local_theme_cost_reduction_value + } + } + desc = estate_location_in_area + } + } + + # Bureaucracy Legacy Perk Discount + if = { + limit = { + scope:actor.dynasty ?= { has_dynasty_perk = ep3_administrative_legacy_2 } + } + add = { + value = scope:calculated_base_cost + multiply = -0.1 + desc = "[GetDynastyPerk('ep3_administrative_legacy_2').GetName]" + } + } + + # A dominant family gets to spend less influence + if = { + limit = { + scope:actor.house ?= { is_dominant_family = yes } + } + add = { + value = scope:calculated_base_cost + multiply = -0.5 + desc = "[dominant_family|E]" + } + } + } + } + + localization_values = { + AS_MUCH_AS_NEEDED_INFLUENCE_OPTION = scope:actor.appointment_score_max_tt_value + MAJOR_INFLUENCE_OPTION = scope:actor.appointment_score_major_tt_value + MEDIUM_INFLUENCE_OPTION = scope:actor.appointment_score_medium_tt_value + MEDIUM_INFLUENCE_LOSS_OPTION = scope:actor.appointment_score_medium_loss_tt_value + MAJOR_INFLUENCE_LOSS_OPTION = scope:actor.appointment_score_major_loss_tt_value + } + + on_accept = { + switch = { + trigger = yes + scope:as_much_as_needed_influence_option = { + # Save the score value + save_scope_value_as = { + name = support_candidate_score + value = { + value = 0 + if = { + limit = { exists = scope:target } + add = { + value = "scope:target.current_heir.appointment_candidate_score(scope:target)" + multiply = 1.1 + } + subtract = "scope:secondary_recipient.appointment_candidate_score(scope:target)" + } + min = 4 # We do this to prevent cases when the default score of the candidate is already much higher than that the heir + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + if = { + limit = { + scope:support_candidate_score >= 100 + } + save_scope_value_as = { + name = opinion_change_value + value = 25 + } + } + else_if = { + limit = { + scope:support_candidate_score >= 80 + } + save_scope_value_as = { + name = opinion_change_value + value = 20 + } + } + else_if = { + limit = { + scope:support_candidate_score >= 60 + } + save_scope_value_as = { + name = opinion_change_value + value = 15 + } + } + else_if = { + limit = { + scope:support_candidate_score >= 40 + } + save_scope_value_as = { + name = opinion_change_value + value = 10 + } + } + else_if = { + limit = { + scope:support_candidate_score >= 20 + } + save_scope_value_as = { + name = opinion_change_value + value = 5 + } + } + else_if = { + limit = { + scope:support_candidate_score >= 10 + } + save_scope_value_as = { + name = opinion_change_value + value = 3 + } + } + else = { + save_scope_value_as = { + name = opinion_change_value + value = 1 + } + } + } + scope:major_influence_option = { + save_scope_value_as = { + name = support_candidate_score + value = { + value = appointment_score_major_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = 10 + } + } + scope:medium_influence_option = { + # Save the score value + save_scope_value_as = { + name = support_candidate_score + value = { + value = appointment_score_medium_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = 5 + } + } + scope:medium_influence_loss_option = { + # Save the score value + save_scope_value_as = { + name = support_candidate_score + value = { + value = appointment_score_medium_loss_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = -10 + } + } + scope:major_influence_loss_option = { + # Save the score value + save_scope_value_as = { + name = support_candidate_score + value = { + value = appointment_score_major_loss_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = -20 + } + } + } + + # Update the score for the corresponding title + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:support_candidate_score + } + if = { + limit = { appointment_interactions_recipient_is_suitable_co_emperor_trigger = yes } + diarch_promoted_as_administrative_candidate_get_best_tooltip_effect = yes + } + } + + if = { + limit = { + OR = { + scope:as_much_as_needed_influence_option = yes + scope:major_influence_option = yes + scope:medium_influence_option = yes + } + } + # Notify the supported character (unless they are the actor) + scope:secondary_recipient ?= { + if = { + limit = { + NOT = { this = scope:actor } + } + hidden_effect = { + send_interface_message = { + type = msg_candidacy_improved + title = supported_candidacy_toast + left_icon = scope:actor + right_icon = scope:target + show_as_tooltip = { + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:support_candidate_score + } + } + } + } + } + } + if = { + limit = { + NOT = { house ?= scope:actor.house } + } + add_opinion = { + modifier = supported_candidacy_opinion + target = scope:actor + opinion = scope:opinion_change_value + } + custom_tooltip = support_candidacy_success_reward_tt + } + } + } + else = { + # Notify the harmed character (unless they are the actor) + scope:secondary_recipient ?= { + if = { + limit = { this != scope:actor } + hidden_effect = { + send_interface_message = { + type = msg_candidacy_harmed + title = harmed_candidacy_toast + left_icon = scope:actor + right_icon = scope:target + show_as_tooltip = { + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:support_candidate_score + } + } + } + } + } + add_opinion = { + modifier = harmed_candidacy_opinion + target = scope:actor + opinion = scope:opinion_change_value + } + } + } + } + } +} + +# AI ONLY - Interaction is referenced in code, please don't rename it used by AI from code +support_candidacy_interaction = { + icon = support_candidacy + category = interaction_category_admin + common_interaction = yes + hidden = yes + + desc = support_candidacy_interaction_desc + + target_type = title + target_filter = recipient_de_jure_titles + + can_be_picked_title = { + is_appointment_valid_trigger = { + TITLE = scope:target + CANDIDATE = scope:secondary_recipient + TOP_LIEGE = scope:recipient + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + exists = holder + is_noble_family_title = no + holder.top_liege = scope:recipient + } + } + + is_shown = { + scope:actor = { + is_ai = yes + has_government = administrative_government + } + scope:secondary_recipient = { + is_independent_ruler = no + has_government = administrative_government + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + any_valid_title_to_grant_trigger = { + CANDIDATE = scope:secondary_recipient + TOP_LIEGE = scope:recipient + } + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + } + } + + can_send = { + is_appointment_valid_trigger = { + TITLE = scope:target + CANDIDATE = scope:secondary_recipient + TOP_LIEGE = scope:recipient + } + } + + redirect = { + scope:recipient = { + save_scope_as = secondary_recipient + } + scope:actor.top_liege = { + save_scope_as = recipient + } + } + + auto_accept = yes + + send_option = { + flag = as_much_as_needed_influence_option + localization = as_much_as_needed_influence_option_desc + } + send_option = { + flag = major_influence_option + localization = major_influence_option_desc + } + send_option = { + flag = medium_influence_option + localization = medium_influence_option_desc + starts_enabled = { always = yes } + } + + cost = { + influence = { + # Base cost + switch = { + trigger = yes + scope:as_much_as_needed_influence_option = { + add = { + value = { + add = { + value = "scope:target.current_heir.appointment_candidate_score(scope:target)" + multiply = 1.1 + } + subtract = "scope:secondary_recipient.appointment_candidate_score(scope:target)" + multiply = 5 + min = 20 # We do this to prevent cases when the default score of the candidate is already much higher than that the heir + } + desc = BASE + } + } + scope:major_influence_option = { + add = { + value = appointment_major_influence_cost + desc = BASE + } + } + scope:medium_influence_option = { + add = { + value = appointment_medium_influence_cost + desc = BASE + } + } + } + + save_temporary_value_as = calculated_base_cost + + # Gender modifiers + if = { + limit = { + scope:secondary_recipient ?= { + top_liege = { has_realm_law = male_preference_law } + is_female = yes + } + } + add = { # Double the (base) cost + value = scope:calculated_base_cost + desc = male_preference_law + } + } + else_if = { + limit = { + scope:secondary_recipient ?= { + top_liege = { has_realm_law = female_preference_law } + is_female = no + } + } + add = { # Double the (base) cost + value = scope:calculated_base_cost + desc = female_preference_law + } + } + + + # Local bonuses + if = { + limit = { + scope:actor = { + domicile ?= { + domicile_location.county = { + scope:target ?= { is_de_jure_liege_or_above_target = prev } + } + } + } + scope:target ?= { tier < tier_empire } + } + add = { + value = scope:calculated_base_cost + multiply = { + value = -0.25 + if = { + limit = { # Increase the bonus if you have the "office" estate upgrade + scope:actor = { + domicile ?= { has_domicile_parameter = estate_local_theme_cost_reduction } + } + } + add = estate_local_theme_cost_reduction_value + } + } + desc = estate_location_in_area + } + } + + # Bureaucracy Legacy Perk Discount + if = { + limit = { + scope:actor.dynasty ?= { has_dynasty_perk = ep3_administrative_legacy_2 } + } + add = { + value = scope:calculated_base_cost + multiply = -0.1 + desc = "[GetDynastyPerk('ep3_administrative_legacy_2').GetName]" + } + } + } + } + + on_accept = { + switch = { + trigger = yes + scope:as_much_as_needed_influence_option = { + # Save the score value + save_scope_value_as = { + name = support_candidate_score + value = { + value = 0 + if = { + limit = { exists = scope:target } + add = { + value = "scope:target.current_heir.appointment_candidate_score(scope:target)" + multiply = 1.1 + } + subtract = "scope:secondary_recipient.appointment_candidate_score(scope:target)" + } + min = 4 # We do this to prevent cases when the default score of the candidate is already much higher than that the heir + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = 20 + } + } + scope:major_influence_option = { + save_scope_value_as = { + name = support_candidate_score + value = { + value = appointment_score_major_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = 10 + } + } + scope:medium_influence_option = { + # Save the score value + save_scope_value_as = { + name = support_candidate_score + value = { + value = appointment_score_medium_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = 5 + } + } + } + + # Update the score for the corresponding title + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:support_candidate_score + } + if = { + limit = { appointment_interactions_recipient_is_suitable_co_emperor_trigger = yes } + diarch_promoted_as_administrative_candidate_get_best_tooltip_effect = yes + } + } + + + # Notify the supported character (unless they are the actor) + scope:secondary_recipient = { + if = { + limit = { + NOT = { this = scope:actor } + } + hidden_effect = { + send_interface_message = { + type = msg_candidacy_improved + title = supported_candidacy_toast + left_icon = scope:actor + right_icon = scope:target + show_as_tooltip = { + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:support_candidate_score + } + } + } + } + } + } + } + if = { + limit = { + scope:secondary_recipient = { + NOT = { + house ?= scope:actor.house + } + } + } + scope:secondary_recipient = { + add_opinion = { + modifier = supported_candidacy_opinion + target = scope:actor + opinion = scope:opinion_change_value + } + } + } + + scope:secondary_recipient = { + custom_tooltip = support_candidacy_success_reward_tt + } + } + + # AI + # Interaction is used by AI in code, don't change the frequency + ai_frequency = 0 + + ai_will_do = { + base = 5 + + # No one promoting... ripe for the taking + modifier = { + scope:target = { + NOT = { + any_title_heir = { + "appointment_candidate_accumulated_score(scope:target)" > 0 + } + } + NOT = { + current_heir = { + exists = house + exists = scope:actor.house + house = scope:actor.house + } + } + } + add = 150 + } + + # Spending more influence in one go is better + modifier = { + scope:major_influence_option = yes + factor = 1.1 + } + + # Promote characters we like + modifier = { + scope:actor = { + opinion = { + target = scope:secondary_recipient + value >= medium_positive_opinion + } + } + factor = 1.5 + } + modifier = { + scope:secondary_recipient = { + is_close_family_of = scope:actor + } + factor = 3 + } + modifier = { + scope:secondary_recipient = { + is_extended_family_of = scope:actor + } + factor = 1.5 + } + modifier = { + scope:actor = { + has_relation_friend = scope:secondary_recipient + } + factor = 2 + } + modifier = { + scope:actor = { + has_relation_best_friend = scope:secondary_recipient + } + factor = 10 + } + + # For the imperial title, we want to promote ourselves + modifier = { + scope:target.tier >= tier_empire + scope:actor = scope:secondary_recipient + factor = 5 + } + + # Prefer unlanded relatives + modifier = { + scope:target.tier < tier_empire + scope:secondary_recipient = { + is_ruler = no + } + factor = 2 + } + + # Prefer titles that are somewhat close to the capital + modifier = { + exists = scope:recipient.capital_province # Make sure the top liege has a capital + scope:target = { + title_capital_county = { + squared_distance = { + target = scope:recipient.capital_province + value <= 130000 + } + } + } + factor = 1.1 + } + + # Try to avoid promoting the same candidate for multiple titles if they are winning a title already + modifier = { + scope:secondary_recipient = { + any_heir_title = { + is_noble_family_title = no + holder = { + has_government = administrative_government + } + } + } + factor = 0 + } + + # Promote only one house member for each title + modifier = { + scope:target = { + any_title_heir = { + exists = house + exists = scope:actor.house + house = scope:actor.house + "appointment_candidate_accumulated_score(scope:target)" > 0 + } + } + scope:secondary_recipient = { + exists = house + exists = scope:actor.house + house = scope:actor.house + "appointment_candidate_accumulated_score(scope:target)" <= 0 + } + factor = 0 + } + + # Don't promote rivals + modifier = { + scope:actor = { + has_relation_rival = scope:secondary_recipient + } + factor = 0 + } + + # Don't promote a candidate if your house is first in line + modifier = { + scope:target = { + any_title_heir = { + exists = house + exists = scope:actor.house + house = scope:actor.house + scope:target = { + place_in_line_of_succession = { + target = prev + value = 1 + } + } + } + } + factor = 0 + } + + # Don't promote your candidate if they are first in line + modifier = { + scope:target = { + any_title_heir = { + this = scope:secondary_recipient + scope:target = { + place_in_line_of_succession = { + target = prev + value = 1 + } + } + } + } + factor = 0 + } + + # Don't promote lowborn or characters of a different house + modifier = { + NOT = { exists = scope:secondary_recipient.house } + factor = 0 + } + modifier = { + exists = scope:secondary_recipient.house + exists = scope:actor.house + NOT = { scope:actor.house = scope:secondary_recipient.house } + factor = 0 + } + + modifier = { # For now + scope:actor.top_liege = { has_realm_law = male_preference_law } + scope:secondary_recipient = { is_female = yes } + factor = 0 + } + modifier = { # For now + scope:actor.top_liege = { has_realm_law = female_preference_law } + scope:secondary_recipient = { is_male = yes } + factor = 0 + } + + # Don't outcompete someone you like + modifier = { + scope:target = { + any_title_heir = { + scope:target = { + place_in_line_of_succession = { + target = prev + value <= 3 + } + } + scope:actor = { has_any_good_relationship_with_character_trigger = { CHARACTER = prev } } + } + } + factor = 0 + } + + # Don't support someone who has renounced their aspirations for the throne + modifier = { + scope:secondary_recipient = { + OR = { + has_character_modifier = ep3_admin_renounce_throne_personal + house ?= { has_house_modifier = ep3_admin_renounce_throne_house } + } + } + scope:target.tier = scope:recipient.highest_held_title_tier + factor = 0 + } + } +} + +# AI ONLY - Smear campaign against a character to reduce score +harm_candidacy_interaction = { + icon = harm_candidacy + category = interaction_category_admin + common_interaction = yes + hidden = yes + + desc = harm_candidacy_interaction_desc + + target_type = title + target_filter = secondary_recipient_de_jure_titles + + can_be_picked_title = { + is_candidate_for_title_trigger = { + TITLE = scope:target + CANDIDATE = scope:secondary_recipient + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + exists = holder + holder = { + top_liege = scope:recipient + } + } + } + + is_shown = { + scope:actor = { + has_government = administrative_government + } + scope:secondary_recipient = { + is_independent_ruler = no + has_government = administrative_government + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + any_valid_title_to_grant_trigger = { + CANDIDATE = scope:secondary_recipient + TOP_LIEGE = scope:recipient + } + } + + can_send = { + is_candidate_for_title_trigger = { + TITLE = scope:target + CANDIDATE = scope:secondary_recipient + } + } + + redirect = { + scope:recipient = { save_scope_as = secondary_recipient } + scope:actor.top_liege = { save_scope_as = recipient } + } + + auto_accept = yes + + send_option = { + flag = minor_influence_option + localization = minor_influence_option_desc + starts_enabled = { always = yes } + } + send_option = { + flag = medium_influence_option + localization = medium_influence_option_desc + } + send_option = { + flag = major_influence_option + localization = major_influence_option_desc + } + + cost = { + influence = { + # Base cost + switch = { + trigger = yes + scope:minor_influence_option = { + add = { + value = appointment_minor_influence_cost + desc = BASE + } + } + scope:medium_influence_option = { + add = { + value = appointment_medium_influence_cost + desc = BASE + } + } + scope:major_influence_option = { + add = { + value = appointment_major_influence_cost + desc = BASE + } + } + } + + save_temporary_value_as = calculated_base_cost + + # Gender modifiers + if = { + limit = { + scope:secondary_recipient ?= { + top_liege = { has_realm_law = male_preference_law } + is_female = yes + } + } + add = { + value = scope:calculated_base_cost + multiply = -0.5 + desc = male_preference_law + } + } + else_if = { + limit = { + scope:secondary_recipient ?= { + top_liege = { has_realm_law = female_preference_law } + is_female = no + } + } + add = { + value = scope:calculated_base_cost + multiply = -0.5 + desc = female_preference_law + } + } + + + # Local bonuses + if = { + limit = { + scope:actor = { + domicile ?= { + domicile_location.county = { + scope:target ?= { is_de_jure_liege_or_above_target = prev } + } + } + } + scope:target ?= { tier < tier_empire } + } + add = { + value = scope:calculated_base_cost + multiply = { + value = -0.25 + if = { + limit = { # Increase the bonus if you have the "office" estate upgrade + scope:actor = { + domicile ?= { has_domicile_parameter = estate_local_theme_cost_reduction } + } + } + add = estate_local_theme_cost_reduction_value + } + } + desc = estate_location_in_area + } + } + + # Bureaucracy Legacy Perk Discount + if = { + limit = { + scope:actor.dynasty ?= { has_dynasty_perk = ep3_administrative_legacy_2 } + } + add = { + value = scope:calculated_base_cost + multiply = -0.1 + desc = "[GetDynastyPerk('ep3_administrative_legacy_2').GetName]" + } + } + } + } + + on_accept = { + switch = { + trigger = yes + scope:minor_influence_option = { + # Save the score value + save_scope_value_as = { + name = harm_candidate_score + value = { + value = appointment_score_minor_loss_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = -5 + } + } + scope:medium_influence_option = { + # Save the score value + save_scope_value_as = { + name = harm_candidate_score + value = { + value = appointment_score_medium_loss_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = -15 + } + } + scope:major_influence_option = { + save_scope_value_as = { + name = harm_candidate_score + value = { + value = appointment_score_major_loss_value + multiply = scope:actor.appointment_score_interaction_multiplier_modifiers_value + } + } + save_scope_value_as = { + name = opinion_change_value + value = -30 + } + } + } + + # Update the score for the corresponding title + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:harm_candidate_score + } + } + + # Handle opinion change and chance for a rivalry + if = { + limit = { + scope:secondary_recipient = { this != scope:actor } + } + scope:secondary_recipient = { + add_opinion = { + modifier = harmed_candidacy_opinion + target = scope:actor + opinion = scope:opinion_change_value + } + hidden_effect = { + send_interface_message = { + type = msg_candidacy_harmed + title = harmed_candidacy_toast + left_icon = scope:actor + right_icon = scope:target + show_as_tooltip = { + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:actor + value = scope:harm_candidate_score + } + } + } + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = harm_candidate_rival_progress_toast + left_icon = scope:secondary_recipient + scope:secondary_recipient = { + progress_towards_rival_effect = { + REASON = rival_harmed_candidacy + CHARACTER = scope:actor + OPINION = 0 + } + } + } + } + } + } + + ai_targets = { + ai_recipients = scripted_relations + max = 10 + } + + ai_frequency = 24 + + ai_potential = { + influence > major_influence_value + has_government = administrative_government + ai_honor <= 25 + } + + ai_will_do = { + base = 0 + modifier = { + scope:actor = { + has_relation_rival = scope:secondary_recipient + } + add = 100 + } + modifier = { + scope:actor = { + has_relation_nemesis = scope:secondary_recipient + } + add = 150 + } + modifier = { + scope:actor = { + opinion = { + target = scope:secondary_recipient + value < medium_positive_opinion + } + } + add = 20 + } + modifier = { + scope:secondary_recipient = { + is_close_family_of = scope:actor + } + add = -50 + } + modifier = { + scope:secondary_recipient = { + is_extended_family_of = scope:actor + } + add = -25 + } + modifier = { + scope:actor = { + OR = { + has_trait = ambitious + has_trait = callous + has_trait = fickle + } + } + add = 40 + } + modifier = { + scope:actor = { + has_usable_hook = scope:secondary_recipient + } + add = -10 + } + modifier = { + scope:actor = { + OR = { + has_relation_friend = scope:secondary_recipient + has_relation_lover = scope:secondary_recipient + } + } + factor = 0 + } + } +} + +# Request support from another character +request_appointment_support = { + category = interaction_category_admin + common_interaction = yes + interface_priority = 70 + custom_character_sort = { governor_efficiency candidate_score } + + desc = request_appointment_support_desc + + target_type = title + target_filter = actor_top_liege_de_jure_titles + + populate_recipient_list = { + scope:actor = { + every_succession_appointment_invested_candidate = { + limit = { + this != scope:recipient + is_alive = yes + has_government = administrative_government + # Check that they are still valid to be appointed + any_valid_title_to_grant_trigger = { + CANDIDATE = this + TOP_LIEGE = scope:actor.top_liege + } + } + add_to_list = characters + } + # We limit how many recipients to check for the AI for performance, player gets the unabridged list + if = { + limit = { + is_ai = no + } + house = { + every_house_member = { + limit = { + this != scope:recipient + has_government = administrative_government + any_valid_title_to_grant_trigger = { + CANDIDATE = this + TOP_LIEGE = scope:actor.top_liege + } + } + add_to_list = characters + } + } + } + } + } + + can_be_picked_title = { + trigger_if = { + limit = { exists = scope:secondary_recipient } + is_appointment_valid_trigger = { + TITLE = scope:target + CANDIDATE = scope:secondary_recipient + TOP_LIEGE = scope:actor.top_liege + } + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + scope:secondary_recipient = { has_succession_appointment_investors = scope:target } + } + scope:target = { + any_succession_appointment_investors = { + candidate = scope:secondary_recipient + this = scope:actor + } + } + } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + exists = holder + holder = { + top_liege = scope:actor.top_liege + } + } + scope:actor = { + trigger_if = { + limit = { is_ai = yes } + any_succession_appointment_invested_title = { + this = scope:target + } + } + } + } + + is_shown = { + scope:actor = { has_government = administrative_government } + scope:recipient = { + this != scope:actor + has_government = administrative_government + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + house = { + any_house_member = { + has_government = administrative_government + any_valid_title_to_grant_trigger = { + CANDIDATE = this + TOP_LIEGE = scope:actor.top_liege + } + count >= 1 + } + } + is_in_civil_war = no + } + scope:recipient = { + influence >= appointment_minor_influence_cost + is_in_civil_war = no + } + } + + can_send = { + trigger_if = { + limit = { scope:hook = no } + scope:actor = { + gold >= medium_gold_value + } + } + custom_tooltip = { + text = appointment_cannot_support_themself + NOT = { scope:recipient = scope:secondary_recipient } + } + } + + 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" + + send_options_exclusive = no + + on_accept = { + scope:actor = { + if = { + limit = { + scope:hook = yes + has_hook = scope:recipient + } + use_hook = scope:recipient + } + } + if = { + limit = { + scope:hook = no + } + scope:actor = { + pay_short_term_gold = { + target = scope:recipient + gold = medium_gold_value + } + } + } + if = { + limit = { # Players gets to accept/decline a specific suggestion + scope:recipient = { is_ai = no } + } + scope:recipient ={ + change_influence = { + value = appointment_medium_influence_cost + multiply = -1 + } + } + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:recipient + value = appointment_score_medium_value + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = thankful_opinion + opinion = 30 + } + trigger_event = ep3_interactions_events.0201 + } + } + else = { # The AI randomizes the amount of support + scope:recipient = { custom_tooltip = request_appointment_support_tt } + hidden_effect = { + random_list = { + 60 = { + scope:actor = { + save_scope_value_as = { + name = request_support_score + value = appointment_score_minor_value + } + send_interface_message = { + type = msg_candidacy_improved + title = supported_candidacy_toast + left_icon = scope:secondary_recipient + right_icon = scope:target + custom_tooltip = request_appointment_support_toast_tt + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:recipient + value = scope:request_support_score + } + } + } + } + scope:recipient = { + change_influence = { + value = appointment_minor_influence_cost + multiply = -1 + } + } + } + 30 = { + scope:actor = { + save_scope_value_as = { + name = request_support_score + value = appointment_score_medium_value + } + send_interface_message = { + type = msg_candidacy_improved + title = supported_candidacy_toast + left_icon = scope:secondary_recipient + right_icon = scope:target + custom_tooltip = request_appointment_support_toast_tt + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:recipient + value = scope:request_support_score + } + } + } + } + scope:recipient = { + change_influence = { + value = appointment_medium_influence_cost + multiply = -1 + } + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.2 + min = 0 + } + modifier = { + factor = 1.5 + scope:recipient = { has_any_good_relationship_with_character_trigger = { CHARACTER = scope:actor } } + } + modifier = { + factor = 2 + scope:recipient = { has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:actor } } + } + modifier = { + factor = 0 + scope:recipient = { influence < appointment_medium_influence_cost } + } + } + 10 = { + scope:actor = { + save_scope_value_as = { + name = request_support_score + value = appointment_score_major_value + } + send_interface_message = { + type = msg_candidacy_improved + title = supported_candidacy_toast + left_icon = scope:secondary_recipient + right_icon = scope:target + custom_tooltip = request_appointment_support_toast_tt + scope:target = { + change_appointment_investment = { + target = scope:secondary_recipient + investor = scope:recipient + value = scope:request_support_score + } + } + } + } + scope:recipient = { + change_influence = { + value = appointment_major_influence_cost + multiply = -1 + } + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.3 + min = 0 + } + modifier = { + factor = 1.5 + scope:recipient = { has_any_good_relationship_with_character_trigger = { CHARACTER = scope:actor } } + } + modifier = { + factor = 2 + scope:recipient = { has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:actor } } + } + modifier = { + factor = 0 + scope:recipient = { influence < appointment_major_influence_cost } + } + } + } + } + scope:actor = { trigger_event = ep3_interactions_events.0201 } + } + } + + on_decline = { + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -10 + } + trigger_event = ep3_interactions_events.0202 + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:recipient = { is_ai = yes } + } + } + + ai_accept = { + base = -40 + + # Opinion Factor + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + desc = AI_SIMPLE_OPINION_REASON + } + + # Admin + modifier = { + influence >= { + value = monumental_influence_value + multiply = 3 + } + add = 20 + desc = plenty_of_influence_reason + } + modifier = { + influence >= massive_influence_value + influence < { + value = monumental_influence_value + multiply = 3 + } + add = 10 + desc = has_influence_reason + } + modifier = { + influence < major_influence_value + add = -100 + desc = not_enough_influence_reason + } + modifier = { # Don't support actor if recipient holds the title (they should want to secure it for their own family first) + exists = scope:target + scope:target.holder = scope:recipient + exists = scope:recipient.house + exists = scope:secondary_recipient + NOT = { scope:secondary_recipient.house ?= scope:recipient.house } + add = -25 + desc = requesting_my_title_reason + } + modifier = { # Don't support actor if there is a close family member within the top 3 candidates + scope:target ?= { + any_title_heir = { + scope:target ?= { + place_in_line_of_succession = { + target = prev + value <= 3 + } + } + is_close_family_of = scope:recipient + } + } + exists = scope:secondary_recipient + NOT = { # Unless secondary_recipient is, in fact, one of these + scope:secondary_recipient = { + scope:target ?= { + place_in_line_of_succession = { + target = prev + value <= 3 + } + } + is_close_family_of = scope:recipient + } + } + add = -100 + desc = close_family_in_line_of_succession + } + modifier = { # More reluctant to lend support towards titles held by top liege + exists = scope:target + scope:target.holder = { + is_independent_ruler = yes + NOT = { this = scope:actor } # Assuming the top liege isn't the one doing the requesting + } + add = -25 + desc = targeting_top_liege_title + } + modifier = { # If you are from a powerful family, and they are not, they are more likely to accept + scope:actor.house ?= { + is_powerful_family = yes + } + scope:recipient.house ?= { + is_powerful_family = no + is_dominant_family = no + } + add = 15 + desc = your_house_is_powerful_reason + } + modifier = { # If you are from a dominant family, and they are not, they are more likely to accept + scope:actor.house ?= { + is_dominant_family = yes + } + scope:recipient.house ?= { + is_dominant_family = no + } + add = 25 + desc = your_house_is_dominant_reason + } + modifier = { # If they are from a powerful family, and you are not, they are more likely to refuse + scope:recipient.house ?= { + is_powerful_family = yes + } + scope:actor.house ?= { + is_powerful_family = no + is_dominant_family = no + } + add = -15 + desc = their_house_is_powerful_reason + } + modifier = { # If they are from a dominant family, and you are not, they are more likely to refuse + scope:recipient.house ?= { + is_dominant_family = yes + } + scope:actor.house ?= { + is_dominant_family = no + } + add = -25 + desc = their_house_is_dominant_reason + } + modifier = { # Difference in influence level + NOT = { scope:actor.influence_level = scope:recipient.influence_level } + add = { + add = { + add = 10 + multiply = scope:actor.influence_level + } + subtract = { + add = 10 + multiply = scope:recipient.influence_level + } + } + desc = difference_in_influence_level_reason + } + + # Relations to actor + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = -100 + desc = AI_YOUR_RIVAL + } + modifier = { + scope:actor = { + has_relation_nemesis = scope:recipient + } + add = -150 + desc = offer_vassalization_interaction_aibehavior_nemesis_tt # Reused loc + } + modifier = { + scope:recipient = { + is_close_family_of = scope:actor + } + add = 50 + desc = CLOSE_FAMILY_REASON + } + modifier = { + scope:recipient = { + is_extended_family_of = scope:actor + } + add = 25 + desc = EXTENDED_FAMILY_REASON + } + modifier = { + exists = scope:actor.house + scope:recipient = { + NOR = { + is_close_family_of = scope:actor + is_extended_family_of = scope:actor + } + exists = house + house = scope:actor.house + } + add = 5 + desc = YOU_ARE_MY_HOUSE_MEMBER + } + modifier = { + scope:actor = { + has_relation_friend = scope:recipient + NOT = { has_relation_best_friend = scope:recipient } + } + add = 15 + desc = WE_ARE_FRIENDS + } + modifier = { + scope:actor = { + has_relation_best_friend = scope:recipient + } + add = 30 + desc = WE_ARE_BEST_FRIENDS + } + + # Relations to secondary_recipient (the character you want them to support) + modifier = { + scope:recipient = { + has_relation_rival = scope:secondary_recipient + NOT = { has_relation_nemesis = scope:secondary_recipient } + } + add = -50 + desc = RIVAL_TO_ME_REASON + } + modifier = { + scope:recipient = { + has_relation_nemesis = scope:secondary_recipient + } + add = -100 + desc = NEMESIS_TO_ME_REASON + } + + # Relations to current title holder + modifier = { + exists = scope:target + scope:recipient = { + has_relation_rival = scope:target.holder + NOT = { has_relation_nemesis = scope:target.holder } + liege = scope:target.holder + liege != scope:actor # Don't worry about liege relation when the liege is the one requesting support + } + add = 25 + desc = AI_THEIR_RIVAL + } + modifier = { + exists = scope:target + scope:recipient = { + has_relation_nemesis = scope:target.holder + liege = scope:target.holder + liege != scope:actor # Don't worry about liege relation when the liege is the one requesting support + } + add = 50 + desc = AI_THEIR_RIVAL + } + modifier = { + exists = scope:target + scope:recipient = { + has_relation_friend = scope:target.holder + NOT = { has_relation_best_friend = scope:target.holder } + liege = scope:target.holder + liege != scope:actor # Don't worry about liege relation when the liege is the one requesting support + } + add = -50 + desc = AI_THEIR_FRIEND + } + modifier = { + exists = scope:target + scope:recipient = { + has_relation_best_friend = scope:target.holder + liege = scope:target.holder + liege != scope:actor # Don't worry about liege relation when the liege is the one requesting support + } + add = -100 + desc = AI_THEIR_FRIEND + } + modifier = { + exists = scope:target + scope:recipient = { + has_relation_lover = scope:target.holder + liege = scope:target.holder + liege != scope:actor # Don't worry about liege relation when the liege is the one requesting support + } + add = -30 + desc = AI_THEIR_LOVER + } + modifier = { + exists = scope:target + scope:recipient = { + OR = { + is_close_family_of = scope:target.holder + is_extended_family_of = scope:target.holder + } + opinion = { target = scope:target.holder value > -25 } + liege = scope:target.holder + liege != scope:actor # Don't worry about liege relation when the liege is the one requesting support + } + add = -20 + desc = AI_THEIR_RELATIVE + } + + # Traits + modifier = { + scope:recipient = { # Ambitious characters doesn't want to spend their influence on anyone not from their house + has_trait = ambitious + exists = house + } + scope:secondary_recipient ?= { + exists = house + NOT = { house = scope:recipient.house } + } + add = -50 + desc = INTERACTION_AMBITIOUS + } + modifier = { + scope:recipient = { + has_trait = callous + } + add = -20 + desc = INTERACTION_CALLOUS + } + modifier = { + scope:recipient = { + has_trait = fickle + } + add = -30 + desc = INTERACTION_FICKLE + } + modifier = { + scope:recipient = { + has_trait = paranoid + } + add = -25 + desc = INTERACTION_PARANOID + } + modifier = { + scope:recipient = { + has_trait = trusting + } + add = 10 + desc = INTERACTION_TRUSTING + } + modifier = { + scope:recipient = { + has_trait = arbitrary + } + add = -15 + desc = INTERACTION_ARBITRARY + } + modifier = { # Cravens dare not help you + scope:recipient = { + has_trait = craven + } + scope:actor.house ?= { + is_dominant_family = no + } + add = -20 + desc = INTERACTION_CRAVEN + } + modifier = { # Cravens dare not refuse a dominant family + scope:recipient = { + has_trait = craven + } + scope:actor.house ?= { + is_dominant_family = yes + } + add = 20 + desc = INTERACTION_CRAVEN + } + } + + ai_potential = { + has_government = administrative_government + house ?= { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + } + + ai_frequency = 48 + + ai_targets = { + ai_recipients = peer_vassals + max = 8 + } + + ai_targets = { + ai_recipients = hooked_characters + max = 2 + } +} + +# Demand that a vassal switches to admin +# Note: Do not rename or delete this interaction as its directly referred to in code +demand_admin_interaction = { + category = interaction_category_admin + icon = demand_admin_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 + + ai_targets = { + ai_recipients = vassals + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 12 + + desc = demand_admin_interaction_desc + + is_shown = { + scope:actor = { has_government = administrative_government } + scope:recipient = { + target_is_liege_or_above = scope:actor + is_ai = yes + is_ruler = yes + NOT = { has_government = administrative_government } + } + trigger_if = { + limit = { + scope:actor = { + is_ai = yes + } + } + scope:recipient = { + highest_held_title_tier >= tier_county + } + } + } + + cooldown_against_recipient = { years = 10 } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + scope:recipient = { 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 = demand_admin_tribal + NOT = { + scope:recipient = { government_has_flag = government_is_tribal } + } + } + custom_tooltip = { + text = head_of_faith_unable_to_change_government_desc + NOT = { + scope:recipient = { faith.religious_head ?= this } + } + } + } + + # Offer hereditary boost + send_option = { + is_valid = { + custom_tooltip = { + text = demand_admin_hereditary_tt + scope:recipient.house ?= { + any_house_member = { count > 1 } + } + } + custom_tooltip = { + text = demand_admin_hereditary_exists_tt + NOT = { exists = scope:recipient.primary_title.var:petition_house_rights } + } + } + flag = hereditary + localization = demand_admin_hereditary + } + #Spend influence + send_option = { + flag = influence + is_valid = { + scope:actor.influence >= massive_influence_value + } + localization = SPEND_INFLUENCE + } + #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_administration } + trigger_event = { + id = ep3_interactions_events.0005 + days = 5 + } + } + } + + on_accept = { + show_as_tooltip = { + change_to_administrative_interaction_effect = yes + } + } + + on_decline = { + scope:recipient = { custom_tooltip = demand_admin_interaction_vassal_refuses } + } + + ai_potential = { + has_government = administrative_government + 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 = 0 + demand_admin_acceptance_modifier = yes + } +} + +#Contest the appointment of another character to a title you have a claim on +contest_appointment_interaction = { + category = interaction_category_admin + common_interaction = yes + highlighted_reason = HIGHLIGHTED_CAN_CONTEST_APPOINTMENT + notification_text = contest_appointment_interaction_desc_tt + intermediary_notification_text = contest_appointment_interaction_liege_desc + intermediary_breakdown_yes = ANSWER_TRILATERAL_CONTEST_LIEGE_YES + intermediary_breakdown_no = ANSWER_TRILATERAL_CONTEST_LIEGE_NO + intermediary_breakdown_maybe = ANSWER_TRILATERAL_INTERMEDIARY_LIEGE_MAYBE + intermediary_answer_accept_key = REPLY_ANSWER_ACCEPT + intermediary_answer_reject_key = REPLY_ANSWER_REJECT + 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 = TODO_CD_EP3: TIT-55514 + + redirect = { + scope:actor.top_liege = { save_scope_as = intermediary } + } + + desc = contest_appointment_interaction_desc + + 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 + + interface_priority = 60 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + prompt = CONTEST_TITLE_SELECT_TITLE + + is_shown = { + # The obvious. + NOR = { + scope:actor = scope:recipient + scope:actor = scope:intermediary + scope:recipient = scope:intermediary + } + # Admin Govt + #You don't have another appointment + scope:actor = { is_landless_administrative = yes } + scope:recipient = { has_government = administrative_government } + scope:intermediary ?= { has_government = administrative_government } + # Make sure scope:recipient is suitable. + scope:recipient = { + # We only target vassals of the liege + top_liege = scope:actor.top_liege + # who have a contestable title + highest_held_title_tier > tier_county + any_held_title = { + tier >= tier_duchy + scope:actor = { + has_claim_on = prev + } + title_revocation_standard_can_pick_title_trigger = yes + } + } + } + + is_valid_showing_failures_only = { + trigger_if = { # Stop AI sending this too often + limit = { + scope:actor = { is_ai = yes } + } + NOT = { + scope:intermediary ?= { has_character_flag = contest_appointment_liege_cooldown } + } + } + 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 } + } + } + } + scope:intermediary = { + influence >= medium_influence_value + } + } + + cooldown_against_recipient = { years = 10 } + + 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 = { + exists = scope:target + } + is_appointment_valid_trigger = { + TITLE = scope:target + CANDIDATE = scope:actor + TOP_LIEGE = scope:intermediary + } + } + } + + is_highlighted = { + scope:recipient = { + any_held_title = { + scope:actor = { + has_claim_on = prev + } + title_revocation_standard_can_pick_title_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" + tier >= tier_duchy + scope:actor = { has_claim_on = scope:target } + } + } + } + + cost = { + influence = { + value = major_influence_value + if = { + limit = { scope:influence_bribe = yes } + add = 100 + } + } + } + + # Hooks can be used to force this through. + send_options_exclusive = no + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:intermediary } + } + flag = hook_liege + localization = SCHEME_HOOK + } + should_use_extra_icon = { + scope:actor = { + OR = { + has_usable_hook = scope:intermediary + 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 + } + } + scope:intermediary ?= { # Stop AI sending this too often + add_character_flag = { + flag = contest_appointment_liege_cooldown + years = 1 + } + } + } + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + } + flag = hook + localization = SCHEME_HOOK + } + # Spend influence to convince your liege + send_option = { + flag = influence_bribe + localization = influence_value_bribe_desc + is_valid = { + scope:actor = { influence >= major_influence_value } + } + } + + on_auto_accept = { + scope:recipient = { trigger_event = ep3_interactions_events.0010 } + scope:actor = { + # Tell them that the revocation went through fine. + trigger_event = ep3_interactions_events.0011 + } + scope:actor = { + # Scope:actor can be hostile again. + clear_hostile_actions_lock_flag_effect = yes + } + create_title_and_vassal_change = { + type = revoked + save_scope_as = change + add_claim_on_loss = yes + } + scope:target = { + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + + on_accept = { + scope:recipient = { trigger_event = ep3_interactions_events.0010 } + scope:actor = { + # Tell them that the revocation went through fine. + trigger_event = ep3_interactions_events.0011 + } + scope:intermediary = { + change_influence = medium_influence_loss + if = { + limit = { + scope:influence_bribe = yes + } + change_influence = major_influence_gain + } + } + scope:actor = { + # Scope:actor can be hostile again. + clear_hostile_actions_lock_flag_effect = yes + } + scope:recipient = { + every_held_title = { + limit = { + is_noble_family_title = no + tier >= tier_county + any_this_title_or_de_jure_above = { + this = scope:target + } + } + add_to_list = transfer_titles + } + } + create_title_and_vassal_change = { + type = revoked + save_scope_as = change + add_claim_on_loss = yes + } + every_in_list = { + list = transfer_titles + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + } + + on_intermediary_decline = { + scope:actor = { + # Inform scope:actor that their liege has vetoed them. + trigger_event = ep3_interactions_events.0012 + # 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_bad + title = liege_blocked_contest_title + left_icon = scope:actor + right_icon = scope:intermediary + custom_tooltip = liege_blocked_contest_title.inform_recipient + } + } + scope:intermediary = { + if = { + limit = { + scope:influence_bribe = yes + } + change_influence = major_influence_gain + } + } + # Flick out some opinions. + diarch_revoke_title_interaction_intermediary_fail_opinions_effect = yes + } + + on_decline = { + scope:intermediary = { + # Tell them that the revocation was refused + trigger_event = ep3_interactions_events.0013 + # And give a crime reason + if = { + limit = { is_ai = no } + custom_tooltip = ADD_OPINION_EFFECT_I_HAVE_IMPRISONMENT_REASON_UNUSABLE + hidden_effect = { + add_opinion = { + target = scope:recipient + modifier = treasonous_revoke_refusal + } + } + } + ## AI use the standard opinion flow. + else = { + add_opinion = { + target = scope:recipient + modifier = treasonous_revoke_refusal + } + } + } + scope:actor = { + # Notify + trigger_event = ep3_interactions_events.0014 + # Scope:actor can be hostile again. + clear_hostile_actions_lock_flag_effect = yes + } + ## Scope:recipient is annoyed with scope:actor and the other way around. + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = revoked_title + } + } + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = treasonous_revoke_refusal + } + } + } + + 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 = { + base = 0 + modifier = { + add = -50 + desc = BASE_RELUCTANCE + } + # Hook + modifier = { + add = 40 + desc = SCHEME_WEAK_HOOK_USED + scope:hook_liege = yes + } + # Bribe + modifier = { + desc = INFLUENCE_REASON + scope:influence_bribe = yes + add = { + value = 20 + multiply = scope:actor.influence_level + min = 5 + } + } + # Opinion Factor + opinion_modifier = { + who = scope:intermediary + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + opinion_modifier = { + who = scope:intermediary + opinion_target = scope:recipient + multiplier = -1 + desc = AI_OPINION_REASON + } + # You would be a better public official (or not)! + modifier = { + desc = AI_STEWARDSHIP_REASON + add = { + value = scope:actor.stewardship + subtract = scope:recipient.stewardship + multiply = 2 + } + } + # How good is the respective character's Governor Efficiency? + modifier = { + scope:actor = { is_ai = no } + desc = AI_GOVERNOR_EFFICIENCY + add = { + value = 0 + add = { + value = scope:actor.governor_efficiency + subtract = 1 + multiply = 100 + } + } + } + modifier = { + scope:actor = { is_ai = no } + desc = RECIPIENT_GOVERNOR_EFFICIENCY + add = { + value = 0 + add = { + value = scope:recipient.governor_efficiency + subtract = 1 + multiply = -100 + } + } + } + # Dread + ## Intimidation + modifier = { + add = { + value = 0 + subtract = intimidated_halved_reason_value + } + desc = YOU_INTIMIDATED_REASON + scope:actor = { + has_dread_level_towards = { + target = scope:intermediary + level = 1 + } + } + } + ## Cowing + modifier = { + add = { + value = 0 + subtract = cowed_halved_reason_value + } + desc = YOU_COWED_REASON + scope:actor = { + has_dread_level_towards = { + target = scope:intermediary + level = 2 + } + } + } + # 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 } + } + } + } + + 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.5 + desc = AI_OPINION_REASON + } + # Refusal is Treason + ## It's always treason, but worth pointing it out. + modifier = { + add = 20 + desc = AI_REFUSAL_IS_TREASON + } + # I am a King! + modifier = { + add = -20 + desc = offer_vassalization_interaction_aibehavior_amkingtier_tt + scope:recipient = { highest_held_title_tier = tier_kingdom } + } + # 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 + } + } + } + ## Intimidation + modifier = { + add = intimidated_halved_reason_value + desc = INTIMIDATED_REASON + scope:recipient = { + has_dread_level_towards = { + target = scope:intermediary + level = 1 + } + } + } + ## Cowing + modifier = { + add = cowed_halved_reason_value + desc = COWED_REASON + scope:recipient = { + has_dread_level_towards = { + target = scope:intermediary + level = 2 + } + } + } + # Difference in influence level + modifier = { + scope:actor.influence_level != scope:recipient.influence_level + add = { + value = scope:actor.influence_level + subtract = scope:recipient.influence_level + multiply = 20 + } + desc = difference_in_influence_level_reason + } + # 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 + } + } + } + } + + # AI + ai_targets = { + ai_recipients = peer_vassals + max = 10 + } + + ai_frequency = 12 + + ai_potential = { + is_landless_administrative = yes + liege = { has_realm_law_flag = title_revocation_allowed } + } + + ai_will_do = { + base = 100 + ai_value_modifier = { + ai_greed = 0.5 + ai_boldness = 1 + } + ## Opinion. + opinion_modifier = { + opinion_target = scope:recipient + multiplier = 0.25 + } + ## Traits. + ### +++ Ambitious. + modifier = { + add = 100 + has_trait = ambitious + } + ### +++ Greedy. + modifier = { + add = 50 + has_trait = greedy + } + ### +++ Vengeful (under certain criteria). + modifier = { + add = 100 + has_trait = vengeful + has_opinion_modifier = { + modifier = revoked_title + target = scope:recipient + } + } + ### --- Content. + modifier = { + add = -50 + has_trait = content + } + # hooked AI. + modifier = { + add = 50 + is_landed = no + has_hook = scope:recipient + scope:recipient = { is_ai = yes } + } + ### + 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 go into influence debt! + modifier = { + factor = 0 + influence <= 0 + } + } +} + +# Request a council position from your liege in exchange for influence +request_council_interaction = { + category = interaction_category_admin + interface_priority = 90 + icon = council + + desc = request_council_interaction_desc + + special_interaction = request_council_position + interface = council_task_interaction + ai_maybe = yes + ai_min_reply_days = 4 + ai_max_reply_days = 9 + can_send_despite_rejection = yes + popup_on_receive = yes + send_name = "SEND_REQUEST_COUNCIL" + + greeting = positive + notification_text = REQUEST_COUNCIL_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + on_decline_summary = request_council_decline_summary + + ai_targets = { + ai_recipients = liege + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 36 + + cooldown_against_recipient = { years = 25 } + + cost = { + influence = admin_council_cost_value + } + + is_shown = { + NOT = { scope:recipient = scope:actor } + scope:actor = { + liege ?= scope:recipient + } + #Admin only + scope:actor = { has_government = administrative_government } + scope:recipient = { has_government = administrative_government } + trigger_if = { + limit = { + exists = scope:target.councillor + } + scope:target = { can_fire_position = yes } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + NOT = { + is_at_war_with = scope:recipient + } + NOT = { + is_councillor = yes + } + 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 = { + block_firing_councillor_effect = { COURT_OWNER = scope:recipient } + custom_tooltip = force_onto_council.recipient.tt.duration + #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 + show_as_tooltip = { + change_influence = admin_council_loss_value + } + } + } + stress_impact = { content = minor_stress_impact_gain } + } + scope:recipient = { + assign_council_task = { + target = scope:actor + council_task = scope:council_task + } + change_influence = massive_influence_gain + 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 + custom_tooltip = force_onto_council.recipient.tt.duration + show_as_tooltip = { change_influence = massive_influence_gain } + } + } + } + } + + on_decline = { + scope:actor = { + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -25 + } + trigger_event = ep3_interactions_events.0020 + } + scope:recipient = { + if = { # If the liege is a player, put on a longer global cooldown to reduce potential spam + limit = { is_ai = no } + add_character_flag = { + flag = refused_council_request + years = 15 + } + } + } + } + + ai_set_target = { + scope:actor = { + random_list = { + 10 = { + trigger = { + exists = scope:recipient.council_task:councillor_chancellor + can_be_chancellor_trigger = { COURT_OWNER = scope:recipient } + } + 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 } + } + 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 } + } + 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 } + } + 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 } + } + modifier = { + factor = learning + } + modifier = { + trigger = { highest_skill = learning } + factor = 10 + } + scope:recipient.council_task:councillor_court_chaplain = { + save_scope_as = target + } + } + } + } + } + + ai_potential = { + is_independent_ruler = no + is_councillor = no + liege ?= { + NOT = { has_character_flag = refused_council_request } + is_at_war = no + } + } + + ai_will_do = { + base = 0 + + # Increase chance if greed and/or boldness is high enough + modifier = { + add = 20 + ai_greed >= medium_positive_ai_value + ai_boldness >= medium_positive_ai_value + } + modifier = { + factor = 1.5 + ai_greed >= very_high_positive_ai_value + } + modifier = { + factor = 1.5 + ai_boldness >= very_high_positive_ai_value + } + + # Don't do it towards a good relation, unless very greedy + modifier = { + factor = 0 + scope:actor = { + ai_greed <= very_high_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 + } + } + } + + # No need if they are a councillor already + modifier = { + factor = 0 + is_councillor = yes + } + } + + ai_accept = { + base = 0 + modifier = { + add = -50 + desc = BASE_RELUCTANCE + } + opinion_modifier = { # Opinion of you + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.8 + desc = AI_OPINION_REASON + } + opinion_modifier = { # Opinion of the current councillor + who = scope:recipient + opinion_target = scope:target.councillor + multiplier = -0.8 + desc = AI_OPINION_REASON + } + ai_value_modifier = { + ai_energy = 0.25 #It's a change + ai_greed = 0.4 #Free influence is free influence + ai_honor = -0.4 #Some might see it as a bribe + } + #Relations + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = -50 + desc = AI_YOUR_RIVAL + } + modifier = { + scope:actor = { + has_relation_friend = scope:recipient + } + add = 25 + desc = AI_YOUR_FRIEND + } + #You are better at the job + modifier = { + scope:target = council_task:councillor_chancellor + scope:actor.diplomacy > scope:target.councillor.diplomacy + desc = AI_BETTER_AT_THE_JOB + add = { + value = scope:actor.diplomacy + subtract = scope:target.councillor.diplomacy + multiply = 10 + } + } + modifier = { + scope:target = council_task:councillor_marshal + scope:actor.martial > scope:target.councillor.martial + desc = AI_BETTER_AT_THE_JOB + add = { + value = scope:actor.martial + subtract = scope:target.councillor.martial + multiply = 10 + } + } + modifier = { + scope:target = council_task:councillor_steward + scope:actor.stewardship > scope:target.councillor.stewardship + desc = AI_BETTER_AT_THE_JOB + add = { + value = scope:actor.stewardship + subtract = scope:target.councillor.stewardship + multiply = 10 + } + } + modifier = { + scope:target = council_task:councillor_spymaster + scope:actor.intrigue > scope:target.councillor.intrigue + desc = AI_BETTER_AT_THE_JOB + add = { + value = scope:actor.intrigue + subtract = scope:target.councillor.intrigue + multiply = 10 + } + } + modifier = { + scope:target = council_task:councillor_court_chaplain + scope:actor.learning > scope:target.councillor.learning + desc = AI_BETTER_AT_THE_JOB + add = { + value = scope:actor.learning + subtract = scope:target.councillor.learning + multiply = 10 + } + } + #You are significantly WORSE at the job (we start reducing AI acceptance when it is more than 10 below current councillor's skill) + modifier = { + scope:target = council_task:councillor_chancellor + scope:actor.diplomacy < { value = scope:target.councillor.diplomacy subtract = 10 } + desc = AI_WORSE_AT_THE_JOB + add = { + value = scope:actor.diplomacy + subtract = scope:target.councillor.diplomacy + add = 10 + multiply = 2 + } + } + modifier = { + scope:target = council_task:councillor_marshal + scope:actor.martial < { value = scope:target.councillor.martial subtract = 10 } + desc = AI_WORSE_AT_THE_JOB + add = { + value = scope:actor.martial + subtract = scope:target.councillor.martial + add = 10 + multiply = 2 + } + } + modifier = { + scope:target = council_task:councillor_steward + scope:actor.stewardship < { value = scope:target.councillor.stewardship subtract = 10 } + desc = AI_WORSE_AT_THE_JOB + add = { + value = scope:actor.stewardship + subtract = scope:target.councillor.stewardship + add = 10 + multiply = 2 + } + } + modifier = { + scope:target = council_task:councillor_spymaster + scope:actor.intrigue < scope:target.councillor.intrigue + desc = AI_WORSE_AT_THE_JOB + add = { + value = scope:actor.intrigue + subtract = scope:target.councillor.intrigue + add = 10 + multiply = 2 + } + } + modifier = { + scope:target = council_task:councillor_court_chaplain + scope:actor.learning < scope:target.councillor.learning + desc = AI_WORSE_AT_THE_JOB + add = { + value = scope:actor.learning + subtract = scope:target.councillor.learning + add = 10 + multiply = 2 + } + } + #You are more powerful + modifier = { + scope:actor = { is_powerful_vassal = yes } + scope:target.councillor = { is_powerful_vassal = no } + desc = AI_POWERFUL_VASSAL + add = 75 + } + modifier = { + scope:actor.house ?= { is_powerful_family = yes } + scope:target.councillor.house ?= { is_powerful_family = no } + desc = AI_POWERFUL_FAMILY + add = 100 + } + #You are more influential + modifier = { + NOT = { scope:actor.influence_level = scope:target.councillor.influence_level } + add = { + value = scope:actor.influence_level + subtract = scope:target.councillor.influence_level + multiply = 10 + } + desc = AI_DIFFERENCE_INFLUENCE + } + } +} + +# Transfer a single county (not belonging to a theme) to an already existing governor +transfer_county_interaction = { + icon = icon_transfer_county + category = interaction_category_admin + common_interaction = no + + desc = transfer_county_interaction_desc + + target_type = title + target_filter = actor_domain_titles + interface_priority = 60 + + # actor character giving the title + # recipient character receiving the title + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:recipient = { + target_is_liege_or_above = scope:actor + highest_held_title_tier >= tier_duchy + has_government = administrative_government + } + scope:actor = { + has_government = administrative_government + is_independent_ruler = yes + highest_held_title_tier >= tier_empire + } + } + + is_valid_showing_failures_only = { + scope:actor = { is_at_war = no } + scope:recipient = { + is_adult = yes + is_at_war = no + bp2_valid_for_standard_interactions_trigger = yes + is_busy_in_events_localised = yes + } + custom_tooltip = { + text = have_no_valid_county_to_assign_trigger + scope:actor = { + any_held_title = { + count >= 1 + tier = tier_county + NOT = { + this = scope:actor.primary_title.title_capital_county + } + duchy ?= { + NOT = { this = scope:actor.primary_title.title_capital_county.duchy } + } + } + } + } + } + + can_be_picked_title = { + scope:target = { + is_leased_out = no + tier = tier_county + custom_tooltip = { + NOT = { this = scope:actor.primary_title.title_capital_county } + text = not_can_be_picked_capital + } + custom_tooltip = { + duchy ?= { + NOT = { this = scope:actor.primary_title.title_capital_county.duchy } + } + text = not_can_be_picked_capital_duchy + } + } + + custom_description = { + text = grant_titles_interaction_can_only_give_diarch_de_jure_liege_to_diarch + subject = scope:actor.diarch + NAND = { + # Only applies if we have an active diarchy. + scope:actor = { has_active_diarchy = yes } + # Now, prevent us from giving away our diarch's land to invalidate them... + scope:target = { + any_dejure_vassal_title_holder = { this = scope:actor.diarch } + # ... _unless_ we're giving it _to_ the diarch. + NOT = { scope:recipient = scope:actor.diarch } + # Plus we only care if the title is below our tier. + tier < scope:actor.highest_held_title_tier + } + } + } + + custom_description = { + text = grant_titles_interaction_title_being_wagered + NOT = { + scope:target = { has_variable = wagered_county } + } + } + } + + auto_accept = yes + + on_auto_accept = { + scope:recipient = { + trigger_event = char_interaction.0111 + } + } + + on_accept = { + hidden_effect = { + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = received_title_county + } + } + scope:target = { add_to_temporary_list = titles_to_grant } + } + #Promised a vassal this title they had a claim on (vassal.2901) + if = { + limit = { + scope:actor = { + exists = var:was_promised_title + var:was_promised_title = scope:recipient + } + } + if = { + limit = { + scope:recipient = { + exists = var:promised_title + } + scope:landed_title = scope:recipient.var:promised_title + } + scope:actor = { + trigger_event = { + id = vassal.2910 + days = { 7 14 } + } + } + } + } + + # The accumulated discontent reduction of the recipient + scope:recipient = { + if = { + limit = { + is_a_faction_member = yes + } + add_joined_faction_discontent = grant_title_opinion_sum_discontent_calc + custom_tooltip = grant_title_modifier_stack_discontent + } + } + + custom_tooltip = grant_title_modifier_stack_counties + + # Jealousy check + if = { + limit = { + any_in_list = { + list = titles_to_grant + any_claimant = { grant_title_rivalry_trigger = yes } + } + } + hidden_effect = { + random = { + chance = 25 + ordered_in_list = { + list = titles_to_grant + limit = { + any_claimant = { grant_title_rivalry_trigger = yes } + } + order_by = tier + save_scope_as = claim_title + ordered_claimant = { + limit = { grant_title_rivalry_trigger = yes } + order_by = primary_title.tier + save_scope_as = claim_vassal + if = { + limit = { + scope:recipient = { is_lowborn = yes } + } + scope:recipient = { save_scope_as = lowborn_scope } + } + else_if = { + limit = { + scope:recipient = { has_claim_on = scope:claim_title } + } + scope:recipient = { save_scope_as = claimant_scope } + } + scope:actor = { + trigger_event = { + id = bp1_yearly.8070 + days = 5 + } + } + } + } + } + } + } + + scope:actor = { + # Maintenance for runestones + if = { + limit = { + # Use expanded version if we have FP1. + has_fp1_dlc_trigger = yes + fp1_remove_stele_new_holder_trigger = { + TITLE = scope:target + PREVIOUS_HOLDER = scope:actor + NEW_HOLDER = scope:recipient + } + } + # Actually removed in fp1_other_decisions.0113 + custom_tooltip = runestone_grant_title_warning + } + else_if = { + limit = { + scope:target = { + exists = var:ancestor_to_bury + has_county_modifier = county_raised_runestone_modifier + } + NOT = { scope:recipient.dynasty = var:ancestor_to_bury.dynasty } #We only have to change something if the new holder is of a different dynasty + } + # Actually removed in religious_decision.0312 + custom_tooltip = runestone_grant_title_warning + } + + if = { + limit = { + exists = scope:actor.dynasty + scope:actor.dynasty = { + has_dynasty_perk = ep1_culture_legacy_3 + } + scope:recipient = { + is_playable_character = no + NOT = { + culture = scope:actor.culture + } + any_in_list = { + list = target_titles + OR = { + tier = tier_county + tier = tier_barony + } + culture = scope:recipient.culture + } + } + } + scope:actor = { + if = { + limit = { + can_add_hook = { + target = scope:recipient + type = favor_hook + } + } + add_hook = { + type = favor_hook + target = scope:recipient + } + } + } + } + + #Feedback for actor + hidden_effect = { + scope:target = { + save_scope_as = loc_title + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = transfer_county_interaction_notification + + left_icon = scope:actor + right_icon = scope:recipient + + custom_tooltip = grant_titles_interaction_notification_effect_2 + if = { + limit = { + exists = dynasty + is_diff_faith_or_culture_trigger = { + CHAR = scope:recipient + STATUS = involved + } + any_character_struggle = { + involvement = involved + has_struggle_phase_parameter = struggle_grant_titles_diff_faith_culture_gives_prestige + } + } + dynasty = { + add_dynasty_prestige = minor_dynasty_prestige_gain + } + } + } + } + } + } + + hidden_effect = { + # Struggle Catalyst + if = { + limit = { + 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 + } + } + } + } + } + # The actual transfer + create_title_and_vassal_change = { + type = granted + save_scope_as = title_change_vassal + } + every_in_list = { + list = titles_to_grant + change_title_holder = { + holder = scope:recipient + change = scope:title_change_vassal + take_baronies = no + } + } + resolve_title_and_vassal_change = scope:title_change_vassal + } + # AI + ai_targets = { + ai_recipients = vassals + } + ai_frequency = 24 + ai_will_do = { + base = 100 + + modifier = { + scope:recipient.house ?= scope:actor.house + add = 10 + } + modifier = { + scope:recipient = { + is_close_family_of = scope:actor + } + add = 10 + } + modifier = { + scope:target = { + any_neighboring_county = { + holder = { + this = scope:recipient + } + } + } + add = 200 + } + } +} + +# Demand that a family member be made a eunuch +castrate_child_interaction = { + category = interaction_category_friendly + icon = eunuch + common_interaction = yes + interface_priority = 60 + ai_maybe = yes + ai_min_reply_days = 1 + ai_max_reply_days = 1 + can_send_despite_rejection = yes + ai_accept_negotiation = yes + popup_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 + + ai_targets = { + ai_recipients = family + max = 5 + } + ai_frequency = 12 + + desc = castrate_child_interaction_desc + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + culture = { + has_cultural_parameter = family_castration + } + NAND = { + is_ai = yes + any_close_family_member = { + is_ai = no + } + } + } + scope:recipient = { + is_ai = yes + is_female = no + is_adult = no + is_close_family_of = scope:actor + is_eunuch_trigger = no + } + } + + cooldown_against_recipient = { years = 1 } + + is_valid_showing_failures_only = { + scope:actor = { + employs_court_position = court_physician_court_position + } + scope:recipient = { + custom_tooltip = { + text = COURTIER_OR_GUEST + OR = { + is_courtier_of = scope:actor + is_pool_guest_of = scope:actor + is_foreign_court_guest_of = scope:actor + } + } + is_ruler = no + is_available = yes + is_betrothed = no + NOT = { is_primary_heir_of = scope:actor } + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + exists = scope:hook + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + is_highlighted = { + #This interaction should only be suggested on potential rivals for the imperial throne, bastards, and for landless house heads + + OR = { + #bastards + AND = { + scope:actor = { + any_close_family_member = { + is_male = yes + house ?= scope:actor.house + is_eunuch_trigger = no + NOR = { + has_trait = celibate + has_trait = devoted + has_trait = order_member + has_trait = bastard + } + OR = { + #Is an old adult with a kid + AND = { + age >= 40 + any_child = { + is_male = yes + } + } + #Is a young adult or child + age < 40 + } + } + } + scope:recipient = { + has_trait = bastard + } + } + #You are poor and uninfluential OR Emperor + AND = { + scope:actor = { + ep3_castration_interest_trigger = yes + ep3_castration_male_family_trigger = yes + } + #Target is a good one + scope:recipient = { + NOT = { is_heir_of = scope:actor } + ep3_ideal_castration_candidate_trigger = yes + OR = { + #target is 3rd child or lower + any_sibling = { + count >= 2 + AND = { + is_male = yes + age > scope:recipient.age + } + } + #target is sibling + NOT = { is_child_of = scope:actor } + } + } + } + } + } + + on_accept = { + scope:recipient = { + if = { + limit = { + age < 12 + } + add_character_flag = accepted_castration_child + } + else = { + add_character_flag = accepted_castration_youth + } + } + show_as_tooltip = { + scope:actor = { change_influence = minor_influence_gain } + #Effects on child target + if = { + limit = { + scope:recipient = { + age < 12 + } + } + scope:recipient = { + ep3_child_castration_effect = yes + add_stress = medium_stress_gain + custom_tooltip = castration_better_before_maturity + } + #Notification that it is better than doing it after 12 years of age + } + #effects on teenaged target + else = { + scope:recipient = { + ep3_youth_castration_effect = yes + add_stress = major_stress_gain + } + } + } + #Immediate interaction effects + if = { + limit = { + exists = scope:hook + scope:hook = yes + scope:actor = { has_usable_hook = scope:recipient } + } + scope:actor = { + use_hook = scope:recipient + } + } + scope:actor = { + if = { + limit = { + scope:recipient = { + age > 6 + } + } + stress_impact = { + compassionate = medium_stress_impact_gain + content = minor_stress_impact_gain + generous = medium_stress_impact_gain + } + } + trigger_event = ep3_interactions_events.0030 + } + } + + on_decline = { + show_as_tooltip = { + #For child targets + if = { + limit = { + scope:recipient = { + age < 12 + } + } + scope:actor = { change_influence = minor_influence_gain } + scope:recipient = { + ep3_child_castration_effect = yes + add_opinion = { + modifier = castration_opinion + target = scope:actor + opinion = -50 + } + add_stress = major_stress_gain + custom_tooltip = castration_better_before_maturity + } + } + #For teenaged victims + else = { + scope:actor = { + remove_courtier_or_guest = scope:recipient + if = { + limit = { + has_hook = scope:recipient + } + remove_hook = { target = scope:recipient } + } + scope:recipient = { + set_relation_rival = { + target = scope:actor + reason = rival_attempted_castration + } + add_stress = medium_stress_gain + + } + } + } + } + if = { + limit = { + scope:hook = yes + scope:actor = { has_usable_hook = scope:recipient } + } + scope:actor = { + use_hook = scope:recipient + } + } + scope:actor = { + if = { + limit = { + scope:recipient = { + age > 6 + } + } + stress_impact = { + compassionate = medium_stress_impact_gain + content = minor_stress_impact_gain + generous = medium_stress_impact_gain + } + } + } + if = { + limit = { + scope:recipient = { + age < 12 + } + } + scope:recipient = { + add_character_flag = resents_castration + } + scope:actor = { + trigger_event = ep3_interactions_events.0030 + } + } + else = { + scope:actor = { + trigger_event = ep3_interactions_events.0031 + } + } + } + + ai_potential = { + is_adult = yes + } + + # Use hook + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + NOT = { + scope:recipient = { is_imprisoned_by = scope:actor } + } + } + 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_will_do = { + base = 0 + modifier = { + scope:actor = { + has_trait = compassionate + } + add = -50 + } + modifier = { + scope:actor = { + has_trait = generous + } + add = -25 + } + modifier = { + scope:actor = { + has_trait = content + } + add = -25 + } + modifier = { + scope:recipient = { + has_trait = bastard + } + add = 100 + } + modifier = { + scope:actor = { + ep3_castration_interest_trigger = yes + } + scope:recipient = { + #target is 3rd child or lower + AND = { + ep3_ideal_castration_candidate_trigger = yes + NOT = { is_heir_of = scope:actor } + #Not oldest child + any_sibling = { + count >= 2 + is_male = yes + age > scope:recipient.age + } + } + } + + add = 100 + } + modifier = { + scope:actor = { + ep3_castration_interest_trigger = yes + } + scope:recipient = { + #target is sibling + AND = { + ep3_ideal_castration_candidate_trigger = yes + NOT = { is_heir_of = scope:actor } + #Not oldest child + NOT = { is_child_of = scope:actor } + } + } + add = 100 + } + modifier = { + scope:actor = { + has_trait = greedy + } + factor = 2 + } + modifier = { + scope:actor = { + has_trait = paranoid + } + factor = 2 + } + modifier = { + scope:actor = { + has_trait = ambitious + } + factor = 2 + } + modifier = { + scope:actor = { + has_trait = sadistic + } + factor = 2 + } + modifier = { + scope:actor = { + opinion = { + target = scope:recipient + value <= -50 + } + } + factor = 2 + } + modifier = { + scope:recipient = { + age > 6 + } + factor = 0.5 + } + modifier = { + scope:recipient = { + age >= 12 + } + factor = 0.5 + } + modifier = { + scope:actor = { + age <= 4 + } + factor = 3 + } + modifier = { + OR = { + scope:actor = { + ep3_castration_male_family_trigger = no + } + scope:recipient = { + is_primary_heir_of = scope:actor + } + scope:recipient = { + AND = { + is_child_of = scope:actor + any_sibling = { + count = 0 + is_male = yes + age >= scope:recipient.age + house ?= scope:recipient.house + } + } + } + } + factor = 0 + } + } + + ai_accept = { + base = 0 + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + desc = AI_OPINION_REASON + } + ai_value_modifier = { + ai_rationality = 0.25 #It's just the way things are + ai_energy = -0.25 #I have big dreams! + ai_boldness = -0.25 #I don't want to be reduced + ai_honor = 0.12 #It is wrong to defy you + ai_sociability = 0.12 #I see the advantages + } + # Weak Hook + modifier = { + trigger = { + always = scope:hook + } + add = 50 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:recipient = { + age <= 2 + } + desc = SCHEME_AGE_2_OR_LESS + add = 50 + } + modifier = { + scope:recipient = { + age <= 6 + } + desc = SCHEME_AGE_6_OR_LESS + add = 20 + } + modifier = { + scope:recipient = { + age >= 10 + } + desc = SCHEME_AGE_10_OR_MORE + add = -20 + } + modifier = { + scope:recipient = { + age >= 14 + } + desc = SCHEME_AGE_14_OR_MORE + add = -40 + } + # They are afraid of you + modifier = { + scope:recipient = { + age >= 12 + has_dread_level_towards = { + target = scope:actor + level = 1 + } + } + desc = SCHEME_TOO_SCARED_TO_RUN + add = 30 + } + modifier = { + scope:recipient = { + age >= 12 + has_dread_level_towards = { + target = scope:actor + level = 2 + } + } + desc = SCHEME_TOO_TERRIFIED_TO_RUN + add = 60 + } + modifier = { + scope:actor = { + highest_held_title_tier >= tier_empire + } + desc = SCHEME_EMPIRE_TIER + add = 30 + } + #You are too good a governor for them to slip away + modifier = { + scope:recipient = { + age >= 12 + } + scope:actor = { + is_governor = yes + governor_efficiency >= 1.25 + } + desc = SCHEME_GOVERNOR_EFFICIENCY_DISSUADES_FLEEING + add = 20 + } + } +} + +### Offer eunuch +# actor = offerer +# recipient = receiver +# secondary_actor = eunuch +offer_eunuch_interaction = { + category = interaction_category_diplomacy + ai_min_reply_days = 4 + ai_max_reply_days = 9 + popup_on_receive = yes + pause_on_receive = yes + icon = eunuch + + populate_recipient_list= { + scope:actor = { + every_courtier = { + limit = { + is_eunuch_trigger = yes + } + add_to_list = characters + } + } + } + + desc = offer_eunuch_interaction_desc + + prompt = OFFER_EUNUCH_SELECT_EUNUCH_TO_TRANSFER + + notification_text = OFFER_EUNUCH_PROPOSAL + + cooldown_against_recipient = { years = 1 } + + is_shown = { + # Only admin gov care about this + scope:actor = { has_government = administrative_government } + scope:recipient = { has_government = administrative_government } + # Only if you actually have any eunuchs in your court + scope:actor = { + any_courtier = { + is_eunuch_trigger = yes + } + } + # Cannot exchange eunuchs with self + NOT = { scope:recipient = scope:actor } + # Only significant rulers + scope:actor.highest_held_title_tier > tier_barony + # Target has to be a ruler and have a court + scope:recipient = { is_ruler = yes } + # Target has to be a direct vassal of the Emperor + scope:recipient.top_liege = scope:recipient.liege + } + + is_valid_showing_failures_only = { + # Must be available + scope:recipient = { is_busy_in_events_localised = yes } + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient = { is_busy_in_events_localised = yes } + } + NOT = { + # Must be at peace + scope:recipient = { is_at_war_with = scope:actor } + } + # Stop AI spamming eunuch offers + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + exists = scope:secondary_recipient + } + NOT = { + scope:secondary_recipient = { has_character_flag = ai_should_not_offer_eunuch } + } + } + } + + can_be_picked = { + # We don't want baby eunuchs, we want eunuchs who can actually do something + is_adult = yes + } + + can_send = { + scope:recipient = { + trigger_if = { + limit = { is_ai = no } + NOT = { + scope:secondary_recipient = { has_character_flag = ai_should_not_offer_eunuch } + } + } + } + } + + is_highlighted = { # We highlight this interaction so it's easier to notice, since we don't show it in the main list + scope:actor = { + any_courtier = { + is_eunuch_trigger = yes + } + } + } + + cost = {} + + on_send = { + scope:secondary_recipient = { + add_character_flag = { + flag = under_offer_as_eunuch_flag + months = 1 + } + court_position_generator_effect = { + VAR = target + EMPLOYER = scope:recipient + } + } + if = { + limit = { + scope:recipient = { is_ai = no } + } + hidden_effect = { + scope:secondary_recipient = { + add_character_flag = { + flag = ai_should_not_offer_eunuch + years = 3 + } + } + } + } + } + + on_accept = { + # Save scopes for clarity + scope:actor = { save_scope_as = eunuch_sender } + scope:secondary_recipient = { save_scope_as = eunuch } + scope:recipient = { save_scope_as = eunuch_taker } + scope:actor = { trigger_event = char_interaction.0350 } + show_as_tooltip = { + ep3_give_eunuch_effect = { + EUNUCH = scope:secondary_recipient + TAKER = scope:recipient + GIVER = scope:actor + } + custom_tooltip = eunuch_will_be_given_a_position_tt + } + } + + on_decline = { + scope:actor = { + trigger_event = char_interaction.0351 + } + scope:secondary_recipient = { remove_character_flag = under_offer_as_eunuch_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 = -50 + ######### OPINION OF LIEGE + 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_targets = { + ai_recipients = liege + } + + ai_frequency = 36 + + ai_potential = { highest_held_title_tier >= tier_county } + + ai_will_do = { + base = 0 + modifier = { + add = scope:actor.ai_boldness + add = { + subtract = scope:actor.ai_compassion + } + } + 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_recipient + multiplier = -0.5 + desc = AI_OPINION_REASON + } + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + # 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 = { + culture = { has_cultural_tradition = tradition_loyal_soldiers } + } + add = 25 + desc = HOSTAGE_CULTURAL_TRADITION_REASON + } + } +} + +# Add artifact to Cabinet of Curiosities +cabinet_of_curiosities_interaction = { + category = interaction_category_admin + common_interaction = yes + interface_priority = 60 + desc = cabinet_of_curiosities_interaction_desc + icon = artisan_inspiration + + target_type = artifact + target_filter = actor_artifacts + + can_be_picked_artifact = { + scope:actor = { + any_artifact = { + this = scope:target + } + #block the artifact from the laamp escort contract + NOT = { + any_scheme = { + var:escorted_artifact ?= scope:target + } + } + } + } + + is_shown = { + scope:recipient = scope:actor + scope:actor = { + domicile ?= { + has_domicile_building_or_higher = cabinet_of_curiosities_01 + } + } + } + + is_valid_showing_failures_only = { + # needs to have an artifact to give away + scope:actor = { + has_any_artifact = yes + is_imprisoned = no + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = cabinet_of_curiosities_interaction_notification + left_icon = scope:actor + right_icon = scope:target + + custom_tooltip = artifact_added_to_domicile_tt + + # Determine Bonus + if = { + limit = { + scope:target = { is_unique = yes } + } + house = { + if = { + limit = { + has_variable = ep3_legacy_domicile_artifact_counter_unique + } + change_variable = { + name = ep3_legacy_domicile_artifact_counter_unique + add = 1 + } + } + else = { + set_variable = { + name = ep3_legacy_domicile_artifact_counter_unique + value = 1 + } + } + } + } + scope:target = { + if = { + limit = { rarity = common } + scope:actor.house = { + if = { + limit = { + has_variable = ep3_legacy_domicile_artifact_counter_common + } + change_variable = { + name = ep3_legacy_domicile_artifact_counter_common + add = 1 + } + } + else = { + set_variable = { + name = ep3_legacy_domicile_artifact_counter_common + value = 1 + } + } + } + } + else_if = { + limit = { rarity = masterwork } + scope:actor.house = { + if = { + limit = { + has_variable = ep3_legacy_domicile_artifact_counter_masterwork + } + change_variable = { + name = ep3_legacy_domicile_artifact_counter_masterwork + add = 1 + } + } + else = { + set_variable = { + name = ep3_legacy_domicile_artifact_counter_masterwork + value = 1 + } + } + } + } + else_if = { + limit = { rarity = famed } + scope:actor.house = { + if = { + limit = { + has_variable = ep3_legacy_domicile_artifact_counter_famed + } + change_variable = { + name = ep3_legacy_domicile_artifact_counter_famed + add = 1 + } + } + else = { + set_variable = { + name = ep3_legacy_domicile_artifact_counter_famed + value = 1 + } + } + } + } + else_if = { + limit = { rarity = illustrious } + scope:actor.house = { + if = { + limit = { + has_variable = ep3_legacy_domicile_artifact_counter_illustrious + } + change_variable = { + name = ep3_legacy_domicile_artifact_counter_illustrious + add = 1 + } + } + else = { + set_variable = { + name = ep3_legacy_domicile_artifact_counter_illustrious + value = 1 + } + } + } + } + } + } + + custom_tooltip = add_artifact_to_domicile_warning + hidden_effect = { + destroy_artifact = scope:target + house = { + if = { + limit = { + has_variable = ep3_legacy_domicile_artifact_counter + } + change_variable = { + name = ep3_legacy_domicile_artifact_counter + add = 1 + } + } + else = { + set_variable = { + name = ep3_legacy_domicile_artifact_counter + value = 1 + } + } + } + } + } + } + + auto_accept = yes + + # AI + ai_targets = { + ai_recipients = self + } + + ai_frequency = 84 + + ai_potential = { + has_any_unequipped_artifact = yes + any_character_artifact = { + count >= 5 + is_equipped = no + } + } + + ai_will_do = { + base = 30 + } +} + +# Send an acknowledgment and reward for a governor's good performance +acknowledge_governor_interaction = { + category = interaction_category_admin + icon = icon_acknowledge_governor + common_interaction = yes + interface_priority = 60 + popup_on_receive = yes + + ai_targets = { + ai_recipients = vassals + max = 10 + } + ai_frequency = 36 + + desc = acknowledge_governor_interaction_desc + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:recipient = { + target_is_liege_or_above = scope:actor + highest_held_title_tier >= tier_duchy + has_government = administrative_government + } + scope:actor = { + has_government = administrative_government + is_independent_ruler = yes + highest_held_title_tier >= tier_empire + } + } + + cooldown_against_recipient = { years = 10 } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + NOT = { + is_at_war_with = scope:recipient + } + } + scope:recipient = { + has_trait = governor + has_trait_xp = { + trait = governor + value >= 80 + } + } + } + + auto_accept = yes + + cost = { + influence = major_influence_value + } + + on_accept = { + scope:actor = { save_scope_as = emperor } + scope:recipient = { + trigger_event = { + id = ep3_interactions_events.0040 + days = 1 + } + } + custom_tooltip = acknowledge_governor_interaction_tt + show_as_tooltip = { + scope:actor = { + add_hook = { + target = scope:recipient + type = loyalty_hook + years = 5 + } + } + if = { + limit = { + scope:recipient = { is_ai = yes } + } + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = feeling_appreciated_opinion + opinion = 30 + } + } + } + } + } + + ai_potential = { + has_government = administrative_government + highest_held_title_tier >= tier_empire + } + + ai_will_do = { + base = 10 + modifier = { + scope:recipient.house ?= scope:actor.house + add = 10 + } + modifier = { + scope:recipient = { + is_close_family_of = scope:actor + } + add = 20 + } + modifier = { + scope:recipient = { + is_extended_family_of = scope:actor + } + add = 10 + } + modifier = { + scope:actor = { + has_relation_friend = scope:recipient + } + add = 10 + } + modifier = { + scope:actor = { + has_relation_best_friend = scope:recipient + } + add = 20 + } + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = -30 + } + opinion_modifier = { # Opinion Factor + who = scope:actor + opinion_target = scope:recipient + multiplier = 0.5 + } + modifier = { + scope:recipient = { + has_trait_xp = { + trait = governor + value >= 90 + } + } + factor = 1.5 + } + modifier = { + scope:recipient = { + has_trait_xp = { + trait = governor + value >= 100 + } + } + factor = 2 + } + modifier = { + scope:actor = { + has_strong_hook = scope:recipient + } + factor = 0.1 + } + } +} + +# Affect Governor's performance +boost_efficiency_interaction = { + category = interaction_category_admin + icon = icon_boost_efficiency + interface_priority = 1 + popup_on_receive = yes + + ai_targets = { + ai_recipients = peer_vassals + max = 15 + } + ai_targets = { + ai_recipients = vassals + max = 15 + } + ai_frequency = 36 + + desc = boost_efficiency_interaction_desc + + is_shown = { + scope:actor = { has_government = administrative_government } + scope:recipient = { + has_government = administrative_government + NOT = { this = scope:actor } + is_governor = yes + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + NOT = { is_at_war_with = scope:recipient } + } + custom_tooltip = { + text = boost_efficiency_interaction_too_high_tt + scope:recipient.governor_efficiency_presented <= boost_efficiency_maximum_value + } + custom_tooltip = { + text = efficiency_interaction_cooldown_tt + scope:recipient = { + NOR = { + is_target_in_variable_list = { + name = efficiency_boosters + target = scope:actor + } + is_target_in_variable_list = { + name = efficiency_damagers + target = scope:actor + } + } + } + } + } + + can_send = { + custom_tooltip = { + text = boost_efficiency_interaction_too_high_tt + scope:recipient.governor_efficiency_presented <= boost_efficiency_maximum_value + } + custom_tooltip = { + text = efficiency_interaction_cooldown_tt + scope:recipient = { + NOR = { + is_target_in_variable_list = { + name = efficiency_boosters + target = scope:actor + } + is_target_in_variable_list = { + name = efficiency_damagers + target = scope:actor + } + } + } + } + } + + cost = { + influence = { + value = minor_influence_value + if = { + limit = { scope:influence_boost = yes } + add = scope:recipient.medium_influence_value + } + } + gold = { + value = 0 + if = { + limit = { scope:gold_boost = yes } + add = scope:recipient.medium_gold_value + } + } + } + + send_option = { + is_valid = { scope:actor.influence >= scope:recipient.medium_influence_gain } + localization = influence_boost_desc + flag = influence_boost + } + send_option = { + is_valid = { scope:actor.gold >= scope:recipient.medium_gold_value } + localization = gold_boost_desc + flag = gold_boost + } + send_option = { + localization = diplomacy_boost_desc + flag = diplomacy_boost + } + send_option = { + localization = stewardship_boost_desc + flag = stewardship_boost + } + send_option = { + localization = intrigue_boost_desc + flag = intrigue_boost + } + send_options_exclusive = yes + + on_send = { + scope:recipient = { + add_to_variable_list = { + name = efficiency_boosters + target = scope:actor + years = 2 + } + } + } + + auto_accept = yes + + on_accept = { + switch = { + trigger = yes + scope:diplomacy_boost = { + boost_governor_efficiency_duel_effect = { SKILL = diplomacy } + } + scope:stewardship_boost = { + boost_governor_efficiency_duel_effect = { SKILL = stewardship } + } + scope:intrigue_boost = { + boost_governor_efficiency_duel_effect = { SKILL = intrigue } + } + fallback = { boost_governor_efficiency_success_effect = yes } # Non-duel options always succeed + } + } + + ai_potential = { + has_government = administrative_government + top_liege = { + any_vassal = { + is_governor = yes + NOT = { this = root } + } + } + } + + ai_will_do = { + base = -10 + modifier = { # Boost house members + scope:recipient.house ?= scope:actor.house + add = 10 + } + modifier = { # Boost family + scope:recipient = { is_close_family_of = scope:actor } + add = 10 + } + modifier = { # Boost friends + scope:actor = { has_relation_friend = scope:recipient } + add = 10 + } + modifier = { # Avoid boosting rivals + scope:actor = { has_relation_rival = scope:recipient } + add = -25 + } + modifier = { # Avoid making potential house gains harder + scope:recipient = { + any_held_title = { + tier >= tier_duchy + current_heir.house = scope:actor.house + scope:actor.house != scope:recipient.house + } + } + add = -10 + } + modifier = { # AI copy players they like + scope:recipient = { + any_in_list = { + variable = efficiency_boosters + is_ai = no + NOT = { has_relation_rival = scope:actor } + OR = { + has_relation_friend = scope:actor + AND = { + exists = house + scope:actor.house ?= house + } + is_close_family_of = scope:actor + } + } + } + add = 15 + } + opinion_modifier = { # Opinion Factor - boost for characters they like + who = scope:actor + opinion_target = scope:recipient + multiplier = 0.25 + } + } +} + +# Affect Governor's performance +damage_efficiency_interaction = { + category = interaction_category_admin + icon = icon_damage_efficiency + interface_priority = 0 + popup_on_receive = yes + + ai_targets = { + ai_recipients = peer_vassals + max = 15 + } + ai_targets = { + ai_recipients = vassals + max = 15 + } + ai_frequency = 36 + + desc = damage_efficiency_interaction_desc + + is_shown = { + scope:actor = { has_government = administrative_government } + scope:recipient = { + is_governor = yes + NOT = { this = scope:actor } + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + NOT = { is_at_war_with = scope:recipient } + } + custom_tooltip = { + text = damage_efficiency_interaction_too_low_tt + scope:recipient.governor_efficiency_presented >= damage_efficiency_minimum_value + } + custom_tooltip = { + text = efficiency_interaction_cooldown_tt + scope:recipient = { + NOR = { + is_target_in_variable_list = { + name = efficiency_boosters + target = scope:actor + } + is_target_in_variable_list = { + name = efficiency_damagers + target = scope:actor + } + } + } + } + } + + can_send = { + custom_tooltip = { + text = damage_efficiency_interaction_too_low_tt + scope:recipient.governor_efficiency_presented >= damage_efficiency_minimum_value + } + custom_tooltip = { + text = efficiency_interaction_cooldown_tt + scope:recipient = { + NOR = { + is_target_in_variable_list = { + name = efficiency_boosters + target = scope:actor + } + is_target_in_variable_list = { + name = efficiency_damagers + target = scope:actor + } + } + } + } + } + + cost = { + influence = { + value = minor_influence_gain + if = { + limit = { scope:influence_damage = yes } + add = scope:recipient.medium_influence_gain + } + } + gold = { + value = 0 + if = { + limit = { scope:gold_damage = yes } + add = scope:recipient.medium_gold_value + } + } + } + + send_option = { + is_valid = { scope:actor.influence >= scope:recipient.medium_influence_gain } + localization = influence_damage_desc + flag = influence_damage + } + send_option = { + is_valid = { scope:actor.gold >= scope:recipient.medium_gold_value } + localization = gold_damage_desc + flag = gold_damage + } + send_option = { + localization = diplomacy_damage_desc + flag = diplomacy_damage + } + send_option = { + localization = stewardship_damage_desc + flag = stewardship_damage + } + send_option = { + localization = intrigue_damage_desc + flag = intrigue_damage + } + send_options_exclusive = yes + + on_send = { + scope:recipient = { + add_to_variable_list = { + name = efficiency_damagers + target = scope:actor + years = 2 + } + } + } + + auto_accept = yes + + on_accept = { + switch = { + trigger = yes + scope:diplomacy_damage = { + damage_governor_efficiency_duel_effect = { SKILL = diplomacy } + } + scope:stewardship_damage = { + damage_governor_efficiency_duel_effect = { SKILL = stewardship } + } + scope:intrigue_damage = { + damage_governor_efficiency_duel_effect = { SKILL = intrigue } + } + fallback = { damage_governor_efficiency_success_effect = yes } # Non-duel options always succeed + } + } + + ai_potential = { + has_government = administrative_government + top_liege = { + any_vassal = { + is_governor = yes + NOT = { this = root } + } + } + } + + ai_will_do = { + base = -10 + modifier = { # Don't damage house members + scope:recipient.house ?= scope:actor.house + add = -10 + } + modifier = { # Don't damage close family + scope:recipient = { is_close_family_of = scope:actor } + add = -10 + } + modifier = { # Don't damage friends + scope:actor = { has_relation_friend = scope:recipient } + add = -10 + } + modifier = { # Damage rivals + scope:actor = { has_relation_rival = scope:recipient } + add = 15 + } + modifier = { # Damage when house stands to gain + scope:recipient = { + any_held_title = { + tier >= tier_duchy + current_heir.house = scope:actor.house + scope:actor.house != scope:recipient.house + } + } + add = 10 + } + modifier = { # AI copy players they like + scope:recipient = { + any_in_list = { + variable = efficiency_damagers + is_ai = no + NOT = { has_relation_rival = scope:actor } + OR = { + has_relation_friend = scope:actor + AND = { + exists = house + scope:actor.house ?= house + } + is_close_family_of = scope:actor + } + } + } + add = 15 + } + opinion_modifier = { # Opinion Factor - boost for characters they dislike + who = scope:actor + opinion_target = scope:recipient + multiplier = -0.25 + } + } +} + +# Emperor fires Governor - AKA Depose Governor/depose_governor +governor_removal_interaction = { + category = interaction_category_admin + icon = icon_governor_removal + common_interaction = yes + desc = governor_removal_interaction_desc + greeting = negative + notification_text = GOVERNOR_REMOVAL_NOTIFICATION_TEXT + popup_on_receive = yes + pause_on_receive = yes + cooldown_against_recipient = { years = 5 } + + auto_accept = yes + + is_shown = { + scope:actor = { + is_independent_ruler = yes + has_government = administrative_government + } + scope:recipient = { + NOT = { this = scope:actor } + is_governor = yes + is_vassal_of = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + any_vassal = { + is_governor = yes + NOT = { this = scope:actor } + } + } + } + + is_highlighted = { + scope:recipient ?= { + any_held_title = { + current_heir ?= { + OR = { + scope:actor ?= this + is_close_family_of = scope:actor + } + } + } + } + } + + highlighted_reason = HIGHLIGHTED_GOVERNOR_REMOVAL_HEIR + + can_send = { + scope:recipient != scope:actor + custom_tooltip = { + text = demand_governor_removal_dominant_family_tt + scope:recipient.house ?= { is_dominant_family = no } + } + } + + cost = { + influence = { + value = 0 + if = { + limit = { exists = scope:recipient } + scope:recipient ?= { + if = { + limit = { + any_held_title = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + every_held_title = { + limit = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + add = { + value = scope:recipient.massive_influence_value + multiply = 3 + } + } + desc = GOVERNOR_RESIGNATION_KINGDOM_COST + } + } + else_if = { + limit = { + any_held_title = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + every_held_title = { + limit = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + add = scope:recipient.massive_influence_value + } + desc = GOVERNOR_RESIGNATION_DUCHY_COST + } + } + if = { + limit = { house ?= { is_powerful_family = yes } } + add = { + value = scope:recipient.massive_influence_value + desc = GOVERNOR_RESIGNATION_POWERFUL_COST + } + } + else_if = { + limit = { house ?= { is_dominant_family = yes } } + add = { + value = scope:recipient.monumental_influence_value + desc = GOVERNOR_RESIGNATION_DOMINANT_COST + } + } + if = { + limit = { + scope:actor = { is_ai = no } # This cost is only for players due to performance reasons + } + if = { + limit = { + scope:recipient.governor_efficiency != 1 + } + add = { + value = -100 + add = { + value = scope:recipient.governor_efficiency + multiply = 100 + } + desc = GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + } + if = { + limit = { + influence_level != 1 + } + add = { + value = { + value = influence_level + subtract = 1 + } + multiply = 50 + desc = GOVERNOR_RESIGNATION_INFLUENCE_LEVEL_COST + } + } + } + scope:actor = { + if = { + limit = { has_revoke_title_reason = scope:recipient } + multiply = { + value = 0.5 + desc = temporal_condemnation_got_revoke_reason # Reused loc + } + } + } + } + } + } + + on_accept = { + scope:recipient = { + if = { + limit = { + exists = house + house = { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + can_set_relation_rival_trigger = { CHARACTER = scope:actor } + } + progress_towards_rival_effect = { + REASON = rival_deposed_governor + CHARACTER = scope:actor + OPINION = 0 + } + } + add_opinion = { + target = scope:actor + modifier = demanded_my_resignation_opinion + } + custom_tooltip = demanded_my_resignation_house_tt + hidden_effect = { + house ?= { + if = { + limit = { + NOT = { this = scope:actor.house } + } + every_house_member = { + custom = custom.every_house_member_secondary_recipient + limit = { + is_ai = yes + NOT = { this = scope:recipient } + } + if = { + limit = { + house = { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + } + add_opinion = { + target = scope:actor + modifier = demanded_my_house_members_resignation_opinion + opinion = -20 + } + } + else = { + add_opinion = { + target = scope:actor + modifier = demanded_my_house_members_resignation_opinion + opinion = -15 + } + } + } + } + } + } + if = { + limit = { + any_held_title = { + is_noble_family_title = no + exists = current_heir + current_heir = { + NOR = { + this = scope:actor + AND = { + exists = scope:recipient.house + house ?= scope:recipient.house + } + has_relation_friend = scope:recipient + has_relation_best_friend = scope:recipient + is_allied_to = scope:recipient + has_relation_soulmate = scope:recipient + is_spouse_of = scope:recipient + is_close_family_of = scope:recipient + } + opinion = { + target = scope:recipient + value <= 40 + } + } + } + } + every_held_title = { + limit = { + is_noble_family_title = no + exists = current_heir + current_heir = { + NOR = { + this = scope:actor + AND = { + exists = scope:recipient.house + house ?= scope:recipient.house + } + has_relation_friend = scope:recipient + has_relation_best_friend = scope:recipient + is_allied_to = scope:recipient + has_relation_soulmate = scope:recipient + is_spouse_of = scope:recipient + is_close_family_of = scope:recipient + } + opinion = { + target = scope:recipient + value <= 40 + } + } + } + current_heir = { + add_to_list = deposed_title_heirs + } + } + every_in_list = { + list = deposed_title_heirs + add_opinion = { + target = scope:actor + modifier = deposed_predecessor_opinion + } + } + } + trigger_event = ep3_interactions_events.0630 + show_as_tooltip = { + governor_resignation_title_transfer_effect = yes + } + } + } + + on_decline = { + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = demanded_my_resignation_opinion + } + } + scope:actor = { + send_interface_toast = { + title = demand_governor_resignation_declined_toast + type = event_toast_effect_bad + left_icon = scope:recipient + revocation_tyranny_effect = { VASSAL = scope:recipient } + title_revocation_stress_effect = { VASSAL = scope:recipient } + } + } + war_for_revoke_effect = { + LIEGE = scope:actor + REBEL = scope:recipient + } + scope:actor = { + if = { + limit = { has_realm_law_flag = vassal_refusal_is_treason } + add_opinion = { + target = scope:recipient + modifier = treasonous_revoke_refusal + } + } + } + } + + 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" + + send_options_exclusive = 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 } + } + } + + # AI + ai_targets = { + ai_recipients = vassals + } + + ai_frequency = 6 + ai_potential = { + influence > massive_influence_value + is_at_war = no # Don't spend influence when at war in case troops are needed + } + + ai_will_do = { + base = -10 + modifier = { + scope:actor.house = scope:recipient.house + add = -50 + } + modifier = { + scope:actor = { has_relation_rival = scope:recipient } + add = 30 + } + modifier = { # Get rid of bad governors, but there is no point if the heir is worse + scope:recipient = { + governor_efficiency <= 0.7 + governor_efficiency < scope:recipient.primary_heir.governor_efficiency + } + add = 10 + } + modifier = { + scope:recipient = { + is_a_faction_member = yes + } + add = 20 + } + modifier = { + scope:recipient = { + governor_efficiency >= 1.25 + } + add = -10 + } + modifier = { + scope:recipient = { + has_trait = loyal + } + add = -10 + } + modifier = { + scope:recipient = { + has_trait = disloyal + } + add = 5 + } + modifier = { + scope:recipient = { + is_allied_to = scope:actor + } + add = -100 + } + modifier = { + scope:recipient = { + any_held_title = { + current_heir ?= { + house = scope:actor.house + NOT = { this = scope:actor } + } + } + } + add = 10 + } + opinion_modifier = { # Opinion Factor + who = scope:actor + opinion_target = scope:recipient + multiplier = -0.25 + } + } +} + +# Demand Emperor fires Governor - AKA Compel Resignation/compel_resignation +force_governor_removal_interaction = { + category = interaction_category_admin + icon = icon_force_governor_removal + desc = force_governor_removal_interaction_desc + interface_priority = 95 + + greeting = positive + notification_text = DEMAND_GOVERNOR_REMOVAL_NOTIFICATION_TEXT + can_send_despite_rejection = yes + popup_on_receive = yes + pause_on_receive = yes + + cooldown = { years = 5 } + + ai_maybe = yes + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + is_shown = { + scope:actor = { + is_independent_ruler = no + exists = top_liege + top_liege = { has_government = administrative_government } + } + scope:secondary_recipient ?= { is_governor = yes } + OR = { + scope:secondary_recipient ?= { is_vassal_of = scope:recipient } + scope:secondary_recipient ?= scope:recipient + } + scope:secondary_recipient != scope:actor + scope:secondary_recipient != scope:recipient + } + + is_valid_showing_failures_only = { + scope:actor = { + NOR = { + is_at_war_with = scope:recipient + is_at_war_with = scope:secondary_recipient + } + top_liege = { + any_vassal = { + is_governor = yes + NOT = { this = scope:actor } + } + } + } + scope:secondary_recipient = { + NOT = { is_at_war_with = scope:recipient } + } + } + + is_highlighted = { + scope:secondary_recipient ?= { + any_held_title = { + current_heir ?= { + OR = { + scope:actor ?= this + house ?= scope:actor.house + } + } + } + } + } + + highlighted_reason = HIGHLIGHTED_DEMAND_GOVERNOR_REMOVAL_HEIR + + can_send = { + scope:secondary_recipient != scope:actor + custom_tooltip = { + text = demand_governor_removal_dominant_family_tt + scope:secondary_recipient.house ?= { is_dominant_family = no } + } + scope:actor = { + NAND = { + is_ai = yes + scope:recipient = { has_character_flag = force_governor_resignation_ai_cooldown } + } + } + } + + can_be_picked = { + house ?= { is_dominant_family = no } + any_held_title = { + is_landless_type_title = no + is_noble_family_title = no + } + exists = house + is_governor = yes + NOR = { + this = scope:actor + this = scope:recipient + } + } + + redirect = { + if = { + limit = { scope:recipient != scope:actor.top_liege } + scope:recipient = { save_scope_as = secondary_recipient } + } + scope:actor.top_liege ?= { + save_scope_as = recipient + } + } + + populate_recipient_list = { + scope:actor.top_liege = { + every_vassal = { + limit = { + exists = house + is_governor = yes + NOR = { + this = scope:actor + this = scope:recipient + } + } + add_to_list = characters + } + } + } + + cost = { + influence = { + value = 0 + if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient ?= { + if = { + limit = { + any_held_title = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + value = 0 + every_held_title = { + limit = { + tier = tier_duchy + is_landless_type_title = no + is_noble_family_title = no + } + add = scope:secondary_recipient.massive_influence_value + } + desc = DEMAND_GOVERNOR_RESIGNATION_DUCHY_COST + } + } + if = { + limit = { + any_held_title = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + } + add = { + value = 0 + every_held_title = { + limit = { + tier = tier_kingdom + is_landless_type_title = no + is_noble_family_title = no + } + add = { + value = scope:secondary_recipient.massive_influence_value + multiply = 2 + } + } + desc = DEMAND_GOVERNOR_RESIGNATION_KINGDOM_COST + } + } + if = { + limit = { house ?= { is_powerful_family = yes } } + add = { + value = scope:secondary_recipient.massive_influence_value + desc = DEMAND_GOVERNOR_RESIGNATION_POWERFUL_COST + } + } + else_if = { + limit = { house ?= { is_dominant_family = yes } } + add = { + value = scope:secondary_recipient.monumental_influence_value + desc = DEMAND_GOVERNOR_RESIGNATION_DOMINANT_COST + } + } + else_if = { + limit = { scope:secondary_recipient.governor_efficiency > 1 } + add = { + value = -100 + add = { + value = scope:secondary_recipient.governor_efficiency + multiply = 100 + } + desc = DEMAND_GOVERNOR_RESIGNATION_EFFICIENCY_COST + } + } + if = { + limit = { + influence_level != 1 + } + add = { + value = { + value = influence_level + subtract = 1 + } + multiply = 50 + desc = DEMAND_GOVERNOR_RESIGNATION_INFLUENCE_LEVEL_COST + } + } + } + } + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = force_governor_resignation_accepted_toast + left_icon = scope:secondary_recipient + right_icon = scope:recipient + if = { + limit = { scope:criminal_secret_recipient = yes} + scope:actor = { + random_known_secret = { + limit = { + secret_owner = scope:recipient + is_criminal_for = scope:recipient + can_be_exposed_by = scope:actor + } + disable_exposure_by = scope:actor + } + } + } + if = { + limit = { scope:criminal_secret_secondary_recipient = yes } + scope:actor = { + random_known_secret = { + limit = { + secret_owner = scope:secondary_recipient + is_criminal_for = scope:secondary_recipient + can_be_exposed_by = scope:actor + NOT = { is_known_by = scope:recipient } + } + reveal_to = scope:recipient + disable_exposure_by = scope:actor + } + } + } + scope:secondary_recipient ?= { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = forced_my_resignation_opinion + } + } + progress_towards_rival_effect = { + REASON = rival_forced_my_resignation_reason + CHARACTER = scope:actor + OPINION = default_rival_opinion + } + house ?= { + if = { + limit = { + this != scope:actor.house + } + every_house_member = { + custom = custom.every_house_member_secondary_recipient + limit = { + is_ai = yes + this != scope:secondary_recipient + } + add_opinion = { + target = scope:actor + modifier = forced_my_house_members_resignation_opinion + } + } + } + } + governor_resignation_title_transfer_effect = yes + } + } + if = { + limit = { scope:influence = yes } + change_influence = massive_influence_loss + } + } + } + + on_decline = { + scope:secondary_recipient ?= { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = attempted_force_my_resignation_opinion + } + add_opinion = { + target = scope:recipient + modifier = blocked_my_resignation_opinion + } + } + custom_tooltip = demanded_my_resignation_blocked_house_tt + hidden_effect = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = force_governor_resignation_vetoed_toast + left_icon = scope:secondary_recipient + right_icon = scope:recipient + scope:secondary_recipient = { + send_interface_toast = { + type = event_toast_effect_good + title = force_governor_resignation_vetoed_toast + left_icon = scope:actor + right_icon = scope:recipient + scope:recipient = { change_influence = medium_influence_loss } + house ?= { + every_house_member = { + custom = custom.every_house_member_secondary_recipient + limit = { + is_ai = yes + NOR = { + this = scope:secondary_recipient + this = scope:actor + this = scope:recipient + } + } + if = { + limit = { + NOT = { scope:actor.house ?= scope:secondary_recipient.house } + } + add_opinion = { + target = scope:actor + modifier = attempted_force_my_house_members_resignation_opinion + } + } + if = { + limit = { + NOT = { scope:recipient.house ?= scope:secondary_recipient.house } + } + add_opinion = { + target = scope:recipient + modifier = blocked_my_house_members_resignation_opinion + } + } + } + } + } + } + } + } + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = force_governor_resignation_declined_toast + left_icon = scope:secondary_recipient + right_icon = scope:recipient + scope:recipient = { + title_revocation_stress_effect = { VASSAL = scope:secondary_recipient } + + if = { + limit = { has_realm_law_flag = vassal_refusal_is_treason } + add_opinion = { + target = scope:secondary_recipient + modifier = treasonous_revoke_refusal + } + } + if = { + limit = { scope:criminal_secret_recipient = yes} + scope:actor = { + random_known_secret = { + limit = { + secret_owner = scope:recipient + is_criminal_for = scope:recipient + can_be_exposed_by = scope:actor + } + expose_secret = scope:actor + } + } + } + } + } + } + } + + on_send = { + scope:actor.top_liege = { + add_character_flag = { + flag = force_governor_resignation_ai_cooldown + months = 6 + } + } + } + + 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" + send_option = { + flag = influence + is_valid = { + scope:actor.influence >= massive_influence_value + } + localization = SPEND_INFLUENCE + } + send_option = { + flag = criminal_secret_recipient + is_shown = { + scope:recipient = { + any_secret = { + is_criminal_for = scope:recipient + is_known_by = scope:actor + can_be_exposed_by = scope:actor + } + } + } + localization = LEVERAGE_CRIMINAL_SECRET_RECIPIENT + } + send_option = { + flag = criminal_secret_secondary_recipient + is_shown = { + scope:secondary_recipient = { + any_secret = { + is_criminal_for = scope:secondary_recipient + is_known_by = scope:actor + can_be_exposed_by = scope:actor + NOT = { is_known_by = scope:recipient } + } + } + } + localization = LEVERAGE_CRIMINAL_SECRET_SECONDARY_RECIPIENT + } + + send_options_exclusive = 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 } + } + } + + # AI + ai_targets = { + ai_recipients = peer_vassals + max = 10 + } + ai_targets = { + ai_recipients = liege + } + + ai_frequency = 60 + ai_potential = { + influence > massive_influence_value + is_independent_ruler = no + has_government = administrative_government + } + ai_accept = { + base = -50 + # SEND OPTIONS + modifier = { + scope:hook = yes + add = 30 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + desc = INFLUENCE_REASON + scope:influence = yes + add = { + value = 20 + multiply = scope:actor.influence_level + min = 5 + } + } + modifier = { + desc = RECIPIENT_SECRET + scope:criminal_secret_recipient = yes + add = 50 + } + modifier = { + desc = SECONDARY_RECIPIENT_SECRET + scope:criminal_secret_secondary_recipient = yes + add = 50 + } + + modifier = { + add = { + value = -100 + add = { + value = scope:secondary_recipient.governor_efficiency + multiply = 100 + } + multiply = -1 + round = yes + } + desc = SECONDARY_RECIPIENT_GOVERNOR_EFFICIENCY + } + modifier = { + scope:secondary_recipient.dynasty = scope:recipient.dynasty + scope:secondary_recipient.house != scope:recipient.house + NOT = { + scope:secondary_recipient = { is_close_family_of = scope:recipient } + } + add = -30 + desc = THEY_ARE_MY_HOUSE_MEMBER + } + modifier = { + scope:secondary_recipient.house = scope:recipient.house + NOT = { + scope:secondary_recipient = { is_close_family_of = scope:recipient } + } + add = -50 + desc = THEY_ARE_MY_HOUSE_MEMBER + } + modifier = { + scope:secondary_recipient = { is_close_family_of = scope:recipient } + add = -70 + desc = THEY_ARE_MY_CLOSE_FAMILY + } + modifier = { + scope:secondary_recipient = { is_councillor = yes } + add = -15 + desc = THEY_ARE_MY_COUNCILLOR + } + modifier = { + scope:recipient = { is_spouse_of = scope:secondary_recipient } + add = -25 + desc = THEY_ARE_MY_SPOUSE + } + modifier = { + scope:recipient = { has_relation_friend = scope:secondary_recipient } + add = -30 + desc = THEY_ARE_MY_FRIEND + } + modifier = { + scope:recipient = { has_relation_rival = scope:secondary_recipient } + add = 25 + desc = THEY_ARE_MY_RIVAL + } + modifier = { + scope:secondary_recipient.house = { + is_powerful_family = yes + NOR = { + this = scope:actor.house + this = scope:intermediary.house + } + } + add = -20 + desc = TARGET_FAMILY_IS_POWERFUL + } + modifier = { + scope:actor.house = { + is_powerful_family = yes + NOR = { + this = scope:actor.house + this = scope:intermediary.house + } + } + add = 20 + desc = YOUR_FAMILY_IS_POWERFUL + } + modifier = { + scope:actor.house = { + is_dominant_family = yes + NOT = { this = scope:recipient.house } + } + add = 30 + desc = YOUR_FAMILY_IS_DOMINANT + } + modifier = { + scope:secondary_recipient.house = { + is_dominant_family = yes + this != scope:recipient.house + } + add = -30 + desc = TARGET_FAMILY_IS_DOMINANT + } + modifier = { + scope:secondary_recipient = { + house != scope:recipient.house + any_held_title = { + current_heir ?= { + is_close_family_of = scope:recipient + NOT = { this = scope:recipient } + } + } + } + add = 30 + desc = THEIR_HOUSE_MEMBER_STANDS_TO_INHERIT + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:secondary_recipient + multiplier = -0.5 + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + } + } + 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 } + } + + ai_will_do = { + base = -10 + modifier = { + scope:actor.house = scope:recipient.house + add = -50 + } + modifier = { + scope:actor = { has_relation_rival = scope:secondary_recipient } + add = 10 + } + modifier = { + scope:secondary_recipient = { + any_held_title = { current_heir.house ?= scope:actor.house } + } + add = 10 + } + modifier = { + scope:actor = { + OR = { + has_relation_friend = scope:secondary_recipient + has_relation_lover = scope:secondary_recipient + is_spouse_of = scope:secondary_recipient + is_close_family_of = scope:secondary_recipient + } + } + add = -50 + } + } +} + +# Force Step Down +force_step_down_interaction = { + icon = icon_force_to_step_down + common_interaction = yes + interface_priority = 65 + category = interaction_category_admin + + cooldown_against_recipient = { years = 5 } + + target_type = title + target_filter = recipient_domain_titles + can_be_picked_title = { + scope:target = { + tier = tier_duchy + is_noble_family_title = no + } + } + has_valid_target_showing_failures_only = { + scope:target = { + tier = tier_duchy + is_noble_family_title = no + } + } + + ai_target_quick_trigger = { adult = yes } + ai_targets = { + ai_recipients = vassals + ai_recipients = peer_vassals + max = 10 + } + + ai_maybe = yes + ai_min_reply_days = 4 + ai_max_reply_days = 9 + can_send_despite_rejection = yes + popup_on_receive = yes + + greeting = negative + notification_text = FORCE_STEP_DOWN_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + ai_frequency = 180 + + is_shown = { + scope:actor = { + has_government = administrative_government + is_independent_ruler = no + this != scope:recipient + } + scope:recipient = { + has_government = administrative_government + is_governor = yes + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + is_imprisoned = no + is_in_civil_war = no + } + scope:recipient = { + is_in_civil_war = no + } + } + + desc = scheme_interaction_tt_force_step_down_approved + + send_options_exclusive = no + send_option = { + flag = hook + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + NOT = { + scope:recipient = { has_hook = scope:actor } + } + } + 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" + send_option = { + flag = influence + is_valid = { + scope:actor.influence >= massive_influence_value + } + localization = SPEND_INFLUENCE + } + send_option = { + flag = gold + is_valid = { + scope:actor.gold >= scope:actor.massive_gold_value + } + localization = GENERIC_SPEND_GOLD + } + send_option = { + flag = criminal_secret_recipient + is_shown = { + scope:recipient = { + any_secret = { + is_criminal_for = scope:recipient + is_known_by = scope:actor + can_be_exposed_by = scope:actor + } + } + } + localization = LEVERAGE_CRIMINAL_SECRET_RECIPIENT + } + + on_accept = { + scope:actor = { + # Save the number of held governorships + scope:recipient = { + save_scope_value_as = { + name = recipient_number_of_governorships + value = { + value = 0 + every_held_title = { + limit = { + tier >= tier_duchy + is_noble_family_title = no + } + add = 1 + } + } + } + } + + if = { + limit = { scope:hook = yes } + use_hook = scope:recipient + } + if = { + limit = { scope:influence = yes } + change_influence = { + value = massive_influence_loss + multiply = 2 + multiply = scope:recipient_number_of_governorships + } + } + if = { + limit = { scope:gold = yes } + pay_short_term_gold = { + target = scope:recipient + gold = { + value = massive_gold_value + multiply = scope:recipient_number_of_governorships + } + } + } + if = { + limit = { scope:criminal_secret_recipient = yes} + scope:actor = { + random_known_secret = { + limit = { + secret_owner = scope:recipient + is_criminal_for = scope:recipient + can_be_exposed_by = scope:actor + } + disable_exposure_by = scope:actor + } + } + } + send_interface_toast = { + type = event_toast_effect_good + title = force_governor_resignation_accepted_toast + left_icon = scope:target + right_icon = scope:recipient + scope:recipient = { + custom_tooltip = loses_target_title_tt + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = forced_my_resignation_opinion + } + } + if = { + limit = { can_set_relation_rival_trigger = { CHARACTER = scope:actor } } + set_relation_rival = { + target = scope:actor + reason = rival_forced_my_resignation_reason + } + } + house ?= { + if = { + limit = { + this != scope:actor.house + } + every_house_member = { + custom = custom.every_house_member_recipient + limit = { + is_ai = yes + this != scope:secondary_recipient + } + add_opinion = { + target = scope:actor + modifier = forced_my_house_members_resignation_opinion + } + } + } + } + + force_step_down_landed_titles = yes + } + } + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = force_governor_resignation_declined_toast + left_icon = scope:target + right_icon = scope:recipient + + change_influence = major_influence_loss + add_prestige = medium_prestige_loss + scope:recipient = { + add_opinion = { + target = scope:actor + modifier = attempted_force_step_down_opinion + } + if = { + limit = { can_set_relation_rival_trigger = { CHARACTER = scope:actor } } + set_relation_rival = { + target = scope:actor + reason = rival_attempted_to_force_my_resignation_reason + } + } + } + if = { + limit = { scope:criminal_secret_recipient = yes} + scope:actor = { + random_known_secret = { + limit = { + secret_owner = scope:recipient + is_criminal_for = scope:recipient + can_be_exposed_by = scope:actor + } + expose_secret = scope:actor + } + } + } + } + } + } + + 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 } + } + + ai_accept = { + base = 0 + + # SEND OPTIONS + modifier = { + scope:hook = yes + add = 30 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + desc = INFLUENCE_REASON + scope:influence = yes + add = { + value = 20 + multiply = scope:actor.influence_level + min = 5 + } + } + modifier = { + desc = GOLD_REASON + scope:gold = yes + add = 30 + } + modifier = { + desc = RECIPIENT_SECRET + scope:criminal_secret_recipient = yes + add = 50 + } + + # TRAITS + modifier = { + scope:recipient = { has_trait = craven } + add = 10 + desc = INTERACTION_CRAVEN + } + modifier = { + scope:recipient = { has_trait = trusting } + add = 5 + desc = INTERACTION_TRUSTING + } + modifier = { + scope:recipient = { has_trait = generous } + add = 5 + desc = INTERACTION_GENEROUS + } + modifier = { + scope:recipient = { has_trait = lazy } + add = 10 + desc = INTERACTION_LAZY + } + modifier = { + scope:recipient = { has_trait = paranoid } + add = -20 + desc = INTERACTION_PARANOID + } + modifier = { + scope:recipient = { has_trait = patient } + add = -5 + desc = INTERACTION_PATIENT + } + modifier = { + scope:recipient = { has_trait = brave } + add = -10 + desc = INTERACTION_BRAVE + } + modifier = { + scope:recipient = { has_trait = greedy } + add = -10 + desc = INTERACTION_GREEDY + } + modifier = { + scope:recipient = { has_trait = ambitious } + add = -20 + desc = INTERACTION_AMBITIOUS + } + + # INTRIGUE COMPARISON + modifier = { + add = { + value = scope:actor.intrigue + multiply = 2 + } + desc = INTERACTION_ACTOR_INTRIGUE + } + modifier = { + add = { + value = scope:recipient.intrigue + multiply = -2 + } + desc = INTERACTION_RECIPIENT_INTRIGUE + } + } + + ai_potential = { + NOT = { + any_scheme = { + is_scheme_category = political + } + } + has_government = administrative_government + is_independent_ruler = no + highest_held_title_tier >= tier_duchy + } + + ai_will_do = { + base = -200 + + opinion_modifier = { + who = scope:actor + opinion_target = scope:recipient + multiplier = -1 + } + + modifier = { # AI should really only use this if they have a house member in line for the title + house = { + any_house_member = { + scope:recipient.primary_title = { + place_in_line_of_succession = { + target = prev + value <= 3 + } + } + } + } + add = 100 + } + + #Personality + modifier = { + has_trait = vengeful + add = 10 + } + + modifier = { + has_trait = deceitful + add = 10 + } + + modifier = { + has_trait = honest + add = -10 + } + + # House & Family + modifier = { + is_close_family_of = scope:recipient + add = -500 + } + modifier = { + house = scope:recipient.house + add = -500 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = 75 + } + + # Relationships + modifier = { + add = 25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -100 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + factor = 0 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Request a governorship from your liege +request_governorship_interaction = { + category = interaction_category_admin + icon = icon_request_governorship + desc = request_governorship_interaction_desc + common_interaction = yes + interface_priority = 95 + is_highlighted = { + always = yes + } + + ai_maybe = yes + ai_min_reply_days = 4 + ai_max_reply_days = 9 + can_send_despite_rejection = yes + popup_on_receive = yes + + greeting = positive + notification_text = REQUEST_GOVERNORSHIP_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + ai_targets = { ai_recipients = liege } + ai_target_quick_trigger = { adult = yes } + ai_frequency = 36 + + cooldown_against_recipient = { years = 10 } + + redirect = { + scope:recipient = { save_scope_as = secondary_recipient } + } + + cost = { + influence = { + add = { + add = { + value = scope:actor.monumental_influence_value + multiply = 2 + } + desc = BASE + } + # Province Size + add = { + value = 0 + if = { + limit = { exists = scope:target } + scope:target = { + every_de_jure_county = { add = 10 } + } + } + multiply = 2 + desc = province_size_desc + } + # Being a Powerful or Dominant Family reduces the cost significantly + scope:actor.house = { + if = { + limit = { is_dominant_family = yes } + multiply = { + value = 0.25 + desc = is_dominant_family_desc + } + } + else_if = { + limit = { is_powerful_family = yes } + multiply = { + value = 0.5 + desc = is_powerful_family_desc + } + } + } + # Only asking for candidate score + scope:target = { + if = { + limit = { + exists = holder + NOT = { holder = scope:recipient } + } + multiply = { + value = 0.5 + desc = candidacy_request_desc + } + } + } + } + } + + is_shown = { + scope:recipient != scope:actor + scope:recipient = scope:actor.top_liege + scope:actor = { + has_government = administrative_government + is_governor = no + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + is_landed = no + NOT = { is_at_war_with = scope:recipient } + } + } + + target_type = title + target_filter = secondary_recipient_de_jure_titles + + can_be_picked_title = { + scope:target = { + custom_tooltip = { + text = request_governorship_interaction_tier_tt + OR = { + tier = tier_duchy + tier = tier_kingdom + } + } + trigger_if = { + limit = { is_title_created = no } + custom_tooltip = { + text = request_governorship_interaction_created_tt + any_de_jure_county = { holder = scope:recipient } + } + } + trigger_else = { + custom_tooltip = { + text = request_governorship_interaction_holder_tt + holder.top_liege = scope:actor.top_liege + } + } + custom_tooltip = { + text = request_governorship_interaction_liege_duchy_tt + NOT = { + any_de_jure_county = { this = scope:recipient.capital_county } + } + } + trigger_if = { + limit = { scope:target.holder ?= scope:recipient } + custom_tooltip = { + text = request_governorship_interaction_county_tt + any_de_jure_county = { holder = scope:recipient } + } + } + } + } + + has_valid_target_showing_failures_only = { + scope:target.tier = tier_duchy + trigger_if = { + limit = { exists = scope:target.holder } + scope:target.holder ?= { has_government = administrative_government } + } + } + + can_send = { + scope:actor = { + is_landed = no + } + } + + on_send = { + save_scope_value_as = { + name = influence_cost + value = { + add = { + add = { + value = scope:actor.monumental_influence_value + multiply = 2 + } + desc = BASE + } + # Province Size + add = { + value = 0 + if = { + limit = { exists = scope:target } + scope:target = { + every_de_jure_county = { add = 10 } + } + } + multiply = 2 + desc = province_size_desc + } + # Being a Powerful or Dominant Family reduces the cost significantly + scope:actor.house = { + if = { + limit = { is_dominant_family = yes } + multiply = { + value = 0.25 + desc = is_dominant_family_desc + } + } + else_if = { + limit = { is_powerful_family = yes } + multiply = { + value = 0.5 + desc = is_powerful_family_desc + } + } + } + # Only asking for candidate score + scope:target = { + if = { + limit = { + exists = holder + NOT = { holder = scope:recipient } + } + multiply = { + value = 0.5 + desc = candidacy_request_desc + } + } + } + } + } + } + + on_accept = { + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = request_governorship_interaction_toast_liege + left_icon = scope:actor + right_icon = scope:target + change_influence = massive_influence_gain + scope:actor = { + # Grant title if held by Liege or uncreated but de jure land is held + if = { + limit = { + scope:target = { + OR = { + is_title_created = no + holder ?= scope:recipient + } + } + } + send_interface_toast = { + type = event_toast_effect_good + title = request_governorship_interaction_toast_granted + left_icon = scope:target + right_icon = scope:recipient + # Create Title if necessary + hidden_effect = { + scope:target ?= { + if = { + limit = { is_title_created = no } + create_title_and_vassal_change = { + type = created + save_scope_as = creation_change + } + change_title_holder = { + holder = scope:recipient + change = scope:creation_change + } + resolve_title_and_vassal_change = scope:creation_change + } + } + } + # Move Titles + create_title_and_vassal_change = { + type = appointment + save_scope_as = grant_change + } + scope:target = { + # Transfer counties + hidden_effect = { + every_de_jure_county = { + limit = { holder = scope:recipient } + change_title_holder = { + holder = scope:actor + change = scope:grant_change + } + } + } + # Transfer governorship + change_title_holder_include_vassals = { + holder = scope:actor + change = scope:grant_change + } + } + resolve_title_and_vassal_change = scope:grant_change + } + } + # Grant Appointment score if already has a Governor + else = { + send_interface_toast = { + type = event_toast_effect_good + title = request_governorship_interaction_toast_candidacy + left_icon = scope:target + right_icon = scope:recipient + scope:target ?= { + change_appointment_investment = { + target = scope:actor + investor = scope:recipient + value = appointment_major_influence_cost + } + } + } + scope:target = { + ordered_title_heir = { + limit = { + NOR = { + house ?= scope:actor.house + house ?= scope:recipient.house + } + } + order_by = "appointment_candidate_score(scope:target)" + check_range_bounds = no + max = 3 + if = { + limit = { + is_house_head = no + exists = house.house_head + NOR = { + house.house_head = scope:actor + house.house_head = scope:recipient + } + } + house.house_head = { + if = { + limit = { + NOT = { is_in_list = governorship_house_head_opinion } + } + add_to_list = governorship_house_head_opinion + } + } + } + else = { add_to_list = governorship_direct_opinion } + } + } + every_in_list = { + list = governorship_house_head_opinion + add_opinion = { + target = scope:actor + modifier = requested_house_heired_governorship + } + } + every_in_list = { + list = governorship_direct_opinion + add_opinion = { + target = scope:actor + modifier = requested_heired_governorship + } + } + } + } + } + } + } + + on_decline = { + scope:actor = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -15 + } + } + trigger_event = ep3_interactions_events.0021 + } + } + + ai_potential = { + is_governor = no + } + + ai_will_do = { + base = 0 + # Increase chance if greed and/or boldness is high enough + modifier = { + add = 20 + ai_greed >= medium_positive_ai_value + ai_boldness >= medium_positive_ai_value + } + modifier = { + add = 15 + ai_greed >= high_positive_ai_value + } + modifier = { + add = 15 + ai_boldness >= high_positive_ai_value + } + } + + ai_accept = { + base = -15 + opinion_modifier = { # Opinion of you + who = scope:recipient + opinion_target = scope:actor + desc = AI_LIEGE_OPINION_REASON + } + modifier = { + exists = scope:target.current_heir + NOR = { + scope:target.current_heir = scope:recipient + scope:target.current_heir = scope:actor + trigger_if = { + limit = { exists = scope:target.current_heir.house.house_head } + scope:target.current_heir != scope:target.current_heir.house.house_head + } + } + add = { + value = "scope:recipient.opinion(scope:target.current_heir)" + divide = 2 + round = yes + } + desc = AI_LIEGE_OPINION_HEIR_REASON + } + modifier = { + exists = scope:target.current_heir + scope:target.current_heir.house.house_head ?= scope:target.current_heir + NOR = { + scope:target.current_heir = scope:recipient + scope:target.current_heir = scope:actor + } + add = { + value = "scope:recipient.opinion(scope:target.current_heir)" + divide = 2 + round = yes + } + desc = AI_LIEGE_OPINION_HEIR_REASON + } + modifier = { + exists = scope:target.current_heir.house.house_head + NOR = { + scope:target.current_heir.house.house_head = scope:target.current_heir + scope:target.current_heir.house.house_head = scope:recipient + scope:target.current_heir.house.house_head = scope:actor + } + add = { + value = "scope:recipient.opinion(scope:target.current_heir.house.house_head)" + round = yes + } + desc = AI_LIEGE_OPINION_HEIR_HOUSE_HEAD_REASON + } + ai_value_modifier = { + ai_energy = 0.1 #It's a change + ai_greed = 0.2 #Free influence is free influence + ai_honor = -0.2 #Some might see it as a bribe + } + # Your Efficiency + modifier = { + add = { + value = { + value = scope:actor.governor_efficiency + multiply = 25 + } + round = yes + } + desc = AI_GOVERNOR_EFFICIENCY + } + # Heir Governor Efficiency + modifier = { + exists = scope:target.current_heir + NOR = { + scope:target.current_heir = scope:recipient + scope:target.current_heir = scope:actor + } + add = { + value = { + value = scope:target.current_heir.governor_efficiency + multiply = -50 + } + round = yes + } + desc = AI_GOVERNOR_EFFICIENCY_HEIR + } + # Your family is dominant + modifier = { + scope:actor.house = { is_dominant_family = yes } + desc = AI_DOMINANT_FAMILY + add = 50 + } + # Your family is powerful + modifier = { + scope:actor.house = { is_powerful_family = yes } + desc = AI_POWERFUL_FAMILY + add = 25 + } + # Heir family is dominant + modifier = { + scope:target.current_heir.house ?= { is_dominant_family = yes } + desc = AI_HEIR_DOMINANT_FAMILY + add = -50 + } + # Heir family is powerful + modifier = { + scope:target.current_heir.house ?= { is_powerful_family = yes } + desc = AI_HEIR_POWERFUL_FAMILY + add = -25 + } + # House of Emperor + modifier = { + scope:actor.house != scope:recipient.house + scope:target.current_heir.house ?= scope:recipient.house + desc = AI_HEIR_IS_MY_HOUSE + add = -50 + } + # You are more influential than heir + modifier = { + exists = scope:target.current_heir + scope:actor.influence_level != scope:target.current_heir.influence_level + add = { + value = scope:actor.influence_level + subtract = scope:target.current_heir.influence_level + multiply = 2 + } + desc = AI_DIFFERENCE_INFLUENCE + } + # Size of Province + modifier = { + exists = scope:target + add = { + value = 0 + scope:target = { + every_de_jure_county = { add = -1 } + } + multiply = 2 + } + desc = AI_THEME_SIZE + } + # Kingdoms are harder to request + modifier = { + scope:target ?= { tier = tier_kingdom } + add = -50 + desc = AI_THEME_IS_KINGDOM + } + # Province is close to the capital duchy + modifier = { + add = -10 + scope:target.tier <= tier_duchy + trigger_if = { + limit = { scope:target.tier = tier_duchy } + scope:target = { save_temporary_scope_as = duchy } + } + trigger_else = { + scope:target.duchy = { save_temporary_scope_as = duchy } + } + scope:duchy = { + OR = { + this = scope:recipient.capital_county.duchy + any_title_to_title_neighboring_and_across_water_duchy = { this = scope:recipient.capital_county.duchy } + } + } + desc = AI_THEME_CLOSE_TO_CAPITAL + } + # Province is far from the capital + modifier = { + add = 10 + trigger_if = { + limit = { scope:target.tier = tier_kingdom } + scope:target = { save_temporary_scope_as = kingdom } + } + trigger_else = { + scope:target.kingdom = { save_temporary_scope_as = kingdom } + } + scope:kingdom = { + NOR = { + this = scope:recipient.capital_county.kingdom + any_title_to_title_neighboring_and_across_water_kingdom = { this = scope:recipient.capital_county.kingdom } + } + } + desc = AI_THEME_FAR_FROM_CAPITAL + } + } +} + +# Adopt character to Noble Family +noble_family_adoption_interaction = { + icon = icon_dynasty + category = interaction_category_friendly + interface_priority = 60 + + desc = noble_family_adoption_interaction_desc + use_diplomatic_range = yes + + ai_min_reply_days = 4 + ai_max_reply_days = 9 + ai_maybe = yes + + cooldown_against_recipient = { years = 5 } + + is_shown = { + NOT = { scope:actor = scope:recipient } + scope:actor = { + culture = { has_cultural_parameter = allows_noble_family_adoption } + house.house_head ?= { + any_held_title = { is_noble_family_title = yes } + } + } + scope:recipient = { + # Don't get imprisoned and so on + is_available = yes + NOR = { + # They don't already belong to your house + house ?= scope:actor.house + # Don't adopt your own grandkids + any_ancestor = { this = scope:actor } + } + } + } + + is_valid = {} + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + } + can_recruit_character_to_court_trigger = { + RECRUITER = scope:actor + RECRUITEE = scope:recipient + } + scope:recipient = { + age >= 10 + trigger_if = { + limit = { exists = house.house_head } + custom_tooltip = { + text = adopt_interaction_noble_family_is_not_house_head_tt + NOT = { scope:recipient.house.house_head = scope:recipient } + } + } + is_ruler = no + } + scope:actor = { + custom_tooltip = { + text = adopt_interaction_noble_family_house_head_tt + is_house_head = yes + } + } + } + + send_option = { + is_valid = { scope:actor.gold >= scope:actor.minor_gold_value } + flag = gold + localization = GENERIC_SPEND_GOLD + } + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + NOT = { + scope:recipient = { has_hook = scope:actor } + } + } + 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" + + send_options_exclusive = no + + on_accept = { + show_as_tooltip = { + noble_family_adoption_effect = { + ADOPTEE = scope:recipient + ADOPTER = scope:actor + } + } + hidden_effect = { + scope:actor = { trigger_event = ep3_interactions_events.0400 } + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = noble_family_adoption_effect_toast + left_icon = scope:recipient + right_icon = scope:actor.house + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_bad + title = noble_family_adoption_effect_toast + left_icon = scope:recipient + right_icon = scope:actor.house + if = { + limit = { scope:actor = { is_ai = yes } } + reverse_add_opinion = { + modifier = angry_opinion + opinion = -20 + target = scope:actor + } + } + if = { + limit = { is_ai = yes } + add_opinion = { + modifier = respect_opinion + opinion = -10 + target = scope:actor + } + } + } + } + } + } + } + + cost = { + prestige = { + value = { + add = medium_prestige_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + # Replace with Influence for Admin noble families + house.house_head ?= { + any_held_title = { is_noble_family_title = yes } + } + } + } + } + multiply = 0 + } + } + } + piety = { + value = { + add = medium_piety_value + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + # No piety cost for adopting a righteous-faith child + if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value < faith_astray_level + } + } + } + multiply = 0 + } + else_if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value > faith_astray_level + } + } + } + add = minor_piety_value + } + else_if = { + limit = { + scope:actor.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value > faith_hostile_level + } + } + } + add = medium_piety_value + } + } + } + influence = { + value = { + value = 0 + # Influence cost for Admin noble families + if = { + limit = { + scope:actor.house.house_head ?= { + any_held_title = { is_noble_family_title = yes } + } + } + add = massive_influence_gain + } + if = { + limit = { + scope:actor = { + OR = { + culture = { has_cultural_parameter = free_adoption } + has_game_rule = adoption_always_allowed + } + } + } + multiply = 0 + } + } + } + } + + ai_potential = { + is_house_head = yes + house ?= { + any_house_member = { + count <= 5 + is_alive = yes + } + } + } + + ai_targets = { + ai_recipients = courtiers + ai_recipients = guests + # Friends, wards, etc. + ai_recipients = scripted_relations + max = 20 + } + + ai_accept = { + base = 0 + modifier = { + exists = house + any_parent = { + is_alive = yes + house = scope:recipient.house + } + add = -15 + desc = MY_PARENT_HOUSE + } + modifier = { + exists = house.house_head + is_close_family_of = house.house_head + add = -15 + desc = CLOSE_FAMILY_OF_HOUSE_HEAD + } + modifier = { + scope:hook = yes + add = 40 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:gold = yes + add = 25 + desc = SCHEME_WITH_GIFT_SIGNIFICANT + } + modifier = { # I have a house + add = -15 + desc = I_ALREADY_HAVE_A_HOUSE + exists = house.house_head + } + modifier = { # My house is powerful + add = -10 + desc = MY_HOUSE_IS_POWERFUL + house ?= { is_powerful_family = yes } + } + modifier = { # My house is dominant + add = -25 + desc = MY_HOUSE_IS_DOMINANT + house ?= { is_dominant_family = yes } + } + modifier = { + scope:actor.house = { is_powerful_family = yes } + add = 10 + desc = YOUR_FAMILY_IS_POWERFUL + } + modifier = { + scope:actor.house = { is_dominant_family = yes } + add = 25 + desc = YOUR_FAMILY_IS_DOMINANT + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + } + modifier = { # I hate my house head + add = 15 + desc = I_HATE_MY_HOUSE_HEAD + exists = house.house_head + is_house_head = no + opinion = { + value <= medium_negative_opinion + target = house.house_head + } + } + modifier = { # I like my house head + add = -15 + desc = I_LIKE_MY_HOUSE_HEAD + exists = house.house_head + is_house_head = no + opinion = { + value >= medium_positive_opinion + target = house.house_head + } + } + modifier = { # You're my friend :) + add = 10 + desc = youre_my_friend_tt + has_relation_friend = scope:actor + } + modifier = { # You're my guardian + add = 10 + desc = youre_my_guardian_tt + has_relation_guardian = scope:actor + } + modifier = { # I have no house + add = 10 + desc = I_WANT_A_HOUSE + NOT = { exists = house } + } + modifier = { # I am a noble! + add = -15 + desc = i_am_noble_tt + has_no_particular_noble_roots_trigger = no + } + modifier = { # Yo, you're offering me a place in a landed house? Sick. + add = 10 + desc = ambition_tt + has_trait = ambitious + has_no_particular_noble_roots_trigger = yes + } + modifier = { + scope:actor = { + exists = house + } + scope:recipient = { + exists = house + } + exists = scope:actor.house.house_head.top_liege + house.house_head.top_liege ?= scope:actor.house.house_head.top_liege + add = { + value = scope:actor.house.house_power_score + subtract = scope:recipient.house.house_power_score + } + desc = RELATIVE_FAMILY_RATING + } + modifier = { + exists = scope:actor.house + exists = house + scope:recipient.dynasty.dynasty_prestige_level != scope:actor.dynasty.dynasty_prestige_level + add = { + value = scope:actor.dynasty.dynasty_prestige_level + subtract = scope:recipient.dynasty.dynasty_prestige_level + multiply = 10 + } + desc = RELATIVE_FAMILY_RENOWN + } + modifier = { + exists = house + house = { + any_house_member = { + count < 5 + is_alive = yes + } + } + scope:actor.house ?= { + any_house_member = { + count >= 5 + is_alive = yes + } + } + add = 10 + desc = MY_HOUSE_IS_SMALL + } + modifier = { + faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_astray_level + } + } + add = { + value = "faith.faith_hostility_level(scope:actor.faith)" + multiply = -10 + } + desc = FAITH_HOSTILITY_LEVEL + } + modifier = { + exists = scope:actor.top_liege.primary_title.state_faith + faith = { + faith_hostility_level = { + target = scope:actor.top_liege.primary_title.state_faith + value >= faith_astray_level + } + } + add = { + value = "faith.faith_hostility_level(scope:actor.top_liege.primary_title.state_faith)" + multiply = -5 + } + desc = FAITH_HOSTILITY_LEVEL_STATE_FAITH + } + modifier = { + culture != scope:actor.culture + "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" < 50 + add = { + value = 50 + subtract = "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" + multiply = -0.25 + round = yes + } + desc = CULTURAL_ACCEPTANCE + } + modifier = { + culture != scope:actor.culture + "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" >= 50 + add = { + value = "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" + subtract = 50 + multiply = 0.25 + round = yes + } + desc = CULTURAL_ACCEPTANCE + } + modifier = { + NOT = { + culture = { has_cultural_parameter = allows_noble_family_adoption } + } + add = -10 + desc = NOBLE_FAMILY_ADOPTION_NOT_CULTURAL + } + modifier = { + exists = house + age >= 31 + add = { + value = age + subtract = 30 + multiply = -1 + } + desc = THEIR_AGE_REASON + } + } + + ai_frequency = 120 + + ai_will_do = { + base = 50 + modifier = { # My house needs more members + add = 100 + scope:actor.house = { + any_house_member = { + count < 3 + save_temporary_scope_as = house_member_temp + NOT = { + scope:actor.top_liege.faith = { has_dominant_ruling_gender = scope:house_member_temp } + } + } + } + } + opinion_modifier = { # Opinion + opinion_target = scope:recipient + multiplier = 0.5 + } + modifier = { # My rival + add = -25 + scope:actor = { has_relation_rival = scope:recipient } + } + modifier = { # My friend + add = 25 + scope:actor = { has_relation_friend = scope:recipient } + } + modifier = { # My ward + add = 25 + scope:actor = { has_relation_guardian = scope:recipient } + } + modifier = { # I care about bloodlines and dynasties and whatnot + add = -25 + scope:actor = { + OR = { + has_trait = arrogant + has_trait = callous + } + } + } + modifier = { # I will not adopt filthy filthy heretics + factor = 0 + ai_zeal >= medium_positive_ai_value + faith = { + faith_hostility_level = { + target = scope:recipient.faith + value >= faith_astray_level + } + } + } + } +} + +# Request title troops from an allied fellow vassal +# +# Referenced in code +request_ally_title_troops_interaction = { + category = interaction_category_admin + desc = request_ally_title_troops_interaction_desc + hidden = yes + + ai_maybe = yes + ai_min_reply_days = 1 + ai_max_reply_days = 3 + popup_on_receive = yes + + greeting = positive + notification_text = REQUEST_TITLE_TROOPS_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + ai_targets = { ai_recipients = peer_vassals } + ai_target_quick_trigger = { adult = yes } + ai_frequency = 36 + + cooldown_against_recipient = { years = 1 } + + target_type = title + target_filter = recipient_domain_titles + + redirect = { + } + + cost = { + influence = { + value = 0 + if = { + limit = { exists = scope:target } + add = scope:target.admin_title_troop_command_cost_value + } + } + } + + is_shown = { + scope:actor = { + has_government = administrative_government + is_independent_ruler = no + is_governor = yes + } + scope:recipient = { + has_government = administrative_government + NOT = { + this = scope:actor + this = scope:actor.top_liege + } + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = admin_troops_have_no_troops_desc + scope:recipient = { + any_maa_regiment = { + is_title_maa_regiment = yes + regiment_owning_title = { holder = scope:recipient } + } + } + } + custom_tooltip = { + text = admin_troops_can_request_from_governor_desc + scope:actor = { + OR = { + is_allied_to = scope:recipient + has_hook = scope:recipient + is_liege_or_above_of = scope:recipient + AND = { + culture ?= { has_cultural_parameter = frontier_themes_borrow_neighbor_troops } + vassal_contract_has_flag = admin_theme_frontier + any_character_to_title_neighboring_duchy = { + holder ?= { + this = scope:recipient + NOT = { vassal_contract_has_flag = admin_theme_frontier } + } + } + } + AND = { + has_perk = friendly_counsel_perk + has_relation_friend = scope:recipient + } + AND = { + has_perk = mortal_adoration_perk + has_relation_lover = scope:recipient + } + } + } + } + + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + is_noble_family_title = no + } + } + + can_send = { + custom_tooltip = { + text = admin_troops_target_title_has_maa_desc + scope:target = { + any_owned_title_maa_regiment = { exists = this } + } + } + trigger_if = { + limit = { + scope:target = { + any_owned_title_maa_regiment = { exists = this } + } + } + custom_tooltip = { + text = admin_troops_target_title_controls_maa_desc #admin_troops_target_title_has_maa_desc + scope:target = { + any_owned_title_maa_regiment = { regiment_controlling_title = scope:target } + } + } + } + } + + on_send = { + } + + on_accept = { + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_neutral + title = request_governorship_interaction_toast_liege + left_icon = scope:actor + right_icon = scope:target + scope:target = { + transfer_owned_maa_control = scope:actor.primary_title + + # Set up a timer to allow the owner to take back the troops when duration runs out + set_variable = { + name = title_troops_lent_out + years = admin_troops_reclaim_cost_cooldown_value + } + } + } + } + scope:actor = { + hidden_effect = { + send_interface_message = { + type = msg_admin_provincial_army_request_accepted + title = msg_admin_provincial_army_request_accepted.title + left_icon = scope:recipient + right_icon = scope:target + show_as_tooltip = { + scope:target = { + transfer_owned_maa_control = scope:actor.primary_title + } + } + } + } + } + } + + on_decline = { + scope:actor = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -15 + } + } + hidden_effect = { + send_interface_message = { + type = msg_admin_provincial_army_request_denied + title = msg_admin_provincial_army_request_denied.title + desc = msg_admin_provincial_army_request_denied.desc + left_icon = scope:recipient + right_icon = scope:target + } + } + } + } + + ai_potential = { + is_governor = yes + } + + ai_will_do = { + base = 0 # AI uses this interaction from code + } + + ai_accept = { + base = 100 + + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + desc = AI_SIMPLE_OPINION_REASON + } + modifier = { # Target is less likely to accept if at war + scope:recipient = { + is_at_war = yes + } + scope:target = { + holder = scope:recipient + } + add = -200 + desc = TARGET_IS_AT_WAR_REASON + } + } +} + +request_emperor_title_troops_interaction = { + category = interaction_category_admin + interface_priority = 60 + common_interaction = yes + desc = request_emperor_title_troops_interaction_desc + hidden = yes + + ai_maybe = yes + ai_min_reply_days = 4 + ai_max_reply_days = 9 + popup_on_receive = yes + + greeting = positive + notification_text = REQUEST_TITLE_TROOPS_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + ai_targets = { ai_recipients = liege } + ai_target_quick_trigger = { adult = yes } + ai_frequency = 24 + + cooldown_against_recipient = { years = 1 } + + target_type = title + target_filter = recipient_de_jure_titles + + redirect = { + scope:actor.top_liege = { save_scope_as = recipient } + } + + cost = { + influence = { + value = 0 + if = { + limit = { exists = scope:target } + add = scope:target.admin_title_troop_command_cost_value + } + } + } + + is_shown = { + scope:actor = { + has_government = administrative_government + is_independent_ruler = no + is_governor = yes + } + scope:recipient = { + has_government = administrative_government + this = scope:actor.liege + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = admin_troops_not_available_desc + scope:recipient = { + OR = { + any_vassal = { + any_maa_regiment = { + is_title_maa_regiment = yes + } + any_held_title = { + any_owned_title_maa_regiment = { regiment_owning_title = prev } + } + } + any_maa_regiment = { + is_title_maa_regiment = yes + regiment_owning_title = { holder = scope:recipient } + } + } + } + } + + scope:actor = { + is_at_war_with_liege = no + } + + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + } + NOT = { + scope:recipient = { has_variable = admin_request_troop_cooldown } + } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier >= tier_duchy + is_noble_family_title = no + exists = holder + holder.top_liege = scope:recipient + NOT = { holder = scope:actor } + any_title_maa_regiment = { + exists = this + } + } + scope:recipient = { + primary_title ?= { + NOT = { this = scope:target } + } + } + } + + can_send = { + custom_tooltip = { + text = admin_troops_target_title_controls_maa_desc + scope:target = { + any_owned_title_maa_regiment = { regiment_controlling_title = scope:target } + } + } + } + + on_send = { + } + + # Hook + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + NOT = { + scope:recipient = { has_hook = scope:actor } + } + } + flag = hook + localization = GENERIC_SPEND_A_HOOK + } + # Dominant Family + send_option = { + is_shown = { + scope:actor = { + house ?= { is_dominant_family = yes } + } + } + flag = dominant_family + localization = OPTION_DOMINANT_FAMILY + } + should_use_extra_icon = { + scope:actor = { has_usable_hook = scope:recipient } + } + send_options_exclusive = no + + on_accept = { + if = { + limit = { + scope:hook = yes + scope:actor = { has_usable_hook = scope:recipient } + } + scope:actor = { + use_hook = scope:recipient + } + } + if = { + limit = { scope:dominant_family = yes } + scope:actor = { + change_influence = medium_influence_loss + } + } + scope:actor = { + if = { + limit = { + is_ai = yes + } + add_opinion = { + target = scope:recipient + modifier = grateful_opinion + opinion = 10 + } + } + hidden_effect = { + send_interface_message = { + type = msg_admin_provincial_army_request_accepted + title = msg_admin_provincial_army_request_accepted.title + left_icon = scope:recipient + right_icon = scope:target + show_as_tooltip = { + scope:target = { + transfer_owned_maa_control = scope:actor.primary_title + } + } + } + } + } + scope:recipient = { + if = { + limit = { + is_ai = yes + } + custom_tooltip = request_emperor_title_troops_approve_desc + } + + # Set up AI cooldown to prevent spam + if = { + limit = { + NOT = { has_variable = admin_request_troop_cooldown } + } + set_variable = { + name = admin_request_troop_cooldown + years = 2 + } + } + } + scope:target = { + transfer_owned_maa_control = scope:actor.primary_title + + # Set up a timer to allow the owner to take back the troops when duration runs out + set_variable = { + name = title_troops_lent_out + years = admin_troops_reclaim_cost_cooldown_value + } + } + } + + on_decline = { + scope:actor = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -20 + } + } + hidden_effect = { + send_interface_message = { + type = msg_admin_provincial_army_request_denied + title = msg_admin_provincial_army_request_denied.title + desc = msg_admin_provincial_army_request_denied.desc + left_icon = scope:recipient + right_icon = scope:target + } + } + } + scope:recipient = { + if = { + limit = { + is_ai = yes + } + custom_tooltip = request_emperor_title_troops_deny_desc + } + if = { + limit = { scope:dominant_family = yes } + change_influence = medium_influence_loss + } + + # Set up AI cooldown to prevent spam + if = { + limit = { + NOT = { has_variable = admin_request_troop_cooldown } + } + set_variable = { # If declined, we make the cooldown a bit longer to prevent the AI from asking again too soon + name = admin_request_troop_cooldown + years = 5 + } + } + else = { # Just in case - If we have a cooldown already, refresh it + remove_variable = admin_request_troop_cooldown + set_variable = { + name = admin_request_troop_cooldown + years = 5 + } + } + } + } + + ai_potential = { + is_governor = yes # Only governors may ask for troops + NOT = { # Don't ask for more troops if you have borrowed some already + any_maa_regiment = { + is_title_maa_regiment = yes + regiment_owning_title = { holder = root } + } + } + } + + ai_will_do = { + base = 0 + + # Some governors are more likely to ask than others + modifier = { + add = 50 + scope:actor = { + vassal_contract_has_flag = admin_theme_frontier + } + } + modifier = { + add = 25 + scope:actor = { + vassal_contract_has_flag = admin_theme_naval + } + } + ai_value_modifier = { + who = scope:actor + ai_greed = 0.25 + ai_boldness = 0.5 + } + modifier = { + add = 20 + is_at_war = yes + } + + # Don't ask for the liege's troops if you can help it + modifier = { + add = -10 + scope:target ?= { + holder = scope:recipient + } + } + modifier = { + add = -30 + scope:recipient = { primary_title = scope:target } + } + + # Don't bother the liege if they are at war + modifier = { + add = -100 + scope:recipient = { is_at_war = yes } + } + + # Consider which title we would like to request troops from + modifier = { # Don't ask for troops owned by your own house if we can help it + add = -20 + scope:target = { holder.house ?= root.house } + } + modifier = { # Larger armies are more enticing, so ask for troops from a military theme + add = 10 + scope:target.holder = { vassal_contract_has_flag = admin_theme_military } + } + modifier = { # Smaller armies are not as exciting, so don't ask for troops from a civilian theme + add = -5 + scope:target.holder = { vassal_contract_has_flag = admin_theme_civilian } + } + modifier = { # Don't request troops that may join your wars + add = 10 + scope:target.holder = { + NOT = { is_allied_to = root } + } + } + + # Some governors never asks for troops + modifier = { + factor = 0 + scope:actor = { + OR = { + vassal_contract_has_flag = admin_theme_balanced + vassal_contract_has_flag = admin_theme_civilian + } + } + } + } + + ai_accept = { + base = -20 + + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + desc = AI_SIMPLE_OPINION_REASON + } + modifier = { + add = -20 + scope:recipient = { + has_trait = paranoid + } + desc = INTERACTION_PARANOID + } + modifier = { + add = 10 + scope:recipient = { + has_trait = trusting + } + desc = INTERACTION_TRUSTING + } + modifier = { + scope:hook = yes + add = 50 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:dominant_family = yes + add = 100 + desc = your_house_is_dominant_reason + } + modifier = { + scope:actor = { + is_at_war = no + } + add = -20 + desc = IS_NOT_AT_WAR_REASON + } + modifier = { + scope:actor = { + vassal_contract_has_flag = admin_theme_military + } + add = 20 + desc = IS_A_MILITARY_THEME + } + modifier = { + scope:actor = { + vassal_contract_has_flag = admin_theme_frontier + } + add = 30 + desc = IS_A_FRONTIER_THEME + } + modifier = { + scope:actor = { + vassal_contract_has_flag = admin_theme_naval + } + add = 25 + desc = IS_A_NAVAL_THEME + } + modifier = { + scope:recipient = { + is_at_war = no + } + scope:target = { + holder = scope:recipient + } + add = -50 + desc = TARGETS_OWN_TROOPS_REASON + } + modifier = { # Asking for the liege's troops when he is at war + scope:recipient = { + is_at_war = yes + } + scope:target = { + holder = scope:recipient + } + add = -200 + desc = TARGET_IS_AT_WAR_REASON + } + modifier = { # Asking for a governor's troops when they are at war + scope:target = { + holder = { is_at_war = yes } + NOT = { holder = scope:recipient } + } + add = -50 + desc = TARGET_IS_AT_WAR_REASON + } + modifier = { + scope:actor = { + any_held_title = { + any_controlled_title_maa_regiment = { + regiment_owning_title = { + NOT = { holder = scope:actor } + } + } + } + } + add = { + value = 0 + scope:actor = { + every_held_title = { + every_controlled_title_maa_regiment = { + limit = { + regiment_owning_title = { + NOT = { holder = scope:actor } + } + } + add = { + value = maa_size + multiply = -10 + } + } + } + } + } + desc = CONTROLS_EXTRA_TROOPS_REASON + } + } +} + +request_title_troops_back_interaction = { + category = interaction_category_admin + desc = request_title_troops_back_interaction_desc + + hidden = yes + popup_on_receive = yes + + greeting = positive + notification_text = REQUEST_TITLE_TROOPS_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + ai_targets = { ai_recipients = liege } + ai_target_quick_trigger = { adult = yes } + ai_frequency = 24 + + cooldown_against_recipient = { years = 1 } + + target_type = title + target_filter = actor_de_jure_titles + + redirect = { + } + + cost = { + influence = { + value = { + add = { + value = define:NAdministrative|BASE_REASSIGN_COST + } + desc = BASE + } + if = { + limit = { + exists = scope:target + scope:target = { + NOT = { has_variable = title_troops_lent_out } + any_owned_title_maa_regiment = { + regiment_controlling_title = { + NOT = { holder = scope:actor.top_liege } + } + } + } + } + subtract = { + value = { + value = define:NAdministrative|BASE_REASSIGN_COST + multiply = 0.8 + } + desc = admin_troops_borrowed_years_desc + } + } + } + } + + is_shown = { + scope:actor = { + has_government = administrative_government + is_independent_ruler = no + is_ai = no # The AI should not request their troops back ahead of time + } + scope:recipient = { + has_government = administrative_government + this = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + custom_tooltip = { + text = admin_troops_already_at_home_desc + any_held_title = { + any_owned_title_maa_regiment = { + regiment_controlling_title = { + NOT = { holder = scope:actor } + } + } + } + } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + any_owned_title_maa_regiment = { + regiment_controlling_title = { + NOT = { this = scope:target } + } + } + } + } + + can_send = { + custom_tooltip = { + text = admin_troops_controlled_by_liege_desc + scope:target = { + any_owned_title_maa_regiment = { + regiment_controlling_title = { + NOT = { holder = scope:actor.top_liege } + } + } + } + } + } + + on_send = { + } + + auto_accept = yes + + on_accept = { + scope:target = { + custom_tooltip = { + text = admin_troops_transfer_troops_back_desc + every_owned_title_maa_regiment = { + limit = { + regiment_controlling_title = { + NOT = { this = scope:target } + } + } + transfer_title_maa = regiment_owning_title + } + } + + # Clear cost timer if present + if = { + limit = { + has_variable = title_troops_lent_out + } + remove_variable = title_troops_lent_out + } + } + } + + on_decline = { + } + + ai_potential = { + always = no + } + + ai_will_do = { + base = 0 + } + + ai_accept = { + base = 100 + } +} + +# Request Raid Estate Remit +request_raid_remit_interaction = { + icon = icon_request_raid_remit + category = interaction_category_admin + interface_priority = 90 + + desc = request_raid_remit_interaction_desc + use_diplomatic_range = yes + + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + cooldown_against_recipient = { years = 5 } + + is_shown = { + scope:actor = { + is_independent_ruler = no + has_government = administrative_government + } + scope:secondary_recipient ?= { + NOT = { house = scope:recipient.house } + top_liege = scope:actor.top_liege + NOT = { house = scope:actor.house } + has_government = administrative_government + any_held_title = { is_noble_family_title = yes } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + custom_tooltip = { + text = raid_estate_noble_family_tt + any_held_title = { is_noble_family_title = yes } + house.house_head ?= this + } + custom_tooltip = { + text = raid_estate_already_remit_tt + NOT = { exists = var:raid_estate_permission } + } + } + scope:recipient.house.house_head ?= { + custom_tooltip = { + text = raid_estate_noble_family_target_tt + any_held_title = { is_noble_family_title = yes } + } + custom_tooltip = { + text = raid_estate_estate_tt + domicile ?= { is_domicile_type = estate } + } + } + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + } + } + + populate_recipient_list = { + scope:actor.top_liege = { + every_noble_family = { + limit = { + NOR = { + holder = scope:actor + holder = scope:actor.top_liege + } + } + holder = { add_to_list = characters } + } + } + } + + redirect = { + scope:recipient.house.house_head ?= { save_scope_as = secondary_recipient } + scope:actor.top_liege = { save_scope_as = recipient } + } + + send_option = { + is_valid = { scope:actor.gold >= scope:actor.minor_gold_value } + flag = gold + localization = GENERIC_SPEND_GOLD + } + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + NOT = { + scope:recipient = { has_hook = scope:actor } + } + } + 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" + + send_options_exclusive = no + + on_accept = { + if = { + limit = { scope:gold = yes } + scope:actor = { + pay_short_term_gold = { + target = scope:recipient + gold = scope:actor.minor_gold_value + } + } + } + scope:recipient = { custom_tooltip = request_raid_remit_interaction_effect_tt } + custom_tooltip = request_raid_remit_interaction_duration_tt + hidden_effect = { + scope:actor = { trigger_event = ep3_interactions_events.0421 } + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = request_raid_remit_effect_toast + left_icon = scope:recipient + right_icon = scope:actor + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_bad + title = request_raid_remit_effect_toast + left_icon = scope:recipient + right_icon = scope:actor + if = { + limit = { scope:actor = { is_ai = yes } } + reverse_add_opinion = { + modifier = angry_opinion + opinion = -20 + target = scope:actor + } + } + if = { + limit = { is_ai = yes } + add_opinion = { + modifier = respect_opinion + opinion = -10 + target = scope:actor + } + } + } + } + } + } + } + + cost = { + influence = { + add = scope:actor.massive_influence_value + # Being a Powerful or Dominant Family reduces the cost significantly + scope:actor.house = { + if = { + limit = { is_dominant_family = yes } + add = { + value = massive_influence_value + multiply = -0.75 + desc = is_dominant_family_desc + } + } + else_if = { + limit = { is_powerful_family = yes } + add = { + value = massive_influence_value + multiply = -0.5 + desc = is_powerful_family_desc + } + } + } + } + } + + ai_potential = { + is_house_head = yes + house ?= { + any_house_member = { + count <= 5 + is_alive = yes + } + } + } + + ai_targets = { + ai_recipients = peer_vassals + ai_recipients = scripted_relations + max = 10 + } + + ai_accept = { + base = -30 + modifier = { + scope:hook = yes + add = 40 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:gold = yes + add = 25 + desc = SCHEME_WITH_GIFT_SIGNIFICANT + } + modifier = { # Target house is powerful + add = -10 + desc = MY_HOUSE_IS_POWERFUL + scope:secondary_recipient.house ?= { is_powerful_family = yes } + } + modifier = { # Target house is dominant + add = -25 + desc = MY_HOUSE_IS_DOMINANT + scope:secondary_recipient.house ?= { is_dominant_family = yes } + } + modifier = { + scope:actor.house = { is_powerful_family = yes } + add = 10 + desc = YOUR_FAMILY_IS_POWERFUL + } + modifier = { + scope:actor.house = { is_dominant_family = yes } + add = 25 + desc = YOUR_FAMILY_IS_DOMINANT + } + modifier = { + scope:recipient.primary_spouse ?= { house ?= scope:secondary_recipient.house } + add = -10 + desc = MY_SPOUSES_HOUSE + } + modifier = { + any_child = { house = scope:secondary_recipient.house } + add = -10 + desc = MY_CHILDS_HOUSE + } + modifier = { + is_close_family_of = scope:secondary_recipient + add = -10 + desc = TARGET_IS_MY_CLOSE_FAMILY + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + } + opinion_modifier = { + opinion_target = scope:secondary_recipient + multiplier = -0.5 + } + modifier = { + has_relation_rival = scope:secondary_recipient + add = 10 + desc = THEY_ARE_MY_RIVAL + } + modifier = { + add = -10 + desc = THEY_ARE_MY_FRIEND + scope:secondary_recipient = { has_relation_friend = scope:recipient } + } + modifier = { # You're my friend :) + add = 10 + desc = youre_my_friend_tt + has_relation_friend = scope:actor + } + modifier = { # You're my rival >:( + add = -10 + desc = ai_opinion.reason.relation.rival + has_relation_rival = scope:actor + } + modifier = { # You're my guardian + add = 10 + desc = youre_my_guardian_tt + has_relation_guardian = scope:actor + } + ai_value_modifier = { + ai_boldness = -0.2 + ai_honor = -0.2 + } + } + + ai_frequency = 120 + + ai_will_do = { + base = -25 + opinion_modifier = { # Opinion + opinion_target = scope:recipient + multiplier = -0.5 + } + modifier = { # My rival + add = 25 + scope:actor = { has_relation_rival = scope:recipient } + } + modifier = { # My friend + add = -25 + scope:actor = { has_relation_friend = scope:recipient } + } + modifier = { + existing_feud_against_target_trigger = { TARGET = scope:recipient } + add = 15 + } + } +} + +# Request to become co-emperor +request_co_emperor_interaction = { + category = interaction_category_diarch + icon = icon_declare_me_co_emperor + + desc = request_co_emperor_interaction_desc + notification_text = DECLARE_ME_CO_EMPEROR_PROPOSAL + + interface_priority = 20 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + # AI + ai_targets = { ai_recipients = liege } + ai_frequency = 60 + ai_target_quick_trigger = { adult = yes } + + cooldown_against_recipient = { years = 10 } + + redirect = { + scope:recipient = { save_scope_as = secondary_recipient } + } + + cost = { + influence = { + add = { + add = { + value = scope:actor.monumental_influence_value + multiply = 2 + } + desc = BASE + } + # Being a Powerful or Dominant Family reduces the cost significantly + scope:actor.house = { + if = { + limit = { is_dominant_family = yes } + multiply = { + value = 0.25 + desc = is_dominant_family_desc + } + } + else_if = { + limit = { is_powerful_family = yes } + multiply = { + value = 0.5 + desc = is_powerful_family_desc + } + } + } + if = { + limit = { scope:influence = yes } + add = { + add = scope:actor.request_co_emperor_interaction_influence_cost_value + desc = SPEND_INFLUENCE + } + } + } + + gold = { + if = { + limit = { scope:gold = yes } + add = { + add = scope:recipient.request_co_emperor_interaction_gold_cost_value + desc = SCHEME_AGENT_GOLD + } + } + } + } + + is_shown = { + scope:actor = { + has_government = administrative_government + is_independent_ruler = no + } + scope:recipient = { + this = scope:actor.top_liege + may_appoint_co_emperors_trigger = yes + } + } + + is_valid_showing_failures_only = { + scope:actor = { + valid_co_emperor_candidate_trigger = { LIEGE = scope:recipient } + NOT = { is_at_war_with = scope:recipient } + } + scope:recipient = { + is_at_war = no + has_active_diarchy = no + trigger_if = { + limit = { exists = designated_diarch } + time_after_diarch_designated = { years >= 10 } + } + } + } + + send_options_exclusive = no + #Spend influence + send_option = { + flag = influence + is_valid = { scope:actor.influence >= request_co_emperor_interaction_influence_cost_value } + localization = SPEND_INFLUENCE + } + #Promise gold. + send_option = { + flag = gold + is_valid = { scope:actor.gold >= scope:recipient.request_co_emperor_interaction_gold_cost_value } + localization = SCHEME_AGENT_GOLD + } + #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" + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = declare_me_co_emperor_interaction.tt.success + left_icon = scope:recipient + scope:recipient = { + custom_tooltip = { + text = declare_me_co_emperor_interaction.tt.effect + start_diarchy = co_emperorship + set_diarch = scope:actor + } + if = { + limit = { + scope:actor = { + is_child_of = scope:recipient + } + } + + designated_heir ?= { + if = { + limit = { this != scope:actor } + custom_tooltip = appoint_co_emperor_interaction.tt.overwrite_designated_heir + # Nab them for use further on. + save_scope_as = old_heir + } + } + hidden_effect = { set_designated_heir = scope:actor } + } + } + } + if = { + limit = { + scope:hook = yes + has_usable_hook = scope:recipient + } + # Use the hook up. + use_hook = scope:recipient + reverse_add_opinion = { + target = scope:recipient + modifier = suspicion_opinion + opinion = -20 + } + } + if = { + limit = { scope:gold = yes } + show_as_tooltip = { + pay_short_term_gold = { + target = scope:recipient + gold = scope:recipient.request_co_emperor_interaction_gold_cost_value + } + } + hidden_effect = { + scope:recipient = { add_gold = request_co_emperor_interaction_gold_cost_value } + } + } + } + if = { + limit = { scope:influence = yes } + scope:recipient = { change_influence = scope:actor.request_co_emperor_interaction_influence_cost_value } + } + # And remember who appointed them on scope:recipient. + scope:actor = { + set_variable = { + name = co_emp_appointer + value = scope:recipient + } + } + + # Your designated heir is _very_ pissed. + if = { + limit = { + exists = scope:old_heir + } + diarch_overwrites_old_designated_heir_apply_opinions_effect = { + LIEGE = scope:recipient + CO_RULER = scope:actor + } + } + } + + on_decline = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_bad + title = declare_me_co_emperor_interaction.tt.failure + left_icon = scope:recipient + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:recipient + modifier = insult_opinion + opinion = -40 + } + } + change_strife_opinion = medium_strife_gain + } + } + } + + ai_potential = { + NOR = { + has_trait = humble + has_trait = content + } + } + + 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 + } + # Dominant family have ambitions. + modifier = { + add = 25 + is_house_head = yes + house ?= { is_dominant_family = yes } + } + # Pretenders. + modifier = { + add = 25 + NOT = { is_close_family_of = scope:recipient } + has_claim_on = scope:recipient.primary_title + } + # Designated Heir + modifier = { + add = 25 + scope:recipient.designated_heir ?= this + } + # Flag management. + ## Hook used + modifier = { + add = 1 + scope:hook = yes + } + ## Influence traded. + modifier = { + add = 3 + scope:influence = yes + } + ## Gold traded. + modifier = { + add = 2 + scope:gold = yes + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + scope:recipient = { is_ai = yes } + } + } + + ai_accept = { + # Try to make it 0 for most interactions + base = -150 + # 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 = { + NOT = { + house = scope:recipient.house + } + } + } + ## Dominant family + modifier = { + scope:actor.house = { + is_dominant_family = yes + NOT = { this = scope:recipient.house } + } + add = 10 + desc = YOUR_FAMILY_IS_DOMINANT + } + ## Powerful family + modifier = { + scope:actor.house = { + is_powerful_family = yes + is_dominant_family = no + NOT = { this = scope:recipient.house } + } + add = 5 + desc = YOUR_FAMILY_IS_POWERFUL + } + ## Powerful family + modifier = { + scope:recipient.designated_heir ?= scope:actor + add = 25 + desc = YOU_ARE_MY_DESIGNATED_HEIR + } + # 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 = { + value = "scope:actor.appointment_candidate_score(scope:recipient.primary_title)" + divide = 4 + min = 0 + max = 100 + } + desc = declare_me_regent_interaction.tt.actor_is.succession_score + } + # Send options. + ## Hook used + modifier = { + add = 50 + desc = SCHEME_WEAK_HOOK_USED + scope:hook = yes + } + ## Influence traded. + modifier = { + add = 50 + desc = INFLUENCE_REASON + scope:influence = yes + } + ## Gold traded. + modifier = { + add = 50 + desc = GOLD_REASON + scope:gold = yes + } + } +} + +# Request a character to fight a war on your behalf - AKA Summon to War/summon_to_war +frontier_influence_war_interaction = { + category = interaction_category_admin + interface_priority = 80 + icon = icon_coax_to_war + desc = frontier_influence_war_interaction_desc + + is_highlighted = { + scope:recipient = { + is_at_war = no + is_adult = yes + custom_tooltip = { + text = admin_theme_type_trigger + OR = { + vassal_contract_has_flag = admin_theme_frontier + vassal_contract_has_flag = admin_theme_naval + } + } + } + } + + target_type = title + target_filter = secondary_recipient_de_jure_titles + can_be_picked_title = { + scope:target = { + is_title_created = yes + tier = tier_duchy + } + } + + populate_recipient_list = { + scope:recipient = { + if = { + limit = { vassal_contract_has_flag = admin_theme_frontier } + every_character_to_title_neighboring_duchy = { + limit = { + holder ?= { top_liege != scope:actor.top_liege } + } + holder ?= { add_to_list = characters } + } + } + else_if = { + limit = { vassal_contract_has_flag = admin_theme_naval } + every_character_to_title_neighboring_and_across_water_duchy = { + limit = { + holder ?= { top_liege != scope:actor.top_liege } + } + holder ?= { add_to_list = characters } + } + } + } + } + + redirect = { + scope:recipient = { + if = { + limit = { vassal_contract_has_flag = admin_theme_frontier } + random_character_to_title_neighboring_duchy = { + limit = { + exists = holder + holder = { top_liege != scope:actor.top_liege } + } + holder = { save_scope_as = secondary_recipient } + } + } + else_if = { + limit = { vassal_contract_has_flag = admin_theme_naval } + random_character_to_title_neighboring_and_across_water_duchy = { + limit = { + exists = holder + holder = { top_liege != scope:actor.top_liege } + } + holder = { save_scope_as = secondary_recipient } + } + } + } + } + + has_valid_target = { + scope:target = { + is_title_created = yes + tier = tier_duchy + holder.top_liege != scope:actor + } + } + + ai_min_reply_days = 3 + ai_max_reply_days = 9 + popup_on_receive = yes + ai_maybe = yes + can_send_despite_rejection = yes + + greeting = positive + notification_text = REQUEST_DUCHY_INFLUENCE_WAR_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + cooldown_against_recipient = { years = 10 } + + is_shown = { + scope:actor = { + is_independent_ruler = yes + has_government = administrative_government + NOT = { government_has_flag = government_is_landless_adventurer } + } + scope:recipient = { + has_government = administrative_government + NOT = { government_has_flag = government_is_landless_adventurer } + custom_tooltip = { + text = admin_theme_type_trigger + OR = { + vassal_contract_has_flag = admin_theme_frontier + vassal_contract_has_flag = admin_theme_naval + } + } + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor != scope:recipient + scope:recipient = { + is_at_war = no + is_adult = yes + custom_tooltip = { + text = admin_theme_type_trigger + OR = { + vassal_contract_has_flag = admin_theme_frontier + vassal_contract_has_flag = admin_theme_naval + } + } + + custom_tooltip = { + text = admin_vassal_war_no_target_desc + trigger_if = { + limit = { vassal_contract_has_flag = admin_theme_frontier } + any_character_to_title_neighboring_duchy = { + exists = holder + holder = { top_liege != scope:actor.top_liege } + } + } + trigger_if= { + limit = { vassal_contract_has_flag = admin_theme_naval } + any_character_to_title_neighboring_and_across_water_duchy = { + exists = holder + holder = { top_liege != scope:actor.top_liege } + } + } + } + } + } + + send_options_exclusive = no + send_option = { + flag = title_maa + localization = send_option_title_troops + is_valid = { + scope:actor = { + is_at_war = no + custom_tooltip = { + text = all_title_maa_must_not_be_raised_tt + primary_title = { + NOT = { + any_controlled_title_maa_regiment = { + is_raised = yes + } + } + } + } + } + } + } + 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 = { + if = { + limit = { scope:title_maa = yes } + scope:actor.primary_title = { + transfer_owned_maa_control = scope:recipient.primary_title + } + } + scope:recipient = { + start_war = { + cb = influence_war_cb + target = scope:secondary_recipient + claimant = scope:recipient.top_liege + target_title = scope:target + } + custom_tooltip = frontier_influence_war_interaction_target_title_tt + } + scope:actor = { + trigger_event = ep3_interactions_events.0210 + } + } + + on_decline = { + scope:recipient = { + change_influence = major_influence_loss + } + scope:actor = { + if = { + limit = { is_ai = yes } + add_opinion = { + modifier = refused_summons_to_war_opinion + target = scope:recipient + } + } + trigger_event = ep3_interactions_events.0211 + } + } + + cost = { + prestige = { + # BASE COSTS + add = { + value = massive_prestige_value + desc = BASE + } + # DOMINANT FAMILY DISCOUNTS + if = { + limit = { scope:actor.house ?= { is_dominant_family = yes } } + multiply = { + value = 0.75 + desc = DOMINANT_FAMILY_DISCOUNT + } + } + # DOMICILE BUILDING DISCOUNTS + } + } + + ai_potential = { + has_government = administrative_government + is_independent_ruler = yes + } + + ai_targets = { + ai_recipients = vassals + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + } + } + + ai_accept = { + base = 0 + modifier = { # My house is powerful + add = -10 + desc = MY_HOUSE_IS_POWERFUL + house ?= { is_powerful_family = yes } + } + modifier = { # My house is dominant + add = -25 + desc = MY_HOUSE_IS_DOMINANT + house ?= { is_dominant_family = yes } + } + modifier = { + scope:actor.house = { is_powerful_family = yes } + add = 10 + desc = YOUR_FAMILY_IS_POWERFUL + } + modifier = { + scope:actor.house = { is_dominant_family = yes } + add = 25 + desc = YOUR_FAMILY_IS_DOMINANT + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + } + modifier = { # You're my friend :) + add = 10 + desc = youre_my_friend_tt + has_relation_friend = scope:actor + } + modifier = { # You're my guardian + add = 10 + desc = youre_my_guardian_tt + has_relation_guardian = scope:actor + } + modifier = { + scope:actor = { + exists = house + } + scope:recipient = { + exists = house + } + exists = scope:actor.house.house_head.top_liege + house.house_head.top_liege ?= scope:actor.house.house_head.top_liege + add = { + value = scope:actor.house.house_power_score + subtract = scope:recipient.house.house_power_score + } + desc = RELATIVE_FAMILY_RATING + } + modifier = { + exists = scope:actor.house + exists = house + scope:recipient.dynasty.dynasty_prestige_level != scope:actor.dynasty.dynasty_prestige_level + add = { + value = scope:actor.dynasty.dynasty_prestige_level + subtract = scope:recipient.dynasty.dynasty_prestige_level + multiply = 10 + } + desc = RELATIVE_FAMILY_RENOWN + } + modifier = { + faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= faith_astray_level + } + } + add = { + value = "faith.faith_hostility_level(scope:actor.faith)" + multiply = -10 + } + desc = FAITH_HOSTILITY_LEVEL + } + modifier = { + exists = scope:actor.top_liege.primary_title.state_faith + faith = { + faith_hostility_level = { + target = scope:actor.top_liege.primary_title.state_faith + value >= faith_astray_level + } + } + add = { + value = "faith.faith_hostility_level(scope:actor.top_liege.primary_title.state_faith)" + multiply = -5 + } + desc = FAITH_HOSTILITY_LEVEL_STATE_FAITH + } + modifier = { + culture != scope:actor.culture + "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" < 50 + add = { + value = 50 + subtract = "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" + multiply = -0.25 + round = yes + } + desc = CULTURAL_ACCEPTANCE + } + modifier = { + culture != scope:actor.culture + "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" >= 50 + add = { + value = "scope:recipient.culture.cultural_acceptance(scope:actor.culture)" + subtract = 50 + multiply = 0.25 + round = yes + } + desc = CULTURAL_ACCEPTANCE + } + modifier = { + add = scope:recipient.current_military_strength + desc = RECIPIENT_MILITARY_STRENGTH + } + modifier = { + add = scope:actor.current_military_strength + scope:title_maa = yes + desc = PROMISED_TITLE_MAA + } + modifier = { + add = { + value = scope:secondary_recipient.top_liege.current_military_strength + multiply = -1 + } + desc = SECONDARY_RECIPIENT_MILITARY_STRENGTH + } + modifier = { # Must not be at war already + is_at_war = yes + add = -1000 + desc = ALREADY_AT_WAR + } + } + + ai_frequency = 120 + + ai_will_do = { + base = 50 + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + modifier = { # My house needs more members + add = 100 + scope:actor.house = { + any_house_member = { + count < 3 + save_temporary_scope_as = house_member_temp + NOT = { + scope:actor.top_liege.faith = { has_dominant_ruling_gender = scope:house_member_temp } + } + } + } + } + opinion_modifier = { # Opinion + opinion_target = scope:recipient + multiplier = 0.5 + } + modifier = { # My rival + add = -25 + scope:actor = { has_relation_rival = scope:recipient } + } + modifier = { # My friend + add = 25 + scope:actor = { has_relation_friend = scope:recipient } + } + modifier = { # My ward + add = 25 + scope:actor = { has_relation_guardian = scope:recipient } + } + modifier = { # I care about bloodlines and dynasties and whatnot + add = -25 + scope:actor = { + OR = { + has_trait = arrogant + has_trait = callous + } + } + } + modifier = { # I will not adopt filthy filthy heretics + factor = 0 + ai_zeal >= medium_positive_ai_value + faith = { + faith_hostility_level = { + target = scope:recipient.faith + value >= faith_astray_level + } + } + } + modifier = { # I'll not make them start a war they'll surely lose + factor = 0 + scope:recipient.current_military_strength < { + value = scope:secondary_recipient.current_military_strength + multiply = 0.75 + } + } + } +} + +#House Head requests to landed family member - AKA Request as House Head +house_head_request_interaction = { + icon = house_head_request_interaction + category = interaction_category_admin + common_interaction = yes + desc = house_head_request_interaction_desc + + ai_maybe = yes + ai_min_reply_days = 4 + ai_max_reply_days = 9 + can_send_despite_rejection = yes + popup_on_receive = yes + + greeting = positive + notification_text = HOUSE_HEAD_REQUEST_PROPOSAL + + pre_answer_yes_key = ACCEPT + pre_answer_no_key = DECLINE + + ai_targets = { + ai_recipients = family + ai_recipients = peer_vassals + ai_recipients = vassals + ai_recipients = liege + } + ai_target_quick_trigger = { adult = yes } + ai_frequency = 36 + + cooldown_against_recipient = { years = 10 } + cooldown = { years = 2 } + + redirect = { + } + + cost = { # If the cost changes, remember to update the on_send to give correct refund in the event + } + + is_shown = { + NOT = { scope:recipient = scope:actor } + scope:actor = { + has_government = administrative_government + this = house.house_head + } + scope:recipient = { + has_government = administrative_government + house = scope:actor.house + } + } + + is_valid_showing_failures_only = { + scope:actor = { + NOT = { is_at_war_with = scope:recipient } + } + scope:recipient = { + is_landed = yes + is_adult = yes + } + } + + send_options_exclusive = yes + send_option = { + flag = gold + localization = HH_ASK_FOR_GOLD + } + send_option = { + flag = hostile_schemes + localization = ASK_FOR_HOSTILE_SCHEMES_HELP + } + send_option = { + flag = personal_schemes + localization = ASK_FOR_PERSONAL_SCHEMES_HELP + } + send_option = { + flag = political_schemes + localization = ASK_FOR_POLITICAL_SCHEMES_HELP + } + send_option = { + is_valid = { + custom_tooltip = { + text = hh_recipient_has_valid_artifact + scope:recipient = { + any_character_artifact = { + save_temporary_scope_as = target_artifact + OR = { + scope:actor.house = { has_house_artifact_claim = scope:target_artifact } + scope:actor = { has_personal_artifact_claim = scope:target_artifact } + } + } + } + } + } + is_shown = { + scope:actor.domicile ?= { has_domicile_building_or_higher = cabinet_of_curiosities_01 } + + } + flag = artifact + localization = ASK_FOR_ARTIFACT + } + send_option = { + is_valid = { + custom_tooltip = { + text = hh_recipient_has_valid_knight + scope:recipient = { + number_of_knights > 0 + any_knight = { + is_acclaimed = no + is_landed = no + } + } + } + } + is_shown = { + OR = { + scope:actor.domicile ?= { has_domicile_building_or_higher = guardhouse_01 } + scope:actor.domicile ?= { has_domicile_building_or_higher = barracks_01 } + } + } + flag = knight + localization = ASK_FOR_KNIGHT + } + send_option = { + is_valid = { + trigger_if = { + limit = { + scope:actor = { + NOT = { + any_maa_regiment = { is_personal_maa_regiment = yes } + } + } + } + custom_tooltip = { + text = hh_has_personal_maa + scope:actor = { + any_maa_regiment = { is_personal_maa_regiment = yes } + } + } + } + trigger_else = { + custom_tooltip = { + text = hh_has_personal_maa_size + scope:actor = { + any_maa_regiment = { + is_personal_maa_regiment = yes + can_upgrade_maa = yes + } + } + } + } + custom_tooltip = { + text = hh_recipient_has_personal_maa + scope:recipient = { + any_maa_regiment = { + is_personal_maa_regiment = yes + } + } + } + } + is_shown = { + OR = { + scope:actor.domicile ?= { has_domicile_building_or_higher = guardhouse_03 } + scope:actor.domicile ?= { has_domicile_building_or_higher = barracks_01 } + scope:actor.domicile ?= { has_domicile_building_or_higher = watchtower_04 } + } + } + flag = maa + localization = ASK_FOR_MAA + } + send_option = { + is_shown = { + OR = { + scope:actor.domicile ?= { has_domicile_building_or_higher = storage_01 } + scope:actor.domicile ?= { has_domicile_building_or_higher = storage_warehouse_03 } + } + } + flag = building + localization = ASK_FOR_BUILDING + } + send_option = { + is_valid = { + custom_tooltip = { + text = hh_recipient_has_valid_courtier + scope:recipient = { + any_courtier_or_guest = { + ep3_interesting_courtier_to_ask_trigger = yes + } + } + } + } + flag = courtier + localization = ASK_FOR_COURTIER + } + + on_send = { + } + + on_accept = { + if = { + limit = { + scope:gold = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + + scope:recipient = { + pay_short_term_gold = { + target = scope:actor + gold = medium_gold_value + } + } + } + } + } + else_if = { + limit = { + scope:hostile_schemes = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + + custom_tooltip = { + text = hostile_schemes_help_request_tt + scope:actor = { + add_to_variable_list = { + name = supporting_hostile_schemes + target = scope:recipient + years = 10 + } + } + } + scope:recipient = { + add_character_modifier = { + modifier = hostile_schemes_distracted_modifier + years = 5 + } + } + } + } + } + else_if = { + limit = { + scope:personal_schemes = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + + custom_tooltip = { + text = personal_schemes_help_request_tt + scope:actor = { + add_to_variable_list = { + name = supporting_personal_schemes + target = scope:recipient + years = 10 + } + } + } + scope:recipient = { + add_character_modifier = { + modifier = personal_schemes_distracted_modifier + years = 5 + } + } + } + } + } + else_if = { + limit = { + scope:political_schemes = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + + custom_tooltip = { + text = political_schemes_help_request_tt + scope:actor = { + add_to_variable_list = { + name = supporting_political_schemes + target = scope:recipient + years = 10 + } + } + } + scope:recipient = { + add_character_modifier = { + modifier = political_schemes_distracted_modifier + years = 5 + } + } + } + } + } + else_if = { + limit = { + scope:artifact = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + right_icon = scope:target_artifact + + scope:recipient = { + random_character_artifact = { + limit = { + save_temporary_scope_as = target_artifact + OR = { + scope:actor.house = { has_house_artifact_claim = scope:target_artifact } + scope:actor = { has_personal_artifact_claim = scope:target_artifact } + } + } + save_scope_as = target_artifact + set_owner = scope:actor + } + } + } + } + } + else_if = { + limit = { + scope:knight = yes + } + scope:recipient = { + ordered_knight = { + limit = { + is_acclaimed = no + is_landed = no + } + order_by = prowess + save_scope_as = knight + } + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + right_icon = scope:knight + + scope:actor = { add_courtier = scope:knight } + } + } + } + else_if = { + limit = { + scope:maa = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + + scope:recipient = { + ordered_maa_regiment = { + limit = { + is_personal_maa_regiment = yes + } + save_scope_as = maa_regiment_decrease + } + scope:maa_regiment_decrease = { + change_maa_regiment_size = -1 + } + } + scope:actor = { + ordered_maa_regiment = { + limit = { + is_personal_maa_regiment = yes + can_upgrade_maa = yes + } + save_scope_as = maa_regiment_increase + } + scope:maa_regiment_increase = { + change_maa_regiment_size = { + size = 1 + reinforce = yes + } + } + } + } + } + } + else_if = { + limit = { + scope:building = yes + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + + scope:actor = { + add_to_variable_list = { + name = supporting_building + target = scope:recipient + years = 10 + } + add_character_modifier = { + modifier = estate_supporting_buildings_modifier + years = 10 + } + } + scope:recipient = { + add_prestige = medium_prestige_loss + } + } + } + } + else_if = { + limit = { + scope:courtier = yes + } + scope:recipient = { + random_courtier_or_guest = { + limit = { + ep3_interesting_courtier_to_ask_trigger = yes + } + save_scope_as = courtier + } + } + scope:actor = { + send_interface_message = { + type = event_toast_effect_good + title = house_head_request_accepted + left_icon = scope:recipient + right_icon = scope:courtier + + add_courtier = scope:courtier + } + } + } + } + + on_decline = { + scope:actor = { + send_interface_message = { + type = event_toast_effect_bad + title = house_head_request_denied + left_icon = scope:recipient + + scope:recipient = { + change_influence = major_influence_loss + } + } + } + + scope:actor = { + if = { + limit = { + is_ai = yes + } + add_opinion = { + target = scope:recipient + modifier = disrespect_opinion + opinion = -30 + } + } + } + } + + ai_potential = { + is_house_head = yes + } + + ai_will_do = { + base = 50 + } + + ai_accept = { + base = 100 + modifier = { + add = 25 + desc = CLOSE_FAMILY_REASON + scope:recipient = { + is_close_family_of = scope:actor + } + } + + modifier = { + add = 25 + desc = WE_ARE_FRIENDS + scope:recipient = { + has_relation_friend = scope:actor + } + } + + modifier = { + add = 50 + desc = WE_ARE_BEST_FRIENDS + scope:recipient = { + has_relation_best_friend = scope:actor + } + } + + modifier = { + add = 10 + desc = WE_ARE_LOVERS + scope:recipient = { + has_relation_lover = scope:actor + } + } + + modifier = { + add = -100 + desc = WE_ARE_RIVALS + scope:recipient = { + has_relation_rival = scope:actor + } + } + + modifier = { + add = -500 + desc = WE_ARE_NEMESES + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + } + modifier = { + # can't afford to be difficult + scope:recipient = { + influence <= major_influence_value + } + add = 30 + desc = INFLUENCE_USED + } + # Don't bankrupt the AI + modifier = { + scope:gold = yes + scope:recipient.gold <= medium_gold_value + add = -75 + desc = GOLD_NEGATIVE_REASON + } + # Personality + modifier = { + scope:recipient = { + has_trait = loyal + } + desc = INTERACTION_LOYAL + add = 20 + } + modifier = { + scope:recipient = { + has_trait = disloyal + } + desc = INTERACTION_DISLOYAL + add = -20 + } + } +} + +# Request Clergy Support / request_clergy_support +ep3_hof_ask_for_influence_interaction = { + icon = icon_influence_01 + category = interaction_category_religion + + desc = ep3_hof_ask_for_influence_interaction_desc + + ai_targets = { + ai_recipients = head_of_faith + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 24 + + cooldown_against_recipient = { years = 10 } + + is_shown = { + NOT = { + scope:recipient = scope:actor + } + scope:actor.faith = { + religious_head = scope:recipient + has_doctrine = doctrine_spiritual_head + } + scope:actor = { + is_playable_character = yes + has_government = administrative_government + is_lowborn = no + } + } + + is_valid_showing_failures_only = { + scope:actor = { + piety >= massive_piety_value + custom_description = { + text = "hof_ask_for_gold_excommunicated" + NOT = { has_trait = excommunicated } + } + NOT = { is_at_war_with = scope:recipient } + custom_description = { + text = "hof_interaction_unreformed_faith" + NOT = { + faith = { has_doctrine_parameter = unreformed } + } + } + custom_description = { + text = "hof_interaction_state_faith" + top_liege = { + government_allows = state_faith + exists = primary_title.state_faith + } + faith = { + this = scope:actor.top_liege.primary_title.state_faith + } + } + custom_description = { + text = "hof_interaction_has_house_modifier" + exists = house + house = { + NOT = { + has_house_modifier = ep3_requested_faith_support_modifier + } + } + } + custom_description = { + text = "hof_interaction_is_house_head" + exists = house + house = { + house_head = scope:actor + } + } + } + scope:recipient = { is_busy_in_events_localised = yes } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + } + } + + send_option = { + is_shown = { + NOT = { scope:actor = scope:recipient } + } + 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" + + send_options_exclusive = no + + ai_min_reply_days = 1 + ai_max_reply_days = 5 + + on_accept = { + ep3_hof_ask_for_influence_interaction_effect = yes + + scope:actor = { + trigger_event = ep3_interactions_events.0620 + } + } + + on_decline = { + scope:actor = { + trigger_event = ep3_interactions_events.0621 + } + } + + ai_potential = { + is_playable_character = yes + piety >= massive_piety_value + NOT = { has_trait = excommunicated } + highest_held_title_tier > tier_barony + exists = faith.religious_head + exists = house + } + + ai_accept = { + base = -50 + + opinion_modifier = { + opinion_target = scope:actor + who = scope:recipient + multiplier = 0.5 + } + + #Doesn't like the emperor... if you're not the emperor + modifier = { + add = 5 + scope:actor.top_liege = { + NOR = { + this = scope:actor + this = scope:recipient + } + reverse_opinion = { + target = scope:recipient + value < 0 + } + reverse_opinion = { + target = scope:recipient + value > -40 + } + } + desc = HOF_OPINION_OF_EMPEROR + } + modifier = { + add = 10 + scope:actor.top_liege = { + NOR = { + this = scope:actor + this = scope:recipient + } + reverse_opinion = { + target = scope:recipient + value <= -40 + } + reverse_opinion = { + target = scope:recipient + value > -80 + } + } + desc = HOF_OPINION_OF_EMPEROR + } + modifier = { + add = 20 + scope:actor.top_liege = { + NOR = { + this = scope:actor + this = scope:recipient + } + reverse_opinion = { + target = scope:recipient + value <= -80 + } + } + desc = HOF_OPINION_OF_EMPEROR + } + #Likes emperor... and you're not emperor + modifier = { + add = -5 + scope:actor.top_liege = { + NOR = { + this = scope:actor + this = scope:recipient + } + reverse_opinion = { + target = scope:recipient + value >= 40 + } + reverse_opinion = { + target = scope:recipient + value < 80 + } + } + desc = HOF_OPINION_OF_EMPEROR + } + modifier = { + add = -10 + scope:actor.top_liege = { + NOR = { + this = scope:actor + this = scope:recipient + } + reverse_opinion = { + target = scope:recipient + value >= 80 + } + } + desc = HOF_OPINION_OF_EMPEROR + } + + modifier = { # Same language + add = 5 + desc = speaks_same_language_interaction_reason + trigger = { + scope:actor = { + knows_language_of_culture = scope:recipient.culture + } + } + } + + modifier = { # Attacking a co-religionist + add = -50 + desc = I_AM_ATTACKING_A_CORELIGIONIST + scope:actor = { + is_at_war = yes + any_character_war = { + primary_attacker = scope:actor + primary_defender.faith = scope:actor.faith + primary_defender = { + NOT = { + has_trait = excommunicated + } + } + } + } + } + + modifier = { # Offensive holy war/excommunication war + add = 30 + desc = I_AM_WAGING_AN_OFFENSIVE_HOLY_OR_EXCOMMUNICATION_WAR + scope:actor = { + is_at_war = yes + any_character_war = { + is_attacker = scope:actor + OR = { + using_non_ghw_holy_war_cb_trigger = yes + using_cb = excommunication_war + } + } + } + } + + modifier = { # Defensive Holy War + add = 50 + desc = I_AM_DEFENDING_AGAINST_A_HOLY_WAR + scope:actor = { + is_at_war = yes + any_character_war = { + is_defender = scope:actor + using_non_ghw_holy_war_cb_trigger = yes + } + } + } + + modifier = { # HoF wants the influence for themselves! + add = -10 + desc = THEY_ARE_GREEDY + scope:recipient = { + ai_greed >= high_positive_greed + } + } + + modifier = { # I am influential already + add = -10 + desc = I_AM_INFLUENTIAL + scope:actor = { + influence_level >= 4 + NOT = { + influence_level >= 6 + } + } + } + + modifier = { # I am very influential already + add = -20 + desc = I_AM_INFLUENTIAL + scope:actor = { + influence_level >= 6 + } + } + + modifier = { # I am Adulterer/Fornicator + add = -25 + desc = I_AM_ADULTERER + scope:actor = { + OR = { + AND = { + has_trait = fornicator + trait_is_shunned_or_criminal_in_faith_trigger = { FAITH = faith TRAIT = fornicator GENDER_CHARACTER = scope:actor } + } + AND = { + has_trait = adulterer + trait_is_shunned_or_criminal_in_faith_trigger = { FAITH = faith TRAIT = adulterer GENDER_CHARACTER = scope:actor } + } + } + } + } + + modifier = { # I am a Murderer + add = -50 + desc = I_AM_MURDERER + scope:actor = { + has_trait = murderer + } + } + + modifier = { # I am Incestous + add = -50 + desc = I_AM_INCESTOUS + scope:actor = { + NOT = { scope:recipient = { faith = { has_doctrine = doctrine_consanguinity_unrestricted } } } + has_trait = incestuous + } + } + + modifier = { # I am a Kinslayer + add = -50 + desc = I_AM_A_KINSLAYER + scope:actor = { + OR = { + AND = { + has_trait = kinslayer_1 + trait_is_shunned_or_criminal_in_faith_trigger = { FAITH = faith TRAIT = kinslayer_1 GENDER_CHARACTER = scope:actor } + } + AND = { + has_trait = kinslayer_2 + trait_is_shunned_or_criminal_in_faith_trigger = { FAITH = faith TRAIT = kinslayer_2 GENDER_CHARACTER = scope:actor } + } + AND = { + has_trait = kinslayer_3 + trait_is_shunned_or_criminal_in_faith_trigger = { FAITH = faith TRAIT = kinslayer_3 GENDER_CHARACTER = scope:actor } + } + } + } + } + modifier = { + desc = RELIGIOUS_HEAD_INTERACTION_SAVIOR + add = 15 + scope:actor = { + has_trait = savior + } + } + modifier = { + desc = RELIGIOUS_HEAD_INTERACTION_DIVINE_BLOOD + add = 5 + scope:actor = { + has_trait = divine_blood + } + } + modifier = { + desc = RELIGIOUS_HEAD_INTERACTION_PARAGON + add = 15 + scope:actor = { + has_trait = paragon + } + } + modifier = { + desc = RELIGIOUS_HEAD_INTERACTION_CONSECRATED_BLOOD + add = 5 + scope:actor = { + has_trait = consecrated_blood + } + } + + modifier = { # You are of the same dynasty as the Head of Faith + add = 5 + desc = YOU_ARE_MY_DYNASTY_MEMBER + scope:recipient = { + is_lowborn = no + dynasty = scope:actor.dynasty + NOR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.dynasty = scope:secondary_recipient.dynasty + } + } + } + + modifier = { # You are of the same house as the Head of Faith + add = 10 + desc = YOU_ARE_MY_HOUSE_MEMBER + scope:recipient = { + is_lowborn = no + house = scope:actor.house + NOR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + is_child_of = scope:actor + scope:recipient.house = scope:secondary_recipient.house + } + } + } + + modifier = { # Related to the Head of Faith + add = 10 + desc = YOU_ARE_MY_RELATIVE + scope:recipient = { + OR = { + is_close_or_extended_family_of = scope:actor + is_cousin_of = scope:actor + } + NOT = { is_child_of = scope:actor } + } + } + + modifier = { # Parent of the Head of Faith + add = 25 + desc = YOU_ARE_MY_PARENT + scope:recipient = { + is_child_of = scope:actor + } + } + + modifier = { # Friend of the Head of Faith + add = 25 + desc = WE_ARE_FRIENDS + scope:recipient = { + has_relation_friend = scope:actor + } + } + + modifier = { # Best Friend of the Head of Faith + add = 50 + desc = WE_ARE_BEST_FRIENDS + scope:recipient = { + has_relation_best_friend = scope:actor + } + } + + modifier = { # Lover of the Head of Faith + add = 10 + desc = WE_ARE_LOVERS + scope:recipient = { + has_relation_lover = scope:actor + } + } + + modifier = { # Rival of the Head of Faith + add = -100 + desc = WE_ARE_RIVALS + scope:recipient = { + has_relation_rival = scope:actor + } + } + + modifier = { # Nemesis of the Head of Faith + add = -500 + desc = WE_ARE_NEMESES + scope:recipient = { + has_relation_nemesis = scope:actor + } + } + + modifier = { + add = { + add = 10 + multiply = scope:actor.num_virtuous_traits + } + scope:actor.num_virtuous_traits > 0 + desc = I_AM_VIRTUOUS + } + + modifier = { + add = { + add = 5 + multiply = scope:actor.piety_level + } + scope:actor.piety_level > 1 + desc = I_AM_PIOUS + } + + modifier = { + add = { + add = -10 + multiply = scope:actor.num_sinful_traits + } + scope:actor.num_sinful_traits > 0 + desc = I_AM_SINFUL + } + } + + ai_will_do = { + base = 0 + + modifier = { # The AI will only use a Hook if they couldn't otherwise do this + scope:hook = yes + add = -1 + } + + modifier = { # I am low on influence + add = 300 + scope:actor = { + influence <= minor_influence_value + } + } + + modifier = { # Piety to burn, and no reason to keep it. + add = 100 + scope:actor = { + piety > massive_piety_value + NOR = { + has_character_modifier = vow_of_poverty_modifier + has_trait = content + has_trait = humble + } + } + } + modifier = { # Or when greedy + add = { + value = scope:actor.ai_greed + multiply = 0.5 + } + scope:actor = { + ai_greed > 0 + } + } + modifier = { # Or when energy + add = { + value = scope:actor.ai_energy + multiply = 0.5 + } + scope:actor = { + ai_energy > 0 + } + } + + modifier = { # I am an up and comer who really needs help + add = 100 + scope:actor = { + influence_level <= 1 + } + } + + modifier = { + add = 100 + scope:actor = { + ai_has_warlike_personality = yes + } + } + + modifier = { + add = 50 + scope:actor = { + ai_has_cautious_personality = no + } + } + } +} + +# Ask non-participating governor to join ongoing Faction War +ep3_join_faction_war_interaction = { + icon = join_faction_war_interaction + category = interaction_category_diplomacy + common_interaction = yes + + desc = ep3_join_faction_war_interaction_desc + + cooldown_against_recipient = { years = 10 } + + greeting = positive + notification_text = JOIN_FACTION_WAR_NOTIFICATION_TEXT + + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + is_shown = { + scope:actor = { + has_ep3_dlc_trigger = yes + is_at_war = yes + NOR = { + this = scope:recipient + is_at_war_with = scope:recipient + } + has_government = administrative_government + } + scope:recipient = { + has_government = administrative_government + scope:actor.liege ?= liege + } + scope:actor.joined_faction ?= { + faction_is_at_war = yes + faction_war ?= { is_attacker = scope:actor } + faction_target != scope:recipient + } + } + + redirect = { + # Save secondary_recipient for UI and ai chance + scope:actor.joined_faction.faction_target ?= { save_scope_as = secondary_recipient } + } + + cost = { influence = 150 } + + is_valid_showing_failures_only = { + scope:recipient = { + is_imprisoned = no + NOT = { is_at_war_with = liege } + } + scope:actor.joined_faction ?= { + faction_war = { + custom_tooltip = { + text = ep3_join_faction_war_interaction_ally_tt + NOT = { + primary_defender = { is_allied_to = scope:recipient } + } + } + } + } + } + + # Offer gold + send_option = { + is_valid = { scope:actor.gold > scope:actor.medium_gold_value } + flag = gold + localization = GENERIC_SPEND_GOLD + } + # Use hook + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + NOT = { + scope:recipient = { is_imprisoned_by = scope:actor } + } + } + 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 = { + scope:actor = { is_ai = no } # player only + custom_tooltip = { + text = ep3_join_faction_war_interaction_ongoing_tt + scope:actor.joined_faction ?= { + faction_is_at_war = yes + faction_war ?= { is_attacker = scope:actor } + } + } + custom_tooltip = { + text = ep3_join_faction_war_interaction_faction_tt + scope:recipient = { + trigger_if = { + limit = { exists = joined_faction } + NOR = { + joined_faction.faction_leader = this + joined_faction.special_character ?= this + } + } + } + } + scope:recipient = { + custom_tooltip = { + text = ep3_join_faction_war_interaction_offer_tt + NOT = { has_character_flag = under_offer_join_faction_war_flag } + } + } + } + + on_send = { + scope:recipient = { + add_character_flag = { + flag = under_offer_join_faction_war_flag + months = 1 + } + } + } + + on_accept = { + scope:actor = { trigger_event = ep3_interactions_events.0800 } + show_as_tooltip = { ep3_join_faction_war_effect = yes } + scope:recipient = { remove_character_flag = under_offer_join_faction_war_flag } + } + + on_decline = { + scope:actor = { trigger_event = ep3_interactions_events.0801 } + scope:recipient = { remove_character_flag = under_offer_join_faction_war_flag } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + ai_accept = { + base = -25 + modifier = { + scope:hook = yes + add = 40 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:gold = yes + add = { + value = 10 + add = { + value = scope:recipient.ai_greed + multiply = 0.25 + min = 0 + } + } + desc = SCHEME_WITH_GIFT_SIGNIFICANT + } + modifier = { # Target is less likely to accept if at war + scope:recipient = { is_at_war = yes } + add = -200 + desc = RECIPIENT_IS_AT_WAR_REASON + } + common_faction_modifiers = { + FACTION_TARGET = scope:secondary_recipient + OPINION_MULTIPLIER = -1.5 + MAX_OPINION = 150 + POWER = 0 + THRESHOLD = 80 + } + admin_faction_modifiers = { + FACTION_TARGET = scope:secondary_recipient + FACTION_TYPE = claimant_faction + } + modifier = { + exists = scope:actor.joined_faction.special_character + add = "scope:recipient.opinion(scope:actor.joined_faction.special_character)" + desc = CLAIMANT_OPINION_REASON + } + modifier = { # Refuse call against Heir + add = -1000 + scope:recipient.player_heir ?= scope:secondary_recipient + desc = WONT_FIGHT_HEIR_REASON + } + modifier = { # Refuse call against Spouse + add = -1000 + is_spouse_of = scope:secondary_recipient + desc = WONT_FIGHT_SPOUSE_REASON + } + modifier = { # Reluctant to join against Friends + add = -50 + has_relation_friend = scope:secondary_recipient + desc = WONT_FIGHT_FRIEND + } + modifier = { # Reluctant to join against Best Friends + add = -100 + has_relation_best_friend = scope:secondary_recipient + desc = WONT_FIGHT_BEST_FRIEND + } + modifier = { # Reluctant to join against Lovers + add = -100 + has_relation_lover = scope:secondary_recipient + desc = WONT_FIGHT_LOVER + } + modifier = { # Reluctant to join against Soulmate + add = -200 + has_relation_soulmate = scope:secondary_recipient + desc = WONT_FIGHT_SOULMATE + } + 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 + } + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 1.0 + desc = AI_OPINION_REASON + } + } + + ai_will_do = { base = 0 } +} + +# Ask governor to switch sides in ongoing Faction War +ep3_switch_faction_war_sides_interaction = { + icon = switch_faction_war_sides_interaction + category = interaction_category_diplomacy + common_interaction = yes + + desc = { + triggered_desc = { + trigger = { + NOT = { scope:recipient = scope:secondary_recipient } + } + desc = ep3_switch_faction_war_sides_interaction_desc + } + } + + cooldown_against_recipient = { years = 10 } + + greeting = positive + notification_text = SWITCH_FACTION_WAR_SIDES_NOTIFICATION_TEXT + + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + is_shown = { + scope:actor = { + has_ep3_dlc_trigger = yes + is_at_war_with = scope:recipient + has_government = administrative_government + NOT = { this = scope:recipient } + } + scope:recipient = { + has_government = administrative_government + OR = { + is_vassal_of = scope:actor + scope:actor.liege ?= liege + } + } + scope:actor = { + any_character_war = { + # Recipient involved in war + is_participant = scope:recipient + # Is a Faction war + save_temporary_scope_as = faction_war_temp + primary_attacker.joined_faction.faction_war ?= scope:faction_war_temp + # Actor and recipient on opposing sides + trigger_if = { + limit = { is_defender = scope:recipient } + is_attacker = scope:actor + } + trigger_else = { is_defender = scope:actor } + } + } + } + + redirect = { + scope:actor = { + # Actor is involved in a faction war with recipient on the other side + random_character_war = { + limit = { ep3_switch_faction_war_sides_war_trigger = yes } + # Save secondary_recipient for UI and ai chance + if = { + limit = { is_defender = scope:actor } + primary_attacker = { save_scope_as = secondary_recipient } + } + else = { + primary_defender = { save_scope_as = secondary_recipient } + } + } + } + } + + cost = { influence = 300 } + + is_valid_showing_failures_only = { + scope:recipient = { + is_imprisoned = no + is_at_war = yes + } + custom_tooltip = { + text = ep3_switch_faction_war_sides_interaction_primary_or_ally_or_claimant_tt + scope:actor = { + any_character_war = { ep3_switch_faction_war_sides_war_trigger = yes } + } + } + } + + # Offer gold + send_option = { + is_valid = { scope:actor.gold > scope:actor.medium_gold_value } + flag = gold + localization = GENERIC_SPEND_GOLD + } + # Use hook + send_option = { + is_valid = { + scope:actor = { has_usable_hook = scope:recipient } + NOT = { + scope:recipient = { is_imprisoned_by = scope:actor } + } + } + 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 = { + scope:actor = { is_ai = no } # player only + custom_tooltip = { + text = ep3_switch_faction_war_sides_interaction_tt + scope:actor = { + any_character_war = { ep3_switch_faction_war_sides_war_trigger = yes } + } + } + scope:recipient = { + custom_tooltip = { + text = ep3_switch_faction_war_sides_interaction_offer_tt + NOT = { has_character_flag = under_offer_switch_faction_war_sides_flag } + } + } + custom_tooltip = { + text = ep3_switch_faction_war_sides_cooldown_tt + NOT = { exists = scope:recipient.var:switched_faction_war_sides } + } + } + + on_send = { + scope:recipient = { + add_character_flag = { + flag = under_offer_switch_faction_war_sides_flag + months = 1 + } + } + } + + on_accept = { + scope:actor = { trigger_event = ep3_interactions_events.0810 } + show_as_tooltip = { ep3_switch_faction_war_sides_effect = yes } + scope:recipient = { + set_variable = { + name = switched_faction_war_sides + value = scope:secondary_recipient + years = 10 + } + remove_character_flag = under_offer_join_faction_war_flag + } + } + + on_decline = { + scope:actor = { trigger_event = ep3_interactions_events.0811 } + scope:recipient = { remove_character_flag = under_offer_join_faction_war_flag } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + ai_accept = { + base = -50 + modifier = { + scope:hook = yes + add = 40 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:gold = yes + add = { + value = 10 + add = { + value = scope:recipient.ai_greed + multiply = 0.25 + min = 0 + } + } + desc = SCHEME_WITH_GIFT_SIGNIFICANT + } + modifier = { + add = { + value = 0 + scope:actor = { + every_character_war = { + limit = { + # Recipient involved in war + is_participant = scope:recipient + # Is a Faction war + save_temporary_scope_as = faction_war_temp + primary_attacker.joined_faction.faction_war ?= scope:faction_war_temp + # Actor and recipient on opposing sides + trigger_if = { + limit = { is_defender = scope:recipient } + is_attacker = scope:actor + # Recipient must not be an ally of the opposing war leader + NOT = { + primary_defender = { is_allied_to = scope:recipient } + } + } + trigger_else = { + is_defender = scope:actor + # Recipient must not be an ally of the opposing war leader + NOT = { + primary_attacker = { is_allied_to = scope:recipient } + } + } + # Recipient must not be a war leader + NOT = { is_war_leader = scope:recipient } + } + if = { + limit = { is_defender = scope:actor } + add = { + value = ep3_invite_to_faction_war_strength_compare_defender_value + divide = ep3_invite_to_faction_war_strength_compare_attacker_value + if = { + limit = { ep3_invite_to_faction_war_strength_compare_defender_value > ep3_invite_to_faction_war_strength_compare_attacker_value } + multiply = 10 + } + else = { multiply = -200 } + max = 50 + min = -50 + } + } + else = { + add = { + value = ep3_invite_to_faction_war_strength_compare_attacker_value + divide = ep3_invite_to_faction_war_strength_compare_defender_value + if = { + limit = { ep3_invite_to_faction_war_strength_compare_attacker_value > ep3_invite_to_faction_war_strength_compare_defender_value } + multiply = 10 + } + else = { multiply = -200 } + max = 50 + min = -50 + } + } + } + } + } + desc = WAR_STRENGTH_BALANCE_REASON + } + modifier = { + add = { + value = 0 + scope:actor = { + every_character_war = { + limit = { + # Recipient involved in war + is_participant = scope:recipient + # Is a Faction war + save_temporary_scope_as = faction_war_temp + primary_attacker.joined_faction.faction_war ?= scope:faction_war_temp + # Actor and recipient on opposing sides + trigger_if = { + limit = { is_defender = scope:recipient } + is_attacker = scope:actor + # Recipient must not be an ally of the opposing war leader + NOT = { + primary_defender = { is_allied_to = scope:recipient } + } + } + trigger_else = { + is_defender = scope:actor + # Recipient must not be an ally of the opposing war leader + NOT = { + primary_attacker = { is_allied_to = scope:recipient } + } + } + # Recipient must not be a war leader + NOT = { is_war_leader = scope:recipient } + } + if = { + limit = { is_defender = scope:actor } + add = { + value = 0 + if = { + limit = { defender_war_score > attacker_war_score } + add = defender_war_score + divide = 2 + } + else = { + add = attacker_war_score + multiply = -0.5 + } + max = 50 + min = -50 + } + } + else = { + add = { + value = 0 + if = { + limit = { attacker_war_score > defender_war_score } + add = attacker_war_score + divide = 2 + } + else = { + add = defender_war_score + multiply = -0.5 + } + max = 50 + min = -50 + } + } + } + } + } + desc = WAR_SCORE_REASON + } + opinion_modifier = { + opinion_target = scope:actor + multiplier = 0.5 + } + opinion_modifier = { + trigger = { + exists = scope:secondary_recipient + } + opinion_target = scope:secondary_recipient + multiplier = -0.5 + } + modifier = { # Refuse call against Heir + add = -1000 + exists = scope:secondary_recipient + scope:recipient.player_heir ?= scope:secondary_recipient + desc = WONT_FIGHT_HEIR_REASON + } + modifier = { # Refuse call against Spouse + add = -1000 + exists = scope:secondary_recipient + is_spouse_of = scope:secondary_recipient + desc = WONT_FIGHT_SPOUSE_REASON + } + modifier = { # Reluctant to join against Friends + add = -50 + exists = scope:secondary_recipient + has_relation_friend = scope:secondary_recipient + desc = WONT_FIGHT_FRIEND + } + modifier = { # Reluctant to join against Best Friends + add = -100 + exists = scope:secondary_recipient + has_relation_best_friend = scope:secondary_recipient + desc = WONT_FIGHT_BEST_FRIEND + } + modifier = { # Reluctant to join against Lovers + add = -100 + exists = scope:secondary_recipient + has_relation_lover = scope:secondary_recipient + desc = WONT_FIGHT_LOVER + } + modifier = { # Reluctant to join against Soulmate + add = -200 + exists = scope:secondary_recipient + has_relation_soulmate = scope:secondary_recipient + desc = WONT_FIGHT_SOULMATE + } + } + + ai_will_do = { base = 0 } +} + +# Request Permission to Wage War +ep3_governor_request_war_permission_interaction = { + icon = invasion + category = interaction_category_admin + + desc = ep3_governor_request_war_permission_interaction_desc + + cooldown_against_recipient = { years = 10 } + + greeting = positive + notification_text = request_war_permission_notification_text + + ai_targets = { + ai_recipients = liege + } + ai_target_quick_trigger = { + adult = yes + } + ai_frequency = 60 + ai_min_reply_days = 2 + ai_max_reply_days = 5 + + is_shown = { + scope:actor = { + has_government = administrative_government + liege = scope:recipient + OR = { + vassal_contract_has_flag = admin_theme_frontier + vassal_contract_has_flag = admin_theme_naval + } + } + scope:recipient = { + has_government = administrative_government + is_independent_ruler = yes + has_realm_law_flag = admin_vassal_wars_permission_only + } + } + + is_valid_showing_failures_only = { + scope:recipient = { is_busy_in_events_localised = yes } + scope:recipient = { NOT = { has_strong_hook = scope:actor } } + scope:actor = { + is_at_war = no + custom_tooltip = { + text = admin_has_war_permission_already_desc + NOT = { has_variable = admin_permission_to_declare_war } + } + top_liege = { + custom_tooltip = { + text = admin_all_vassal_wars_banned + NOT = { has_realm_law_flag = admin_vassal_wars_banned } + } + } + } + } + + #Spend influence + send_option = { + flag = influence + is_valid = { + scope:actor.influence >= { value = massive_influence_value multiply = 2 } + scope:actor = { is_ai = no } # The AI shouldn't spend influence for this + } + localization = SPEND_INFLUENCE + } + #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 + + on_accept = { + scope:actor = { + # Add permission + custom_tooltip = { + text = admin_gain_war_permission_desc + set_variable = admin_permission_to_declare_war + } + + # And send a toast as confirmation + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_good + title = admin_gained_war_permission_title + left_icon = scope:recipient + custom_tooltip = admin_gained_war_permission_desc + } + } + + # If options are used, spend the corresponding cost + if = { + limit = { scope:influence = yes } + change_influence = { + value = massive_influence_loss + multiply = 2 + } + scope:recipient = { # Liege gets the spent influence + change_influence = { + value = massive_influence_gain + multiply = 2 + } + } + } + if = { + limit = { + scope:hook = yes + has_hook = scope:recipient + } + use_hook = scope:recipient + } + } + } + + on_decline = { + scope:actor = { + # Add penalties + change_influence = minor_influence_loss + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -20 + } + + # And send a toast to inform + hidden_effect = { + send_interface_toast = { + type = event_toast_effect_bad + title = admin_declined_war_permission_title + left_icon = scope:recipient + custom_tooltip = admin_declined_war_permission_desc + + show_as_tooltip = { change_influence = minor_influence_loss } + } + } + } + } + + ai_accept = { + base = -50 + + # Opinion Factor + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_SIMPLE_OPINION_REASON + } + + # Send options + modifier = { + scope:hook = yes + add = 100 + desc = SCHEME_WEAK_HOOK_USED + } + modifier = { + scope:influence = yes + add = { + value = 20 + multiply = scope:actor.influence_level + min = 5 + } + desc = INFLUENCE_REASON + } + + # Relations + modifier = { + scope:actor = { + has_relation_rival = scope:recipient + } + add = -100 + desc = AI_YOUR_RIVAL + } + modifier = { + scope:recipient = { + is_close_family_of = scope:actor + } + add = 20 + desc = CLOSE_FAMILY_REASON + } + modifier = { + scope:recipient = { + is_extended_family_of = scope:actor + } + add = 10 + desc = EXTENDED_FAMILY_REASON + } + modifier = { + scope:actor = { + has_relation_friend = scope:recipient + } + add = 20 + desc = WE_ARE_FRIENDS + } + + # Family status + modifier = { # You are a powerful family + scope:actor.house ?= { + is_powerful_family = yes + } + add = 15 + desc = YOUR_FAMILY_IS_POWERFUL + } + modifier = { # You are a dominant family + scope:actor.house ?= { + is_dominant_family = yes + } + add = 30 + desc = YOUR_FAMILY_IS_DOMINANT + } + } + + ai_potential = { + has_government = administrative_government + is_adult = yes + liege = { is_at_war = no } # Don't ask if your liege is at war + } + + ai_will_do = { + base = 10 + modifier = { + scope:actor = { + OR = { + has_trait = ambitious + has_trait = brave + has_trait = greedy + has_trait = wrathful + } + } + add = 20 + } + modifier = { + scope:actor = { + has_vassal_stance = glory_hound + } + add = 10 + } + modifier = { # Attempt to be opportunistic if you border weak realms + scope:actor = { + any_top_realm_border_county = { + any_neighboring_county = { + holder.top_liege = { + NOT = { this = scope:actor.top_liege } + current_military_strength < { value = scope:actor.current_military_strength multiply = 0.4 } + } + } + } + } + add = 25 + } + } +} diff --git a/common/character_interactions/06_ep3_laamp_interactions.txt b/common/character_interactions/06_ep3_laamp_interactions.txt new file mode 100644 index 00000000..42fa0210 --- /dev/null +++ b/common/character_interactions/06_ep3_laamp_interactions.txt @@ -0,0 +1,7855 @@ +################## +# Purchase Land +# by Joe Parkin +################## + +purchase_land_interaction = { + category = interaction_category_laamp + interface_priority = 30 + icon = purchase_land_interaction + + desc = purchase_land_interaction_desc + target_type = title + target_filter = recipient_de_jure_titles + + cooldown_against_recipient = { years = 10 } + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:recipient = { is_independent_ruler = no } + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:recipient.highest_held_title_tier = tier_duchy + } + trigger_else = { scope:recipient.highest_held_title_tier = tier_county } + } + } + desc = PURCHASE_LAND_PROPOSAL_FELLOW_VASSAL + } + triggered_desc = { + trigger = { + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:recipient.highest_held_title_tier >= tier_kingdom + } + trigger_else = { scope:recipient.highest_held_title_tier >= tier_duchy } + } + } + desc = PURCHASE_LAND_PROPOSAL_LIEGE + } + desc = PURCHASE_LAND_PROPOSAL + } + } + + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 60 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + send_options_exclusive = no + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + government_has_flag = government_is_landless_adventurer + } + scope:recipient = { + is_landed = yes + # Need to own the land/cannot directly buy a governorship (procure estate first) + NOT = { government_has_flag = government_is_administrative } + } + NOT = { scope:recipient = scope:actor } + } + + has_valid_target = { + custom_tooltip = { #prevent unwanted trigger tooltip + text = blank_line + scope:target = { + is_title_created = yes + holder = { + is_ai = yes + this = scope:recipient + } + OR = { #flatten the selection + tier = tier_duchy + tier = tier_county + } + NOR = { + this = scope:recipient.capital_county + this = scope:recipient.capital_county.duchy + } + } + } + } + + send_option = { + flag = offer_gold + localization = purchase_land_interaction_offer_gold + current_description = purchase_land_interaction_offer_gold_desc + } + + send_option = { + flag = hook + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + localization = GENERIC_SPEND_A_HOOK + } + + send_option = { + flag = offer_hook + is_valid = { + NOT = { + scope:recipient = { + has_usable_hook = scope:actor + } + } + } + localization = purchase_land_interaction_offer_hook + current_description = purchase_land_interaction_offer_hook_desc + } + + send_option = { + flag = vassal_obligation + is_shown = { + scope:recipient = { + government_has_flag = government_is_feudal + } + } + localization = purchase_land_interaction_offer_obligations + current_description = purchase_land_interaction_offer_obligations_desc + } + + can_be_picked_title = { + custom_tooltip = { + text = purchase_land_tier_tt + scope:target = { + tier >= tier_county + tier <= tier_duchy + } + } + custom_tooltip = { + text = purchase_land_capital_tt + NOT = { scope:target = scope:recipient.capital_county } + } + custom_tooltip = { + text = purchase_land_primary_tt + NOT = { scope:target = scope:recipient.primary_title } + } + custom_tooltip = { + text = purchase_land_duchy_tt + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:actor = { + prestige_level >= 3 + } + } + } + } + trigger_if = { + limit = { exists = scope:target.holder } + scope:target.holder = scope:recipient + } + } + + is_valid_showing_failures_only = { + scope:actor = { is_independent_ruler = yes } + scope:actor = { + prestige_level >= 2 + } + scope:actor = { + NOT = { + has_trait = gallowsbait + } + } + scope:actor = { + NOT = { + has_trait = gallivanter + } + } + scope:recipient = { is_at_war = no } + trigger_if = { # Can't purchase Baronies + limit = { + scope:target ?= { tier = tier_barony } + } + custom_description = { + text = purchase_land_barony_tt + always = no + } + } + trigger_if = { # Can't purchase Kingdoms or Empires + limit = { + scope:target ?= { tier >= tier_kingdom } + } + custom_description = { + text = purchase_land_kingdom_tt + always = no + } + } + trigger_if = { # Can't purchase HoF titles + limit = { + scope:target ?= { is_head_of_faith = yes } + } + custom_description = { + text = purchase_land_religious_tt + always = no + } + } + trigger_if = { # Can't purchase nf titles + limit = { + scope:target ?= { is_noble_family_title = yes } + } + custom_description = { + text = purchase_land_noble_family_tt + always = no + } + } + trigger_if = { # Can't purchase laamp titles + limit = { + scope:target ?= { has_variable = adventurer_creation_reason } + } + custom_description = { + text = purchase_land_landless_adventurer_tt + always = no + } + } + trigger_if = { + limit = { + scope:recipient = { + any_held_county = { count < 2 } + } + } + custom_description = { + text = purchase_land_minimum_county_tt + object = scope:recipient + always = no + } + } + scope:recipient = { + is_busy_in_events_localised = yes + NOT = { has_strong_hook = scope:actor } + } + #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 + } + # 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 + } + } + } + } + + cost = { + gold = { + if = { + limit = { scope:target.tier = tier_county } + add = purchase_land_county_cost_value + } + else = { + add = purchase_land_duchy_cost_value + scope:target = { + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add = purchase_land_county_cost_value + } + } + } + if = { + limit = { scope:offer_gold = yes } + multiply = 2 + } + } + } + + on_accept = { + scope:actor = { save_scope_as = adventurer } + scope:target = { + add_to_list = purchased_titles + if = { + limit = { tier = tier_duchy } + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add_to_list = purchased_titles + } + } + } + ordered_in_list = { + list = purchased_titles + save_scope_as = new_primary_title + } + save_scope_value_as = { + name = purchase_land_cost + value = { + every_in_list = { + list = purchased_titles + if = { + limit = { tier = tier_county } + add = purchase_land_county_cost_value + } + else_if = { + limit = { tier = tier_duchy } + add = purchase_land_duchy_cost_value + } + } + if = { + limit = { + scope:actor = { has_variable = ep3_grace_to_the_family_var } + } + multiply = 0.5 + } + if = { + limit = { + scope:offer_gold = yes + } + multiply = 2 + } + } + } + save_scope_value_as = { + name = purchase_land_legitimacy_cost + value = { + value = 0 + if = { + limit = { + NOT = { + scope:target.holder = scope:recipient + } + } + every_in_list = { + list = purchased_titles + if = { + limit = { tier = tier_county } + add = minor_legitimacy_loss + } + else = { add = medium_legitimacy_loss } + } + } + } + } + show_as_tooltip = { purchase_land_interaction_shortened_effect = yes } + if = { + limit = { always = scope:hook } + scope:actor = { use_hook = scope:recipient } + } + scope:actor = { trigger_event = ep3_laamps.0100 } + } + + on_decline = { + scope:actor = { + save_scope_as = adventurer + trigger_event = ep3_laamps.0102 + } + } + + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = contacts + } + ai_frequency = 120 + + ai_accept = { + base = 0 # Try to make it 0 for most interactions + + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + modifier = { # Num of counties/duchy + add = { + value = 0 + scope:target = { + if = { + limit = { tier = tier_county } + add = -30 + } + else = { + add = -60 + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add = -30 + } + } + } + } + desc = PURCHASE_LAND_NUM_TITLES_REASON + } + modifier = { # Too close to capital + add = -50 + desc = PURCHASE_LAND_DE_JURE_DUCHY_REASON + scope:target.duchy = scope:recipient.capital_county.duchy + } + modifier = { # Province value + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = scope:target.development_level + scope:target = { + every_county_province = { add = num_buildings } + } + } + else = { + scope:target = { + every_de_jure_county = { + limit = { ep3_purchase_land_valid_county_trigger = yes } + add = development_level + every_county_province = { add = num_buildings } + } + } + } + multiply = -2 + } + #add = 1 + desc = PURCHASE_LAND_VALUE_REASON + } + modifier = { # Land is foreign + add = 10 + desc = PURCHASE_LAND_FOREIGN_COUNTY_CULTURE_REASON + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = 10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + culture != scope:recipient.culture + } + add = 10 + } + } + } + max = 30 + } + desc = PURCHASE_LAND_FOREIGN_CULTURE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.culture != scope:recipient.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture != scope:recipient.culture + } + } + } + } + modifier = { # Different faith + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = 10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + faith != scope:recipient.faith + } + add = 10 + } + } + } + max = 30 + } + desc = PURCHASE_LAND_DIFFERENT_FAITH_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith != scope:recipient.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + faith != scope:recipient.faith + } + } + } + } + modifier = { # My culture's lands + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -40 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + culture != scope:recipient.culture + } + add = -40 + } + } + } + if = { + limit = { scope:acceptance != 0 } + divide = scope:acceptance + } + multiply = 2 + min = -200 + } + desc = PURCHASE_LAND_MY_CULTURE_REASON + scope:actor.culture != scope:recipient.culture + trigger_if = { + limit = { + scope:target.tier = tier_county + } + scope:target.culture = scope:recipient.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture = scope:recipient.culture + } + } + } + scope:recipient.culture = { + save_temporary_scope_value_as = { + name = acceptance + value = { + value = "cultural_acceptance(scope:actor.culture)" + divide = 25 + ceiling = yes + } + } + } + } + modifier = { # My faith's lands + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -40 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_purchase_land_valid_county_trigger = yes + faith != scope:recipient.faith + } + add = -40 + } + } + } + if = { + limit = { scope:hostility != 0 } + multiply = scope:hostility + } + multiply = 2 + min = -200 + } + desc = PURCHASE_LAND_MY_FAITH_REASON + scope:actor.faith != scope:recipient.faith + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith = scope:recipient.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + faith = scope:recipient.faith + } + } + } + scope:recipient.faith = { + save_temporary_scope_value_as = { + name = hostility + value = "faith_hostility_level(scope:actor.faith)" + } + } + } + modifier = { # Too close + add = { + value = 0 + add = scope:distance + divide = scope:recipient.highest_held_title_tier + if = { + limit = { scope:distance <= squared_distance_medium } + multiply = -0.01 + } + else = { multiply = 0.0005 } + min = -25 + max = 50 + } + desc = PURCHASE_LAND_DISTANCE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target = { save_temporary_scope_as = distance_target } + } + trigger_else = { + scope:target.title_capital_county = { save_temporary_scope_as = distance_target } + } + scope:recipient.capital_county = { + save_temporary_scope_value_as = { + name = distance + value = "squared_distance(scope:distance_target)" + } + } + } + opinion_modifier = { # Opinion Factor of title holder + trigger = { + NOT = { + scope:target.holder ?= scope:recipient + } + } + who = scope:recipient + opinion_target = scope:target.holder + multiplier = -1 + desc = AI_OPINION_REASON + } + modifier = { + add = { + value = scope:actor.prestige_level + multiply = 20 + } + scope:actor.prestige_level >= 4 + desc = PURCHASE_LAND_PRESTIGE_LEVEL_REASON + } + modifier = { + add = 40 + trigger = { + scope:actor.culture != scope:recipient.culture + OR = { + AND = { + scope:target.tier = tier_county + scope:target.culture = scope:recipient.culture + } + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture = scope:recipient.culture + } + } + } + } + scope:actor.primary_spouse ?= { + culture = scope:recipient.culture + dynasty ?= { + dynasty_prestige_level >= 2 + } + } + desc = PURCHASE_LAND_MARRIED_TO_CULTURE_NOBLE_REASON + } + modifier = { + add = 40 + trigger = { + scope:actor.faith != scope:recipient.faith + } + scope:actor.primary_spouse ?= { + faith = scope:recipient.faith + dynasty ?= { + dynasty_prestige_level >= 2 + } + } + desc = PURCHASE_LAND_MARRIED_TO_FAITH_NOBLE_REASON + } + modifier = { + add = 80 + scope:actor.primary_spouse ?= { + house ?= scope:recipient.house + } + desc = PURCHASE_LAND_MARRIED_TO_HOUSE_REASON + } + modifier = { + add = 20 + trigger = { + OR = { + AND = { + scope:target.tier = tier_county + scope:target.culture = scope:recipient.culture + } + scope:target = { + any_de_jure_county = { + ep3_purchase_land_valid_county_trigger = yes + culture = scope:recipient.culture + } + } + } + } + scope:actor = { + knows_language_of_culture = scope:recipient.culture + NOT = { + culture = scope:recipient.culture + } + } + desc = PURCHASE_LAND_SPEAKS_LANGUAGE_REASON + } + modifier = { + add = -40 + scope:actor = { + NOT = { + knows_language_of_culture = scope:recipient.culture + culture = scope:recipient.culture + } + } + desc = PURCHASE_LAND_DOES_NOT_SPEAK_LANGUAGE_REASON + } + modifier = { + add = { + value = 40 + multiply = scope:recipient.debt_level + } + trigger = { + scope:recipient = { + debt_level > 0 + } + } + desc = PURCHASE_LAND_IS_IN_DEBT_REASON + } + modifier = { + add = 60 + scope:actor = { + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + desc = PURCHASE_LAND_RELATIONSHIP_REASON + } + modifier = { + add = 80 + scope:offer_gold = yes + desc = PURCHASE_LAND_DOUBLE_GOLD_REASON + } + modifier = { + add = 160 + scope:hook = yes + desc = YOU_HAVE_HOOK_REASON + } + modifier = { + add = 60 + scope:offer_hook = yes + desc = PURCHASE_LAND_OFFER_HOOK_REASON + } + modifier = { + add = 80 + scope:vassal_obligation = yes + desc = PURCHASE_LAND_OBLIGATIONS_REASON + } + } + + ai_will_do = { + base = -25 + ai_value_modifier = { + ai_boldness = -0.5 + ai_energy = -0.5 + ai_greed = 0.5 + } + modifier = { + gold < 1000 + factor = 0 + } + modifier = { + gold > 2000 + add = 50 + } + } +} + +################## +# Request Invasion Sponsorship +# by Joe Parkin +################## + +request_laamp_invasion_sponsorship_interaction = { + common_interaction = no + category = interaction_category_laamp + interface_priority = 20 + cooldown_against_recipient = { years = 5 } + + greeting = positive + notification_text = REQUEST_LAAMP_INVASION_SPONSORSHIP_PROPOSAL + + answer_accept_key = REQUEST_LAAMP_INVASION_SPONSORSHIP_ACCEPT + answer_reject_key = REQUEST_LAAMP_INVASION_SPONSORSHIP_REJECT + + icon = request_invasion_sponsorship_interaction + desc = request_laamp_invasion_sponsorship_interaction_desc + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { government_has_flag = government_is_landless_adventurer } + scope:recipient = { is_landed = yes } + NOT = { scope:recipient = scope:actor } + NOT = { scope:actor = { has_realm_law = camp_purpose_legitimists } } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_independent_ruler = yes + custom_tooltip = { + text = request_laamp_invasion_sponsorship_existing_supporter_tt + NOT = { exists = var:adventurer_invasion_supporter } + } + } + scope:recipient = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + custom_tooltip = { + text = request_laamp_invasion_sponsorship_existing_supportee_tt + NOT = { exists = var:adventurer_invasion_supportee } + } + } + #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 + } + #You need to be at least Illustrious + scope:actor = { + prestige_level >= 3 + } + } + + populate_recipient_list = { + every_independent_ruler = { + limit = { + highest_held_title_tier >= tier_kingdom + is_landed = yes + in_diplomatic_range = scope:actor + in_diplomatic_range = scope:recipient + NOR = { + is_at_war_with = scope:actor + is_at_war_with = scope:recipient + is_allied_to = scope:actor + is_allied_to = scope:recipient + has_truce = scope:actor + has_truce = scope:recipient + this = scope:actor + this = scope:recipient + } + } + add_to_list = characters + } + } + + send_options_exclusive = no + + send_option = { + flag = request_soldiers + localization = request_laamp_invasion_sponsorship_option_request_soldiers + current_description = request_laamp_invasion_sponsorship_option_request_soldiers_desc + starts_enabled = { always = yes } + } + + send_option = { + flag = join_war + localization = request_laamp_invasion_sponsorship_option_join_war + current_description = request_laamp_invasion_sponsorship_option_join_war_desc + is_valid = { + scope:secondary_recipient ?= { + NOR = { + is_at_war_with = scope:recipient + is_allied_to = scope:recipient + has_truce = scope:recipient + } + } + } + } + + send_option = { + flag = offer_gold + localization = request_laamp_invasion_sponsorship_option_offer_gold + current_description = request_laamp_invasion_sponsorship_option_offer_gold_desc + is_shown = { exists = scope:recipient } + is_valid = { scope:actor.gold >= scope:recipient.request_laamp_invasion_sponsorship_gold_cost } + } + + send_option = { + flag = hook + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + localization = GENERIC_SPEND_A_HOOK + } + + cost = { + prestige = { + value = massive_prestige_value + if = { + limit = { scope:join_war = yes } + add = major_prestige_value + } + } + gold = { + if = { + limit = { scope:offer_gold = yes } + value = scope:recipient.request_laamp_invasion_sponsorship_gold_cost + } + } + } + + can_send = { + custom_tooltip = { + text = request_laamp_invasion_sponsorship_minimum_request_tt + OR = { + scope:join_war = yes + scope:request_soldiers = yes + } + } + } + + on_accept = { + scope:actor = { save_scope_as = adventurer } + scope:recipient ?= { + if = { + limit = { + scope:request_soldiers = yes + scope:join_war = yes + } + custom_tooltip = adventurer_invasion_supporter_tt + } + else_if = { + limit = { scope:request_soldiers = yes } + custom_tooltip = adventurer_invasion_supporter_soldiers_tt + } + else_if = { + limit = { scope:join_war = yes } + custom_tooltip = adventurer_invasion_supporter_join_tt + } + else = { custom_tooltip = request_laamp_invasion_sponsorship_minimum_request_tt } + hidden_effect = { + set_variable = { + name = adventurer_invasion_supportee + value = scope:actor + years = 5 + } + set_variable = { + name = adventurer_invasion_target + value = scope:secondary_recipient + years = 5 + } + if = { + limit = { scope:join_war = yes } + set_variable = { + name = adventurer_invasion_join_war + value = scope:actor + years = 5 + } + } + if = { + limit = { scope:request_soldiers = yes } + set_variable = { + name = adventurer_invasion_request_soldiers + value = scope:actor + years = 5 + } + } + } + } + scope:actor = { + if = { + limit = { scope:offer_gold = yes } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:recipient.request_laamp_invasion_sponsorship_gold_cost + target = scope:recipient + } + } + } + if = { + limit = { scope:hook = yes } + use_hook = scope:recipient + } + + custom_tooltip = { + text = adventurer_invasion_supporter_victory_tt + set_variable = { + name = adventurer_invasion_supporter + value = scope:recipient + years = 5 + } + set_variable = { + name = adventurer_invasion_target + value = scope:secondary_recipient + years = 5 + } + } + trigger_event = ep3_laamps.0200 + } + } + + on_decline = { + scope:actor = { trigger_event = ep3_laamps.0201 } + } + + use_diplomatic_range = yes + + ai_accept = { + base = -25 + + # Relationships: actor -> recipient / We avoid more relationship checks for balance reasons (and because important decisions tend to care little for relationships) + modifier = { # Rivalry modifier. + desc = offer_vassalization_interaction_aibehavior_rival_tt + 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 + scope:recipient = { has_relation_nemesis = scope:actor } + add = -30 + } + modifier = { # Same Dynasty modifier. + desc = offer_vassalization_interaction_aibehavior_dynasty_tt + scope:recipient.dynasty = scope:actor.dynasty + add = 10 + } + + # Compare Opinion modifier + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + } + opinion_modifier = { + who = scope:recipient + opinion_target = scope:secondary_recipient + multiplier = -0.5 + } + + # Relative power (taken from PT interaction) + modifier = { # A lot less levies than scope:secondary_recipient + add = -50 + scope:recipient.max_military_strength <= scope:secondary_recipient.purchase_truce_interaction_recipient_far_weaker_value + scope:join_war = yes + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_MUCH_WEAKER_REASON + } + modifier = { # Few less levies than scope:secondary_recipient + add = -25 + scope:recipient.max_military_strength > scope:secondary_recipient.purchase_truce_interaction_recipient_far_weaker_value + scope:recipient.max_military_strength <= scope:secondary_recipient.purchase_truce_interaction_recipient_somewhat_weaker_value + scope:join_war = yes + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_SOMEWHAT_WEAKER_REASON + } + modifier = { # Roughly equal levies with scope:secondary_recipient + add = -10 + scope:recipient.max_military_strength > scope:secondary_recipient.purchase_truce_interaction_recipient_somewhat_weaker_value + scope:recipient.max_military_strength <= scope:secondary_recipient.purchase_truce_interaction_recipient_somewhat_stronger_value + scope:join_war = yes + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_ROUGHLY_EQUAL_REASON + } + + # AI who are in debt will take whatever windfalls they can. + modifier = { + add = { + value = scope:recipient.debt_level + add = 1 # Our first level is 0, so we add one to always get a positive number. + multiply = 10 + } + scope:offer_gold = yes + scope:recipient.debt_level > 0 + desc = PT_AI_IS_IN_DEBT + } + + # Pacifist AI don't like raiding + modifier = { + add = -25 + scope:recipient.faith = { has_doctrine_parameter = pacifist_opinion_active } + desc = PT_AI_IS_PACIFIST_FAITH + } + modifier = { + add = -25 + scope:recipient.culture = { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith } + desc = PT_AI_IS_PACIFIST_CULTURE + } + + # Small realm + modifier = { + add = -50 + scope:recipient.realm_size < minor_realm_size + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_SMALL_REALM_REASON + } + # Own war + modifier = { + add = -50 + scope:recipient = { is_at_war = yes } + scope:join_war = yes + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_OWN_WAR_REASON + } + + modifier = { # Distance + add = { + value = 0 + add = scope:distance + if = { + limit = { scope:distance >= squared_distance_medium } + add = scope:distance + multiply = -0.00001 + } + min = -100 + } + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_DISTANCE_REASON + scope:recipient = { + NOT = { + any_neighboring_top_liege_realm_owner = { this = scope:secondary_recipient } + } + } + scope:recipient.capital_county = { + save_temporary_scope_value_as = { + name = distance + value = "squared_distance(scope:secondary_recipient.capital_county)" + } + } + } + + modifier = { + add = -30 + scope:recipient.faith = scope:secondary_recipient.faith + desc = I_AM_ATTACKING_A_CORELIGIONIST + } + modifier = { + add = -10 + NOT = { scope:actor.faith = scope:recipient.faith } + desc = DIFFERENT_FAITH + } + modifier = { + add = -200 + scope:recipient.primary_heir ?= scope:secondary_recipient + desc = WONT_FIGHT_HEIR_REASON + } + modifier = { + add = -200 + scope:recipient = { is_consort_of = scope:secondary_recipient } + desc = WONT_FIGHT_SPOUSE_REASON + } + modifier = { + add = -100 + scope:recipient = { + has_relation_friend = scope:secondary_recipient + NOT = { has_relation_best_friend = scope:secondary_recipient } + } + desc = WONT_FIGHT_FRIEND_REASON + } + modifier = { + add = -200 + scope:recipient = { has_relation_best_friend = scope:secondary_recipient } + desc = WONT_FIGHT_BEST_FRIEND_REASON + } + modifier = { + add = -100 + scope:recipient = { + has_relation_lover = scope:secondary_recipient + NOT = { has_relation_soulmate = scope:secondary_recipient } + } + desc = WONT_FIGHT_LOVER_REASON + } + modifier = { + add = -200 + scope:recipient = { has_relation_soulmate = scope:secondary_recipient } + desc = WONT_FIGHT_SOULMATE_REASON + } + modifier = { + add = -200 + scope:recipient = { is_allied_to = scope:secondary_recipient } + desc = WAR_WITH_ALLY_REASON + } + + modifier = { + add = 50 + scope:hook = yes + desc = YOU_HAVE_HOOK_REASON + } + + # Offered proportional gold + modifier = { + add = -25 + scope:request_soldiers = yes + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_REQUEST_SOLDIERS_REASON + } + modifier = { + add = -50 + scope:join_war = yes + desc = REQUEST_LAAMP_INVASION_SPONSORSHIP_JOIN_WAR_REASON + } + modifier = { + add = 35 + scope:offer_gold = yes + desc = GOLD_REASON + } + + # AI value mod + ai_value_modifier = { + ai_greed = 0.5 + ai_boldness = 0.25 + min = 0 + max = 25 + } + } + can_send_despite_rejection = no +} + +################## +# Negotiate Settlement +# by Joe Parkin +################## + +negotiate_settlement_interaction = { + common_interaction = yes + category = interaction_category_diplomacy + icon = negotiate_settlement_interaction + + desc = negotiate_settlement_interaction_desc + target_type = title + target_filter = actor_domain_titles + + cooldown_against_recipient = { years = 5 } + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:actor = { is_independent_ruler = no } + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:actor.highest_held_title_tier = tier_duchy + } + trigger_else = { scope:actor.highest_held_title_tier = tier_county } + } + } + desc = NEGOTIATE_SETTLEMENT_PROPOSAL_FELLOW_VASSAL + } + triggered_desc = { + trigger = { + scope:target = { + trigger_if = { + limit = { tier = tier_duchy } + scope:actor.highest_held_title_tier >= tier_kingdom + } + trigger_else = { scope:actor.highest_held_title_tier >= tier_duchy } + } + } + desc = NEGOTIATE_SETTLEMENT_PROPOSAL_LIEGE + } + desc = NEGOTIATE_SETTLEMENT_PROPOSAL + } + } + + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 60 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { is_landed = yes } + scope:recipient = { + government_has_flag = government_is_landless_adventurer + } + NOT = { scope:recipient = scope:actor } + } + + can_be_picked_title = { + custom_tooltip = { + text = purchase_land_tier_tt + scope:target = { + tier >= tier_county + tier <= tier_duchy + } + } + custom_tooltip = { + text = purchase_land_capital_tt + NOR = { + scope:target = scope:actor.capital_county + scope:target = scope:actor.capital_county.duchy + } + } + custom_tooltip = { + text = purchase_land_primary_tt + NOT = { scope:target = scope:actor.primary_title } + } + custom_tooltip = { + text = negotiate_settlement_title_cant_receive_reason_higher_tier_without_county + scope:target = { + tier = tier_duchy + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + } + } + } + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + scope:recipient = { is_ai = yes } + scope:target.tier < tier_duchy + } + scope:recipient = { + OR = { + current_military_strength < 1000 # You can do better + global_variable_list_size = { + name = laamps_tally + value >= too_many_laamps_value + } + } + OR = { + AND = { + has_character_modifier = ep3_lust_for_land_modifier + ai_greed >= 25 + ai_boldness >= 25 + ai_rationality <= -25 + } + AND = { + has_trait = greedy + ai_rationality <= -50 + } + global_variable_list_size = { + name = laamps_tally + value >= too_many_laamps_value + } + } + } + } + } + + has_valid_target_showing_failures_only = { + trigger_if = { # Can't purchase HoF titles + limit = { + scope:target ?= { is_head_of_faith = yes } + } + custom_description = { + text = negotiate_settlement_religious_tt + always = no + } + } + trigger_if = { # Can't purchase nf titles + limit = { + scope:target ?= { is_noble_family_title = yes } + } + custom_description = { + text = negotiate_settlement_noble_family_tt + always = no + } + } + trigger_if = { # Can't purchase laamp titles + limit = { + scope:target ?= { has_variable = adventurer_creation_reason } + } + custom_description = { + text = negotiate_settlement_landless_adventurer_tt + always = no + } + } + trigger_if = { + limit = { + scope:actor = { government_has_flag = government_is_administrative } + } + scope:target.tier = tier_duchy + } + trigger_else = { + scope:target = { + tier >= tier_county + tier <= tier_duchy + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + custom_tooltip = { + text = negotiate_settlement_target_tt + OR = { + any_character_war = { + is_attacker = scope:recipient + primary_defender = scope:actor + save_temporary_scope_as = war_temp + } + AND = { + exists = scope:recipient.capital_province + scope:recipient.capital_province.county.holder.top_liege = scope:actor.top_liege + } + } + } + } + # Can only settle if not at risk of losing land, outside of war of adventurer + custom_tooltip = { + text = negotiate_settlement_defensive_wars_tt + scope:actor = { + NOT = { + any_character_war = { + any_war_defender = { this = scope:actor } + NOT = { + any_war_attacker = { this = scope:recipient } + } + } + } + } + } + NOT = { + scope:actor = { has_relation_nemesis = scope:recipient } + } + trigger_if = { # Can't purchase Baronies + limit = { + scope:target ?= { tier = tier_barony } + } + custom_description = { + text = negotiate_settlement_barony_tt + always = no + } + } + trigger_if = { # Can't purchase Kingdoms or Empires + limit = { + scope:target ?= { tier >= tier_kingdom } + } + custom_description = { + text = negotiate_settlement_kingdom_tt + always = no + } + } + trigger_if = { + limit = { + scope:actor = { + any_held_county = { count < 2 } + } + } + custom_description = { + text = negotiate_settlement_minimum_county_tt + always = no + } + } + scope:recipient = { + is_busy_in_events_localised = yes + NOT = { has_strong_hook = scope:actor } + } + # Adventurers can't be negotiated back into places they're exiled from. + trigger_if = { + limit = { + scope:actor = { is_independent_ruler = no } + } + custom_tooltip = { + text = the_wake_1 + NOT = { + is_laamp_exiled_from_province_trigger = { + PROVINCE = scope:actor.capital_province + LAAMP = scope:recipient + } + } + } + } + # Story blockers. + ## Hereward cannot be exiled by active participants in the Harrying of the North. + disable_interaction_for_hereward_trigger = yes + ## Hasan cannot be exiled by anyone during his story. + disable_interaction_for_hasan_trigger = yes + } + + on_send = { + debug_log = "NEGOTIATE_SETTLEMENT" + debug_log_scopes = yes + } + + on_accept = { + scope:actor = { save_scope_as = adventurer } + scope:target = { + add_to_list = offered_titles + if = { + limit = { tier = tier_duchy } + every_de_jure_county = { + limit = { ep3_negotiate_settlement_valid_county_trigger = yes } + add_to_list = offered_titles + } + } + } + ordered_in_list = { + list = offered_titles + save_scope_as = new_primary_title + } + save_scope_value_as = { + name = negotiate_settlement_legitimacy_cost + value = { + value = 0 + every_in_list = { + list = offered_titles + if = { + limit = { tier = tier_county } + add = -25 + } + else = { add = -50 } + } + multiply = scope:actor.highest_held_title_tier + } + } + show_as_tooltip = { negotiate_settlement_interaction_effect = yes } + scope:actor = { trigger_event = ep3_laamps.0300 } + } + + on_decline = { + scope:actor = { + trigger_event = ep3_laamps.0302 + } + } + + ai_targets = { + ai_recipients = scripted_relations + ai_recipients = spouses + max = 5 + } + ai_targets = { + ai_recipients = top_realm_domicile_owners + ai_recipients = nearby_domicile_owners + max = 5 + } + ai_targets = { + ai_recipients = war_enemies + max = 10 + } + ai_frequency = 3 # Must be fairly common as it can happen during war + + ai_potential = { + OR = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + } + OR = { + is_at_war = yes + has_trait = craven + has_trait = generous + } + } + + 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 + } + ai_value_modifier = { + ai_boldness = -0.25 + ai_energy = -0.25 + ai_greed = 0.25 + } + modifier = { # Claims + add = { + value = 0 + if = { + limit = { + scope:recipient = { has_claim_on = scope:target } + } + add = 25 + } + if = { + limit = { scope:target.tier = tier_duchy } + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + save_temporary_scope_as = claim_temp + scope:recipient = { has_claim_on = scope:claim_temp } + } + add = 25 + } + } + } + } + desc = NEGOTIATE_SETTLEMENT_CLAIM_REASON + OR = { + scope:recipient = { has_claim_on = scope:target } + trigger_if = { + limit = { scope:target.tier = tier_duchy } + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + save_temporary_scope_as = county_temp + scope:recipient = { has_claim_on = scope:county_temp } + } + } + } + trigger_else = { always = no } + } + } + modifier = { + add = -300 + scope:recipient = { has_realm_law = camp_purpose_legitimists } + desc = NEGOTIATE_SETTLEMENT_LEGITIMIST_REASON + } + modifier = { # Tier lower than war claim + add = { + value = 0 + scope:recipient = { + every_character_war = { + limit = { + primary_attacker = scope:recipient + primary_defender = scope:actor + casus_belli = { + any_target_title = { tier > scope:target.tier } + } + } + casus_belli = { + every_target_title = { + limit = { tier > scope:target.tier } + add = -25 + } + } + } + } + } + desc = NEGOTIATE_SETTLEMENT_LOWER_THAN_WAR_TARGET_REASON + scope:recipient = { + any_character_war = { + primary_attacker = scope:recipient + primary_defender = scope:actor + casus_belli = { + any_target_title = { tier > scope:target.tier } + } + } + } + } + modifier = { # War Targets + add = { + value = 0 + scope:recipient = { + every_character_war = { + limit = { + primary_attacker = scope:recipient + casus_belli = { + any_target_title = { + OR = { + this = scope:target + de_jure_liege = scope:target + } + } + } + } + casus_belli = { + every_target_title = { + limit = { + OR = { + this = scope:target + de_jure_liege = scope:target + } + } + add = 25 + } + } + } + } + } + desc = NEGOTIATE_SETTLEMENT_WAR_TARGET_REASON + scope:recipient = { + any_character_war = { + primary_attacker = scope:recipient + casus_belli = { + any_target_title = { + OR = { + this = scope:target + de_jure_liege = scope:target + } + } + } + } + } + } + modifier = { # Num of counties/duchy + add = { + value = 0 + scope:target = { + if = { + limit = { tier = tier_county } + add = 25 + } + else = { + add = 50 + every_de_jure_county = { + limit = { ep3_negotiate_settlement_valid_county_trigger = yes } + add = 25 + } + } + } + } + desc = NEGOTIATE_SETTLEMENT_NUM_TITLES_REASON + } + modifier = { # Province value + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = scope:target.development_level + scope:target = { + every_county_province = { add = num_buildings } + } + } + else = { + scope:target = { + every_de_jure_county = { + limit = { ep3_negotiate_settlement_valid_county_trigger = yes } + add = development_level + every_county_province = { add = num_buildings } + } + } + } + } + #add = 1 + desc = NEGOTIATE_SETTLEMENT_VALUE_REASON + } + modifier = { # Land is foreign + add = -10 + desc = NEGOTIATE_SETTLEMENT_FOREIGN_COUNTY_CULTURE_REASON + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + culture != scope:recipient.culture + } + add = -10 + } + } + } + min = -30 + } + desc = NEGOTIATE_SETTLEMENT_FOREIGN_CULTURE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.culture != scope:recipient.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + culture != scope:recipient.culture + } + } + } + } + modifier = { # Different faith + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith != scope:recipient.faith + } + add = -10 + } + } + } + min = -30 + } + desc = NEGOTIATE_SETTLEMENT_DIFFERENT_FAITH_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith != scope:recipient.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith != scope:recipient.faith + } + } + } + } + modifier = { # Losing/winning as attacker + add = { + value = 0 + scope:recipient = { + ordered_character_war = { + limit = { + OR = { + primary_attacker = scope:actor + primary_defender = scope:actor + } + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + } + order_by = war_days + if = { + limit = { + primary_attacker = scope:actor + primary_defender = scope:recipient + } + add = defender_war_score + } + else = { add = attacker_war_score } + } + } + divide = 4 + } + desc = NEGOTIATE_SETTLEMENT_LOSING_WAR_REASON + scope:recipient = { + any_character_war = { + OR = { + primary_attacker = scope:actor + primary_defender = scope:actor + } + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + trigger_if = { + limit = { + primary_attacker = scope:actor + primary_defender = scope:recipient + } + defender_war_score >= 25 + } + trigger_else = { attacker_war_score >= 25 } + } + } + } + modifier = { # Losing/winning as defender + add = { + value = 0 + scope:recipient = { + ordered_character_war = { + limit = { + OR = { + primary_attacker = scope:actor + primary_defender = scope:actor + } + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + } + order_by = war_days + if = { + limit = { + primary_attacker = scope:actor + primary_defender = scope:recipient + } + add = attacker_war_score + } + else = { add = defender_war_score } + } + } + divide = 4 + } + desc = NEGOTIATE_SETTLEMENT_LOSING_WAR_REASON + scope:recipient = { + any_character_war = { + OR = { + primary_attacker = scope:actor + primary_defender = scope:actor + } + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + trigger_if = { + limit = { + primary_attacker = scope:actor + primary_defender = scope:recipient + } + attacker_war_score >= 25 + } + trigger_else = { defender_war_score >= 25 } + } + } + } + modifier = { # Number of troops at peace, + add = { + add = current_military_strength + multiply = -0.02 + } + desc = laamp_has_soldiers_negotiate_settlement_tt + } + modifier = { + add = -50000 + scope:actor = { is_ai = yes } + NOT = { + scope:target.tier >= tier_duchy + } + scope:recipient = { + NOR = { + current_military_strength < 1000 # You can do better + global_variable_list_size = { + name = laamps_tally + value >= too_many_laamps_value + } + } + NOR = { + AND = { + has_character_modifier = ep3_lust_for_land_modifier + ai_greed >= 25 + ai_boldness >= 25 + ai_rationality <= -25 + } + AND = { + has_trait = greedy + ai_rationality <= -50 + } + global_variable_list_size = { + name = laamps_tally + value >= too_many_laamps_value + } + } + } + } + } + + ai_will_do = { + base = -25 + modifier = { + add = 25 + scope:actor.domain_size > scope:actor.domain_limit + } + opinion_modifier = { + who = scope:actor + opinion_target = scope:recipient + multiplier = 0.25 + } + ai_value_modifier = { + ai_boldness = -0.25 + ai_energy = -0.25 + ai_greed = -0.25 + } + modifier = { # Tier lower than war claim + add = { + value = 0 + scope:recipient = { + every_character_war = { + limit = { + primary_attacker = scope:recipient + primary_defender = scope:actor + casus_belli = { + any_target_title = { tier > scope:target.tier } + } + attacker_war_score >= 50 + } + add = 150 + } + } + } + desc = NEGOTIATE_SETTLEMENT_SAVE_TITLE_REASON + scope:recipient = { + any_character_war = { + primary_attacker = scope:recipient + primary_defender = scope:actor + casus_belli = { + any_target_title = { tier > scope:target.tier } + } + attacker_war_score >= 50 + } + } + } + modifier = { + scope:recipient = { + is_landless_adventurer = yes + has_realm_law = camp_purpose_legitimists + any_claim = { + OR = { + holder ?= { + OR = { + this = scope:actor + target_is_liege_or_above = scope:actor + } + } + target_is_de_jure_liege_or_above = scope:actor.primary_title + } + } + } + desc = NEGOTIATE_SETTLEMENT_DE_JURE_LEGITIMIST_REASON + add = -150 + } + modifier = { # Defending against a LAAMP + any_character_war = { + primary_defender = scope:actor + any_war_attacker = { + scope:recipient ?= this + is_landless_adventurer = yes + NOT = { has_realm_law = camp_purpose_legitimists } + # Attacking laamp's troops at least 10% of defender's total troops + current_military_strength > war_defender_total_strength_tenth_value + } + OR = { + attacker_war_score >= 25 + # Attackers outnumber defenders at least 2:1 + war_attacker_total_current_strength_halved_value >= war_defender_total_current_strength_value + } + } + desc = NEGOTIATE_SETTLEMENT_DEFENDING_REASON + add = { + value = 0 + every_character_war = { + limit = { + primary_defender = scope:actor + any_war_attacker = { + scope:recipient ?= this + is_landless_adventurer = yes + NOT = { has_realm_law = camp_purpose_legitimists } + # Attacking laamp's troops at least 10% of defender's total troops + current_military_strength > war_defender_total_strength_tenth_value + } + } + add = { + value = 25 + add = { + value = attacker_war_score + subtract = 25 + min = 0 + } + if = { + limit = { + exists = primary_attacker + scope:recipient ?= primary_attacker + } + multiply = 2 + } + # Difference in strength of attackers and defenders + multiply = war_attacker_total_current_strength_divided_by_defender_value + } + } + } + } + modifier = { # Attacking a LAAMP + any_character_war = { + primary_attacker = scope:actor + any_war_defender = { + scope:recipient ?= this + is_landless_adventurer = yes + # Defending laamp's troops at least 10% of attacker's total troops + current_military_strength > war_attacker_total_strength_tenth_value + } + OR = { + defender_war_score >= 25 + # Defenders outnumber attackers at least 2:1 + war_defender_total_current_strength_halved_value >= war_attacker_total_current_strength_value + } + } + desc = NEGOTIATE_SETTLEMENT_ATTACKING_REASON + add = { + value = 0 + every_character_war = { + limit = { + primary_attacker = scope:actor + any_war_defender = { + scope:recipient ?= this + is_landless_adventurer = yes + # Defending laamp's troops at least 10% of attacker's total troops + current_military_strength > war_attacker_total_strength_tenth_value + } + } + add = { + value = 25 + add = { + value = defender_war_score + subtract = 25 + min = 0 + } + # Difference in strength of defenders and attackers + multiply = war_defender_total_current_strength_divided_by_attacker_value + } + } + } + } + modifier = { # Potential war target of a LAAMP + scope:recipient ?= { + ep3_adventurer_might_attack_target_trigger = { TARGET = scope:actor } + trigger_if = { + limit = { + NOT = { is_at_war_with = scope:actor } + } + ep3_laamp_diplo_range_trigger = { + TARGET = scope:actor + LAAMP = scope:recipient + } + } + } + desc = NEGOTIATE_SETTLEMENT_POTENTIAL_WAR_TARGET_REASON + add = { + value = 25 + multiply = recipient_strength_divided_by_actors_value + # Scale of threat + scope:recipient = { + if = { + limit = { + can_declare_war = { + casus_belli = ep3_laamp_adventurer_duchy_invasion + defender = scope:actor + } + } + multiply = 1.25 + } + if = { + limit = { + can_declare_war = { + casus_belli = ep3_laamp_adventurer_kingdom_invasion + defender = scope:actor + } + } + multiply = 1.5 + } + if = { + limit = { + can_declare_war = { + casus_belli = ep3_laamp_adventurer_empire_invasion + defender = scope:actor + } + } + multiply = 2 + } + } + scope:actor = { + # Worried about ongoing wars + if = { + limit = { + any_character_war = { + primary_defender = scope:actor + # Only care if attackers are really a threat + war_attacker_total_current_strength_value > war_defender_total_current_strength_halved_value + } + } + multiply = 2 + } + # Already at war + if = { + limit = { is_at_war_with = scope:recipient } + multiply = 0.5 + } + } + } + } + modifier = { # Potential faction claimant + exists = scope:recipient + scope:actor = { + any_targeting_faction = { + special_character ?= scope:recipient + faction_power >= faction_power_threshold + } + } + desc = NEGOTIATE_SETTLEMENT_CLAIMANT_REASON + add = { + value = 0 + every_targeting_faction = { + limit = { + special_character ?= scope:recipient + faction_power >= faction_power_threshold + } + add = 25 + } + } + } + modifier = { # Give claims to laamps + scope:target ?= { + any_claimant = { scope:recipient ?= this } + } + desc = NEGOTIATE_SETTLEMENT_CLAIM_REASON + add = { + value = 25 + if = { + limit = { + scope:target.tier = tier_county + } + subtract = scope:target.development_level + } + if = { + limit = { + scope:target.tier > tier_county + } + subtract = scope:target.title_capital_county.development_level + } + } + } + # Essentially the inverse of Purchase Land + modifier = { # Land is foreign + add = 10 + desc = NEGOTIATE_SETTLEMENT_FOREIGN_COUNTY_CULTURE_REASON + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = 10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + culture != scope:recipient.culture + } + add = 10 + } + } + } + max = 30 + } + desc = NEGOTIATE_SETTLEMENT_FOREIGN_CULTURE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.culture != scope:actor.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + culture != scope:actor.culture + } + } + } + } + modifier = { # Different faith + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = 10 + } + else = { + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith != scope:actor.faith + } + add = 10 + } + } + } + max = 30 + } + desc = NEGOTIATE_SETTLEMENT_DIFFERENT_FAITH_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith != scope:actor.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith != scope:actor.faith + } + } + } + } + modifier = { # My culture's lands + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -15 + } + else = { + add = -15 + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith != scope:actor.faith + } + add = -15 + } + } + } + if = { + limit = { scope:acceptance != 0 } + divide = scope:acceptance + } + min = -50 + } + desc = NEGOTIATE_SETTLEMENT_MY_CULTURE_REASON + scope:actor.culture != scope:recipient.culture + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.culture = scope:actor.culture + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + culture = scope:actor.culture + } + } + } + scope:actor.culture = { + save_temporary_scope_value_as = { + name = acceptance + value = { + value = "cultural_acceptance(scope:recipient.culture)" + divide = 25 + ceiling = yes + } + } + } + } + modifier = { # My faith's lands + add = { + value = 0 + if = { + limit = { scope:target.tier = tier_county } + add = -15 + } + else = { + add = -15 + scope:target = { + every_de_jure_county = { + limit = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith != scope:actor.faith + } + add = -15 + } + } + } + if = { + limit = { scope:hostility != 0 } + multiply = scope:hostility + } + min = -50 + } + desc = NEGOTIATE_SETTLEMENT_MY_FAITH_REASON + scope:actor.faith != scope:recipient.faith + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target.faith = scope:actor.faith + } + trigger_else = { + scope:target = { + any_de_jure_county = { + ep3_negotiate_settlement_valid_county_trigger = yes + faith = scope:actor.faith + } + } + } + scope:actor.faith = { + save_temporary_scope_value_as = { + name = hostility + value = "faith_hostility_level(scope:recipient.faith)" + } + } + } + modifier = { # Too close + add = { + value = 0 + add = scope:distance + divide = scope:actor.highest_held_title_tier + if = { + limit = { scope:distance <= squared_distance_medium } + multiply = -0.01 + } + else = { multiply = 0.0005 } + min = -25 + max = 50 + } + desc = NEGOTIATE_LAND_DISTANCE_REASON + trigger_if = { + limit = { scope:target.tier = tier_county } + scope:target = { save_temporary_scope_as = distance_target } + } + trigger_else = { + scope:target.title_capital_county = { save_temporary_scope_as = distance_target } + } + scope:actor.capital_county = { + save_temporary_scope_value_as = { + name = distance + value = "squared_distance(scope:distance_target)" + } + } + } + } +} + +################## +# Trade Oath +# by Joe Parkin +################## + +trade_oath_interaction = { + icon = hook_icon + category = interaction_category_laamp + interface_priority = 10 + + desc = trade_oath_interaction_desc + + is_shown = { + scope:actor = { + domicile ?= { has_domicile_parameter = camp_unlock_trade_oath_interaction } + NOT = { has_strong_hook = scope:recipient } + } + scope:recipient = { + is_courtier_of = scope:actor + NOR = { + has_hook = scope:actor + is_close_family_of = scope:actor + is_spouse_of = scope:actor + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + is_busy_in_events_localised = yes + } + scope:actor = { + is_at_war = no + is_imprisoned = no + } + scope:recipient.location = scope:actor.location + } + + cost = { prestige = 250 } + + on_accept = { + show_as_tooltip = { + scope:actor = { + add_hook = { + type = loyalty_hook + target = scope:recipient + } + } + scope:recipient = { + add_hook = { + type = follower_oath_hook + target = scope:actor + } + } + } + scope:actor = { trigger_event = ep3_laamps.1011 } + } + + ai_accept = { + base = -75 + + opinion_modifier = { opinion_target = scope:actor } + + # Traits. + ## Loyal + modifier = { + add = 30 + has_trait = loyal + } + ## Disloyal + modifier = { + add = -30 + has_trait = disloyal + } + ## Arbitrary + modifier = { + add = -20 + has_trait = arbitrary + } + ## Just + modifier = { + add = 20 + has_trait = just + } + ## Fickle + modifier = { + add = -10 + has_trait = fickle + } + ## Stubborn + modifier = { + add = 20 + has_trait = stubborn + } + ## Deceitful + modifier = { + add = -5 + has_trait = deceitful + } + ## Honest + modifier = { + add = 5 + has_trait = honest + } + } + ai_potential = { + has_realm_law = camp_purpose_legitimists + } + # Always do it if you get the chance. + ai_will_do = { base = 1000 } + + ai_targets = { ai_recipients = courtiers } + ai_frequency = 12 + auto_accept = yes +} + +################## +# Pawn Gear +# by Joe Parkin +################## + +pawn_gear_interaction = { + icon = artisan_inspiration + category = interaction_category_laamp + interface_priority = 10 + common_interaction = yes + desc = pawn_gear_interaction_desc + + target_type = artifact + target_filter = actor_artifacts + + is_shown = { + scope:actor = { + domicile ?= { has_domicile_parameter = camp_unlocks_pawn_gear_interaction } + this = scope:recipient + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_at_war = no + is_imprisoned = no + has_any_artifact = yes + trigger_if = { + limit = { is_ai = no } + custom_description = { + text = "any_unequipped_artifact_tt" + any_character_artifact = { is_equipped = no } + } + } + } + } + + can_be_picked_artifact = { + trigger_if = { + limit = { + scope:actor = { is_ai = no } + } + scope:target = { is_equipped = no } + } + scope:actor = { + any_character_artifact = { this = scope:target } + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_good + title = pawn_gear_interaction_notification + left_icon = scope:actor + add_short_term_gold = artifact_wealth_quality_average_value + destroy_artifact = scope:target + } + } + } + + auto_accept = yes +} + +################## +# Complete the Contract +# by Arkadiusz Majewski +# Needed for the action_can_complete_task_contract and to be able to end contracts if you cancelled the initial travel planner +################## + +complete_task_contract_interaction = { + category = interaction_category_laamp + interface_priority = 120 + common_interaction = yes + icon = icon_contract_escort + use_diplomatic_range = no + + popup_on_receive = yes + pause_on_receive = yes + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + any_character_active_contract = { + OR = { + ep3_transport_contract_trigger = yes + has_task_contract_type = laamp_help_increase_control_contract + } + OR = { + task_contract_employer ?= scope:recipient + task_contract_destination.province_owner ?= scope:recipient + task_contract_target ?= scope:recipient + var:task_contract_object ?= scope:recipient + } + } + } + } + + is_valid_showing_failures_only = { + } + + is_highlighted = { + always = yes + } + + send_option = { + flag = without_domicile + } + + send_option = { + flag = with_domicile + } + + on_accept = { + scope:actor = { + random_character_active_contract = { + limit = { + OR = { + ep3_transport_contract_trigger = yes + has_task_contract_type = laamp_help_increase_control_contract + } + #check for any contract that has the recipient as any relevant character to it (employer, target, target destination owner, escortee) + OR = { + task_contract_employer ?= scope:recipient + task_contract_destination.province_owner ?= scope:recipient + task_contract_target ?= scope:recipient + var:task_contract_object ?= scope:recipient + } + } + save_scope_as = task_contract + } + #set all the scopes + if = { + limit = { + exists = scope:task_contract.var:task_contract_employer + } + scope:task_contract.var:task_contract_employer ?= { + save_scope_as = task_contract_employer + } + } + if = { + limit = { + scope:task_contract = { + has_task_contract_type = laamp_help_increase_control_contract + } + } + scope:task_contract.var:task_contract_councillor_liege ?= { + save_scope_as = task_contract_councillor_liege + } + } + if = { + limit = { + exists = scope:task_contract.var:task_contract_destination + } + scope:task_contract.var:task_contract_destination = { + save_scope_as = task_contract_destination + } + } + if = { + limit = { + exists = scope:task_contract.var:task_contract_target + } + scope:task_contract.var:task_contract_target ?= { + save_scope_as = task_contract_target + } + } + if = { + limit = { + exists = scope:task_contract.var:task_contract_object + } + scope:task_contract.var:task_contract_object = { + save_scope_as = task_contract_object + } + } + if = { + limit = { + exists = scope:task_contract.var:escorted_artifact + } + scope:task_contract.var:escorted_artifact = { + save_scope_as = escorted_artifact + } + } + if = { + limit = { + exists = scope:task_contract.var:escorted_gold + } + scope:task_contract.var:escorted_gold = { + save_scope_as = escorted_gold + } + } + if = { + limit = { + exists = scope:task_contract.var:escorted_story + } + scope:task_contract.var:escorted_story = { + save_scope_as = escorted_story + } + } + #show a nice tooltip with which contract, who you are taking and where are you going info + scope:task_contract = { + switch = { + trigger = has_task_contract_type + laamp_transport_vip = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_vip } + } + laamp_transport_ward = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_ward } + } + laamp_transport_explorer = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_explorer } + } + laamp_transport_artifact = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_artifact } + } + laamp_transport_gold = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_gold } + } + laamp_transport_animal = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_animal } + } + laamp_construction_contract = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_construction } + } + laamp_help_increase_control_contract = { + scope:actor = { custom_tooltip = ep3_contract_event.0001.tt_increase_control } + } + } + } + #trigger the travel planner + switch = { + trigger = yes + scope:with_domicile = { + start_travel_plan = { + destination = scope:task_contract_destination + travel_with_domicile = yes + on_arrival_destinations = all + } + custom_tooltip = ep3_contract_event.0001.with_domicile.tt + } + scope:without_domicile = { + start_travel_plan = { + destination = scope:task_contract_destination + on_arrival_destinations = all + } + } + } + } + } + + auto_accept = yes +} + +################## +# Make a Request +# by Arkadiusz Majewski +# As a LAAMP you can ask characters on your contact list for something +################## + +contact_list_request_interaction = { # make a request, make_a_request + category = interaction_category_laamp + interface_priority = 110 + icon = icon_scheme_befriend + desc = contact_list_request_interaction_desc + common_interaction = yes + + popup_on_receive = yes + pause_on_receive = yes + + ai_min_reply_days = 0 + ai_max_reply_days = 0 + + cooldown_against_recipient = { months = 8 } + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { government_has_flag = government_is_landless_adventurer } + scope:actor != scope:recipient + } + is_valid_showing_failures_only = { + scope:recipient = { + is_adult = yes + is_imprisoned = no + NOR = { + is_at_war_with = scope:actor + has_relation_rival = scope:actor + has_relation_nemesis = scope:actor + has_opinion_modifier = { + target = scope:actor + modifier = released_from_prison + } + has_opinion_modifier = { + target = scope:actor + modifier = eviction_ignored_opinion + } + existing_feud_against_target_trigger = { TARGET = scope:actor } + } + } + scope:actor = { + NOT = { has_truce = scope:recipient } + } + scope:recipient = { + trigger_if = { + limit = { + NOR = { + is_contact_of = scope:actor + is_close_or_extended_family_of = scope:actor + is_consort_of = scope:actor + AND = { + OR = { + capital_province ?= scope:actor.domicile.domicile_location + any_held_title = { + tier = tier_county + any_county_province = { + this = scope:actor.domicile.domicile_location + } + } + } + scope:actor = { has_perk = embassies_perk } + } + } + } + is_contact_of = scope:actor + } + } + scope:recipient = { + custom_tooltip = { + text = RULER_DESIGNER_ACHIEVEMENTS_NOT_AVAILABLE + OR = { + is_landed = yes + gold > 20 + AND = { + is_landed_or_landless_administrative = yes + scope:actor.maa_regiments_count < scope:actor.maa_regiments_max_count + } + AND = { + #Recipient can marry the actor + can_marry_character_trigger = { CHARACTER = scope:actor } + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + } + } + } + } + is_highlighted = { + scope:actor = { + is_character_interaction_potentially_accepted = { + recipient = scope:recipient + interaction = contact_list_request_interaction + } + } + } + can_send = { + #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 + } + } + #request provisions + send_option = { + flag = request_provisions + is_valid = { + scope:recipient = { + is_landed = yes + } + } + } + #request gold + send_option = { + flag = request_gold + is_valid = { + custom_tooltip = { + scope:recipient.gold > 20 + text = contact_list_request_interaction.request_gold_recipient_not_enough_gold + } + } + } + #request men-at-arms regiment + send_option = { + flag = request_maa + is_valid = { + scope:recipient = { + is_landed_or_landless_administrative = yes + } + custom_tooltip = { + scope:actor.maa_regiments_count < scope:actor.maa_regiments_max_count + text = contact_list_request_interaction.request_maa_actor_too_many_regiments + } + } + } + #request a knight + send_option = { + flag = request_knights + is_shown = { + scope:recipient = { is_ai = yes } + } + is_valid = { + custom_tooltip = { + scope:recipient = { + any_knight = { + is_landed = no + count > 1 + } + } + text = contact_list_request_interaction.request_knights_recipient_not_enough_knights + } + } + } + #request to arrange a marriage + send_option = { + flag = request_marriage + is_valid = { + #There is an available marriage, copied from 00_marriage_interactions is_valid_showing_failures_only + custom_description = { + text = "basic_can_marry_check_recipient" + subject = scope:actor + object = scope:recipient + scope:recipient = { + OR = { + AND = { + #Recipient can marry the actor + can_marry_character_trigger = { CHARACTER = scope:actor } + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + can_marry_character_trigger = { CHARACTER = scope:actor } + } + } + AND = { + is_ruler = yes #(Following are only for rulers) + OR = { + any_child = { + matchmaker = scope:actor + OR = { + #Any of recipient's children can marry + AND = { + can_marry_trigger = yes + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + } + } + #Any of recipient's children are ready to marry their betrothed + AND = { + ready_to_marry_betrothed_trigger = yes + betrothed.matchmaker = scope:actor + } + } + } + any_courtier = { + OR = { + #Any of recipient's courtiers can marry + AND = { + can_marry_trigger = yes + #To account for a person marrying their concubines + trigger_if = { + limit = { + is_concubine = yes + } + is_concubine_of = scope:actor + } + } + #Any of recipient's courtiers are ready to marry their betrothed + AND = { + ready_to_marry_betrothed_trigger = yes + betrothed.matchmaker = scope:actor + } + } + } + } + } + } + } + } + } + } + #request new contract + send_option = { + flag = request_contract + is_shown = { + scope:recipient = { is_ai = yes } + } + is_valid = { + custom_tooltip = { + text = contact_list_request_interaction.create_contracts.already_has_contract + scope:actor = { + any_character_task_contract = { + count = all + task_contract_employer != scope:recipient + } + is_ai = no + } + } + custom_description = { + text = contact_list_request_interaction_create_contracts + object = scope:recipient + scope:actor = { + OR = { + can_create_task_contract = { + type_name = laamp_raid_contract + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_join_war_contract + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_steal_artifact_contract + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_construction_contract + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_treasure_hunting_contract + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_transport_vip + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_transport_artifact + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_transport_gold + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_transport_ward + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_transport_explorer + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_transport_animal + employer = scope:recipient + } + can_create_task_contract = { + type_name = laamp_join_faction_contract + employer = scope:recipient + } + } + } + } + } + } + #request feast + send_option = { + flag = request_feast + is_shown = { + scope:actor = { + has_perk = inspiring_rule_perk + } + scope:recipient = { + is_landed_or_landless_administrative = yes + capital_province ?= { + squared_distance = { + target = scope:actor.capital_province + value < define:NTaskContract|ADVENTURER_DISTANCE_RESTRICTION + } + } + } + scope:recipient = { is_ai = yes } + } + is_valid = { + scope:recipient = { + highest_held_title_tier > tier_barony + is_at_war = no + is_available_adult = yes + } + scope:actor = { + custom_tooltip = { + text = ACTIVITY_SUMMARY_COOLDOWN_HEADER + NOT = { has_character_flag = laamp_recently_requested_feast } + } + } + } + } + #request tournament + send_option = { + flag = request_tournament + is_shown = { + has_ep2_dlc_trigger = yes + scope:actor = { + has_perk = stalwart_leader_perk + } + scope:recipient = { + is_landed = yes + ai_has_conqueror_personality = no + capital_province ?= { + squared_distance = { + target = scope:actor.capital_province + value < define:NTaskContract|ADVENTURER_DISTANCE_RESTRICTION + } + } + } + scope:recipient = { is_ai = yes } + } + is_valid = { + scope:recipient = { + highest_held_title_tier > tier_barony + is_at_war = no + is_available_adult = yes + } + scope:actor = { + custom_tooltip = { + text = contact_list_request_interaction.request_tournament_cooldown + NOT = { has_character_flag = laamp_recently_requested_tourney } + } + } + } + } + should_use_extra_icon = { + scope:actor = { has_usable_hook = scope:recipient } + } + extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" + + cost = { + prestige = { + add = 100 + # Upgrade for tier. + multiply = { + value = scope:recipient.highest_held_title_tier + # Discount barons. + add = -1 + } + # Upgrade for the more egregious requests. + ## Marriage. + if = { + limit = { scope:request_marriage = yes } + multiply = 1.5 + } + ## Activities. + ### Tournament. + if = { + limit = { scope:request_tournament = yes } + multiply = 2 + } + ### Feast. + if = { + limit = { scope:request_feast = yes } + multiply = 1.25 + } + min = 100 + } + } + + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:request_tournament ?= { + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion_special + target = scope:actor + opinion = -50 + } + custom_tooltip = contact_list_request_interaction.request_tournament + } + hidden_effect = { + scope:recipient = { + add_character_flag = { + flag = tournament_ai_override + } + ai_attempt_to_host_activity = activity_tournament + } + scope:actor = { + add_character_flag = { + flag = laamp_recently_requested_tourney + days = 3650 + } + } + } + } + scope:request_feast ?= { + scope:actor = { custom_tooltip = contact_list_request_interaction.request_feast_honor } + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion + target = scope:actor + opinion = -30 + } + custom_tooltip = contact_list_request_interaction.request_feast + } + hidden_effect = { + scope:recipient = { + add_character_flag = { + flag = feast_ai_override + } + ai_attempt_to_host_activity = activity_feast + } + scope:actor = { + add_character_flag = { + flag = laamp_recently_requested_feast + days = 1875 + } + } + } + } + scope:request_provisions ?= { + save_scope_value_as = { + name = provisions_to_add_value + value = { + if = { + limit = { scope:recipient.highest_held_title_tier >= tier_empire } + add = monumental_provisions_gain + } + else_if = { + limit = { scope:recipient.highest_held_title_tier >= tier_kingdom } + add = massive_provisions_gain + } + else_if = { + limit = { scope:recipient.highest_held_title_tier >= tier_duchy } + add = major_provisions_gain + } + else_if = { + limit = { scope:recipient.highest_held_title_tier >= tier_county } + add = medium_provisions_gain + } + else = { add = minor_provisions_gain } + } + } + if = { + limit = { + scope:actor.domicile.max_provisions < { + value = { + value = scope:provisions_to_add_value + add = scope:actor.domicile.provisions + } + } + } + save_scope_value_as = { + name = gained_provisions_value + value = { + value = scope:actor.domicile.max_provisions + subtract = scope:actor.domicile.provisions + } + } + save_scope_value_as = { + name = provisions_overflow_value + value = { + value = scope:provisions_to_add_value + subtract = scope:gained_provisions_value + } + } + save_scope_value_as = { + name = provisions_transformed_to_gold_value + value = { + value = scope:provisions_overflow_value + multiply = 0.05 + } + } + } + else = { + save_scope_value_as = { + name = gained_provisions_value + value = scope:provisions_to_add_value + } + } + send_interface_toast = { + type = event_toast_effect_good + title = contact_list_request_interaction.request_provisions_tt + left_icon = scope:actor + right_icon = scope:recipient + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion_special + target = scope:actor + opinion = -20 + } + if = { + limit = { + exists = capital_county + } + hidden_effect = { + capital_county = { + add_county_modifier = { + modifier = ep3_gave_out_provisions + years = 3 + } + #save it for loc in custom tooltip + save_scope_as = capital_county + } + } + custom_tooltip = contact_list_request_interaction.capital_county_modifier + } + } + scope:actor = { + custom_tooltip = contact_list_request_interaction.gained_provisions_value + hidden_effect = { + domicile = { + change_provisions = scope:gained_provisions_value + } + } + if = { + limit = { + exists = scope:provisions_transformed_to_gold_value + } + custom_tooltip = { + text = overflowing_provisions_to_gold.tt + add_gold = scope:provisions_transformed_to_gold_value + } + } + } + } + } + scope:request_gold ?= { + save_scope_value_as = { + name = requested_gold_value + value = { + value = scope:recipient.gold + divide = 4 + multiply = { + value = scope:recipient.ai_greed + divide = -300 + add = 1 + } + if = { + limit = { + scope:recipient = { + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:actor } + } + } + multiply = 1.5 + } + else_if = { + limit = { + scope:recipient = { + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:actor } + } + } + multiply = 1.25 + } + max = { + scope:recipient.culture = { + if = { + limit = { + has_cultural_era_or_later = culture_era_late_medieval + } + value = 250 + } + else_if = { + limit = { + has_cultural_era_or_later = culture_era_high_medieval + } + value = 200 + } + else_if = { + limit = { + has_cultural_era_or_later = culture_era_early_medieval + } + value = 150 + } + else_if = { + limit = { + has_cultural_era_or_later = culture_era_tribal + } + value = 100 + } + else = { + value = 50 + } + } + } + floor = yes + min = 5 + } + } + send_interface_toast = { + type = event_toast_effect_good + title = contact_list_request_interaction.request_gold_tt + left_icon = scope:actor + right_icon = scope:recipient + scope:actor = { + show_as_tooltip = { + add_gold = scope:requested_gold_value + } + } + scope:recipient = { + pay_short_term_gold = { + target = scope:actor + gold = scope:requested_gold_value + } + add_opinion = { + modifier = laamp_used_contact_opinion + target = scope:actor + opinion = -40 + } + } + } + } + scope:request_maa ?= { + custom_tooltip = contact_list_request_interaction.request_maa + hidden_effect = { + ep3_pick_random_maa_regiment_effect = { + OWNER = scope:recipient + INCLUDE_BASIC_MAA = no + INCLUDE_SIEGE_MAA = no + } + send_interface_toast = { + type = event_toast_effect_good + title = contact_list_request_interaction.request_maa_tt + left_icon = scope:actor + right_icon = scope:recipient + ep3_create_random_maa_regiment_effect = { + OWNER = scope:actor + SIZE = 1 + } + } + } + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion + target = scope:actor + opinion = -40 + } + } + } + scope:request_knights ?= { + scope:actor = { + custom_tooltip = contact_list_request_interaction.request_knights + trigger_event = ep3_interactions_events.0101 + } + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion + target = scope:actor + opinion = -30 + } + } + } + scope:request_marriage ?= { + scope:actor = { + custom_tooltip = contact_list_request_interaction.request_marriage + custom_tooltip = contact_list_request_interaction.request_marriage.marriagable_women + custom_tooltip = contact_list_request_interaction.request_marriage.marriagable_men + custom_tooltip = contact_list_request_interaction.request_marriage.warning + if = { + limit = { is_ai = no } + open_interaction_window = { + interaction = arrange_marriage_interaction + actor = scope:actor + recipient = scope:recipient + } + } + add_to_variable_list = { + name = contact_list_marriage + target = scope:recipient + } + } + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion + target = scope:actor + opinion = -50 + } + } + } + scope:request_contract ?= { + scope:actor = { + custom_tooltip = contact_list_request_interaction.request_contract + hidden_effect = { + random_list = { + #laamp_raid_contract + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_raid_contract + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_mercenaries + } + create_task_contract = { + task_contract_type = laamp_raid_contract + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_raid_contract + value = yes + } + } + #laamp_join_war_contract + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_join_war_contract + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_mercenaries + } + create_task_contract = { + task_contract_type = laamp_join_war_contract + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_join_war_contract + value = yes + } + } + #laamp_steal_artifact_contract + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_steal_artifact_contract + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_brigands + } + create_task_contract = { + task_contract_type = laamp_steal_artifact_contract + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_steal_artifact_contract + value = yes + } + } + #laamp_construction_contract + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_construction_contract + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_scholars + } + create_task_contract = { + task_contract_type = laamp_construction_contract + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_construction_contract + value = yes + } + } + #laamp_treasure_hunting_contract + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_treasure_hunting_contract + employer = scope:recipient + } + } + modifier = { + add = 10 + OR = { + has_realm_law = camp_purpose_brigands + has_realm_law = camp_purpose_explorers + } + } + create_task_contract = { + task_contract_type = laamp_treasure_hunting_contract + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_treasure_hunting_contract + value = yes + } + } + #laamp_transport_vip + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_transport_vip + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_explorers + } + create_task_contract = { + task_contract_type = laamp_transport_vip + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_transport_vip + value = yes + } + } + #laamp_transport_artifact + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_transport_artifact + employer = scope:recipient + } + } + modifier = { + add = 10 + OR = { + has_realm_law = camp_purpose_brigands + has_realm_law = camp_purpose_explorers + } + } + create_task_contract = { + task_contract_type = laamp_transport_artifact + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_transport_artifact + value = yes + } + } + #laamp_transport_gold + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_transport_gold + employer = scope:recipient + } + } + modifier = { + add = 10 + OR = { + has_realm_law = camp_purpose_brigands + has_realm_law = camp_purpose_explorers + } + } + create_task_contract = { + task_contract_type = laamp_transport_gold + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_transport_gold + value = yes + } + } + #laamp_transport_ward + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_transport_ward + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_explorers + } + create_task_contract = { + task_contract_type = laamp_transport_ward + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_transport_ward + value = yes + } + } + #laamp_transport_explorer + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_transport_explorer + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_explorers + } + create_task_contract = { + task_contract_type = laamp_transport_explorer + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_transport_explorer + value = yes + } + } + #laamp_transport_animal + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_transport_animal + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_explorers + } + create_task_contract = { + task_contract_type = laamp_transport_animal + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_transport_animal + value = yes + } + } + #laamp_join_faction_contract + 1 = { + trigger = { + can_create_task_contract = { + type_name = laamp_join_faction_contract + employer = scope:recipient + } + } + modifier = { + add = 10 + has_realm_law = camp_purpose_mercenaries + } + create_task_contract = { + task_contract_type = laamp_join_faction_contract + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + save_scope_as = new_contract + } + save_scope_value_as = { + name = create_laamp_join_faction_contract + value = yes + } + } + } + scope:new_contract = { + open_view_data = { + view = task_contract + player = scope:actor + } + } + } + } + scope:recipient = { + add_opinion = { + modifier = laamp_used_contact_opinion + target = scope:actor + opinion = -5 + } + show_as_tooltip = { + custom_description_no_bullet = { text = contact_list_request_interaction_possible_outcomes } + if = { + limit = { + scope:create_laamp_raid_contract ?= yes + } + create_task_contract = { + task_contract_type = laamp_raid_contract + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_join_war_contract ?= yes + } + create_task_contract = { + task_contract_type = laamp_join_war_contract + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_construction_contract ?= yes + } + create_task_contract = { + task_contract_type = laamp_construction_contract + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_steal_artifact_contract ?= yes + } + create_task_contract = { + task_contract_type = laamp_steal_artifact_contract + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_treasure_hunting_contract ?= yes + } + create_task_contract = { + task_contract_type = laamp_treasure_hunting_contract + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_transport_vip ?= yes + } + create_task_contract = { + task_contract_type = laamp_transport_vip + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_transport_artifact ?= yes + } + create_task_contract = { + task_contract_type = laamp_transport_artifact + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_transport_gold ?= yes + } + create_task_contract = { + task_contract_type = laamp_transport_gold + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_transport_ward ?= yes + } + create_task_contract = { + task_contract_type = laamp_transport_ward + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_transport_explorer ?= yes + } + create_task_contract = { + task_contract_type = laamp_transport_explorer + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_transport_animal ?= yes + } + create_task_contract = { + task_contract_type = laamp_transport_animal + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + if = { + limit = { + scope:create_laamp_join_faction_contract ?= yes + } + create_task_contract = { + task_contract_type = laamp_join_faction_contract + location = scope:recipient.location + task_contract_employer = scope:recipient + task_contract_tier = scope:recipient.task_contract_tier_value + } + } + } + } + } + } + if = { + limit = { + has_usable_hook = scope:recipient + scope:recipient = { is_ai = yes } + } + use_hook = scope:recipient + custom_tooltip = contact_list_request_interaction.tt.hook_auto_used + } + } + scope:recipient = { + add_prestige = { + value = scope:actor.prestige_level + multiply = 100 + } + } + } + + can_send_despite_rejection = no + ai_frequency = 3 + ai_targets = { ai_recipients = contacts } + ai_targets = { ai_recipients = hooked_characters } + auto_accept = { + scope:actor = { has_usable_hook = scope:recipient } + scope:recipient = { is_ai = yes } + } + ai_potential = { government_has_flag = government_is_landless_adventurer } + ai_accept = { + base = 0 + + modifier = { + add = -50 + scope:recipient = { + NOR = { + is_contact_of = scope:actor + is_close_or_extended_family_of = scope:actor + is_consort_of = scope:actor + } + } + desc = contact_list_request_interaction.no_contact + } + + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.5 + desc = AI_OPINION_REASON + } + + modifier = { + add = -50 + scope:recipient = { + has_opinion_modifier = { + modifier = laamp_used_contact_opinion + target = scope:actor + } + } + desc = contact_list_request_interaction.repeated_request + } + + ai_value_modifier = { + ai_compassion = -0.5 + ai_greed = -0.5 + min = -50 + max = 50 + } + + modifier = { + add = 30 + desc = contact_list_request_interaction.request_gold.contract + scope:request_contract ?= yes + } + + modifier = { + add = -30 + desc = contact_list_request_interaction.request_gold.poor_recipient + scope:request_gold ?= yes + scope:recipient = { + gold < major_gold_value + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.request_gold.stewardship + OR = { + scope:request_provisions ?= yes + scope:request_gold ?= yes + } + scope:recipient = { + has_trait = education_stewardship + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.request_gold.martial + OR = { + scope:request_maa ?= yes + scope:request_knights ?= yes + } + scope:recipient = { + has_trait = education_martial + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.request.defensive_negotiations_perk + OR = { + scope:request_maa ?= yes + scope:request_knights ?= yes + } + scope:actor = { + has_perk = defensive_negotiations_perk + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.relevant_focus + scope:request_marriage ?= yes + scope:recipient = { + OR = { + has_focus = diplomacy_family_focus + has_focus = intrigue_temptation_focus + has_focus = martial_chivalry_focus + } + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.relevant_focus + OR = { + scope:request_maa ?= yes + scope:request_knights ?= yes + } + scope:recipient = { + OR = { + has_focus = martial_strategy_focus + has_focus = martial_chivalry_focus + has_focus = martial_authority_focus + } + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.request_knights.plenty + scope:request_knights ?= yes + scope:recipient = { + number_of_knights > 6 + } + } + + modifier = { + add = -25 + desc = contact_list_request_interaction.request_knights.little + scope:request_knights ?= yes + scope:recipient = { + number_of_knights <= 6 + } + } + + modifier = { + add = -25 + desc = contact_list_request_interaction.powerful + scope:request_maa ?= yes + scope:actor = { + max_military_strength >= 400 + max_military_strength < 800 + } + } + + modifier = { + add = -50 + desc = contact_list_request_interaction.very_powerful + scope:request_maa ?= yes + scope:actor.max_military_strength >= 800 + } + + modifier = { + add = -30 + desc = contact_list_request_interaction.stronger_than_me + scope:request_maa ?= yes + scope:actor.max_military_strength > scope:recipient.max_military_strength + } + + modifier = { + add = -25 + desc = contact_list_request_interaction.traveler + scope:request_provisions ?= yes + scope:recipient = { + has_trait = lifestyle_traveler + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.adventurer + scope:recipient = { + has_trait = adventurer + } + } + + modifier = { + add = 25 + desc = contact_list_request_interaction.adventurer_follower + scope:recipient = { + has_trait = adventurer_follower + } + } + + modifier = { + add = 20 + desc = contact_list_request_interaction.flexible_truces_perk + scope:actor = { + has_perk = flexible_truces_perk + } + } + + # Your level of prestige. + ## Impotent + modifier = { + add = -10 + desc = AI_OPINION_PRESTIGE_LEVEL_DISGRACED + scope:actor.prestige_level = 0 + } + ## Influential + ### Would be zero, so it wouldn't appear. + ## Persuasive + modifier = { + add = 5 + desc = AI_OPINION_PRESTIGE_LEVEL_DISTINGUISHED + scope:actor.prestige_level = 2 + scope:actor = { + NOT = { + has_perk = true_ruler_perk + } + } + } + ## Controlling + modifier = { + add = 10 + desc = AI_OPINION_PRESTIGE_LEVEL_ILLUSTRIOUS + scope:actor.prestige_level = 3 + scope:actor = { + NOT = { + has_perk = true_ruler_perk + } + } + } + ## Authoritative + modifier = { + add = 20 + desc = AI_OPINION_PRESTIGE_LEVEL_EXALTED + scope:actor.prestige_level = 4 + scope:actor = { + NOT = { + has_perk = true_ruler_perk + } + } + } + ## Imperious + modifier = { + add = 30 + desc = AI_OPINION_PRESTIGE_LEVEL_LEGENDARY + scope:actor.prestige_level = 5 + scope:actor = { + NOT = { + has_perk = true_ruler_perk + } + } + } + + ## Persuasive + modifier = { + add = 6 + desc = AI_OPINION_PRESTIGE_LEVEL_DISTINGUISHED + scope:actor.prestige_level = 2 + scope:actor = { has_perk = true_ruler_perk } + } + ## Controlling + modifier = { + add = 12 + desc = AI_OPINION_PRESTIGE_LEVEL_ILLUSTRIOUS + scope:actor.prestige_level = 3 + scope:actor = { has_perk = true_ruler_perk } + } + ## Authoritative + modifier = { + add = 24 + desc = AI_OPINION_PRESTIGE_LEVEL_EXALTED + scope:actor.prestige_level = 4 + scope:actor = { has_perk = true_ruler_perk } + } + ## Imperious + modifier = { + add = 36 + desc = AI_OPINION_PRESTIGE_LEVEL_LEGENDARY + scope:actor.prestige_level = 5 + scope:actor = { has_perk = true_ruler_perk } + } + } + + ai_will_do = { + base = 50 + + # Set up the AI so that they actually know how to use the send_options. + ## Troops, if they don't have gold. + modifier = { + add = 50 + scope:recipient.gold < 50 + scope:request_maa = yes + } + ## Gold is always good. + modifier = { + add = 50 + scope:recipient.gold >= 30 + scope:request_gold = yes + } + ## Feasts are especially attractive for some adventurers. + modifier = { + add = 50 + scope:request_feast = yes + OR = { + prestige <= 500 + has_trait = arrogant + has_trait = gluttonous + has_trait = gregarious + has_trait = drunkard + } + } + ## Provisions are fine, but nothing special for the AI. + modifier = { + add = 5 + scope:request_provisions = yes + scope:actor.domicile.provisions < scope:actor.domicile.max_provisions + } + ## Don't go crazy with tournaments + modifier = { + factor = 0 + scope:request_tournament = yes + } + modifier = { + factor = 0 + NOR = { + scope:request_provisions = yes + scope:request_gold = yes + scope:request_maa = yes + scope:request_knights = yes + scope:request_marriage = yes + scope:request_contract = yes + scope:request_feast = yes + scope:request_tournament = yes + } + } + } +} + +################## +# Seize Realm Scheme +# by Joe Parkin +################## + +seize_realm_interaction = { + icon = icon_scheme_seizure + category = interaction_category_laamp + interface_priority = 10 + + ignores_pending_interaction_block = yes + + scheme = seize_realm + + send_name = START_SCHEME + + is_shown = { + NOT = { scope:recipient = scope:actor } + scope:actor = { government_has_flag = government_is_landless_adventurer } + scope:recipient = { + is_landed = yes + highest_held_title_tier >= tier_county + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = seize_realm + target_character = scope:recipient + } + } + NOT = { + scope:recipient = { has_strong_hook = scope:actor } + } + #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 = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = seize_realm + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_seize_realm_approved + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Balanced agents. + send_option = { + flag = agent_focus_balance + current_description = seize_realm_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = seize_realm_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = seize_realm_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = seize_realm_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 = { + title = start_seize_realm_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 = seize_realm + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_muscle + AGENT_2 = agent_muscle + AGENT_3 = agent_diplomat + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = seize_realm + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_infiltrator + AGENT_2 = agent_footpad + AGENT_3 = agent_planner + # Success. + AGENT_4 = agent_muscle + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = seize_realm + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_decoy + AGENT_3 = agent_decoy + # Success. + AGENT_4 = agent_muscle + # Speed. + AGENT_5 = agent_infiltrator + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = seize_realm + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_muscle + AGENT_2 = agent_muscle + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_planner + # Secrecy. + AGENT_5 = agent_lookout + } + } + + show_as_tooltip = { + stress_impact = { + honest = medium_stress_impact_gain + just = medium_stress_impact_gain + } + } + } + } + custom_tooltip = seize_realm_warning + } + + auto_accept = yes +} + +################## +# Reinforce Soldiers +# by Joe Parkin +################## + +reinforce_soldiers_interaction = { + icon = owner_in_debt + category = interaction_category_laamp + interface_priority = 10 + common_interaction = yes + desc = reinforce_soldiers_interaction_desc + cooldown = { months = 6 } + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + government_allows = conditional_maa_refill + } + scope:recipient = scope:actor + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = reinforce_soldiers_any_regiment_tt + scope:actor.maa_regiments_count >= 1 + } + custom_tooltip = { + text = reinforce_soldiers_unfull_regiment_tt + scope:actor = { + any_maa_regiment = { maa_regiments_valid_for_cheap_reinforcement_trigger = yes } + } + } + custom_tooltip = { + text = SUPPLY_LOSS_AT_SEA + scope:actor = { any_laamp_portion_at_sea_trigger = no } + } + } + + send_options_exclusive = yes + + send_option = { + flag = skill + localization = reinforce_soldiers_option_skill + current_description = reinforce_soldiers_option_skill_desc + } + + send_option = { + flag = prestige + localization = reinforce_soldiers_option_prestige + current_description = reinforce_soldiers_option_prestige_desc + } + + send_option = { + flag = piety + localization = reinforce_soldiers_option_piety + current_description = reinforce_soldiers_option_piety_desc + is_valid = { + custom_tooltip = { + text = reinforce_soldiers_option_piety_tt + scope:actor.domicile.domicile_location.county ?= { + OR = { + holder ?= { government_has_flag = government_is_theocracy } + any_county_province = { + barony = { + is_under_holy_order_lease = yes + lessee.faith = scope:actor.faith + } + } + } + } + } + } + } + + send_option = { + flag = dread + localization = reinforce_soldiers_option_dread + current_description = reinforce_soldiers_option_dread_desc + is_valid = { + custom_tooltip = { + text = reinforce_soldiers_option_dread_tt + OR = { + scope:actor.dread >= reinforce_soldiers_dread_cost_value + scope:actor = { + has_character_modifier = ep3_friend_to_old_soldiers_modifier + } + } + } + } + } + + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:prestige = { + if = { + limit = { + is_ai = no + } + add_prestige = { + value = { + value = -75 + if = { + limit = { + scope:actor.domicile.domicile_location.county.holder ?= { government_has_flag = government_is_tribal } + } + add = 25 + } + multiply = reinforce_soldiers_reinforcable_regiments_value + } + } + } + reinforce_soldiers_regiment_effect = yes + } + scope:piety = { + add_piety = { + value = { + value = minor_piety_loss + multiply = reinforce_soldiers_reinforcable_regiments_value + } + } + reinforce_soldiers_regiment_effect = yes + } + scope:skill = { + duel = { + skills = { diplomacy prowess } + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 2 + } + desc = reinforce_soldiers_skill_success + send_interface_toast = { + type = event_toast_effect_good + title = reinforce_soldiers_skill_success + reinforce_soldiers_regiment_effect = yes + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 2 + } + desc = reinforce_soldiers_skill_failure + send_interface_toast = { + type = event_toast_effect_bad + title = reinforce_soldiers_skill_failure + if = { + limit = { + is_ai = no + } + add_prestige = -100 + } + } + } + } + } + scope:dread = { + random_list = { + 1 = { + modifier = { + add = { + value = scope:actor.dread + multiply = 2 + } + } + desc = reinforce_soldiers_skill_success + send_interface_toast = { + type = event_toast_effect_good + title = reinforce_soldiers_skill_success + reinforce_soldiers_regiment_effect = yes + } + } + 100 = { + min = 25 + modifier = { + add = { + value = 0 + subtract = scope:actor.dread + } + } + desc = reinforce_soldiers_skill_failure + send_interface_toast = { + type = event_toast_effect_bad + title = reinforce_soldiers_skill_failure + if = { + limit = { + is_ai = no + } + add_prestige = minor_prestige_loss + } + } + } + } + add_dread = { + value = reinforce_soldiers_dread_cost_value + multiply = -1 + } + } + } + } + } + + ai_frequency = 6 + ai_targets = { + ai_recipients = self + } + ai_potential = { + government_allows = conditional_maa_refill + any_maa_regiment = { maa_current_troops_count < maa_max_troops_count } + } + + ai_will_do = { + base = 100 + + modifier = { + scope:dread = yes + add = 5 + } + + modifier = { + scope:prestige = yes + add = 3 + } + + modifier = { + scope:piety = yes + add = 2 + } + + modifier = { + scope:skill = yes + add = 1 + } + } +} + +################## +# Hire LAAMP as mercenaries +# by Arkadiusz Majewski +# As a landed ruler hire a LAAMP to join your war +################## + +hire_laamp_mercenaries_interaction = { + category = interaction_category_diplomacy + icon = alliance + desc = hire_laamp_mercenaries_interaction_desc + + greeting = positive + notification_text = hire_laamp_mercenaries_interaction_notification + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 60 + ai_min_reply_days = 0 + ai_max_reply_days = 0 + + cooldown_against_recipient = { years = 3 } + can_send_despite_rejection = yes + ai_accept_negotiation = yes + send_options_exclusive = no + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor != scope:recipient + scope:actor = { + trigger_if = { # Avoid calling Adventurers without armies + limit = { + is_ai = yes + } + scope:recipient.current_military_strength >= 100 + } + } + scope:recipient = { + is_landless_adventurer = yes + } + } + is_valid_showing_failures_only = { + scope:recipient = { + is_busy_in_events_localised = yes + is_travelling = no + is_at_war = no + is_imprisoned = no + } + scope:actor = { + custom_tooltip = { + text = MERCENARY_COMPANY_COST_BANKRUPTCY + debt_level <= 1 + } + is_at_war = yes + custom_tooltip = { + text = I_MUST_BE_THE_WAR_LEADER + any_character_war = { + is_war_leader = scope:actor + } + } + NOT = { + is_at_war_with = scope:recipient + } + } + scope:actor = { + NOT = { + any_war_ally = { + count >= 3 + is_landless_adventurer = yes + } + } + } + scope:actor = { + OR = { + is_ai = no + any_character_war = { + count = all + OR = { + AND = { + primary_attacker = scope:actor + defender_war_score <= 95 + } + AND = { + primary_defender = scope:actor + attacker_war_score <= 95 + } + } + } + } + } + # Adventurers can't join wars in places they're exiled from. + trigger_if = { + limit = { + scope:actor = { is_independent_ruler = no } + } + custom_tooltip = { + text = the_wake_1 + NOT = { + is_laamp_exiled_from_province_trigger = { + PROVINCE = scope:actor.capital_province + LAAMP = scope:recipient + } + } + } + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + scope:actor = { has_strong_hook = scope:recipient } + } + } + + on_accept = { + scope:actor = { + every_character_war = { + add_to_list = actor_wars + } + } + every_in_list = { + list = actor_wars + limit = { + primary_defender = scope:actor + } + add_to_list = join_as_defender + remove_from_list = actor_wars + } + every_in_list = { + list = actor_wars + limit = { + primary_attacker = scope:actor + } + add_to_list = join_as_attacker + remove_from_list = actor_wars + } + + every_in_list = { + list = join_as_attacker + add_attacker = scope:recipient + } + every_in_list = { + list = join_as_defender + add_defender = scope:recipient + } + #list all wars that scope:recipient can't join + every_in_list = { + list = actor_wars + custom = hire_laamp_mercenaries_interaction.not_primary_side + # I swear it was the only way to make the tooltip look nice + every_in_list = { + list = actor_wars + save_temporary_scope_as = war + custom_tooltip = hire_laamp_mercenaries_interaction.war + } + } + scope:actor = { + pay_short_term_gold = { + target = scope:recipient + gold = ep3_hire_laamp_mercs_cost_value + } + add_to_variable_list = { + name = hired_mercenaries + target = scope:recipient + } + custom_tooltip = hire_laamp_mercenaries_interaction.contribution_pay + } + scope:recipient = { + add_character_flag = joined_as_mercenary + } + 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 + } + debug_log = "Landed ruler hired a LAAMP to join wars" + debug_log_scopes = yes + #for debug purposes: + #if = { + # limit = { NOT = { exists = global_var:hire_laamp_as_mercs_accepted } } + # set_global_variable = { + # name = hire_laamp_as_mercs_accepted + # value = 0 + # } + #} + #else = { + # change_global_variable = { + # name = hire_laamp_as_mercs_accepted + # add = 1 + # } + #} + } + + on_decline = { + scope:recipient = { + trigger_event = ep3_interactions_events.0111 + custom_tooltip = hire_laamp_mercenaries_interaction.negotiation_offer + } + #for debug purposes: + #if = { + # limit = { NOT = { exists = global_var:hire_laamp_as_mercs_rejected } } + # set_global_variable = { + # name = hire_laamp_as_mercs_rejected + # value = 0 + # } + #} + #else = { + # change_global_variable = { + # name = hire_laamp_as_mercs_rejected + # add = 1 + # } + #} + 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 + } + } + + # 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" + + ai_frequency = 12 + ai_targets = { + ai_recipients = nearby_domicile_owners + } + ai_potential = { + any_character_war = { + is_war_leader = prev + } + war_chest_gold >= quarter_ai_war_chest_gold_maximum + } + ai_accept = { + base = -20 + + modifier = { # merc laamp wants to join + add = 50 + scope:recipient = { + has_realm_law = camp_purpose_mercenaries + } + desc = camp_purpose_mercenaries_reason + } + + modifier = { # don't join many losing wars + save_temporary_scope_value_as = { + name = attacker_war + value = 2 + } + scope:actor = { + any_character_war = { + primary_attacker = scope:actor + attacker_war_score < 0 + save_temporary_scope_value_as = { + name = attacker_war + value = { + value = scope:attacker_war + multiply = attacker_war_score + } + } + } + } + add = scope:attacker_war + desc = attacker_losisng_too_much_reason + } + modifier = { # don't join many losing wars + add = scope:defender_war + save_temporary_scope_value_as = { + name = defender_war + value = 2 + } + scope:actor = { + any_character_war = { + primary_defender = scope:actor + defender_war_score < 0 + save_temporary_scope_value_as = { + name = defender_war + value = { + value = scope:defender_war + multiply = defender_war_score + } + } + } + } + desc = defender_losisng_too_much_reason + } + + modifier = { # Refuse call against Heir + add = -1000 + exists = scope:recipient.player_heir + scope:actor = { + any_character_war = { + OR = { + primary_defender = scope:recipient.player_heir + primary_attacker = scope:recipient.player_heir + } + } + } + desc = WONT_FIGHT_HEIR_REASON + } + + modifier = { # Refuse call against Spouse + add = -1000 + scope:actor = { + any_character_war = { + OR = { + primary_defender = { + is_spouse_of = scope:recipient + } + primary_attacker = { + is_spouse_of = scope:recipient + } + } + } + } + desc = WONT_FIGHT_SPOUSE_REASON + } + + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + desc = AI_OPINION_REASON + } + + modifier = { # Tends to join if low on cash + add = 50 + scope:recipient = { + short_term_gold <= minor_gold_value + } + desc = NEEDS_CASH + } + + modifier = { # Tends to join defensive wars + add = 50 + scope:actor = { + any_character_war = { + primary_defender = scope:actor + } + } + desc = DEFENSIVE_WAR_REASON + } + + modifier = { # Same language + add = 5 + desc = speaks_same_language_interaction_reason + scope:actor = { + knows_language_of_culture = scope:recipient.culture + } + } + + compare_modifier = { # Likes fighting infidels + trigger = { + scope:recipient.faith = scope:actor.faith + scope:actor = { + any_character_war = { + trigger_if = { + limit = { + primary_defender = scope:actor + } + primary_attacker = { + faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= religious_cb_enabled_hostility_level + } + } + } + } + trigger_else_if = { + limit = { + primary_attacker = scope:actor + } + primary_defender = { + faith = { + faith_hostility_level = { + target = scope:actor.faith + value >= religious_cb_enabled_hostility_level + } + } + } + } + trigger_else = { + always = no + } + } + } + } + target = scope:recipient + value = ai_zeal + desc = "ZEAL_AGAINST_INFIDELS" + min = 0 + multiplier = 0.5 + } + + modifier = { # Reluctant to attack another ally + add = -50 + scope:actor = { + any_character_war = { + NOT = { primary_defender = scope:actor } + primary_defender = { + is_allied_to = scope:recipient + } + } + } + desc = ATTACK_ON_ALLY_REASON + } + + modifier = { # Reluctant to defend against another ally + add = -25 + scope:actor = { + any_character_war = { + NOT = { primary_attacker = scope:actor } + primary_attacker = { + is_allied_to = scope:recipient + } + } + } + desc = WAR_WITH_ALLY_REASON + } + + modifier = { # Reluctant to join wars against religious brethren. + add = -50 + NOT = { scope:recipient.faith = scope:actor.faith } + scope:actor = { + any_character_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 + OR = { + AND = { + NOT = { primary_attacker = scope:actor } + primary_attacker.faith = scope:recipient.faith + } + AND = { + NOT = { primary_defender = scope:actor } + primary_defender.faith = scope:recipient.faith + } + } + } + } + } + desc = WONT_ATTACK_RELIGIOUS_BRETHREN_REASON + } + + modifier = { # Reluctant to join against Friends + add = -50 + scope:actor = { + any_character_war = { + OR = { + AND = { + NOT = { primary_attacker = scope:actor } + primary_attacker = { + has_relation_friend = scope:recipient + } + } + AND = { + NOT = { primary_defender = scope:actor } + primary_defender = { + has_relation_friend = scope:recipient + } + } + } + } + } + } + + modifier = { # Reluctant to join against Best Friends + add = -100 + scope:actor = { + any_character_war = { + OR = { + AND = { + NOT = { primary_attacker = scope:actor } + primary_attacker = { + has_relation_best_friend = scope:recipient + } + } + AND = { + NOT = { primary_defender = scope:actor } + primary_defender = { + has_relation_best_friend = scope:recipient + } + } + } + } + } + } + modifier = { # Reluctant to join against Lovers + add = -100 + scope:actor = { + any_character_war = { + OR = { + AND = { + NOT = { primary_attacker = scope:actor } + primary_attacker = { + has_relation_lover = scope:recipient + } + } + AND = { + NOT = { primary_defender = scope:actor } + primary_defender = { + has_relation_lover = scope:recipient + } + } + } + } + } + } + modifier = { # Reluctant to join against Soul mate + add = -200 + scope:actor = { + any_character_war = { + OR = { + AND = { + NOT = { primary_attacker = scope:actor } + primary_attacker = { + has_relation_soulmate = scope:recipient + } + } + AND = { + NOT = { primary_defender = scope:actor } + primary_defender = { + has_relation_soulmate = scope:recipient + } + } + } + } + } + } + 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 + } + + fp3_struggle_resist_allied_wars_modifier = yes + } + + ai_will_do = { + base = 50 + + #don't do it if hired army wouldn't have an impact + modifier = { + scope:actor = { + any_character_war = { + count = all + OR = { + AND = { + primary_attacker = scope:actor + primary_defender.current_military_strength > { + value = scope:recipient.current_military_strength + add = scope:actor.current_military_strength + multiply = 1.5 + } + } + AND = { + primary_defender = scope:actor + primary_attacker.current_military_strength > { + value = scope:recipient.current_military_strength + add = scope:actor.current_military_strength + multiply = 1.5 + } + } + } + } + } + add = -100 + } + + #don't do it if you are stronger than the enemy + modifier = { + scope:actor = { + any_character_war = { + count = all + OR = { + AND = { + primary_attacker = scope:actor + primary_defender.current_military_strength < scope:actor.current_military_strength + } + AND = { + primary_defender = scope:actor + primary_attacker.current_military_strength < scope:actor.current_military_strength + } + } + } + } + add = -200 + } + + #more likely to ask if on contact list + modifier = { + scope:actor = { + is_contact_of = scope:recipient + } + add = 100 + } + + #merc laamp wants to join, so why not asking them more? + modifier = { + scope:recipient = { + has_realm_law = camp_purpose_mercenaries + } + add = 50 + } + + #more likely to ask if losing + modifier = { + scope:actor = { + any_character_war = { + OR = { + AND = { + primary_attacker = scope:actor + defender_war_score > 25 + } + AND = { + primary_defender = scope:actor + attacker_war_score > 25 + } + } + } + } + add = 20 + } + + #don't do it if they betrayed you already in any of your ongoing wars + modifier = { + scope:actor = { + any_character_war = { + OR = { + is_target_in_variable_list = { + name = already_switched_side + target = scope:recipient + } + is_target_in_variable_list = { + name = left_voluntarily + target = scope:recipient + } + } + } + } + add = -1000 + } + + #don't do it if you cannot afford it + modifier = { + scope:actor = { + war_chest_gold < ep3_hire_laamp_mercs_cost_value + } + add = -50 + } + modifier = { + scope:actor = { + gold < ep3_hire_laamp_mercs_cost_value + } + add = -1000 + } + } +} + +################## +# Refill MaA +################## + +refill_maa_interaction = { + icon = icon_soldier_survivor + category = interaction_category_laamp + interface_priority = 20 + common_interaction = yes + desc = refill_maa_interaction_desc + cooldown = { months = 6 } + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + government_allows = conditional_maa_refill + } + scope:recipient = scope:actor + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = reinforce_soldiers_any_regiment_tt + scope:actor.maa_regiments_count >= 1 + } + custom_tooltip = { + text = reinforce_soldiers_unfull_regiment_tt + scope:actor = { + any_maa_regiment = { maa_regiments_valid_to_refill_trigger = yes } + } + } + custom_tooltip = { + text = SUPPLY_LOSS_AT_SEA + scope:actor = { any_laamp_portion_at_sea_trigger = no } + } + custom_tooltip = { + text = PROCURE_ESTATE_AT_WAR_TT + scope:actor = { + NOT = { + any_army = { + location.county.holder = { + OR = { + is_at_war_with = scope:actor + any_liege_or_above = { is_at_war_with = scope:actor } + } + } + } + } + } + } + } + + send_options_exclusive = yes + + send_option = { + flag = provisions + localization = reinforce_soldiers_option_provisions + current_description = reinforce_soldiers_option_provisions_desc + is_valid = { + scope:actor.domicile.provisions >= 5 + } + } + + send_option = { + flag = gold + localization = reinforce_soldiers_option_gold + current_description = reinforce_soldiers_option_gold_desc + is_valid = { + scope:actor.gold >= 5 + custom_tooltip = { + text = reinforce_soldiers_option_gold_tt + NOT = { + scope:actor.domicile.domicile_location.county.holder ?= { government_has_flag = government_is_tribal } + } + } + } + } + + on_accept = { + scope:actor = { + switch = { + trigger = yes + scope:gold = { + if = { + limit = { gold > replenishable_troops_payed_gold_tt_value } + custom_tooltip = refill_maa_gold_full_tt + } + else = { custom_tooltip = refill_maa_gold_tt } + custom_tooltip = refill_maa_gold_cost_tt + refill_maa_with_gold_effect = yes + } + scope:provisions = { + if = { + limit = { domicile.provisions > replenishable_troops_payed_provisions_tt_value } + custom_tooltip = refill_maa_provisions_full_tt + } + else = { custom_tooltip = refill_maa_provisions_tt } + custom_tooltip = refill_maa_provision_cost_tt + refill_maa_with_provisions_effect = yes + } + } + if = { + limit = { + is_ai = yes + NOR = { + scope:gold = yes + scope:provisions = yes + } + } + refill_maa_with_provisions_effect = yes + } + } + } + + ai_frequency = 1 + ai_targets = { + ai_recipients = self + } + ai_potential = { + government_allows = conditional_maa_refill + any_maa_regiment = { maa_current_troops_count < maa_max_troops_count } + } + + ai_will_do = { + base = 100 + modifier = { + factor = 0 + scope:gold = yes + gold <= 500 + } + } +} + +################## +# Evict Adventurer +# by Joe Parkin +################## + +evict_adventurer_interaction = { + common_interaction = yes + category = interaction_category_diplomacy + cooldown_against_recipient = { years = 5 } + greeting = positive + icon = icon_evict_adventurer + desc = evict_adventurer_interaction_desc + + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 60 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { is_landed = yes } + NOT = { scope:recipient = scope:actor } + scope:recipient = { + government_has_flag = government_is_landless_adventurer + is_landed = no + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_at_war = no + NOR = { + is_spouse_of = scope:recipient + has_relation_friend = scope:recipient + has_relation_lover = scope:recipient + } + } + scope:recipient = { + # Adventurer must be in the subrealm + domicile.domicile_location.county.holder ?= { + OR = { + this = scope:actor + any_liege_or_above = { this ?= scope:actor } + } + } + } + # AI should not against hired adventurers + trigger_if = { + limit = { + scope:actor = { is_ai = yes } + } + scope:actor = { + opinion = { + target = scope:recipient + value < 25 + } + } + NOT = { + scope:recipient = { + any_character_active_contract = { task_contract_employer = scope:actor } + } + } + } + scope:recipient = { + is_busy_in_events_localised = yes + NOT = { has_strong_hook = scope:actor } + } + # Story blockers. + ## Hereward cannot be exiled by active participants in the Harrying of the North. + disable_interaction_for_hereward_trigger = yes + ## Hasan cannot be exiled by anyone during his story. + disable_interaction_for_hasan_trigger = yes + } + + on_send = { + scope:recipient = { + send_interface_toast = { + type = diplo_contract_scheme_invalidated_message + title = evict_adventurer_interaction.tt.contracts_invalidated.t + right_icon = scope:actor + custom_tooltip = { + text = evict_adventurer_interaction.tt.contracts_invalidated + every_character_task_contract = { + limit = { + task_contract_location.county.holder = { + OR = { + this = scope:actor + any_liege_or_above = { this = scope:actor } + } + } + } + invalidate_contract = yes + } + # We also need to invalidate your active contract, if you've got one, since you need to be travelling. + every_character_active_contract = { invalidate_contract = yes } + } + } + } + } + + on_accept = { + scope:actor = { save_scope_as = expeller } + scope:recipient = { + save_scope_as = adventurer + add_opinion = { + target = scope:actor + modifier = demanded_eviction_opinion + } + custom_tooltip = evict_adventurer_contracts_tt + } + scope:actor = { + custom_description_no_bullet = { + text = evict_adventurer_consequences_tt + object = scope:recipient + subject = scope:actor + } + custom_tooltip = evict_adventurer_casus_belli_tt + show_as_tooltip = { + add_opinion = { + target = scope:recipient + modifier = eviction_ignored_opinion + } + } + } + scope:recipient = { + set_variable = { + name = adventurer_expeller + value = scope:actor + months = 4 + } + trigger_event = { + id = ep3_interactions_events.0500 + days = 1 + } + trigger_event = { + id = ep3_interactions_events.0501 + months = 3 + } + } + } + + on_decline = { + scope:recipient = { + start_war = { + cb = ep3_laamp_apprehend_adventurer_cb + target = scope:actor + } + } + } + + auto_accept = yes + + ai_frequency = 6 + ai_targets = { + ai_recipients = sub_realm_domicile_owners + max = 10 + } + ai_potential = { + is_at_war = no + is_imprisoned = no + NOT = { has_trait = incapable } + } + ai_will_do = { + base = -25 + opinion_modifier = { + who = scope:actor + opinion_target = scope:recipient + multiplier = -0.5 + } + # Independent rulers or kings and over will happily exile claimants. + modifier = { + add = 250 + OR = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + } + scope:recipient = { + any_claim = { + tier >= scope:actor.highest_held_title_tier + holder ?= scope:actor + } + } + } + modifier = { + add = 10 + has_opinion_modifier = { + modifier = failed_task_contract_opinion + target = scope:recipient + } + } + modifier = { + add = 30 + has_opinion_modifier = { + modifier = left_war_early + target = scope:recipient + } + } + modifier = { + add = 100 + has_opinion_modifier = { + modifier = switched_sides_in_war + target = scope:recipient + } + } + modifier = { + add = { + if = { + limit = { + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + value >= 100 + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + value >= 100 + } + } + } + add = 200 + } + else_if = { + limit = { + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + value >= 80 + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + value >= 80 + } + } + } + add = 150 + } + else_if = { + limit = { + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + value >= 60 + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + value >= 60 + } + } + } + add = 100 + } + else_if = { + limit = { + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + value >= 40 + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + value >= 40 + } + } + } + add = 75 + } + else_if = { + limit = { + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + value >= 20 + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + value >= 20 + } + } + } + add = 50 + } + else_if = { + limit = { + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + value >= 0 + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + value >= 0 + } + } + } + add = 25 + } + } + OR = { + has_opinion_modifier = { + modifier = gallowsbait_scum_opinion + target = scope:recipient + } + has_opinion_modifier = { + modifier = succeeded_criminal_contract_against_me_opinion + target = scope:recipient + } + } + } + # Factors must got at the bottom. + ## Don't evict people we can't beat up. + modifier = { + factor = 0 + scope:actor.current_military_strength < scope:recipient.military_strength_75_percent_value + } + ## Don't evict anyone currently doing a job for us. + modifier = { + factor = 0 + scope:recipient = { + any_character_task_contract = { task_contract_employer = scope:actor } + } + } + ## We _only_ evict if we actually dislike someone. + first_valid = { + # People close to us are more willing to put up with our bullshit. + modifier = { + factor = 0 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + opinion = { + target = scope:recipient + value > -30 + } + } + modifier = { + factor = 0 + opinion = { + target = scope:recipient + value > 0 + } + } + } + } +} + +#Become landless admin from laamp +procure_estate_interaction = { + category = interaction_category_laamp + icon = powerful_family_shield + + desc = procure_estate_interaction_desc + + cooldown_against_recipient = { years = 10 } + + notification_text = { + first_valid = { + triggered_desc = { + trigger = { + scope:hook = yes + } + desc = PROCURE_ESTATE_HOOK + } + triggered_desc = { + trigger = { + scope:gold_option = yes + } + desc = PROCURE_ESTATE_GOLD + } + triggered_desc = { + trigger = { + scope:piety_option = yes + } + desc = PROCURE_ESTATE_PIETY + } + desc = PROCURE_ESTATE_PRESTIGE + } + desc = PROCURE_ESTATE_PROPOSAL_OUTRO + } + + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 100 + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { government_has_flag = government_is_landless_adventurer } + scope:recipient = { + is_landed = yes + has_government = administrative_government + } + NOT = { scope:recipient = scope:actor } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_independent_ruler = yes + prestige_level >= 2 + # Only house heads can have Noble Family titles + custom_tooltip = { + text = NOT_IS_HOUSE_HEAD + house.house_head ?= { + OR = { + this = scope:actor + is_ruler = no + } + } + } + } + trigger_if = { # Only a Duke or higher can treat you right + limit = { + scope:recipient = { + highest_held_title_tier < tier_duchy + } + } + custom_description = { + text = procure_estate_low_rank_tt + always = no + } + } + trigger_if = { # Not going to give you a title if you're at war + limit = { + scope:actor = { + is_at_war_with = scope:recipient + } + } + custom_description = { + text = procure_estate_at_war_tt + always = no + } + } + scope:recipient = { + is_busy_in_events_localised = yes + NOT = { has_strong_hook = scope:actor } + } + #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 + } + scope:recipient = { is_contact_of = scope:actor } + + # 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 + } + } + } + } + + auto_accept = { + custom_description = { + text = "spending_hook" + subject = scope:actor + object = scope:recipient + scope:hook = yes + } + } + should_use_extra_icon = { + scope:actor = { has_usable_hook = scope:recipient } + } + extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds" + + send_option = { + is_valid = { + scope:actor = { + has_usable_hook = scope:recipient + } + } + flag = hook + localization = SCHEME_HOOK + } + send_option = { + flag = prestige_option + localization = laamp_to_ladmin_prestige_option_desc + } + send_option = { + flag = gold_option + localization = laamp_to_ladmin_gold_option_desc + } + send_option = { + flag = piety_option + localization = laamp_to_ladmin_piety_option_desc + } + + cost = { + gold = { + add = { + value = procure_estate_interaction_cost_base_gold + desc = BASE + } + if = { + limit = { scope:gold_option = yes } + add = { + value = procure_estate_interaction_cost_base_gold + desc = laamp_to_ladmin_gold_option_desc + } + } + } + prestige = { + if = { + limit = { + NOR = { + scope:gold_option = yes + scope:piety_option = yes + scope:hook = yes + } + } + # Base cost + add = { + value = procure_estate_interaction_cost_base_prestige + desc = BASE + } + # Gender modifiers + if = { + limit = { + scope:recipient ?= { + top_liege = { has_realm_law = male_preference_law } + } + scope:actor = { + is_female = yes + } + } + add = { # Increase the base cost + value = { + value = procure_estate_interaction_cost_base_prestige + multiply = 0.25 + } + desc = male_preference_law + } + } + if = { + limit = { + scope:recipient ?= { + top_liege = { has_realm_law = female_preference_law } + } + scope:actor = { + is_male = yes + } + } + add = { # Increase the base cost + value = { + value = procure_estate_interaction_cost_base_prestige + multiply = 0.25 + } + desc = female_preference_law + } + } + #Brigands need to pay more to be legitimized + if = { + limit = { + scope:actor = { + has_realm_law = camp_purpose_brigands + } + } + add = { # Increase the base cost + value = { + value = major_prestige_value + } + desc = camp_purpose_brigands + } + } + } + } + piety = { + if = { + limit = { + scope:piety_option = yes + } + + # Base cost + add = { + value = procure_estate_interaction_cost_base_piety + desc = BASE + } + + # Gender modifiers + if = { + limit = { + scope:recipient ?= { + top_liege = { has_realm_law = male_preference_law } + } + scope:actor = { + is_female = yes + } + } + add = { # Increase the base cost + value = { + value = procure_estate_interaction_cost_base_piety + multiply = 0.25 + } + desc = male_preference_law + } + } + if = { + limit = { + scope:recipient ?= { + top_liege = { has_realm_law = female_preference_law } + } + scope:actor = { + is_male = yes + } + } + add = { # Increase the base cost + value = { + value = procure_estate_interaction_cost_base_piety + multiply = 0.25 + } + desc = female_preference_law + } + } + #Brigands need to pay more to be legitimized + if = { + limit = { + scope:actor = { + has_realm_law = camp_purpose_brigands + } + } + add = { # Increase the base cost + value = { + value = procure_estate_interaction_cost_base_piety + } + desc = camp_purpose_brigands + } + } + } + } + } + + is_highlighted = { + always = yes + } + + on_accept = { + scope:actor = { + save_scope_as = adventurer + procure_estate_interaction_effect = yes + create_character_memory = { + type = procured_estate_memory + participants = { benefactor = scope:recipient } + } + if = { + limit = { + is_ai = no + } + add_achievement_global_variable_effect = { + VARIABLE = started_from_the_bottom_now_were_ere_procure + VALUE = yes + } + } + } + + scope:actor = { trigger_event = ep3_interactions_events.0610 } + } + + on_decline = { + scope:actor = { + save_scope_as = adventurer + trigger_event = ep3_interactions_events.0611 + } + } + + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = contacts + } + ai_frequency = 120 + + 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 + } + #DIFFERENT FAITH FROM STATE FAITH (if recipient is state faith) + modifier = { + add = -20 + desc = PROCURE_ESTATE_STATE_FAITH_REASON + scope:actor.faith = { + NOT = { + this = scope:recipient.top_liege.primary_title.state_faith + } + } + scope:recipient.faith = { + this = scope:recipient.top_liege.primary_title.state_faith + } + NOT = { + scope:piety_option = yes + } + } + #Hey you're actually a local in my capital + modifier = { + add = 10 + desc = PROCURE_ESTATE_SAME_CULTURE_AS_CAPITAL_REASON + scope:recipient.capital_county.culture = { + this = scope:actor.culture + } + } + #Your dynasty is worthless + modifier = { + add = -10 + scope:actor.dynasty = { + dynasty_prestige_level < 2 + } + desc = PROCURE_ESTATE_DYNASTY_PRESTIGE_LEVEL_REASON + } + #Your dynasty is pretty great actually + modifier = { + add = 10 + scope:actor.dynasty = { + dynasty_prestige_level >= 4 + dynasty_prestige_level < 7 + } + desc = PROCURE_ESTATE_DYNASTY_PRESTIGE_LEVEL_REASON + } + #Your dynasty is pretty great actually + modifier = { + add = 20 + scope:actor.dynasty = { + dynasty_prestige_level >= 7 + dynasty_prestige_level < 10 + } + desc = PROCURE_ESTATE_DYNASTY_PRESTIGE_LEVEL_REASON + } + #Your dynasty is pretty great actually + modifier = { + add = 30 + scope:actor.dynasty = { dynasty_prestige_level >= 10 } + desc = PROCURE_ESTATE_DYNASTY_PRESTIGE_LEVEL_REASON + } + #We are not related + modifier = { + add = -15 + desc = PROCURE_ESTATE_SHARED_RELATIVES_REASON + NOR = { + scope:actor.house ?= { + any_house_member = { + is_close_or_extended_family_of = scope:recipient + } + } + scope:actor = { + any_close_or_extended_family_member = { + is_close_or_extended_family_of = scope:recipient + } + } + scope:recipient.house ?= { + any_house_member = { + is_close_or_extended_family_of = scope:actor + } + } + scope:recipient = { + any_spouse = { + is_close_or_extended_family_of = scope:actor + } + } + scope:actor = { + any_spouse = { + is_close_or_extended_family_of = scope:recipient + } + } + scope:actor.dynasty = { + this = scope:recipient.dynasty + } + } + } + #You are criminal scum + modifier = { + add = -50 + desc = PROCURE_ESTATE_BRIGANDS_REASON + scope:actor = { + has_realm_law = camp_purpose_brigands + } + } + #You are an upright legitimist + modifier = { + add = 25 + desc = PROCURE_ESTATE_LEGITIMISTS_REASON + scope:actor = { + has_realm_law = camp_purpose_legitimists + } + } + #You have a criminal background + modifier = { + add = -10 + desc = PROCURE_ESTATE_GALLOWSBAIT_REASON + scope:actor = { + has_trait = gallowsbait + } + } + #You have a criminal background + modifier = { + add = -5 + desc = PROCURE_ESTATE_GALLOWSBAIT_REASON + scope:actor = { + has_trait = gallowsbait + NOR = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value < 40 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value < 40 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value < 40 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value < 40 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value < 40 + } + } + } + } + modifier = { + add = -20 + desc = PROCURE_ESTATE_GALLOWSBAIT_REASON + scope:actor = { + has_trait = gallowsbait + OR = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value >= 40 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 40 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value >= 40 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value >= 40 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value >= 40 + } + } + NOR = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value < 80 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value < 80 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value < 80 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value < 80 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value < 80 + } + } + } + } + modifier = { + add = -50 + desc = PROCURE_ESTATE_GALLOWSBAIT_REASON + scope:actor = { + has_trait = gallowsbait + OR = { + has_trait_xp = { + trait = gallowsbait + track = bandit + value >= 80 + } + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 80 + } + has_trait_xp = { + trait = gallowsbait + track = thief + value >= 80 + } + has_trait_xp = { + trait = gallowsbait + track = poacher + value >= 80 + } + has_trait_xp = { + trait = gallowsbait + track = marauder + value >= 80 + } + } + } + } + #You have an interesting claim within my realm + modifier = { + add = 5 + desc = PROCURE_ESTATE_CLAIMS_REASON + scope:actor = { + any_claim = { + save_temporary_scope_as = laamp_claim_temp + scope:recipient.top_liege.primary_title = { + is_de_jure_liege_or_above_target = scope:laamp_claim_temp + } + NOT = { + holder ?= scope:recipient + } + } + } + } + #You are a challenger for the empire and I want you indebted to me + modifier = { + add = 20 + desc = PROCURE_ESTATE_IMPERIAL_CLAIMS_REASON + scope:actor = { + any_claim = { + save_temporary_scope_as = laamp_claim_temp + this = scope:recipient.top_liege.primary_title + NOT = { + holder ?= scope:recipient + } + scope:recipient = { + NOR = { + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:recipient.top_liege } + opinion = { + target = scope:recipient.top_liege + value >= -20 + } + is_allied_to = scope:recipient.top_liege + } + } + } + } + } + #You have a scary claim on one of my titles! + modifier = { + add = -50 + desc = PROCURE_ESTATE_RIVAL_CLAIMANT_REASON + scope:actor = { + any_claim = { + holder ?= scope:recipient + } + } + } + #Needs gold + modifier = { + add = 10 + scope:recipient = { + gold <= minor_gold_value + } + NOT = { + scope:gold_option = yes + } + desc = PROCURE_ESTATE_NEEDS_GOLD_REASON + } + #Needs gold and offering gold + modifier = { + add = 20 + scope:recipient = { + gold <= minor_gold_value + } + scope:gold_option = yes + desc = PROCURE_ESTATE_NEEDS_GOLD_REASON + } + #Needs piety + modifier = { + add = 20 + scope:recipient = { + piety_level <= 0 + } + scope:piety_option = yes + desc = PROCURE_ESTATE_NEEDS_PIETY_REASON + } + + #Needs prestige + modifier = { + add = 20 + scope:recipient = { + prestige_level <= 0 + } + scope:prestige_option = yes + desc = PROCURE_ESTATE_NEEDS_PRESTIGE_REASON + } + } + + ai_will_do = { + base = -25 + ai_value_modifier = { + ai_boldness = -0.5 + ai_energy = -0.5 + ai_greed = 0.5 + ai_rationality = 0.5 + } + modifier = { + gold < 100 + factor = 0 + } + modifier = { + gold > 100 + OR = { + prestige >= massive_prestige_value + piety >= massive_piety_value + gold >= massive_gold_value + } + add = 50 + } + modifier = { + has_hook = scope:recipient + add = 200 + } + } +} + +request_laamp_legitimist_support = { + interface_priority = 50 + common_interaction = yes + category = interaction_category_laamp + cooldown_against_recipient = { years = 5 } + + greeting = positive + + icon = request_invasion_sponsorship_interaction + desc = request_laamp_legitimist_support_interaction_desc + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + government_has_flag = government_is_landless_adventurer + has_realm_law = camp_purpose_legitimists + } + scope:recipient = { + is_landed = yes + is_ai = yes + primary_title.tier >= tier_kingdom + } + NOT = { scope:recipient = scope:actor } + } + + is_valid_showing_failures_only = { + NOR = { #so legitimist AI can get lucky. It looks ugly but formats the tooltip correctly + NOT = { + ep3_laamp_diplo_range_trigger = { + TARGET = scope:recipient + LAAMP = scope:actor + } + } + scope:actor = { + is_available_ai_adult = yes + } + } + + + custom_tooltip = { + text = request_laamp_legitimist_have_claim_on_target + scope:actor = { + NOT = { + any_claim = { + OR = { + holder = { + this = scope:recipient + } + holder.top_liege = { + this = scope:recipient + } + } + } + } + } + } + + custom_tooltip = { + text = request_laamp_legitimist_support_already_supporting + scope:recipient = { + NOT = { + has_character_flag = legitimist_supporter + } + } + } + scope:recipient = { + is_busy_in_events_localised = yes + is_at_war = no + is_available_ai_adult = yes + } + + # 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 + } + } + } + } + + send_options_exclusive = no + + cost = { + prestige = { + value = massive_prestige_value + if = { + limit = { + scope:actor.dynasty = scope:recipient.dynasty + } + divide = 2 + } + if = { + limit = { #so legitimist AI can get lucky + scope:actor = { is_ai = yes } + } + divide = 6 + } + } + } + + on_accept = { + scope:actor = { + create_task_contract = { + task_contract_type = laamp_legitimist_support_contract + task_contract_tier = 3 + location = scope:recipient.capital_province + task_contract_employer = scope:recipient + save_temporary_scope_as = legitimist_contract + } + custom_tooltip = laamp_legitimist_support_contract_success + if = { + limit = { + is_ai = yes + } + accept_task_contract = scope:legitimist_contract + } + } + } + + on_decline = { + + } + + use_diplomatic_range = yes + + ai_accept = { + base = -60 + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = 1 + desc = AI_OPINION_REASON + } + modifier = { + add = 40 + scope:actor = { + any_claim = { + tier >= tier_kingdom + holder = { + save_temporary_scope_as = claim_holder + } + } + prestige_level > scope:claim_holder.prestige_level + } + desc = AI_REASON_LEGITIMIST_HIGHER_PRESTIGE + } + modifier = { + add = 60 + scope:actor = { + has_hook = scope:recipient + } + desc = YOU_HAVE_HOOK_REASON + } + modifier = { + add = 10 + scope:actor.dynasty = scope:recipient.dynasty + desc = BF_AI_SAME_DYNASTY_REASON + } + modifier = { + add = 20 + scope:actor.house = scope:recipient.house + desc = IS_SAME_HOUSE_REASON + } + modifier = { + add = 20 + scope:recipient = { has_trait = ambitious } + desc = RECIPIENT_IS_AMBITIOUS + } + modifier = { + add = 10 + scope:recipient = { has_trait = just } + desc = RECIPIENT_IS_JUST + } + modifier = { + add = 10 + scope:recipient = { has_trait = greedy } + desc = RECIPIENT_IS_GREEDY + } + modifier = { + add = 40 #so legitimist AI can get lucky + scope:actor = { is_ai = yes } + } + } + + can_send_despite_rejection = no + ai_frequency = 60 + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = liege + ai_recipients = contacts + } + ai_potential = { + is_at_war = no + NOT = { ai_has_economical_boom_personality = yes } + ai_greed <= 25 + } + ai_will_do = { + base = 100 #no downside to ai trying this + } +} + +#travel around the map to look for new contracts +relocate_camp_to_interaction = { + category = interaction_category_laamp + interface_priority = 100 + common_interaction = yes + use_diplomatic_range = no + ignores_pending_interaction_block = yes + icon = icon_contract_escort + desc = relocate_camp_to_interaction_desc + is_shown = { + NOT = { scope:recipient = scope:actor } + scope:actor = { + is_landless_adventurer = yes + } + scope:recipient = { exists = capital_province } #just to make sure proper scopes will be set up + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = relocate_camp_to_interaction.here + NOT = { scope:actor.domicile.domicile_location = scope:recipient.capital_province } + } + scope:actor = { + is_travelling = no + is_in_army = no + is_imprisoned = no + } + # 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 + } + } + } + } + + on_accept = { + scope:recipient.capital_province = { + save_scope_as = relocation_destination + } + scope:actor = { + show_as_tooltip = { + domicile = { + move_domicile = scope:relocation_destination + } + } + start_travel_plan = { + destination = scope:relocation_destination + on_start_on_action = on_travel_relocation_start + on_arrival_on_action = on_travel_relocation_end + on_arrival_destinations = last + return_trip = no # One way + travel_with_domicile = yes + } + } + } + + auto_accept = yes +} + +# +task_contract_train_knight_interaction = { + category = interaction_category_laamp + interface_priority = 120 + common_interaction = yes + icon = icon_combat + + popup_on_receive = yes + pause_on_receive = yes + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { + any_character_active_contract = { + has_task_contract_type = laamp_help_train_commanders_contract + OR = { + task_contract_employer ?= scope:recipient + task_contract_target ?= scope:recipient + any_in_list = { + variable = knights_to_train + is_alive = yes + is_knight = yes + this = scope:recipient + } + } + } + } + } + + is_valid_showing_failures_only = { + } + + redirect = { + scope:actor = { + random_character_active_contract = { + limit = { + has_task_contract_type = laamp_help_train_commanders_contract + OR = { + task_contract_employer ?= scope:recipient + task_contract_target ?= scope:recipient + any_in_list = { + variable = knights_to_train + is_alive = yes + is_knight = yes + this = scope:recipient + } + } + } + save_scope_as = task_contract + } + } + if = { + limit = { + scope:task_contract ?= { + any_in_list = { + variable = knights_to_train + is_alive = yes + is_knight = yes + this = scope:recipient + } + } + } + scope:recipient = { + save_scope_as = secondary_recipient + } + scope:secondary_recipient.liege = { + save_scope_as = recipient + } + } + if = { + limit = { + scope:task_contract.task_contract_employer ?= scope:recipient + scope:task_contract.task_contract_employer.liege ?= scope:task_contract.task_contract_target + } + + } + } + + populate_recipient_list = { + scope:actor = { + random_character_active_contract = { + limit = { + has_task_contract_type = laamp_help_train_commanders_contract + OR = { + task_contract_employer ?= scope:recipient + task_contract_target ?= scope:recipient + any_in_list = { + variable = knights_to_train + is_alive = yes + is_knight = yes + this = scope:recipient + } + } + } + every_in_list = { + variable = knights_to_train + limit = { + is_alive = yes + is_knight = yes + } + add_to_list = characters + } + } + } + } + + is_highlighted = { + always = yes + } + + on_accept = { + scope:actor = { + random_character_active_contract = { + limit = { + has_task_contract_type = laamp_help_train_commanders_contract + OR = { + task_contract_employer ?= scope:recipient + task_contract_target ?= scope:recipient + any_in_list = { + variable = knights_to_train + is_alive = yes + is_knight = yes + this = scope:recipient + } + } + } + save_scope_as = task_contract + } + } + scope:secondary_recipient = { + save_scope_as = knight + custom_tooltip = task_contract_train_knight_interaction.tt + } + scope:actor = { + trigger_event = ep3_contract_event.0091 + } + } + + auto_accept = yes + + ai_accept = { + base = 100 + } + + ai_frequency = 12 + ai_targets = { + ai_recipients = neighboring_rulers + ai_recipients = liege + ai_recipients = contacts + } + ai_potential = { + is_at_war = no + } + ai_will_do = { + base = 100 #no downside to ai trying this + } +} + +#landless adventurer are allowed to change allegiances mid-war +laamp_war_change_sides_interaction = { + category = interaction_category_laamp + icon = alliance + desc = laamp_war_change_sides_interaction_desc + common_interaction = yes + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 120 + ai_min_reply_days = 0 + ai_max_reply_days = 0 + + cooldown_against_recipient = { years = 3 } + send_options_exclusive = yes + + is_shown = { + scope:actor = { + is_at_war = yes + is_landless_adventurer = yes + } + scope:recipient = { + NOT = { this = scope:actor } + any_war_ally = { this = scope:actor } + any_character_war = { + #can't switch/leave wars you lead + NOT = { is_war_leader = scope:actor } + #can't switch/leave Great Holy Wars + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + any_war_participant = { + this = scope:recipient + } + } + } + } + + is_valid_showing_failures_only = { + scope:recipient = { + trigger_if = { + limit = { + any_character_war = { + has_variable_list = already_switched_side + } + } + custom_tooltip = { + text = laamp_war_change_sides_interaction.already_switched_side + is_target_in_variable_list = { + name = already_switched_side + target = scope:actor + } + } + } + } + } + + populate_recipient_list = { + scope:recipient = { + every_character_war = { + limit = { + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + #can't switch/leave wars you lead + NOT = { is_war_leader = scope:actor } + #can't switch/leave Great Holy Wars + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + any_war_participant = { + this = scope:recipient + } + } + if = { + limit = { primary_attacker = scope:recipient } + primary_defender = { add_to_list = characters } + } + else = { + primary_attacker = { add_to_list = characters } + } + } + } + } + + on_accept = { + scope:recipient = { + save_scope_as = betrayed_leader + } + scope:secondary_recipient = { + save_scope_as = new_leader + } + scope:actor = { + #ROOT is a 4th crusader and should not be one anymore + frankokratia_remove__war_leader_var_effect = yes + #ROOT is not a 4th crusader and should be one + if = { + limit = { + any_character_war = { + using_cb = crusading_claim_cb + any_war_participant = { + this = scope:recipient + } + any_war_participant = { + any_owned_story = { + story_type = frankokratia_story + NOT = { + any_in_list = { + variable = frankokratia_leaders + this = scope:actor + } + } + } + } + any_war_defender = { + this = scope:actor + } + } + } + random_character_war = { + limit = { + any_war_participant = { + any_owned_story = { + story_type = frankokratia_story + NOT = { + any_in_list = { + variable = frankokratia_leaders + this = scope:actor + } + } + } + } + any_war_defender = { + this = scope:actor + } + } + random_war_participant = { + limit = { + any_owned_story = { + story_type = frankokratia_story + NOT = { + any_in_list = { + variable = frankokratia_leaders + this = scope:actor + } + } + } + } + random_owned_story = { + limit = { + story_type = frankokratia_story + NOT = { + any_in_list = { + variable = frankokratia_leaders + this = scope:actor + } + } + } + add_to_variable_list = { + name = frankokratia_leaders + target = scope:actor + } + } + } + } + } + random_character_war = { + limit = { + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + OR = { + primary_attacker = scope:secondary_recipient + primary_defender = scope:secondary_recipient + } + } + save_scope_as = war + } + if = { + limit = { + scope:war = { + using_non_ghw_holy_war_cb_trigger = yes + } + scope:recipient.faith = scope:actor.faith + } + add_piety_level = -1 + } + every_character_active_contract = { + limit = { + var:task_contract_war = scope:war + } + complete_task_contract = failure_standard + } + # Clear Offer Assistance. + if = { + limit = { + has_variable = owed_contract_assistance_war + scope:recipient = { is_participant_in_war = scope:actor.var:owed_contract_assistance_war } + } + remove_variable = owed_contract_assistance_war + remove_variable = owed_contract_assistance_contribution + remove_variable = owed_contract_assistance_gold + } + } + scope:war = { + hidden_effect = { + remove_participant = scope:actor + } + if = { + limit = { + is_defender = scope:secondary_recipient + } + add_defender = scope:actor + } + else = { + add_attacker = scope:actor + } + } + scope:actor = { + every_character_war = { + limit = { + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + NOT = { this = scope:war } + } + remove_participant = scope:actor + } + } + scope:actor = { + # We deliberately charge you here to let you go into prestige debt; you shouldn't be blocked from switching sides due to a lack of prestige if you're willing to tank the loss. + add_prestige = { + value = -250 + multiply = { + value = scope:recipient.highest_held_title_tier + add = -1 + } + } + if = { + limit = { scope:recipient.highest_held_title_tier >= tier_kingdom } + add_prestige_level = -1 + } + if = { + limit = { + NOT = { has_contact = scope:secondary_recipient } + } + add_contact = scope:secondary_recipient + } + # Break the alliance + if = { + limit = { is_allied_to = scope:recipient } + break_alliance = scope:recipient + } + # And don't forget stress! + stress_impact = { + base = major_stress_impact_gain + disloyal = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + callous = miniscule_stress_impact_loss + arbitrary = miniscule_stress_impact_loss + just = minor_stress_impact_gain + humble = medium_stress_impact_gain + content = medium_stress_impact_gain + loyal = major_stress_impact_gain + } + } + scope:recipient = { + if = { + limit = { + can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } + } + set_relation_potential_rival = scope:actor + } + add_opinion = { + modifier = switched_sides_in_war + target = scope:actor + } + } + scope:secondary_recipient = { + add_opinion = { + modifier = switched_to_my_side + target = scope:actor + } + if = { + limit = { is_ai = yes } + pay_short_term_gold = { + target = scope:actor + gold = major_gold_value + } + } + } + scope:recipient = { + every_character_war = { + limit = { + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + #can't switch/leave wars you lead + NOT = { is_war_leader = scope:actor } + #can't switch/leave Great Holy Wars + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + any_war_participant = { + this = scope:recipient + } + NOR = { + primary_attacker = scope:secondary_recipient + primary_defender = scope:secondary_recipient + } + } + if = { + limit = { primary_attacker = scope:recipient } + primary_defender = { + add_opinion = { + modifier = left_war_early + opinion = 40 + target = scope:actor + } + } + } + else = { + primary_attacker = { + add_opinion = { + modifier = left_war_early + opinion = 20 + target = scope:actor + } + } + } + } + } + scope:war = { + add_to_variable_list = { + name = already_switched_side + target = scope:actor + } + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = yes + } + + ai_targets = { + ai_recipients = war_allies + } + ai_frequency = 24 + + ai_will_do = { + base = -25 + #you have to be dishonorable and greedy to do this + ai_value_modifier = { + ai_honor = -0.1 + ai_greed = 0.1 + } + ##check if the recipient is the war leader and do it + #if they are infamous + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + scope:recipient = { + prestige_level < 0 + } + add = 5 + } + #if they are impious + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + scope:recipient = { + piety_level < 0 + } + add = 5 + } + #if they are a criminal + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + has_any_criminal_trait_in_faith_trigger = { + CHARACTER = scope:recipient + FAITH = scope:actor.faith + } + add = 5 + } + #if they wronged you or your family + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + scope:actor = { + has_any_major_revenge_opinion_against_character_trigger = { + CHARACTER = scope:recipient + } + } + add = 5 + } + #if they have good relation with the other side + modifier = { + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + primary_attacker = { + has_any_good_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + AND = { + primary_attacker = scope:recipient + primary_defender = { + has_any_good_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + } + } + add = 5 + } + #don't do it + # if the other side has bad relation with you + modifier = { + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + primary_attacker = { + has_any_bad_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + AND = { + primary_attacker = scope:recipient + primary_defender = { + has_any_bad_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + } + } + add = -1000 + } + # you are winning + modifier = { + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + defender_war_score >= 0 + } + AND = { + primary_attacker = scope:recipient + attacker_war_score >= 0 + } + } + } + add = -1000 + } + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = -0.1 + desc = AI_OPINION_REASON + } + } +} + +#landless adventurer are allowed to leave the war outright +laamp_leave_war_interaction = { + category = interaction_category_laamp + icon = alliance + desc = laamp_leave_war_interaction_desc + common_interaction = yes + popup_on_receive = yes + pause_on_receive = yes + + interface_priority = 120 + ai_min_reply_days = 0 + ai_max_reply_days = 0 + + cooldown_against_recipient = { years = 3 } + send_options_exclusive = yes + + is_shown = { + scope:actor = { + is_at_war = yes + is_landless_adventurer = yes + } + scope:recipient = { + NOT = { this = scope:actor } + any_war_ally = { this = scope:actor } + any_character_war = { + is_participant = scope:recipient + #can't leave wars you lead + NOT = { is_war_leader = scope:actor } + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + any_character_war = { + is_participant = scope:recipient + #can't leave wars you lead + NOT = { is_war_leader = scope:actor } + #can't leave Great Holy Wars + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + } + } + scope:recipient = { + trigger_if = { + limit = { + any_character_war = { + has_variable_list = already_switched_side + } + } + custom_tooltip = { + text = laamp_war_change_sides_interaction.already_switched_side + is_target_in_variable_list = { + name = already_switched_side + target = scope:actor + } + } + } + } + } + + on_accept = { + scope:recipient = { + save_scope_as = betrayed_leader + } + scope:secondary_recipient = { + save_scope_as = new_leader + } + scope:actor = { + #ROOT is a 4th crusader and should not be one anymore + frankokratia_remove__war_leader_var_effect = yes + every_character_war = { + limit = { + OR = { + primary_attacker = scope:recipient + primary_defender = scope:recipient + } + #can't switch/leave wars you lead + NOT = { is_war_leader = scope:actor } + #can't switch/leave Great Holy Wars + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + any_war_participant = { + this = scope:recipient + } + } + remove_participant = scope:actor + if = { + limit = { primary_defender = scope:recipient } + primary_attacker = { + add_opinion = { + modifier = left_war_early + opinion = 30 + target = scope:actor + } + } + } + else = { + primary_defender = { + add_opinion = { + modifier = left_war_early + opinion = 30 + target = scope:actor + } + } + } + add_to_variable_list = { + name = left_voluntarily + target = scope:actor + } + } + if = { + limit = { + scope:war = { + using_non_ghw_holy_war_cb_trigger = yes + } + } + add_piety_level = -1 + } + save_scope_value_as = { + name = task_contract_reward + value = flag:failure_standard + } + save_scope_value_as = { + name = task_contract_tier + value = scope:task_contract.task_contract_tier + } + every_character_active_contract = { + limit = { var:task_contract_war = scope:war } + task_contract_employer = { save_scope_as = task_contract_employer } + invalidate_contract = yes + } + if = { + limit = { + NOT = { + exists = scope:task_contract_employer + } + } + scope:recipient = { + save_scope_as = task_contract_employer + } + } + trigger_event = ep3_contract_event.0013 + # We deliberately charge you here to let you go into prestige debt; you shouldn't be blocked from switching sides due to a lack of prestige if you're willing to tank the loss. + add_prestige = { + value = -200 + multiply = { + value = scope:recipient.highest_held_title_tier + add = -1 + } + } + if = { + limit = { scope:recipient.highest_held_title_tier >= tier_kingdom } + add_prestige_level = -1 + } + # Break the alliance + if = { + limit = { is_allied_to = scope:recipient } + break_alliance = scope:recipient + } + # And don't forget stress! + stress_impact = { + base = major_stress_impact_gain + disloyal = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + callous = miniscule_stress_impact_loss + arbitrary = miniscule_stress_impact_loss + just = minor_stress_impact_gain + humble = medium_stress_impact_gain + content = medium_stress_impact_gain + loyal = major_stress_impact_gain + } + # Clear Offer Assistance. + if = { + limit = { + has_variable = owed_contract_assistance_war + scope:recipient = { is_participant_in_war = scope:actor.var:owed_contract_assistance_war } + } + remove_variable = owed_contract_assistance_war + remove_variable = owed_contract_assistance_contribution + remove_variable = owed_contract_assistance_gold + } + } + scope:recipient = { + if = { + limit = { + can_set_relation_potential_rival_trigger = { CHARACTER = scope:actor } + } + set_relation_potential_rival = scope:actor + } + add_opinion = { + modifier = left_war_early + target = scope:actor + } + } + } + + auto_accept = yes + + ai_potential = { + is_at_war = yes + } + + ai_targets = { + ai_recipients = war_allies + } + + ai_frequency = 24 + + ai_will_do = { + base = -25 + #you have to be dishonorable and lazy to do this + ai_value_modifier = { + ai_honor = -0.1 + ai_energy = -0.1 + } + ##check if the recipient is the war leader and do it + #if they are infamous + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + scope:recipient = { + prestige_level < 0 + } + add = 5 + } + #if they are impious + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + scope:recipient = { + piety_level < 0 + } + add = 5 + } + #if they are a criminal + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + has_any_criminal_trait_in_faith_trigger = { + CHARACTER = scope:recipient + FAITH = scope:actor.faith + } + add = 5 + } + #if they wronged you or your family + modifier = { + any_character_war = { + is_war_leader = scope:recipient + } + scope:actor = { + has_any_major_revenge_opinion_against_character_trigger = { + CHARACTER = scope:recipient + } + } + add = 5 + } + #if they have good relation with the other side + modifier = { + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + primary_attacker = { + has_any_good_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + AND = { + primary_attacker = scope:recipient + primary_defender = { + has_any_good_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + } + } + add = 5 + } + #don't do it + # if the other side has bad relation with you + modifier = { + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + primary_attacker = { + has_any_bad_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + AND = { + primary_attacker = scope:recipient + primary_defender = { + has_any_bad_relationship_with_character_trigger = { + CHARACTER = scope:actor + } + } + } + } + } + add = -1000 + } + # you are winning + modifier = { + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + defender_war_score >= 0 + } + AND = { + primary_attacker = scope:recipient + attacker_war_score >= 0 + } + } + } + add = -1000 + } + opinion_modifier = { # Opinion Factor + who = scope:recipient + opinion_target = scope:actor + multiplier = -0.1 + desc = AI_OPINION_REASON + } + } +} diff --git a/common/character_interactions/06_ep3_scheme_interactions.txt b/common/character_interactions/06_ep3_scheme_interactions.txt new file mode 100644 index 00000000..7936e8d7 --- /dev/null +++ b/common/character_interactions/06_ep3_scheme_interactions.txt @@ -0,0 +1,3673 @@ +### EP3 Scheme Interactions + +# Slander +start_slander_interaction = { + icon = icon_scheme_slander + interface_priority = 95 + common_interaction = yes + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = slander + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = peer_vassals + max = 10 + } + ai_frequency = 36 + + is_shown = { + scope:actor = { + is_adult = yes + is_imprisoned = no + government_allows = administrative + } + scope:recipient = { + NOT = { this = scope:actor } + government_allows = administrative + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = slander + target_character = scope:recipient + } + } + scope:recipient = { + NOT = { has_strong_hook = scope:actor } + is_independent_ruler = no + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = slander + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_slander_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_slander_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_slander_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_slander_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = start_slander_interaction.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_slander_notification + + left_icon = scope:actor + right_icon = scope:recipient + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = slander + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_sycophant + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + # Secrecy. + AGENT_5 = agent_courtesan + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = slander + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_political_socialite + AGENT_2 = agent_political_socialite + AGENT_3 = agent_bureaucrat + # Success. + AGENT_4 = agent_sycophant + # Secrecy. + AGENT_5 = agent_courtesan + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = slander + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_courtesan + AGENT_2 = agent_amanuensis + AGENT_3 = agent_eunuch + # Success. + AGENT_4 = agent_sycophant + # Speed. + AGENT_5 = agent_political_socialite + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = slander + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_sycophant + AGENT_2 = agent_intermediary + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_bureaucrat + # Secrecy. + AGENT_5 = agent_courtesan + } + } + } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + stress_impact = { + compassionate = minor_stress_impact_gain + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + } + } + scope:recipient = { custom_tooltip = slander_modifier_tt } + } + + ai_potential = { + OR = { + primary_title.tier >= tier_duchy + AND = { + this = house.house_head + is_landless_administrative = yes + } + } + NOT = { + any_scheme = { + is_scheme_category = hostile + } + } + } + + auto_accept = yes + + ai_will_do = { + base = 5 + + #Competing candidate + modifier = { + scope:recipient = { is_competing_for_same_title_as = { CHARACTER = scope:actor } } + add = 30 + } + modifier = { + scope:recipient = { is_winning_competing_for_same_title_as = { CHARACTER = scope:actor } } + add = 50 + } + + # More likely against powerful or dominant families + modifier = { + scope:recipient.house ?= { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + add = 20 + } + + #Personality + modifier = { + has_trait = ambitious + add = 15 + } + modifier = { + has_trait = deceitful + add = 15 + } + modifier = { + has_trait = honest + add = -15 + } + modifier = { + has_trait = compassionate + add = -15 + } + modifier = { + has_trait = content + add = -15 + } + + # House & Family + modifier = { + is_close_family_of = scope:recipient + add = -20 + } + modifier = { + house = scope:recipient.house + add = -50 + } + modifier = { + house.house_head = scope:recipient + add = -50 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = 50 + } + + # Relationships + modifier = { + add = 25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -25 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -50 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + factor = 0 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Promote +start_promote_interaction = { + icon = icon_scheme_promote + interface_priority = 50 + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = promote + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = self + } + ai_targets = { + ai_recipients = spouses + } + ai_targets = { + ai_recipients = children + max = 10 + } + ai_targets = { + ai_recipients = family + max = 10 + } + ai_targets = { + ai_recipients = dynasty + max = 10 + } + ai_frequency = 60 + + is_shown = { + scope:actor = { + is_adult = yes + is_imprisoned = no + government_allows = administrative + } + scope:recipient = { + government_allows = administrative + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = promote + target_character = scope:recipient + } + } + scope:recipient = { + is_adult = yes + custom_tooltip = { + text = is_in_line_of_succession + any_heir_title = { + exists = this + } + } + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = promote + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_promote_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_promote_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_promote_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_promote_interaction.tt.agent_focus_speed + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_promote_notification + + left_icon = scope:actor + right_icon = scope:recipient + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = promote + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_proponent + AGENT_4 = agent_sycophant + # Speed. + AGENT_5 = agent_political_socialite + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = promote + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_political_socialite + AGENT_2 = agent_political_socialite + AGENT_3 = agent_bureaucrat + AGENT_4 = agent_bureaucrat + # Success. + AGENT_5 = agent_proponent + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = promote + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_proponent + AGENT_2 = agent_intermediary + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + AGENT_5 = agent_bureaucrat + } + } + } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + } + scope:recipient = { custom_tooltip = promote_scheme_success_tt } + } + + ai_potential = { + OR = { + primary_title.tier >= tier_duchy + AND = { + this = house.house_head + is_landless_administrative = yes + } + } + NOT = { + any_scheme = { + is_scheme_category = hostile + } + } + } + + auto_accept = yes + + ai_will_do = { + base = 0 + + #Competing candidate + modifier = { + scope:recipient = { is_competing_for_same_title_as = { CHARACTER = scope:actor } } + add = -50 + } + + modifier = { + scope:recipient = { is_winning_competing_for_same_title_as = { CHARACTER = scope:actor } } + add = -75 + } + + #Personality + modifier = { + has_trait = gregarious + add = 15 + } + + modifier = { + has_trait = honest + add = -10 + } + + modifier = { + has_trait = shy + add = -10 + } + + modifier = { + has_trait = ambitious + add = 20 + } + + # House & Family + modifier = { + is_close_family_of = scope:recipient + add = 30 + } + + modifier = { + is_parent_of = scope:recipient + add = 50 + } + + modifier = { + house = scope:recipient.house + add = 50 + } + + modifier = { + house.house_head = scope:recipient + add = 50 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = -100 + } + + # Relationships + modifier = { + add = -25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 25 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 100 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Generate Claim - used in laamp_help_fabricate_claim_contract landless adventurer task contract +start_generate_claim_interaction = { + icon = icon_scheme_generate_claim + interface_priority = 50 + category = interaction_category_laamp + + target_type = title + target_filter = recipient_de_jure_titles + + can_be_picked_title = { + scope:target = { + custom_description = { + text = adventurer_not_famous_trigger_tt + value = scope:target.tier + OR = { + tier <= scope:actor.prestige_level + tier = tier_county + } + } + is_noble_family_title = no + is_landless_type_title = no + } + } + + send_name = START_SCHEME + + scheme = generate_claim + + is_shown = { + scope:actor = { + any_character_active_contract = { + has_task_contract_type = laamp_help_fabricate_claim_contract + var:task_contract_target = scope:recipient + } + } + NOT = { + scope:recipient = scope:actor + } + scope:recipient = { is_landed = yes } + } + + is_valid_showing_failures_only = { + } + + desc = { + triggered_desc = { + trigger = { + scope:recipient = { + any_held_title = { + scope:actor = { + NOT = { has_claim_on = prev } + } + is_noble_family_title = no + target_is_de_facto_liege_or_above = scope:actor.top_liege.primary_title + tier >= tier_duchy + save_temporary_scope_as = target + } + } + scope:actor = { + can_start_scheme = { + type = generate_claim + target_title = scope:target + } + } + } + desc = scheme_interaction_tt_generate_claim_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_generate_claim_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_generate_claim_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_generate_claim_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = start_generate_claim_interaction.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_generate_claim_notification + + left_icon = scope:actor + right_icon = scope:recipient + + if = { + limit = { + any_character_active_contract = { + has_task_contract_type = laamp_help_fabricate_claim_contract + var:task_contract_target ?= scope:recipient + } + } + random_character_active_contract = { + limit = { + has_task_contract_type = laamp_help_fabricate_claim_contract + var:task_contract_target ?= scope:recipient + } + save_scope_as = scheme_contract + } + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + TASK_CONTRACT = scope:scheme_contract + # Success. + AGENT_1 = agent_scribe + AGENT_2 = agent_scribe + AGENT_3 = agent_diplomat + # Speed. + AGENT_4 = agent_justiciar_speed + # Secrecy. + AGENT_5 = agent_decoy + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + TASK_CONTRACT = scope:scheme_contract + # Speed. + AGENT_1 = agent_justiciar_speed + AGENT_2 = agent_infiltrator + AGENT_3 = agent_socialite + # Success. + AGENT_4 = agent_scribe + # Secrecy. + AGENT_5 = agent_decoy + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + TASK_CONTRACT = scope:scheme_contract + # Secrecy. + AGENT_1 = agent_decoy + AGENT_2 = agent_decoy + AGENT_3 = agent_alibi + # Success. + AGENT_4 = agent_scribe + # Speed. + AGENT_5 = agent_justiciar_speed + } + } + # Balanced. + else = { + begin_contract_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + TASK_CONTRACT = scope:scheme_contract + # Success. + AGENT_1 = agent_scribe + AGENT_2 = agent_diplomat + # Speed. + AGENT_3 = agent_justiciar_speed + AGENT_4 = agent_socialite + # Secrecy. + AGENT_5 = agent_decoy + } + } + } + else = { + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_scribe + AGENT_2 = agent_scribe + AGENT_3 = agent_diplomat + # Speed. + AGENT_4 = agent_justiciar_speed + # Secrecy. + AGENT_5 = agent_decoy + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Speed. + AGENT_1 = agent_justiciar_speed + AGENT_2 = agent_infiltrator + AGENT_3 = agent_socialite + # Success. + AGENT_4 = agent_scribe + # Secrecy. + AGENT_5 = agent_decoy + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Secrecy. + AGENT_1 = agent_decoy + AGENT_2 = agent_decoy + AGENT_3 = agent_alibi + # Success. + AGENT_4 = agent_scribe + # Speed. + AGENT_5 = agent_justiciar_speed + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = generate_claim + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_scribe + AGENT_2 = agent_diplomat + # Speed. + AGENT_3 = agent_justiciar_speed + AGENT_4 = agent_socialite + # Secrecy. + AGENT_5 = agent_decoy + } + } + } + } + } + } + + auto_accept = yes + + ai_will_do = { + base = 5 + + #Not a governor already + modifier = { + is_governor = no + add = 30 + } + + #Personality + modifier = { + has_trait = ambitious + add = 15 + } + + modifier = { + has_trait = deceitful + add = 15 + } + + modifier = { + has_trait = honest + add = -10 + } + + # House & Family + modifier = { + is_close_family_of = scope:recipient + add = -10 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = 50 + } + + # Relationships + modifier = { + add = 25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -25 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + factor = 0 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Challenge Status +start_challenge_status_interaction = { + icon = icon_scheme_challenge_status + interface_priority = 80 + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = challenge_status + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = peer_vassals + max = 5 + } + + ai_frequency = 120 + + is_shown = { + scope:actor = { + government_allows = administrative + } + scope:recipient != scope:actor + scope:recipient = { + government_allows = administrative + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + is_imprisoned = no + can_start_scheme = { + type = challenge_status + target_character = scope:recipient + } + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = challenge_status + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_challenge_status_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_challenge_status_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_challenge_status_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_challenge_status_interaction.tt.agent_focus_speed + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_challenge_status_notification + + left_icon = scope:actor + right_icon = scope:recipient + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = challenge_status + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_proponent + AGENT_2 = agent_intermediary + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + AGENT_5 = agent_bureaucrat + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = challenge_status + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_proponent + AGENT_2 = agent_intermediary + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_bureaucrat + AGENT_5 = agent_bureaucrat + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = challenge_status + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_proponent + AGENT_2 = agent_intermediary + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_bureaucrat + # Secrecy. + AGENT_5 = agent_amanuensis + } + } + } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + custom_tooltip = challenge_status_success_actor_tt + } + scope:recipient = { + save_scope_as = target + custom_tooltip = challenge_status_success_recipient_tt + } + } + + ai_potential = { + NOT = { + any_scheme = { + is_scheme_category = political + } + } + government_allows = administrative + } + + auto_accept = yes + + ai_will_do = { + base = 5 + + #Personality + modifier = { + has_trait = vengeful + add = 15 + } + + modifier = { + has_trait = deceitful + add = 15 + } + + modifier = { + has_trait = honest + add = -10 + } + + # House & Family + modifier = { + is_close_family_of = scope:recipient + add = -50 + } + modifier = { + house = scope:recipient.house + add = -30 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = 50 + } + + # Relationships + modifier = { + add = 25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -25 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + factor = 0 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Expand Power Base +start_expand_power_base_interaction = { + icon = icon_scheme_expand_power_base + common_interaction = yes + interface_priority = 70 + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = expand_power_base + ignores_pending_interaction_block = yes + + cooldown = { years = 10 } + + ai_frequency = 48 + ai_targets = { + ai_recipients = self + } + + is_shown = { + scope:actor = { + is_adult = yes + is_imprisoned = no + government_allows = administrative + this = scope:recipient + exists = house.house_head + house.house_head = { + any_held_title = { + is_noble_family_title = yes + } + } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = expand_power_base + target_character = scope:actor + } + } + } + + desc = scheme_interaction_tt_expand_power_base_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_expand_power_base_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_expand_power_base_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_expand_power_base_interaction.tt.agent_focus_speed + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_expand_power_base_notification + + left_icon = scope:actor + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = expand_power_base + TARGET_TYPE = target_character + TARGET_SCOPE = scope:actor + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_proponent + AGENT_4 = agent_sycophant + # Speed. + AGENT_5 = agent_bureaucrat + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = expand_power_base + TARGET_TYPE = target_character + TARGET_SCOPE = scope:actor + # Speed. + AGENT_1 = agent_political_socialite + AGENT_2 = agent_political_socialite + AGENT_3 = agent_bureaucrat + AGENT_4 = agent_bureaucrat + # Success. + AGENT_5 = agent_intermediary + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = expand_power_base + TARGET_TYPE = target_character + TARGET_SCOPE = scope:actor + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + AGENT_5 = agent_bureaucrat + } + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = stewardship } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + custom_tooltip = expand_power_base_effect_tt + } + } + + auto_accept = yes + + ai_will_do = { + base = 0 + # The more I'm investing, the more I want my cap to increase + modifier = { + add = { + value = 0 + every_succession_appointment_invested_candidate = { + add = 5 + } + } + } + + #Not a governor + modifier = { + is_governor = no + add = 30 + } + + #Personality + modifier = { + has_trait = ambitious + add = 20 + } + } +} + +# Depose Scheme +start_depose_interaction = { + icon = icon_scheme_depose + interface_priority = 50 + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = depose + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = liege + max = 1 + } + ai_frequency = 60 + + is_shown = { + has_ep3_dlc_trigger = yes + scope:actor = { government_allows = administrative } + scope:recipient = { + government_allows = administrative + primary_title.tier >= tier_empire # Target has to be the emperor + this != scope:actor + top_liege.primary_title = scope:actor.top_liege.primary_title # This hides the tooltip + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_adult = yes + is_imprisoned = no + custom_tooltip = { + text = house_head_powerful_dominant_family_trigger + house = { + # Must be a powerful or dominant family + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + # Must be the house head + house.house_head = scope:actor + } + # Must not be from the same House as the Emperor + NOT = { house = scope:actor.top_liege.house } + can_start_scheme = { + type = depose + target_character = scope:recipient + } + } + scope:recipient = { + NOT = { has_strong_hook = scope:actor } + } + } + + desc = scheme_interaction_tt_depose_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_depose_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_depose_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_depose_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = start_depose_interaction.tt.agent_focus_secrecy + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_depose_notification + + left_icon = scope:actor + right_icon = scope:recipient + + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = depose + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + # Secrecy. + AGENT_5 = agent_courtesan + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = depose + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Speed. + AGENT_1 = agent_political_socialite + AGENT_2 = agent_political_socialite + AGENT_3 = agent_bureaucrat + # Success. + AGENT_4 = agent_proponent + # Secrecy. + AGENT_5 = agent_courtesan + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = depose + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_courtesan + AGENT_2 = agent_amanuensis + AGENT_3 = agent_eunuch_speed + # Success. + AGENT_4 = agent_proponent + # Speed. + AGENT_5 = agent_political_socialite + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = depose + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_bureaucrat + # Secrecy. + AGENT_5 = agent_courtesan + } + } + } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + stress_impact = { + compassionate = minor_stress_impact_gain + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + loyal = major_stress_impact_gain + } + } + } + + ai_potential = { + OR = { + primary_title.tier >= tier_duchy + AND = { + this = house.house_head + is_landless_administrative = yes + } + } + NOT = { + any_scheme = { + is_scheme_category = hostile + } + } + } + + auto_accept = yes + + ai_will_do = { + base = 0 + + # Dominant Family + modifier = { + house = { is_dominant_family = yes } + add = 50 + } + + #Personality + modifier = { + has_trait = ambitious + add = 15 + } + modifier = { + has_trait = deceitful + add = 15 + } + modifier = { + has_trait = honest + add = -15 + } + modifier = { + has_trait = compassionate + add = -15 + } + modifier = { + has_trait = just + add = -10 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = 50 + } + + # Relationships + modifier = { + add = 25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -25 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + factor = 0 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + # House & Family + modifier = { # Family and house members never want to depose each other + OR = { + is_close_family_of = scope:recipient + AND = { + exists = house + NOT = { scope:recipient.house ?= house } + } + } + NOR = { # Unless they are... + has_trait = ambitious + has_trait = greedy + has_trait = deceitful + } + factor = 0 + } + + # Only depose if you dislike the target + modifier = { + opinion = { target = scope:recipient value > -30 } + factor = 0 + } + + # EP3 Dynasty Legacy Perk Malus + modifier = { + add = -70 + scope:target.dynasty ?= { has_dynasty_perk = ep3_administrative_legacy_5 } + } + } +} + +# Foster Legitimacy +start_foster_legitimacy_interaction = { + icon = icon_scheme_foster_legitimacy + interface_priority = 55 + common_interaction = yes + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = foster_legitimacy_scheme + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = liege + } + + ai_frequency = 60 + + is_shown = { + scope:actor = { + is_adult = yes + is_imprisoned = no + government_allows = administrative + } + + NOT = { + scope:recipient = scope:actor + } + + scope:recipient = { + this = scope:actor.liege + is_adult = yes + government_allows = administrative + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = foster_legitimacy_scheme + target_character = scope:recipient + } + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = foster_legitimacy_scheme + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_foster_legitimacy_approved + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_foster_legitimacy_notification + + left_icon = scope:actor + right_icon = scope:recipient + + begin_scheme_basic_effect = { + SCHEME_TYPE = foster_legitimacy_scheme + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = diplomacy } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + custom_tooltip = foster_legitimacy_positive_outcome_actor_tt + custom_tooltip = foster_legitimacy_negative_outcome_tt + } + scope:recipient = { + custom_tooltip = foster_legitimacy_positive_outcome_recipient_tt + } + } + + ai_potential = { + is_governor = yes + trigger_if = { + limit = { exists = scope:recipient } + opinion = { + target = scope:recipient + value > 0 + } + } + # Only try to foster legitimacy if they don't meet your expectations + scope:recipient ?= { + NOT = { meets_legitimacy_expectation_of = scope:actor } + } + } + + auto_accept = yes + + ai_will_do = { + base = 0 # So the AI doesn't mess with your Legitimacy too often + + # Legitimacy Levels + modifier = { + scope:recipient.legitimacy_level >= 4 + add = -50 + } + + #Personality + modifier = { + has_lifestyle = diplomacy_lifestyle + add = 15 + } + + modifier = { + has_trait = loyal + add = 15 + } + + modifier = { + has_trait = disloyal + add = -25 + } + + modifier = { + has_trait = deceitful + add = -15 + } + + # House & Family, but you need to get along + modifier = { + is_close_family_of = scope:recipient + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + add = 25 + } + + modifier = { + house = scope:recipient.house + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + add = 15 + } + + # Relationships + modifier = { + add = -25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -100 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Damage Legitimacy +start_damage_legitimacy_interaction = { + icon = icon_scheme_damage_legitimacy + interface_priority = 50 + common_interaction = yes + category = interaction_category_admin + + send_name = START_SCHEME + + scheme = damage_legitimacy_scheme + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = liege + } + + ai_frequency = 60 + + is_shown = { + scope:actor = { + is_adult = yes + is_imprisoned = no + government_allows = administrative + } + + NOT = { + scope:recipient = scope:actor + } + + scope:recipient = { + this = scope:actor.liege + is_adult = yes + government_allows = administrative + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = damage_legitimacy_scheme + target_character = scope:recipient + } + } + } + + desc = { + triggered_desc = { + trigger = { + scope:actor = { + can_start_scheme = { + type = damage_legitimacy_scheme + target_character = scope:recipient + } + } + } + desc = scheme_interaction_tt_damage_legitimacy_approved + } + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_damage_legitimacy_notification + + left_icon = scope:actor + right_icon = scope:recipient + + begin_scheme_basic_effect = { + SCHEME_TYPE = damage_legitimacy_scheme + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = intrigue } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + custom_tooltip = damage_legitimacy_negative_outcome_tt + + stress_impact = { + loyal = major_stress_impact_gain + honest = medium_stress_impact_gain + } + } + scope:recipient = { + custom_tooltip = damage_legitimacy_positive_outcome_tt + } + } + + ai_potential = { + is_governor = yes + } + + auto_accept = yes + + ai_will_do = { + base = 0 # So the AI doesn't mess with your Legitimacy too often + + #Personality + modifier = { + has_lifestyle = intrigue_lifestyle + add = 15 + } + + modifier = { + has_trait = disloyal + add = 15 + } + + modifier = { + has_trait = deceitful + add = 15 + } + + modifier = { + has_trait = loyal + add = -25 + } + + modifier = { + has_trait = honest + add = -15 + } + + # Relationships + modifier = { + add = -25 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 75 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} + +# Dispute Border +start_dispute_border_interaction = { + icon = icon_dispute_border + interface_priority = 75 + category = interaction_category_admin + send_name = START_SCHEME + scheme = dispute_border + ignores_pending_interaction_block = yes + ai_targets = { ai_recipients = peer_vassals } + ai_frequency = 60 + + cooldown_against_recipient = { years = 5 } + + target_type = title + target_filter = recipient_realm_titles + + can_be_picked_title = { + scope:target = { + ep3_boundary_dispute_county_trigger = { + OWNER = scope:actor + TARGET = scope:recipient + } + } + } + + is_shown = { + scope:actor = { is_governor = yes } + scope:recipient = { + this != scope:actor + is_alive = yes + top_liege = scope:actor.top_liege + is_governor = yes + in_diplomatic_range = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_available_adult = yes + trigger_if = { + limit = { exists = scope:target } + can_start_scheme = { + type = dispute_border + target_title = scope:target + } + } + custom_tooltip = { + text = dispute_border_county_neighbour_tt + character_is_realm_neighbor = scope:recipient + } + is_in_civil_war = no + custom_tooltip = { + text = admin_vassal_border_limit_desc + top_liege ?= { + NOT = { has_realm_law_flag = admin_vassal_border_limit } + } + } + trigger_if = { + limit = { + top_liege ?= { + NOT = { has_realm_law_flag = admin_vassal_border_limit } + has_realm_law_flag = admin_vassal_border_restricted + } + } + custom_tooltip = { + text = interaction_must_be_powerful_or_dominant_family_tt + house = { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + } + } + } + scope:recipient = { + is_in_civil_war = no + } + } + + desc = start_dispute_border_interaction_desc + + cost = { + influence = { + add = scope:actor.massive_influence_gain + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_dispute_border_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_dispute_border_interaction.tt.agent_focus_speed + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_dispute_border_notification + left_icon = scope:recipient + right_icon = scope:target + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_bad + title = start_dispute_border_notification + left_icon = scope:actor + right_icon = scope:target + scope:actor = { + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = dispute_border + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + AGENT_5 = agent_bureaucrat + } + } + # Speed. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = dispute_border + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_bureaucrat + AGENT_5 = agent_bureaucrat + } + } + } + } + } + } + random_scheme = { + limit = { + scheme_type = dispute_border + scheme_target_title = scope:target + } + set_variable = { + name = target_character + value = scope:recipient + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = diplomacy } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + custom_tooltip = boundary_dispute_outcome_tt + + stress_impact = { + content = medium_stress_impact_gain + } + } + scope:recipient = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = attempted_dispute_border_opinion + } + } + } + } + + ai_potential = { + NOT = { + any_scheme = { is_scheme_category = political } + } + is_governor = yes + } + + auto_accept = yes + + ai_will_do = { + base = 0 + #Personality + modifier = { + has_trait = ambitious + add = 15 + } + modifier = { + has_trait = content + add = -15 + } + # Land + modifier = { + scope:recipient = { + any_sub_realm_county = { + OR = { + duchy.holder = scope:actor + kingdom.holder = scope:actor + } + } + } + } + # Relationships + modifier = { + add = -25 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -50 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 15 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 25 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 50 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + # House + modifier = { + add = -50 + scope:recipient.house ?= scope:actor.house + } + } +} + +# Subsume Province +start_subsume_province_interaction = { + icon = icon_subsume_province + common_interaction = yes + interface_priority = 50 + category = interaction_category_admin + send_name = START_SCHEME + scheme = subsume_province + ignores_pending_interaction_block = yes + ai_targets = { ai_recipients = peer_vassals } + ai_frequency = 60 + + cooldown = { years = 5 } + + target_type = title + target_filter = recipient_de_jure_titles + + can_be_picked_title = { + scope:actor = { + can_start_scheme = { + type = subsume_province + target_title = scope:target + } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier = tier_duchy + exists = holder + holder = scope:recipient + } + } + + desc = start_subsume_province_interaction_desc + + is_shown = { + scope:actor = { is_governor = yes } + scope:recipient = { + is_alive = yes + top_liege = scope:actor.top_liege + is_governor = yes + NOR = { + this = scope:actor + scope:actor.house = scope:recipient.house + } + in_diplomatic_range = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_available_adult = yes + trigger_if = { + limit = { exists = scope:target } + can_start_scheme = { + type = subsume_province + target_title = scope:target + } + } + trigger_if = { + limit = { + top_liege ?= { + NOT = { has_realm_law_flag = admin_vassal_border_limit } + } + } + custom_tooltip = { + text = interaction_must_be_powerful_or_dominant_family_tt + house = { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + } + } + is_in_civil_war = no + custom_tooltip = { + text = admin_vassal_border_limit_desc + top_liege ?= { + NOT = { has_realm_law_flag = admin_vassal_border_limit } + } + } + } + scope:recipient = { + custom_tooltip = { + text = subsume_province_neighboring_duchy_tt + any_sub_realm_county = { + any_neighboring_county = { + county_held_or_vassal_to_target_trigger = { TARGET = scope:actor } + } + } + } + custom_tooltip = { + text = subsume_province_recipient_scheming_against_you_tt + NOT = { + is_scheming_against = { + type = subsume_province + target = scope:actor + } + } + } + custom_tooltip = { + text = subsume_province_recipient_house_power_or_gov_efficiency_tt + OR = { + governor_efficiency_presented <= -25 + AND = { + trigger_if = { + limit = { house = { is_powerful_family = yes } } + scope:actor.house = { is_dominant_family = yes } + } + house = { is_dominant_family = no } + } + } + } + is_in_civil_war = no + NOT = { is_diarch_of_target = liege } + } + } + + is_highlighted = { scope:recipient.governor_efficiency_presented <= -25 } + should_use_extra_icon = { scope:recipient.governor_efficiency_presented <= -25 } + extra_icon = "gfx/interface/icons/character_interactions/icon_damage_efficiency.dds" + + cost = { + influence = { + add = { + value = scope:actor.massive_influence_gain + multiply = 4 + } + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_subsume_province_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_subsume_province_interaction.tt.agent_focus_speed + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_subsume_province_notification + left_icon = scope:recipient + right_icon = scope:target + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_bad + title = start_subsume_province_notification + left_icon = scope:actor + right_icon = scope:target + scope:actor = { + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = subsume_province + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_proponent + # Speed. + AGENT_4 = agent_political_socialite + AGENT_5 = agent_political_socialite + } + } + # Speed. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = subsume_province + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_political_socialite + AGENT_5 = agent_political_socialite + } + } + } + } + } + } + random_scheme = { + limit = { + scheme_type = subsume_province + scheme_target_title = scope:target + } + set_variable = { + name = target_character + value = scope:recipient + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = diplomacy } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + custom_tooltip = subsume_province_scheme_success_outcome_tt + stress_impact = { + content = medium_stress_impact_gain + } + } + scope:recipient = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = attempted_subsume_province_opinion + } + } + } + } + + ai_potential = { + NOT = { + any_scheme = { is_scheme_category = political } + } + is_governor = yes + } + + auto_accept = yes + + ai_will_do = { + base = 0 + + #Personality + modifier = { + has_trait = ambitious + add = 15 + } + modifier = { + has_trait = content + add = -15 + } + # Land + modifier = { + scope:recipient = { + any_sub_realm_county = { + OR = { + duchy.holder = scope:actor + kingdom.holder = scope:actor + } + } + } + } + # Relationships + modifier = { + add = -25 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -50 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 15 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 25 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 50 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + # House + modifier = { + add = -50 + scope:recipient.house ?= scope:actor.house + } + } +} + +# Found Despotate +start_found_despotate_interaction = { + icon = icon_found_despotate + interface_priority = 60 + common_interaction = yes + category = interaction_category_admin + send_name = START_SCHEME + scheme = found_despotate + ignores_pending_interaction_block = yes + ai_frequency = 60 + ai_targets = { ai_recipients = self } + + target_type = title + target_filter = secondary_recipient_de_jure_titles + + can_be_picked_title = { + scope:target ?= { + custom_tooltip = { + text = found_despotate_existing_scheme_tt + NOT = { + scope:actor.top_liege = { + any_vassal = { + any_scheme = { + scheme_type = found_despotate + scheme_target_title = scope:target + } + } + } + } + } + trigger_if = { + limit = { tier = tier_kingdom } + custom_tooltip = { + text = found_despotate_hold_duchy_tt + any_direct_de_jure_vassal_title = { holder = scope:actor } + } + custom_tooltip = { + text = found_despotate_hold_county_tt + any_de_jure_county = { holder = scope:actor } + } + } + is_landless_type_title = no + NOT = { holder ?= scope:actor } + is_title_created = no + scope:recipient.top_liege = { completely_controls = scope:target } + } + } + + has_valid_target_showing_failures_only = { + scope:target = { + tier = tier_kingdom + } + } + + # We do this via redirects because recipient_de_jure_titles did not turn up for work today. + redirect = { + scope:actor = { + top_liege ?= { save_scope_as = secondary_recipient } + if = { + limit = { + exists = primary_title.kingdom + primary_title.tier = tier_duchy + } + primary_title.kingdom = { save_scope_as = target } + } + } + } + + cooldown = { years = 5 } + + is_shown = { + scope:actor = { is_governor = yes } + scope:recipient = scope:actor + } + + is_valid_showing_failures_only = { + #If kingdom primary title kingdom has more than one duchy, needs to have two duchies + trigger_if = { + limit = { + scope:actor = { + is_ruler = yes + primary_title.kingdom = { + any_in_de_jure_hierarchy = { + count >= 2 + tier = tier_duchy + is_landless_type_title = no + } + } + } + } + custom_tooltip = { + text = 2_or_more_governorships_tt + scope:actor = { + any_held_title = { + count >= 2 + tier = tier_duchy + is_landless_type_title = no + } + } + + } + } + scope:actor = { + is_adult = yes + is_imprisoned = no + highest_held_title_tier < tier_kingdom + custom_tooltip = { + text = interaction_must_be_powerful_or_dominant_family_tt + exists = house + house = { + OR = { + is_powerful_family = yes + is_dominant_family = yes + } + } + } + custom_tooltip = { + text = influence_level_3_tt + influence_level >= 3 + } + } + scope:secondary_recipient.primary_title ?= { + any_direct_de_jure_vassal_title = { + tier = tier_kingdom + is_landless_type_title = no + custom_tooltip = { + text = found_despotate_hold_duchy_tt + any_direct_de_jure_vassal_title = { holder = scope:actor } + } + NOT = { holder ?= scope:actor } + is_title_created = no + } + } + custom_tooltip = { + text = found_despotate_existing_scheme_tt + NOT = { + scope:actor.top_liege = { + any_vassal = { + any_scheme = { + scheme_type = found_despotate + scheme_target_title = scope:actor.primary_title.kingdom + } + } + } + } + } + custom_tooltip = { + text = found_despotate_percent_controlled_tt + scope:actor.primary_title.kingdom = { + any_de_jure_county = { + percent >= 0.25 + county_held_or_vassal_to_target_trigger = { TARGET = scope:actor } + } + } + } + trigger_if = { + limit = { + exists = scope:target + scope:actor.liege.diarch ?= { + any_held_title = { + any_this_title_or_de_jure_above = { this = scope:target } + } + } + } + scope:actor.liege.diarch = { + NOT = { is_diarch_of_target = liege } + } + } + } + + desc = start_found_despotate_interaction_desc + + cost = { + influence = { + add = scope:actor.massive_influence_value + } + } + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_found_despotate_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_found_despotate_interaction.tt.agent_focus_speed + } + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_found_despotate_notification + left_icon = scope:recipient + right_icon = scope:target + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_bad + title = start_found_despotate_notification + left_icon = scope:actor + right_icon = scope:target + scope:actor = { + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = found_despotate + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + AGENT_3 = agent_sycophant + # Speed. + AGENT_4 = agent_political_socialite + AGENT_5 = agent_political_socialite + } + } + # Speed. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = found_despotate + TARGET_TYPE = target_title + TARGET_SCOPE = scope:target + # Success. + AGENT_1 = agent_intermediary + AGENT_2 = agent_proponent + # Speed. + AGENT_3 = agent_political_socialite + AGENT_4 = agent_political_socialite + AGENT_5 = agent_political_socialite + } + } + } + } + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = diplomacy } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + custom_tooltip = found_despotate_success_tt + + stress_impact = { + content = minor_stress_impact_gain + humble = minor_stress_impact_gain + } + } + } + + ai_potential = { + has_trait = ambitious + is_governor = yes + NOR = { + has_trait = content + any_scheme = { is_scheme_category = political } + } + } + + auto_accept = yes + + ai_will_do = { + base = 15 + } +} + +# Raid Estate +start_raid_estate_interaction = { + icon = icon_raid_estate + interface_priority = 90 + category = interaction_category_admin + send_name = START_SCHEME + scheme = raid_estate + ignores_pending_interaction_block = yes + ai_frequency = 60 + + ai_targets = { ai_recipients = liege } + ai_targets = { + ai_recipients = peer_vassals + max = 20 + } + ai_targets = { + ai_recipients = vassals + max = 20 + } + + cooldown = { years = 5 } + + highlighted_reason = start_raid_estate_interaction_HIGHLIGHTED + + is_highlighted = { scope:actor.var:raid_estate_permission ?= scope:recipient.house } + + is_shown = { + scope:actor = { government_allows = administrative } + scope:recipient.house.house_head ?= { + exists = house + NOT = { house = scope:actor.house } + top_liege = scope:actor.top_liege + government_allows = administrative + any_held_title = { is_noble_family_title = yes } + } + } + + is_valid_showing_failures_only = { + scope:actor = { + is_available_adult = yes + custom_tooltip = { + text = raid_estate_noble_family_tt + any_held_title = { is_noble_family_title = yes } + house.house_head ?= this + } + } + scope:recipient.house.house_head ?= { + custom_tooltip = { + text = raid_estate_noble_family_target_tt + any_held_title = { is_noble_family_title = yes } + } + custom_tooltip = { + text = raid_estate_estate_tt + domicile ?= { is_domicile_type = estate } + } + } + } + + desc = start_raid_estate_interaction_desc + + # Scheme Starter Packages + options_heading = schemes.t.agent_packages + send_options_exclusive = yes + ## Balanced agents. + send_option = { + flag = agent_focus_balance + current_description = start_raid_estate_interaction.tt.agent_focus_balance + } + ## Focused on Success Chance. + send_option = { + flag = agent_focus_success + current_description = start_raid_estate_interaction.tt.agent_focus_success + } + ## Focused on Speed. + send_option = { + flag = agent_focus_speed + current_description = start_raid_estate_interaction.tt.agent_focus_speed + } + ## Focused on Secrecy. + send_option = { + flag = agent_focus_secrecy + current_description = start_raid_estate_interaction.tt.agent_focus_secrecy + } + + on_accept = { + scope:recipient = { + custom_tooltip = raid_estate_kill_maim_imprison_house_members_tt + custom_tooltip = raid_estate_destroy_buildings_tt + custom_tooltip = raid_estate_house_modifier_tt + random_held_title = { + limit = { is_noble_family_title = yes } + save_scope_as = target_title + } + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_raid_estate_notification + left_icon = scope:recipient + right_icon = scope:target_title + # Success. + if = { + limit = { scope:agent_focus_success ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = raid_estate + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_scout + AGENT_2 = agent_scout + AGENT_3 = agent_muscle + # Speed. + AGENT_4 = agent_infiltrator + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Speed. + else_if = { + limit = { scope:agent_focus_speed ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = raid_estate + 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_scout + # Secrecy. + AGENT_5 = agent_lookout + } + } + # Secrecy. + else_if = { + limit = { scope:agent_focus_secrecy ?= yes } + begin_scheme_with_agents_effect = { + SCHEME_TYPE = raid_estate + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Secrecy. + AGENT_1 = agent_lookout + AGENT_2 = agent_lookout + AGENT_3 = agent_alibi + # Success. + AGENT_4 = agent_scout + # Speed. + AGENT_5 = agent_infiltrator + } + } + # Balanced. + else = { + begin_scheme_with_agents_effect = { + SCHEME_TYPE = raid_estate + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + # Success. + AGENT_1 = agent_scout + AGENT_2 = agent_muscle + # Speed. + AGENT_3 = agent_infiltrator + AGENT_4 = agent_footpad + # Secrecy. + AGENT_5 = agent_lookout + } + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = intrigue } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + + custom_tooltip = raid_estate_gain_coin_tt + if = { + limit = { + has_relation_rival = scope:recipient + } + custom_tooltip = raid_estate_nemesis_relation_tt + } + else = { + custom_tooltip = raid_estate_rival_relation_tt + } + + stress_impact = { + content = medium_stress_impact_gain + } + if = { + limit = { + has_relation_nemesis = scope:recipient + } + stress_impact = { base = major_stress_impact_loss } + } + else_if = { + limit = { + has_relation_rival = scope:recipient + } + stress_impact = { base = medium_stress_impact_loss } + } + } + } + + ai_potential = { + NOT = { + any_scheme = { is_hostile = yes } + } + any_held_title = { is_noble_family_title = yes } + } + + auto_accept = yes + + ai_will_do = { + base = -20 + #Personality + modifier = { + has_trait = vengeful + add = 15 + } + modifier = { + has_trait = forgiving + add = -15 + } + modifier = { + has_trait = brave + add = 15 + } + modifier = { + has_trait = craven + add = -15 + } + # Relationships + modifier = { + add = -25 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -50 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 15 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 25 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 50 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + scope:recipient.house = scope:actor.top_liege.house + add = -25 + } + opinion_modifier = { + who = scope:actor + opinion_target = scope:recipient + multiplier = -0.25 + } + } +} + +# Teach Governor - AKA Mentor in Governance/mentor_in_governance +start_teach_governor_interaction = { + icon = icon_teach_governor + interface_priority = 50 + category = interaction_category_admin + send_name = START_SCHEME + scheme = teach_governor + ai_targets = { + ai_recipients = peer_vassals + max = 20 + } + ai_targets = { + ai_recipients = vassals + max = 10 + } + + ai_frequency = 60 + + notification_text = TEACH_GOVERNOR_NOTIFICATION + ai_min_reply_days = 4 + ai_max_reply_days = 9 + + cooldown_against_recipient = { years = 15 } + + is_shown = { + scope:actor = { government_allows = administrative } + scope:recipient != scope:actor + scope:recipient = { + is_alive = yes + top_liege = scope:actor.top_liege + in_diplomatic_range = scope:actor + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = teach_governor + target_character = scope:recipient + } + custom_tooltip = { + text = teach_governor_maximum_xp_tt + scope:recipient = { has_trait_xp = { trait = governor value < 95 } } + } + custom_tooltip = { + text = teach_governor_minimum_xp_tt + scope:recipient = { + trigger_if = { + limit = { has_trait_xp = { trait = governor value >= 100 } } + scope:actor = { has_trait_xp = { trait = governor value >= 75 } } + } + trigger_else_if = { + limit = { has_trait_xp = { trait = governor value >= 75 } } + scope:actor = { has_trait_xp = { trait = governor value >= 50 } } + } + trigger_else_if = { + limit = { has_trait_xp = { trait = governor value >= 50 } } + scope:actor = { has_trait_xp = { trait = governor value >= 25 } } + } + trigger_else = { always = yes } + } + } + } + } + + desc = start_teach_governor_interaction_desc + + cost = { + influence = { add = scope:actor.minor_influence_gain } + } + + on_accept = { + scope:actor = { + custom_tooltip = teach_governor_actor_reward_tt + stress_impact = { + humble = minor_stress_impact_gain + lazy = medium_stress_impact_gain + } + trigger_event = scheme_critical_moments.8045 + } + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_teach_governor_notification + left_icon = scope:recipient + right_icon = scope:recipient.primary_title + scope:recipient = { + send_interface_toast = { + type = event_toast_effect_bad + title = start_teach_governor_notification + left_icon = scope:actor + right_icon = scope:actor.primary_title + scope:actor = { + begin_scheme_basic_effect = { + SCHEME_TYPE = teach_governor + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + } + } + } + } + } + # Scheme progress bonus from education + education_5_scheme_progress_effect = { SKILL = stewardship } + # Scheme bonuses from being the emperor/dominant family/powerful family + ep3_actor_scheme_modifier_effect = yes + } + scope:recipient = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:actor + modifier = mentoring_governor_opinion + } + } + custom_tooltip = teach_governor_recipient_reward_tt + } + } + + on_decline = { + scope:actor = { + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:recipient + modifier = insulted_opinion + opinion = -10 + } + } + else = { trigger_event = scheme_critical_moments.8046 } + } + } + + ai_potential = { + NOR = { + has_trait = lazy + scheme_generic_ai_blocker_trigger = yes + } + is_governor = yes + } + + ai_accept = { + base = 0 + opinion_modifier = { + who = scope:recipient + opinion_target = scope:actor + multiplier = 0.25 + } + # Experience + modifier = { + desc = RELATIVE_GOVERNOR_EFFICIENCY + add = { + value = ep3_actor_recipient_governor_trait_level_diff_value + subtract = 1 + multiply = 15 + } + } + modifier = { # If you are from a powerful family, and they are not, they are more likely to accept + scope:actor.house ?= { is_powerful_family = yes } + house ?= { + is_powerful_family = no + is_dominant_family = no + } + add = 15 + desc = your_house_is_powerful_reason + } + modifier = { # If you are from a dominant family, and they are not, they are more likely to accept + scope:actor.house ?= { is_dominant_family = yes } + house ?= { is_dominant_family = no } + add = 25 + desc = your_house_is_dominant_reason + } + modifier = { # If they are from a powerful family, and you are not, they are more likely to refuse + house ?= { is_powerful_family = yes } + scope:actor.house ?= { + is_powerful_family = no + is_dominant_family = no + } + add = -15 + desc = their_house_is_powerful_reason + } + modifier = { # If they are from a dominant family, and you are not, they are more likely to refuse + house ?= { is_dominant_family = yes } + scope:actor.house ?= { is_dominant_family = no } + add = -25 + desc = their_house_is_dominant_reason + } + modifier = { # Difference in influence level + influence_level != scope:actor.influence_level + add = { + add = { + add = 10 + multiply = scope:recipient.influence_level + } + subtract = { + add = 10 + multiply = scope:actor.influence_level + } + } + desc = difference_in_influence_level_reason + } + modifier = { + scope:actor = { + exists = house + } + scope:recipient = { + exists = house + } + exists = scope:actor.house.house_head.top_liege + house.house_head.top_liege ?= scope:actor.house.house_head.top_liege + add = { + value = scope:actor.house.house_power_score + subtract = scope:recipient.house.house_power_score + divide = 4 + floor = yes + } + desc = RELATIVE_FAMILY_RATING + } + # Relations + modifier = { # Friend + desc = offer_vassalization_interaction_aibehavior_friend_tt + has_relation_friend = scope:actor + NOT = { has_relation_best_friend = scope:actor } + add = 15 + } + modifier = { # Best Friend + desc = offer_vassalization_interaction_aibehavior_best_friend_tt + has_relation_best_friend = scope:actor + add = 30 + } + modifier = { # Rival + desc = offer_vassalization_interaction_aibehavior_rival_tt + has_relation_rival = scope:actor + NOT = { has_relation_nemesis = scope:actor } + add = -25 + } + modifier = { # Nemesis + desc = offer_vassalization_interaction_aibehavior_nemesis_tt + has_relation_nemesis = scope:actor + add = -50 + } + modifier = { + is_close_family_of = scope:actor + add = 50 + desc = CLOSE_FAMILY_REASON + } + modifier = { + is_extended_family_of = scope:actor + add = 25 + desc = EXTENDED_FAMILY_REASON + } + modifier = { + NOR = { + is_close_family_of = scope:actor + is_extended_family_of = scope:actor + } + house ?= scope:actor.house + add = 5 + desc = YOU_ARE_MY_HOUSE_MEMBER + } + #Age + modifier = { + desc = AGE_DIFFERENCE + add = { + value = scope:actor.age + add = { + value = scope:recipient.age + multiply = -1 + } + } + } + # Traits + modifier = { + has_trait = ambitious + add = 10 + desc = INTERACTION_AMBITIOUS + } + modifier = { + has_trait = diligent + add = 10 + desc = INTERACTION_DILIGENT + } + modifier = { + has_trait = humble + add = 10 + desc = INTERACTION_HUMBLE + } + modifier = { + has_trait = content + add = -10 + desc = INTERACTION_CONTENT + } + modifier = { + has_trait = lazy + add = -10 + desc = INTERACTION_LAZY + } + modifier = { + has_trait = arrogant + add = -10 + desc = INTERACTION_ARROGANT + } + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:actor.house + } + } + add = -50 + } + } + + ai_will_do = { + base = -25 + #Personality + modifier = { + has_trait = diligent + add = 15 + } + modifier = { + has_trait = generous + add = 15 + } + modifier = { + has_trait = lazy + add = -15 + } + modifier = { + has_trait = greedy + add = -15 + } + # Relationships + modifier = { + add = 25 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = 50 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -15 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -25 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + modifier = { + add = -50 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + # House + modifier = { + add = 5 + scope:recipient.house ?= scope:actor.house + } + # Family + modifier = { + add = 10 + scope:actor = { is_parent_of = scope:recipient } + } + modifier = { + add = 5 + scope:actor = { is_close_family_of = scope:recipient } + } + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = -50 + } + } +} + +# Ingratiate Family +start_ingratiate_family_interaction = { + icon = icon_ingratiate_family + interface_priority = 50 + category = interaction_category_admin + send_name = START_SCHEME + scheme = ingratiate_family + ignores_pending_interaction_block = yes + + ai_targets = { + ai_recipients = peer_vassals + max = 20 + } + ai_frequency = 36 + + is_shown = { + scope:actor = { + is_adult = yes + is_imprisoned = no + is_incapable = no + any_held_title = { is_noble_family_title = yes } + house.house_head ?= this + } + scope:recipient = { + is_adult = yes + is_imprisoned = no + is_incapable = no + any_held_title = { is_noble_family_title = yes } + house.house_head ?= this + NOT = { house = scope:actor.house } + top_liege = scope:actor.top_liege + } + } + + is_valid_showing_failures_only = { + scope:actor = { + can_start_scheme = { + type = ingratiate_family + target_character = scope:recipient + } + } + } + + desc = start_ingratiate_family_interaction_desc + + on_accept = { + scope:actor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = start_ingratiate_family_notification + left_icon = scope:recipient + + begin_scheme_basic_effect = { + SCHEME_TYPE = ingratiate_family + TARGET_TYPE = target_character + TARGET_SCOPE = scope:recipient + } + scope:recipient = { + if = { + limit = { is_ai = yes } + add_opinion = { + modifier = ingratiating_family_opinion + target = scope:actor + } + } + } + show_as_tooltip = { + stress_impact = { + arrogant = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + } + } + + if = { # I am the emperor + limit = { scope:actor.highest_held_title_tier >= tier_empire } + custom_tooltip = { + text = admin_emperor_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_emperor_scheme_modifier } + } + } + } + else_if = { # I am a dominant family + limit = { + scope:actor.house ?= { is_dominant_family = yes } + } + custom_tooltip = { + text = admin_dominant_family_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_dominant_family_scheme_modifier } + } + } + if = { + limit = { scope:recipient.highest_held_title_tier >= tier_empire } + custom_tooltip = { + text = admin_target_emperor_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_target_emperor_scheme_modifier } + } + } + } + } + else_if = { # I am a powerful family + limit = { + scope:actor.house ?= { is_powerful_family = yes } + } + custom_tooltip = { + text = admin_powerful_family_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_powerful_family_scheme_modifier } + } + } + if = { + limit = { scope:recipient.highest_held_title_tier >= tier_empire } + custom_tooltip = { + text = admin_target_emperor_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_target_emperor_scheme_modifier } + } + } + } + else_if = { + limit = { scope:recipient.house ?= { is_dominant_family = yes } } + custom_tooltip = { + text = admin_target_dominant_family_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_target_dominant_family_scheme_modifier } + } + } + } + } + else = { # I am NOT a powerful or dominant family or the emperor + if = { + limit = { scope:recipient.highest_held_title_tier >= tier_empire } + custom_tooltip = { + text = admin_target_emperor_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_target_emperor_scheme_modifier } + } + } + } + else_if = { + limit = { scope:recipient.house ?= { is_dominant_family = yes } } + custom_tooltip = { + text = admin_target_dominant_family_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_target_dominant_family_scheme_modifier } + } + } + } + else_if = { + limit = { scope:recipient.house ?= { is_powerful_family = yes } } + custom_tooltip = { + text = admin_target_powerful_family_scheme_modifier_tt + random_scheme = { + limit = { + scheme_type = ingratiate_family + scheme_target_character = scope:recipient + } + add_scheme_modifier = { type = admin_target_powerful_family_scheme_modifier } + } + } + } + } + + custom_tooltip = ingratiate_family_success_actor_tt + stress_impact = { + arrogant = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + } + scope:recipient = { + custom_tooltip = ingratiate_family_success_recipient_tt + } + } + + ai_potential = { + NOT = { + any_scheme = { + is_scheme_category = hostile + } + } + } + + auto_accept = yes + + ai_will_do = { + base = 5 + + #Competing candidate + modifier = { + scope:recipient = { is_competing_for_same_title_as = { CHARACTER = scope:actor } } + add = -50 + } + + modifier = { + scope:recipient = { is_winning_competing_for_same_title_as = { CHARACTER = scope:actor } } + add = -75 + } + + #Personality + modifier = { + has_trait = ambitious + add = 15 + } + + modifier = { + has_trait = deceitful + add = 15 + } + + modifier = { + has_trait = honest + add = -15 + } + + # Culture + modifier = { + culture != scope:actor.culture + "culture.cultural_acceptance(scope:recipient.culture)" < 50 + add = { + value = 50 + subtract = "culture.cultural_acceptance(scope:recipient.culture)" + multiply = -0.25 + round = yes + } + desc = CULTURAL_ACCEPTANCE + } + + # Faith + modifier = { + faith = { + faith_hostility_level = { + target = scope:recipient.faith + value >= faith_astray_level + } + } + add = { + value = "faith.faith_hostility_level(scope:recipient.faith)" + multiply = -10 + } + desc = FAITH_HOSTILITY_LEVEL + } + + # House & Family + modifier = { + is_close_family_of = scope:recipient + add = -20 + } + + #Feuds + modifier = { + house.house_head ?= { + any_owned_story = { + story_type = story_cycle_house_feud + has_variable = house_feud_house + var:house_feud_house = scope:recipient.house + } + } + add = -50 + } + + # Relationships + modifier = { + add = -25 + has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = -50 + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + factor = 0 + has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 25 + has_any_mild_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 50 + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + + modifier = { + add = 100 + has_any_best_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } + } + } +} diff --git a/common/character_interactions/06_ep3_test_interactions_.txt b/common/character_interactions/06_ep3_test_interactions_.txt new file mode 100644 index 00000000..7e06048a --- /dev/null +++ b/common/character_interactions/06_ep3_test_interactions_.txt @@ -0,0 +1,114 @@ + +make_noble_family_interaction = { + + category = interaction_debug_admin + common_interaction = no + icon = powerful_family_shield + + is_shown = { + debug_only = yes + scope:recipient = { + liege = scope:actor + is_ruler = no + } + } + + auto_accept = yes + on_accept = { + scope:recipient = { create_noble_family_effect = yes } + } +} + +destroy_noble_family_interaction = { + + category = interaction_debug_admin + common_interaction = no + icon = icon_cross + + is_shown = { + debug_only = yes + scope:recipient = { + liege = scope:actor + any_held_title = { + is_noble_family_title = yes + } + } + } + + auto_accept = yes + + on_accept = { + scope:recipient = { + random_held_title = { + limit = { + is_noble_family_title = yes + } + save_scope_as = title_to_destroy + scope:recipient = { + destroy_title = scope:title_to_destroy + } + } + } + } +} + +invest_appointment_interaction = { + + category = interaction_debug_admin + common_interaction = yes + icon = byzantine_crown_positive + + target_type = title + target_filter = actor_domain_titles + + is_shown = { + debug_only = yes + scope:recipient = { + government_allows = administrative + liege = scope:actor + } + } + + auto_accept = yes + + on_accept = { + scope:target = { + change_appointment_investment = { + target = scope:recipient + value = 20 + } + } + } +} + +transfer_title_army_maa_interaction = { + category = interaction_debug_admin + target_type = title + target_filter = actor_domain_titles + icon = request_maa_interaction + + + auto_accept = yes + + is_shown = { + debug_only = yes + scope:recipient = { + government_allows = administrative + } + scope:actor = { + government_allows = administrative + } + scope:actor != scope:recipient + } + + on_accept = { + scope:actor = { + every_maa_regiment = { + limit = { + regiment_owning_title = scope:target + } + transfer_title_maa = scope:recipient.primary_title + } + } + } +} diff --git a/common/character_interactions/_character_interactions.info b/common/character_interactions/_character_interactions.info new file mode 100644 index 00000000..55525429 --- /dev/null +++ b/common/character_interactions/_character_interactions.info @@ -0,0 +1,568 @@ +=== Notes === +This info is a WIP. + +=== Structure === + +my_interaction = { + interface_priority = number # Used by interaction menu + + common_interaction = yes/no # Used by interaction menu + + category = interaction_category_hostile # Used by interaction menu + + icon = key # What icon to use. If an icon is used for more + # than one interaction; please consider making + # it general (such as icon_culture for + # interactions relating to culture or + # icon_personal for personal schemes.). + # Otherwise defaults to none/the my_interaction + # key + related my_interaction.dds in + # gfx/interface/icons/character_interactions + + override_background = { reference = relaxing_room } # Used to define which image is used as the + # background for the interaction window. These + # can use triggers. + # + # Root is scope:actor for the interaction. If + # there are no backgrounds defined or none are + # valid, the interaction gui will default to + # "study" + + + is_highlighted = trigger # Should the interaction be highlighted in + # the menu + + highlighted_reason = loc_key # Tooltip if highlighted in menu + + on_decline_summary = dynamic description # Flavor text that is shown under acceptance + # widget. Use it when you need to draw more + # attention to the on decline effect + + special_interaction = type # This interaction uses specialized GUI + + special_ai_interaction = type # This interaction runs specialized code that + # identifies the interaction by this + + interface = call_ally/marriage/grant_titles/etc. # What interface does the interaction use? + + custom_character_sort = { } # What custom character sort options should the + # interaction have available? Last one defined + # will show up first in the dropdown list. + # + # Current Options: + # candidate_score (requires a target title) + # governor_efficiency + scheme = elope/murder/etc. # The type of scheme the interaction starts + + popup_on_receive = yes # Have the interaction pop-up for the + # recipient when received + + force_notification = yes/no # Force diplomatic item if interaction is + # auto-accept + + pause_on_receive = yes/no # Pause the game on receive. It usually makes + # sense to combine it with popup_on_receive + + ai_accept_negotiation = yes/no # If the interaction is declined negotiations + # will start. We don't show "won't accept", etc. + # because there is still a possibility that the + # interaction will be accepted via negotiation + # event chain + + hidden = yes # Is the interaction hidden? + + use_diplomatic_range = yes/no/trigger # Does this interaction check diplomatic range? + # Yes by default + + can_send_despite_rejection = yes # Interaction can be sent and the ai might reject + + ignores_pending_interaction_block = yes # If the actor is a player and the recipient + # already has received an interaction from them + # pending a response, can this interaction be + # sent anyway. + # Defaults to no + + send_name = loc_key # The name of the interaction in context of + # it being seen once sent. Defaults to database + # object key + + needs_recipient_to_open = yes # Does the interaction need a recipient set to + # be able to be allowed to open and be shown. + # Defaults to no + + show_effects_in_notification = no # Should the effects of the interaction be shown + # in the notification window when an interaction + # is sent. + # Defaults to yes + + diarch_interaction = no # If this interaction should be taken by diarch, + # including unlanded one + + alert_icon = texture_path # Default is gfx/interface/icons/ + # character_interactions/my_interaction_alert.dds + + icon_small = texture_path # Default is gfx/interface/icons/ + # character_interactions/my_interaction_small.dds + + should_use_extra_icon = { always = yes } # When to show an extra icon. + # Tooltip key is _extra_icon + + extra_icon = "gfx/<...>/hook_icon.dds" # Icon to show when should_use_extra_icon is true + + target_type = type # Possible types: + # title + # artifact + # men_at_arms + # count (default) + + target_filter = type # See FAQ for possible types + + ai_intermediary_maybe = no # The ai intermediary answer is randomized + + ai_maybe = yes # The ai answer is randomized + + ai_min_reply_days = 4 # Minimum days before ai replies + + ai_max_reply_days = 9 # Maximum days before ai replies + + desc = loc_key # Short description of the interaction + + greeting = negative/positive # Sets tone in request text + + intermediary_notification_text = loc_key # Request text shown to the intermediary + + notification_text = loc_key # Request text shown to the recipient + + prompt = loc_key # What text should be shown under the + # portrait? (For example: "Pick a Guardian") + + cooldown = { years = x } # How long until the interaction can be + # used again? + + cooldown_against_recipient = { years = x } # How long until the interaction can be + # used again against recipient? + + ignore_recipient_recieve_cooldown = trigger # Under what circumstances can an interaction + # against a recipient be used despite there + # being a cooldown for targeting that recipient? + + category_cooldown = { years = x } # Will apply a cooldown to all interactions in + # the same category as this interaction + # + # If an interaction already has a cooldown, + # the longer cooldown one will be applied + + category_cooldown_against_recipient = { years = x } # Will apply a cooldown to all interactions in + # the same category as this interaction against + # this recipient + # + # If an interaction already has a cooldown, the + # longer cooldown will be applied + + is_shown = trigger # Is the interaction available and visible + # between scope:actor and scope:recipient + + is_valid_showing_failures_only = trigger # Is the interaction valid to be selected in + # it's current setup, trigger only displays + # failures + + is_valid = trigger # Is the interaction valid to be selected in + # it's current setup + + has_valid_target_showing_failures_only = trigger # Is the target valid, trigger only displays + # failures + + has_valid_target = trigger # Is the target valid + + can_be_picked = trigger # Can this character be picked as a valid target + + can_be_picked_title = trigger # Can this title be picked as a valid target + + can_be_picked_artifact = trigger # Can this artifact be picked as a valid target + + can_be_picked_regiment = trigger # Can this regiment be picked as a valid target + + auto_accept = yes/no/trigger # Is the interaction automatically accepted, + # or can recipient decide + + can_send = trigger # Can the interaction be sent? + + can_be_blocked = trigger # Can the interaction be blocked by the + # recipient (i.e. by a hook on the actor) + + redirect = {} # This changes the redirection of characters + # using the scopes actor, recipient, + # secondary_actor and secondary_recipient + + populate_actor_list = {} # Everyone sorted into the list 'characters' has + # the potential of being shown to be selected. + # + # Uses the scopes actor, recipient, + # secondary_actor and secondary_recipient. + + populate_recipient_list = {} # Same as populate_actor_list + + localization_values = = {} # To be able to use values in loc + # (for example: RANSOM_COST = + # scope:secondary_recipient.ransom_cost_value + # lets you use $RANSOM_COST|0$ in loc) + + options_heading = loc_key # Text shown above options block - describes all + # options in general + + send_option = { # Adds an option + + is_shown = trigger # Is option shown. Independent trigger - don't + # reference any other option flags to avoid + # logic bugs + + is_valid = trigger # Is option selectable + + current_description = desc # Tooltip + + flag = flag_name # If selected then scope:flag_name will be + # set to yes + + localization = loc_key # Loc_key for option label + + starts_enabled = trigger # Trigger for whether this should be on when the + # window opens. If not defined, defaults to off + + can_be_changed = trigger # Trigger for whether this option can be changed + # from its default + + can_invalidate_interaction = bool # If yes then when the AI picks an interaction + # it will do the full can send this entire + # interaction check instead of the more + # performance saving checking of recipient + # refusal and ai will do, use with care and + # profile it + } + + # Options should avoid preventing an interaction from sending (except by the recipient refusing), as we assume that to be the case in the AI for performance reasons, use can_invalidate_interaction if you need it to be re-checked + + send_options_exclusive = yes/no # Are the options exclusive? + + secondary_scopes_optional = yes/no # Are the secondary scope targets optional? + + on_send = effect # Executes directly the interaction is sent + + on_accept = effect # Executes when accepted by recipient + # (only if intermediary accepts) + + on_decline = effect # Executes when declined by recipient + # (only if intermediary accepts) + + on_blocked_effect = effect # Executes when blocked by recipient + # (only if intermediary accepts) + + pre_auto_accept = effect # Only executes if the interaction was auto + # accepted. Done before any other side effect + # (E.G., hard coded ones like marriage) + + on_auto_accept = effect # Only executes if the interaction was + # auto accepted + + on_intermediary_accept = effect # Executes when intermediary allows the + # interaction to happen. It's followed by + # recipient decision + + on_intermediary_decline = effect # Executes when intermediary declines the + # interaction. It prevents any effect from + # being called on the recipient + + reply_item_key = loc_key # The key to the loc to show in the interaction + # item tooltip. Receives the name of the + # interaction in $INTERACTION$. Default value + # "INTERACTION_REPLY_ITEM" + + + ### These loc keys are shown to the player when sending the interaction. The meaning is what is going to be the answer from the target. + pre_answer_yes_key = loc_key # The key to the loc when the interaction is + # going to be accepted. + # Default value "ANSWER_YES" + + pre_answer_no_key = loc_key # The key to the loc when the interaction is + # NOT going to be accepted. + # Default value "ANSWER_NO" + + pre_answer_maybe_key = loc_key # The key to the loc when the interaction maybe + # is accepted. Receives the acceptance value in + # $VALUE$. + # Default value "ANSWER_MAYBE" + + pre_answer_yes_breakdown_key = ANSWER_WILL_ACCEPT # Summary header for acceptance breakdown for + # recipient, when they accept + + pre_answer_no_breakdown_key = ANSWER_WILL_NOT_ACCEPT # Summary header for acceptance breakdown for + # recipient, when they decline + + pre_answer_maybe_breakdown_key = ANSWER_SUM_MAYBE # Summary header for acceptance breakdown for + # recipient, when it's randomized + + intermediary_breakdown_yes = ANSWER_WILL_ACCEPT # Summary header for acceptance breakdown for + # intermediary, when they accept + + intermediary_breakdown_no = ANSWER_WILL_NOT_ACCEPT # Summary header for acceptance breakdown for + # intermediary, when they decline + + intermediary_breakdown_maybe = ANSWER_SUM_MAYBE # Summary header for acceptance breakdown for + # intermediary, when it's randomized + + + ### These loc keys are shown to the player when answering an interaction. + intermediary_answer_accept_key = ANSWER_YES # Intermediary Accept interaction button text + + intermediary_answer_reject_key = ANSWER_NO # Intermediary Decline interaction button text + + answer_block_key = ANSWER_BLOCK # Recipient Block interaction text + + answer_accept_key = ANSWER_YES # Recipient Accept interaction button text + + answer_reject_key = ANSWER_NO # Recipient Decline interaction button text + + answer_acknowledge_key = ANSWER_ACKNOWLEDGE # Recipient Acknowledge interaction button text. + # Used for notifications when it's already + # happened + + + cost = { # Scripted cost for the interaction. The + # interaction will be disabled if the actor + # can't pay up, and the cost will be subtracted + # from the actor when the interaction is sent. + # Renown can only be spent by the dynast. + piety = {} + prestige = {} + gold = {} + renown = {} + } + + ai_instant_response = yes/no # Will the AI respond instantly, and not pretend + # to think about it for N days? + + ai_set_target = {} # Set scope:target to make the AI target + # something specific. Title targeting + # interactions don't need this + ai_targets = { + ai_recipients = type # Which characters does the ai consider as + # recipient for the interaction, can be scripted + # multiple times to combine lists + # + # Available lists are in the "ai_targets" + # section of this file (trying to add an invalid + # list will trigger an error message with all + # available ) + + max = integer # Maximum number of targets to consider, unset + # considers all of them, will consider random + # targets that it filters too + + chance = 0-1 # A low chance, such as 0.25, randomly excludes + # that number of characters from being checked - + # this is useful for saving performance + } + + ai_target_quick_trigger = { # Quick triggers for the ai_targets + + adult = yes # The target needs to be adult + + attracted_to_owner = yes # The target needs to be attracted to owner + + owner_attracted = yes # Owner needs to be attracted to the target + + prison = yes # Target must be in prison + } + + ai_frequency = months # How often should the ai consider doing this + # interaction + + ai_potential = trigger # Will the ai consider trying this interaction. + # Root scope is the actor, and other event + # target are not available + + ai_intermediary_accept = mtth # Will the intermediary ai approve for this + # interaction and forward it to the recipient + + ai_accept = mtth # Will the ai accept a request for this + # interaction + + ai_will_do = mtth # How interested is the ai in sending this + # interaction (tested after selecting targets) + # 0-100 percent chance, will be clamped. + # + + ### Note that for title interactions, each individual target title will get evaluated, and the one giving the highest ai_will_do will get used. If the interaction has options, the combination of options that gives the highest ai_will_do will be used. +} + +=== FAQ === +Q: What does the special interaction type arrange_marriage_interaction do? +A: special_interaction = arrange_marriage_interaction will add extra marriage info to the interaction + this info makes the game show the special marriage interfaces when setting up an interaction or replying to it. + It's also used by the ai in knowing which interaction to use when setting up marriages. + It automatically marries/betroths the secondary participants and sets up alliances and hands out prestige. + +Q: What does "secondary_actor = marriage" and "secondary_recipient = marriage" do? +A: It states that the interaction has secondary participants (the one's actually getting married) and that + we're allowed to change them in the interface. It also automatically redirects the interaction to the matchmaker + so that the player can arrange a marriage with the son/daughter of another ruler and get the child as the + secondary recipient and the ruler as the recipient (since they will be the ones accepting or not). + It also sets up the list of characters to choose from from the actor/recipient with their courts and children. + +Q: What does "secondary_actor = marry_off" and "secondary_recipient = marry_off" do? +A: Very similar to marriage, but with some expections: + - The list of characters is calculated from all living characters that are allowed to marry. + - The redirection makes the character you do the interaction with the secondary actor (since you're the one marrying them off) + - There's the marriage redirection for whoever you select them to marry (ie mostly being the employer) + +Q: How and when are the character interaction triggers checked? +A: These are the main triggers used by interactions: + - is_shown + - is_highlighted + - is_valid_showing_failures_only + - is_valid + - has_valid_target_showing_failures_only + - has_valid_target + - can_be_picked + - can_be_picked_title + - can_be_blocked + - can_send + +Q: What are the possible types for target_filter? +A: Possible types: + - actor_domain_titles + - recipient_domain_titles + - secondary_actor_domain_titles + - secondary_recipient_domain_titles + - actor_domain_titles_including_leases + - recipient_domain_titles_including_leases + - secondary_actor_domain_titles_including_leases + - secondary_recipient_domain_titles_including_leases + - actor_de_jure_titles + - recipient_de_jure_titles + - secondary_actor_de_jure_titles + - secondary_recipient_de_jure_titles + - actor_realm_titles + - recipient_realm_titles + - secondary_actor_realm_titles + - secondary_recipient_realm_titles + - actor_top_liege_de_jure_titles + - recipient_top_liege_de_jure_titles + - secondary_actor_top_liege_de_jure_titles + - secondary_recipient_top_liege_de_jure_titles + + - actor_artifacts + - recipient_artifacts + - actor_artifacts_claimable + - recipient_artifacts_claimable + + - actor_maa + - recipient_maa + - actor_personal_maa + - recipient_personal_maa + - actor_title_maa + - recipient_title_maa + + - count (default) + +Is there any other special behaviors set in code that these interactions are affected by? +When are the following conditions evaluated, are any of them checked during special circumstances (e.g. "not all scopes exist yet"): +is_shown +can_be_picked +is_valid_showing_failures_only +has_valid_target_showing_failures_only + + + +=== Custom Widgets === + +=== FAQ === +Q: What does the special interaction type arrange_marriage_interaction do? +A: special_interaction = arrange_marriage_interaction will add extra marriage info to the interaction + this info makes the game show the special marriage interfaces when setting up an interaction or replying to it. + It's also used by the ai in knowing which interaction to use when setting up marriages. + It automatically marries/betroths the secondary participants and sets up alliances and hands out prestige. + +Q: What does "secondary_actor = marriage" and "secondary_recipient = marriage" do? +A: It states that the interaction has secondary participants (the one's actually getting married) and that + we're allowed to change them in the interface. It also automatically redirects the interaction to the matchmaker + so that the player can arrange a marriage with the son/daughter of another ruler and get the child as the + secondary recipient and the ruler as the recipient (since they will be the ones accepting or not). + It also sets up the list of characters to choose from from the actor/recipient with their courts and children. + +Q: What does "secondary_actor = marry_off" and "secondary_recipient = marry_off" do? +A: Very similar to marriage, but with some expections: + - The list of characters is calculated from all living characters that are allowed to marry. + - The redirection makes the character you do the interaction with the secondary actor (since you're the one marrying them off) + - There's the marriage redirection for whoever you select them to marry (ie mostly being the employer) + +Q: How and when are the character interaction triggers checked? +A: These are the main checks used by interactions: + + Can Send: If an interaction can be sent is tested like this: + - check if set up for sending (this means that all targets and secondary actors/recipients that the interaction uses, must have been selected) + - check diplomatic range (if interaction scripted to use it) + - make special is shown checks decided by special_interaction = + - Trigger: is_shown + - check if the interaction is already being considered by the recipient + - Trigger: is_valid_showing_failures_only + - Trigger: has_valid_target_showing_failures_only + - Trigger: can_send + - Trigger: is_valid + - Trigger: has_valid_target + - make special can send checks decided by special_interaction = + If it passes all the above, then we check if the interaction needs to be accepted (auto_accept = no or failing trigger and interactions that can be sent regardless like imprison) + interactions that need acceptance cannot be sent to the ai unless it will accept. + + When populating a list of titles we look at this (examples: grant title, revoke title): + - select domain or dejure title based on target_filter = + - Trigger: can_be_picked_title with the full interaction scope and the title set as scope:target + Note: can_be_picked_title is not checked when we try to send, it's a separate trigger that should be a fast way of deciding what can end up in the list to select from + + When populating a list of characters we look a this: + - secondary_actor/secondary_recipient = decides what to base the list off (vassals, courtiers, marriage, dynasty, house, ...) + If we're haven't picked a character already (many interactions wants us to pick two characters, such as marriage) + - Trigger: can_be_picked with the current interaction scipe and the tested character set as root + Else if we're picking character number two + - Try setting the character as secondary_actor/secondary_recipient. The interaction should be fully set up after this. + - Do a full Can Send test, but ignore the ai acceptance check. + Note: can_be_picked is only there to filter out the first character we need to select and is not part of the Can Send test. + + Is Shown: is_shown is used by the interface to check if the interaction should be visible in the interaction list + Is Valid: is_valid and is_valid_showing_failures_only are tested to see if an interaction should be enabled (clickable) or not in the menu + + +== ai_targets == +The following are valid AI targets: +known_secrets - Characters who has a secret you know of +scheme_targets +hooked_characters +neighboring_rulers +peer_vassals +guests +dynasty +courtiers +councillors +prisoners +sub_realm_characters +realm_characters +vassals +liege +self +head_of_faith +spouses +family +children +primary_war_enemies +war_enemies +war_allies +scripted_relations - Any character you have a scripted relation with +activity_host - Host of your involved activity +activity_guests - Guests of your involved activity +contacts - People on your contact list (connected to task contracts) +domicile_location_top_ruler - Ruler of domicile location's Top Realm (for Domicile Owners) +domicile_location_top_realm_vassals - Vassals of domicile location's Top Realm (for Domicile Owners) +domicile_location_neighboring_top_rulers - Rulers of Neighboring Top Realms (for Domicile Owners, uses the top liege of the domicile's location to fetch neighboring realms) +domicile_location_neighboring_top_realm_vassals - Vassals of Neighboring Top Realms (for Domicile Owners, uses the top liege of the domicile's location to fetch neighboring realms) +top_realm_domicile_owners - Owners of domiciles located in Top Liege Realm (for unlanded Domicile Owners, uses the top liege of the location you're in) +sub_realm_domicile_owners - Owners of domiciles located within your own realm (for Landed Rulers) +nearby_domicile_owners - Nearby owners of domiciles (Uses a range value defined as NEARBY_DOMICILE_RANGE in 00_defines.txt)