vg-mod-ck3/Medievel_Thievery/common/character_interactions/medievel_thievery_character...

743 lines
16 KiB
Plaintext
Raw Normal View History

2024-12-18 21:22:13 -05:00
##############################################################################################################################
# Medievel Thievery Mod
# Developed by DevZero (some code taken from pdx) - the mod has thievery in the name after all...
# Notes: First iteration -- Might need to balance piety and prestige values, will judge by community feedback
##############################################################################################################################
# Interaction name is a holdover from before mod was expanded. Leaving as-is so as not to create any localization issues, and it matters very little.
mt_steal_gold_interaction = {
icon = mt_interaction_icon
common_interaction = yes
interface_priority = 12
category = interaction_category_hostile
desc = mt_steal_gold_interaction_desc
cooldown = { months = 20 }
cooldown_against_recipient = {years = 3}
is_shown = {
NOT = {
scope:recipient = scope:actor
scope:actor = {
OR = {
intrigue < 10
is_allied_to = scope:recipient
age < 11
}
}
scope:recipient = {
is_ruler = no
}
}
# PDX Multiplayer Checks | Mod not balanced or made for multiplayer, but in case someone uses it.
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:recipient = { NOT = { has_strong_hook = scope:actor } }
}
# Will stop AI as they do not trigger the flags -- must trigger on player
can_send = {
trigger_if = {
limit = {
scope:actor = {
is_ai = no
}
}
custom_tooltip = {
text = mt_can_send_requirement
OR = {
scope:steal_gold = yes
scope:steal_prestige = yes
scope:steal_piety = yes
}
}
}
trigger_else = {
scope:recipient = {
NOT = {
has_character_flag = flag_mt_ai_theft_victim
}
}
}
}
on_accept = {
scope:actor = {
save_scope_as = mt_thief
}
scope:recipient = {
save_scope_as = mt_victim
}
if = {
limit = {
scope:steal_gold = yes
}
scope:actor = {
duel = {
skill = intrigue
target = scope:recipient
50 = {
desc = mt_steal_gold_interaction.tt.success.actor
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
}
send_interface_toast = {
title = mt_steal_gold_interaction.tt.success.actor
left_icon = scope:recipient
give_or_update_embezzler_secret_effect = {
TARGET = scope:recipient
STAKE = mt_steal_gold_value
}
show_as_tooltip = {
add_gold = {
value = mt_steal_gold_value
}
}
show_as_tooltip = {
scope:recipient = {
add_gold = {
value = mt_steal_gold_value
multiply = -1
}
}
}
scope:actor = {
if = {
limit = { has_trait = greedy }
add_stress = massive_stress_impact_loss
}
if = {
limit = { has_trait = compassionate }
add_stress = medium_stress_impact_gain
}
if = {
limit = { has_trait = deceitful }
add_stress = minor_stress_impact_loss
}
if = {
limit = { has_trait = content }
add_sress = medium_stress_impact_gain
}
if = {
limit = { has_trait = temperate }
add_stress = minor_stress_impact_gain
}
if = {
limit = { has_trait = honest }
add_stress = massive_stress_impact_gain
}
if = {
limit = { has_trait = just }
add_stress = medium_stress_impact_gain
}
}
}
hidden_effect = {
scope:recipient = {
pay_short_term_gold = {
target = scope:actor
gold = {
value = mt_steal_gold_value
}
}
trigger_event = {
id = mt_event.1001
days = { 7 10 }
}
}
}
}
50 = {
desc = mt_steal_gold_interaction_tt.failure.actor
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
}
send_interface_toast = {
title = mt_steal_gold_interaction_tt.failure.actor
left_icon = scope:recipient
scope:recipient = {
# Greedy characters will not forgive this slight if they can help it.
if = {
limit = {
has_trait = greedy
can_set_relation_nemesis_trigger = { CHARACTER = scope:actor }
}
set_relation_nemesis = {
target = scope:actor
reason = rival_tried_to_embezzle
}
}
# Forgiving characters lose a little less.
else_if = {
limit = { has_trait = forgiving }
add_opinion = {
target = scope:actor
modifier = disappointed_opinion
opinion = -10
}
}
# Otherwise, folks do be mad.
else = {
add_opinion = {
target = scope:actor
modifier = trust_opinion
opinion = -45
}
}
}
}
####################################################################################################################
# Events and AI Reciprocations
hidden_effect = {
mt_reciprocal_gold_effect = yes
}
}
}
}
}
else_if = {
limit = {
scope:steal_prestige = yes
}
scope:actor = {
duel = {
skill = diplomacy
target = scope:recipient
50 = {
desc = mt_steal_gold_interaction.tt.success.actor
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
}
send_interface_toast = {
title = mt_steal_gold_interaction.tt.success.actor
left_icon = scope:recipient
add_prestige = {
value = 0
add = mt_steal_prestige_value
}
scope:recipient = {
add_prestige = {
value = 0
add = mt_steal_prestige_value
multiply = -1
}
}
scope:actor = {
if = {
limit = { has_trait = arrogant }
add_stress = medium_stress_impact_loss
}
if = {
limit = { has_trait = compassionate }
add_stress = medium_stress_impact_gain
}
if = {
limit = { has_trait = deceitful }
add_stress = minor_stress_impact_loss
}
if = {
limit = { has_trait = content }
add_sress = medium_stress_impact_gain
}
if = {
limit = { has_trait = temperate }
add_stress = minor_stress_impact_gain
}
if = {
limit = { has_trait = honest }
add_stress = massive_stress_impact_gain
}
if = {
limit = { has_trait = just }
add_stress = medium_stress_impact_gain
}
}
}
hidden_effect = {
scope:recipient = {
trigger_event = {
id = mt_event.2001
days = { 7 10 }
}
}
}
}
50 = {
desc = mt_steal_gold_interaction_tt.failure.actor
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
}
send_interface_toast = {
title = mt_steal_gold_interaction_tt.failure.actor
left_icon = scope:recipient
scope:recipient = {
# Greedy characters will not forgive this slight if they can help it.
if = {
limit = {
has_trait = arrogant
}
add_opinion = {
target = scope:actor
modifier = trust_opinion
opinion = -75
}
}
# Forgiving characters lose a little less.
else_if = {
limit = { has_trait = forgiving }
add_opinion = {
target = scope:actor
modifier = disappointed_opinion
opinion = -10
}
}
# Otherwise, folks do be mad.
else = {
add_opinion = {
target = scope:actor
modifier = trust_opinion
opinion = -45
}
}
}
}
####################################################################################################################
# Events and AI reciprocations
hidden_effect = {
mt_reciprocal_prestige_effect = yes
}
}
}
}
}
else_if = {
limit = {
scope:steal_piety = yes
}
scope:actor = {
duel = {
skill = learning
target = scope:recipient
50 = {
desc = mt_steal_gold_interaction.tt.success.actor
compare_modifier = {
value = scope:duel_value
multiplier = 3.5
min = -49
}
send_interface_toast = {
title = mt_steal_gold_interaction.tt.success.actor
left_icon = scope:recipient
add_piety = {
value = mt_steal_piety_value
}
scope:recipient = {
add_piety = {
value = mt_steal_piety_value
multiply = -1
}
}
scope:actor = {
if = {
limit = { has_trait = humble }
add_stress = medium_stress_impact_gain
}
if = {
limit = { has_trait = compassionate }
add_stress = medium_stress_impact_gain
}
if = {
limit = { has_trait = deceitful }
add_stress = minor_stress_impact_loss
}
if = {
limit = { has_trait = content }
add_sress = massive_stress_impact_gain
}
if = {
limit = { has_trait = temperate }
add_stress = minor_stress_impact_gain
}
if = {
limit = { has_trait = honest }
add_stress = massive_stress_impact_gain
}
if = {
limit = { has_trait = just }
add_stress = medium_stress_impact_gain
}
}
}
hidden_effect = {
scope:recipient = {
trigger_event = {
id = mt_event.3001
days = { 7 10 }
}
}
}
}
50 = {
desc = mt_steal_gold_interaction_tt.failure.actor
compare_modifier = {
value = scope:duel_value
multiplier = -3.5
min = -49
}
send_interface_toast = {
title = mt_steal_gold_interaction_tt.failure.actor
left_icon = scope:recipient
scope:recipient = {
# Forgiving characters lose a little less.
if = {
limit = { has_trait = forgiving }
add_opinion = {
target = scope:actor
modifier = disappointed_opinion
opinion = -10
}
}
# Otherwise, folks do be mad.
else = {
add_opinion = {
target = scope:actor
modifier = trust_opinion
opinion = -45
}
}
}
}
####################################################################################################################
# Events and AI reciprocations
hidden_effect = {
mt_reciprocal_piety_effect = yes
}
}
}
}
}
else_if = {
limit = {
scope:ai_option = yes
}
hidden_effect = {
mt_ai_action_effect = yes
}
}
}
# AI Option -- effects, choice and such filtered out in the effect. AI can not pick options normally so we filter based on traits and default to theft of gold. This choice is hidden from the player and should be first among the options so the ai defaults to it.
send_option = {
flag = ai_option
is_shown = {
scope:actor = {
is_ai = yes
}
}
is_valid = {
scope:actor = {
is_ai = yes
}
}
}
# Player Options
send_option = {
flag = steal_gold
localization = mt_local_gold
is_valid = {
NOT = { scope:recipient.gold < 50 }
}
}
send_option = {
flag = steal_prestige
localization = mt_local_prestige
is_valid = {
NOT = { scope:recipient.prestige < 50 }
}
}
send_option = {
flag = steal_piety
localization = mt_local_piety
is_valid = {
NOT = { scope:recipient.piety < 50 }
}
}
send_options_exclusive = yes
auto_accept = yes
####################################################
# AI
ai_targets = {
ai_recipients = neighboring_rulers
max = 3
}
ai_targets = {
ai_recipients = leige
max = 1
}
ai_targets = {
ai_recipients = realm_characters
max = 5
}
ai_targets = {
ai_recipients = peer_vassals
max = 3
}
ai_frequency = 240
ai_potential = {
AND = {
age > 15
intrigue > 9
AND = {
OR = {
has_trait = schemer
has_trait = deceitful
has_trait = education_intrigue_4
has_trait = education_intrigue_5
}
OR = {
has_trait = greedy
has_trait = ambitious
has_trait = arbitrary
}
}
}
}
ai_will_do = {
base = 0
####################################
# Weights - Who am I? Who are YOU!?
# Weigh Opinion
opinion_modifier = {
opinion_target = scope:recipient
multiplier = -0.25
}
# Weigh Personality.
ai_value_modifier = {
ai_boldness = 0.10
ai_greed = 0.25
ai_honor = -1
}
########################
# Debt based modifiers - I NEED IT, GIVE IT HERE!
modifier = {
add = 5
debt_level = 1
}
### Is one year in debt.
modifier = {
add = 10
debt_level = 2
}
### Is two years in debt.
modifier = {
add = 20
debt_level = 3
}
### Is three years in debt.
modifier = {
add = 35
debt_level = 4
}
### Is four years in debt.
modifier = {
add = 50
debt_level = 5
}
### Is over five years in debt.
modifier = {
add = 75
debt_level >= 6
}
#########################
# Traits
modifier = {
add = 15
has_trait = deceitful
}
modifier = {
add = -150
has_trait = honest
}
modifier = {
add = -15
has_trait = generous
}
modifier = {
add = -25
has_trait = compassionate
}
modifier = {
add = -10
has_trait = temperate
}
modifier = {
add = -5
has_trait = calm
}
modifier = {
add = -20
has_trait = humble
}
modifier = {
add = -15
has_trait = craven
}
modifier = {
add = 5
has_trait = ambitious
}
modifier = {
add = 10
has_trait = greedy
}
modifier = {
add = -35
has_trait = content
}
modifier = {
add = -30
has_trait = just
}
##############################
# Specialized Criteria
# Rival
modifier = {
add = 15
scope:actor = {
has_relation_rival = scope:recipient
}
}
# Nemesis
modifier = {
add = 25
scope:actor = {
has_relation_nemesis = scope:recipient
}
}
# Friend of Some Kind
modifier = {
add = -100
scope:actor = {
OR = {
has_relation_friend = scope:recipient
has_relation_best_friend = scope:recipient
has_relation_lover = scope:recipient
has_relation_soulmate = scope:recipient
has_relation_guardian = scope:recipient
has_relation_ward = scope:recipient
}
}
}
# Probably not the best idea to steal from the Head of my Faith . . .
modifier = {
add = -85
scope:actor.faith.religious_head = scope:recipient
}
}
}