N3OW/common/character_interactions/00_courtier_and_guest_interactions.txt
2025-02-20 11:52:45 +00:00

1173 lines
24 KiB
Text

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 = {
has_government = administrative_government
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
}
}
}