Spymaster Task Events
Spymaster Task Events
Spymaster Task Events
namespace = spymaster_task
####
# 0001-0999: Task outcome events
# by Petter Vilberg
####
# 0301 - Find Minor Secret - Hidden setup!
# 0302 - Find Major Secret - Hidden setup!
####
# 1000-1999: Side effects from Disrupt Schemes
# by Petter Vilberg
####
# 1001-1002 - Spymaster Gives Up Your Secret
# 1003-1004 - Spymaster Gives Up a Courtier's Secret
# 1005 - Spymaster Giving Up Secret: Follow-up for Forgiving
####
# 2000-2999: Side effects from Support Schemes
# by Petter Vilberg
####
# 2001 - Loss of Piety
# 2002 - Loss of Prestige
# 2003 - Scheme Fails
####
# 3000-3999: Side effects from Espionage
# by Petter Vilberg
####
### Own vassal targets:
# 3001 - Snooping on your vassal causes opinion loss
# 3002 - Your Liege has been and continues to snoop on you
# 3003 - Your Liege has been snooping, but promises to stop
##################
# Task Outcome Events
# 0001-0999
##################
#######
# Espionage
# 0301-0399
# by Petter Vilberg
#######
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:target_character = {
spymaster_task_find_secrets_court_has_minor_secrets_trigger = yes
}
}
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
scope:target_character = {
#Find any secrets from the court owner
if = {
limit = {
any_secret = {
save_temporary_scope_as =
illegal_or_shunned_secret
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
every_secret = {
limit = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
add_to_temporary_list = suitable_secrets
}
}
#Find any secrets from courtiers or guests
every_courtier_or_guest = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
every_secret = {
limit = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
NOT = { is_in_list = suitable_secrets }
}
add_to_temporary_list = suitable_secrets
}
}
#Find any secrets from direct vassals
every_vassal = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
every_secret = {
limit = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
NOT = { is_in_list = suitable_secrets }
}
add_to_temporary_list = suitable_secrets
}
}
}
spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = yes
}
modifier = {
add = 1
spymaster_find_secrets_secret_target_is_interesting_to_me_trigger = yes
}
}
save_scope_as = secret_to_reveal
secret_owner = {
save_scope_as = secret_holder
}
}
#Fire events
scope:councillor_liege = {
if = { #It's someone I care about
limit = {
OR = {
spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = yes
scope:secret_to_reveal = {
spymaster_find_secrets_secret_target_is_interesting_to_me_trigger = yes
}
}
}
trigger_event = {
on_action = task_find_secrets_reveal_selection
}
}
else = { #For everyone else, send a feed message
send_interface_message = {
type = event_spymaster_task_good
title = spymaster_task.0311.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor =
{ intrigue <= average_skill_level }
}
desc =
task_intrigue_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor =
{ intrigue > average_skill_level }
}
desc =
task_intrigue_good_skilled_notification_tooltip
}
}
left_icon = scope:secret_holder
right_icon = scope:councillor
goto = scope:secret_holder
scope:secret_to_reveal = {
reveal_to = scope:councillor_liege
}
}
}
}
scope:councillor = {
if = { #Check that the Spymaster doesn't already know the secret
limit = {
scope:secret_to_reveal = {
NOT = { is_known_by = prev }
}
}
if = { #It's the owner of the court or someone else I care
about
limit =
{ spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = yes }
trigger_event = {
on_action = task_find_secrets_reveal_selection
}
}
else = { #For everyone else, send a feed message
send_interface_message = {
type = event_spymaster_task_good
title = spymaster_task.0311.notification
left_icon = scope:secret_holder
goto = scope:secret_holder
scope:secret_to_reveal = {
reveal_to = scope:councillor
}
}
}
}
}
}
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:target_character = {
spymaster_task_find_secrets_court_has_major_secrets_trigger = yes
}
}
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
scope:target_character = {
#Find any secrets from the court owner
if = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
every_secret = {
limit = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
add_to_temporary_list = suitable_secrets
}
}
#Find any secrets from courtiers
every_courtier_or_guest = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
every_secret = {
limit = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
NOT = { is_in_list = suitable_secrets }
}
add_to_temporary_list = suitable_secrets
}
}
#Find any secrets from direct vassals
every_vassal = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
every_secret = {
limit = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
NOT = { is_in_list = suitable_secrets }
}
add_to_temporary_list = suitable_secrets
}
}
}
spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = yes
}
modifier = {
add = 1
spymaster_find_secrets_secret_target_is_interesting_to_me_trigger = yes
}
}
save_scope_as = secret_to_reveal
secret_owner = {
save_scope_as = secret_holder
}
}
#Fire events
scope:councillor_liege = {
if = { #It's someone I care about
limit = {
OR = {
spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = yes
scope:secret_to_reveal = {
spymaster_find_secrets_secret_target_is_interesting_to_me_trigger = yes
}
}
}
trigger_event = {
on_action = task_find_secrets_reveal_selection
}
}
else = { #For everyone else, send a feed message
send_interface_message = {
type = event_spymaster_task_good
title = spymaster_task.0311.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor =
{ intrigue <= average_skill_level }
}
desc =
task_intrigue_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor =
{ intrigue > average_skill_level }
}
desc =
task_intrigue_good_skilled_notification_tooltip
}
}
left_icon = scope:secret_holder
right_icon = scope:councillor
goto = scope:secret_holder
scope:secret_to_reveal = {
reveal_to = scope:councillor_liege
}
}
}
}
scope:councillor = {
if = { #Check that the Spymaster doesn't already know the secret
limit = {
scope:secret_to_reveal = {
NOT = { is_known_by = prev }
}
}
if = { #It's the owner of the court or someone else I care
about
limit = {
OR = {
scope:secret_holder = {
is_ruler = yes
}
spymaster_find_secrets_secret_holder_is_interesting_to_me_trigger = yes
scope:secret_to_reveal = {
spymaster_find_secrets_secret_target_is_interesting_to_me_trigger = yes
}
}
}
trigger_event = {
on_action = task_find_secrets_reveal_selection
}
}
else = { #For everyone else, send a feed message
scope:councillor = {
send_interface_message = {
type = event_spymaster_task_good
title = spymaster_task.0311.notification
left_icon = scope:secret_holder
goto = scope:secret_holder
scope:secret_to_reveal = {
reveal_to = scope:councillor
}
}
}
}
}
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_deviant
}
}
immediate = {
option = {
name = {
text = spymaster_task.0341.a.deviant
trigger = {
OR = {
has_trait = deviant
any_secret = {
secret_type = secret_deviant
}
}
}
}
name = {
trigger = {
has_trait = callous
has_trait = stubborn
has_trait = sadistic
}
text = spymaster_task.0341.a.detached
}
name = spymaster_task.0341.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_homosexual
}
}
option = {
name = spymaster_task.0342.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
is_of_major_interest_to_root_trigger = yes
is_of_minor_interest_to_root_trigger = yes
}
}
}
}
desc =
spymaster_task.0311.secret_murder_attempt.close_to_me
}
desc = spymaster_task.0311.secret_murder_attempt.other
}
}
theme = intrigue
left_portrait = {
character = scope:councillor
animation = disgust
}
right_portrait = {
character = scope:secret_holder
animation = shame
}
lower_right_portrait = scope:murder_target
trigger = {
scope:secret_to_reveal = {
secret_type = secret_murder_attempt
}
}
immediate = {
scope:secret_to_reveal = {
secret_target = {
save_scope_as = murder_target
}
}
if = {
limit = {
any_scheme = {
scheme_type = murder
scheme_target = scope:secret_holder
}
}
random_scheme = {
limit = {
scheme_type = murder
scheme_target = scope:secret_holder
}
save_scope_as = scheme
}
}
}
option = {
name = spymaster_task.0343.a
scope:secret_to_reveal = {
reveal_to = root
}
}
option = {
name = spymaster_task.0343.murder_back
trigger = {
exists = scope:scheme
}
exclusive = yes
scope:secret_to_reveal = {
reveal_to = root
}
scope:scheme = {
add_scheme_progress = 1
}
}
}
is_of_major_interest_to_root_trigger = yes
is_of_minor_interest_to_root_trigger = yes
}
}
}
}
desc = {
first_valid = {
triggered_desc = {
trigger = {
has_trait = vengeful
}
desc =
spymaster_task.0311.secret_murder.close_to_me.vengeful
}
desc =
spymaster_task.0311.secret_murder.close_to_me
}
triggered_desc = {
trigger = {
OR = {
has_trait = fickle
has_trait = impatient
has_trait = compassionate
}
}
desc =
spymaster_task.0311.secret_murder.close_to_me_regret
}
}
}
desc = spymaster_task.0311.secret_murder.other
}
}
theme = intrigue
left_portrait = {
character = scope:councillor
animation = disgust
}
right_portrait = {
character = scope:secret_holder
animation = shame
}
lower_right_portrait = scope:murder_target
trigger = {
scope:secret_to_reveal = {
secret_type = secret_murder
}
}
immediate = {
scope:secret_to_reveal = {
secret_target = {
save_scope_as = murder_target
}
}
if = {
limit = {
any_scheme = {
scheme_type = murder
scheme_target = scope:secret_holder
}
}
random_scheme = {
limit = {
scheme_type = murder
scheme_target = scope:secret_holder
}
save_scope_as = scheme
}
}
}
option = {
name = {
text = spymaster_task.0344.a.sadistic
trigger = {
has_trait = sadistic
}
}
name = {
text = spymaster_task.0344.a.callous
trigger = {
has_trait = callous
}
}
name = spymaster_task.0344.a
scope:secret_to_reveal = {
reveal_to_without_events_effect = {
CHARACTER = root
}
}
}
option = {
name = {
text = spymaster_task.0344.a.sadistic
trigger = {
has_trait = sadistic
}
}
name = spymaster_task.0344.b
trigger = {
exists = scope:scheme
}
exclusive = yes
scope:secret_to_reveal = {
reveal_to_without_events_effect = {
CHARACTER = root
}
}
scope:scheme = {
add_scheme_progress = 1
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_cannibal
}
}
option = {
name = {
text = spymaster_task.0345.a.cannibal
trigger = {
has_trait = cannibal
}
}
name = spymaster_task.0345.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_lover
exists = secret_target
}
}
immediate = {
if = {
limit = {
NOT = {
exists = scope:lover
}
}
scope:secret_to_reveal = {
secret_target = {
save_scope_as = lover
}
}
}
}
option = {
name = {
text = spymaster_task.0346.a.consort
trigger = {
OR = {
scope:secret_holder = { is_consort_of = root }
scope:lover = { is_consort_of = root }
}
}
}
name = {
text = spymaster_task.0346.a.close
trigger = {
OR = {
scope:secret_holder = {
is_close_family_of = root
}
scope:lover = {
is_close_family_of = root
}
}
}
}
name = spymaster_task.0346.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_non_believer
}
}
immediate = {
option = {
name = spymaster_task.0347.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_incest
}
}
option = {
name = {
trigger = {
OR = {
has_trait = incestuous
any_secret = {
secret_type = secret_incest
}
}
}
text = spymaster_task.0348.a.shared
}
name = {
trigger = {
OR = {
has_trait = lustful
is_deviant_trigger = yes
}
}
text = spymaster_task.0348.a.lustful
}
name = spymaster_task.0348.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_witch
}
}
option = {
name = {
trigger = {
OR = {
has_trait = zealous
has_trait = lustful
}
}
text = spymaster_task.0349.a.zealous
}
name = spymaster_task.0349.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
is_of_major_interest_to_root_trigger = yes
}
}
}
desc =
spymaster_task.0311.secret_bastard.father_is_interesting
}
desc = spymaster_task.0311.secret_bastard
}
}
}
}
}
theme = intrigue
left_portrait = {
character = scope:councillor
animation = shock
}
right_portrait = {
character = scope:secret_holder
animation = shame
}
lower_right_portrait = scope:actual_father
trigger = {
scope:secret_to_reveal = {
secret_type = secret_disputed_heritage
secret_target = scope:secret_holder
}
}
immediate = {
scope:secret_to_reveal = {
secret_target = {
save_scope_as = bastard
}
secret_target.real_father = {
save_scope_as = actual_father
}
secret_target.mother = {
save_scope_as = mother
}
}
}
option = {
name = {
trigger = {
OR = {
scope:actual_father = root
scope:secret_holder.father = root
}
}
text = spymaster_task.0350.a.related
}
name = spymaster_task.0350.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
is_of_major_interest_to_root_trigger = yes
}
}
}
desc =
spymaster_task.0311.secret_bastard.father_is_interesting
}
desc = spymaster_task.0311.secret_bastard
}
}
}
}
}
theme = intrigue
left_portrait = {
character = scope:councillor
animation = shock
}
right_portrait = {
character = scope:secret_holder
animation = shame
}
lower_right_portrait = scope:bastard
trigger = {
scope:secret_to_reveal = {
secret_type = secret_disputed_heritage
}
}
immediate = {
scope:secret_to_reveal = {
secret_target = {
save_scope_as = bastard
}
secret_target.real_father = {
save_scope_as = actual_father
}
secret_target.mother = {
save_scope_as = mother
}
}
}
option = {
name = {
trigger = {
OR = {
scope:actual_father = root
scope:secret_holder.father = root
}
}
text = spymaster_task.0350.a.related
}
name = spymaster_task.0350.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
scope:secret_to_reveal = {
secret_type = secret_unmarried_illegitimate_child
}
}
immediate = {
scope:secret_to_reveal = {
secret_target = {
save_scope_as = bastard
}
secret_target.real_father = {
save_scope_as = actual_father
}
secret_target.mother = {
save_scope_as = mother
}
}
}
option = {
name = {
trigger = {
OR = {
scope:actual_father = root
scope:secret_holder.father = root
}
}
text = spymaster_task.0350.a.related
}
name = spymaster_task.0350.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
trigger = {
exists = scope:secret_to_reveal
}
option = {
name = spymaster_task.0359.a
scope:secret_to_reveal = {
reveal_to = root
}
}
}
################################
# Fabricate a Hook on a Courtier
# by Petter Vilberg
################################
scripted_trigger spymaster_task_courtier_valid_for_hook_fabrication_trigger = {
is_available_ai_adult = yes
save_temporary_scope_as = target_check
NOR = {
this = scope:councillor
root = {
has_hook = scope:target_check
}
root = {
any_scheme = {
scheme_target = scope:target_character
scheme_is_character_agent = scope:target_check
}
}
any_secret = { # Should prioritise actually finding Secrets
is_known_by = root
}
}
}
spymaster_task.0381 = {
type = letter_event
opening = spymaster_task.0381.opening
desc = {
first_valid = {
triggered_desc = {
trigger = {
scope:target_character = root
}
desc = spymaster_task.0381.desc_your_court
}
desc = spymaster_task.0381.desc_other_court
}
desc = spymaster_task.0381.desc
}
sender = scope:councillor
trigger = {
has_perk = truth_is_relative_perk
scope:target_character = {
any_courtier_or_guest = {
spymaster_task_courtier_valid_for_hook_fabrication_trigger
= yes
}
}
}
weight_multiplier = {
base = 1
modifier = {
add = 2
any_scheme = {
scheme_target = scope:target_character
is_hostile = yes
}
}
}
immediate = {
scope:target_character = {
random_courtier_or_guest = {
limit = {
spymaster_task_courtier_valid_for_hook_fabrication_trigger = yes
}
weight = {
base = 1
modifier = { # Prioritise actual Courtiers
add = 3
is_courtier_of = scope:target_character
}
}
save_scope_as = character_to_hook
}
}
}
option = {
name = spymaster_task.0381.a
custom_tooltip = spymaster_task.0381.a.truth_is_relative_unlock
add_hook = {
target = scope:character_to_hook
type = fabrication_hook
}
remove_short_term_gold = medium_gold_value
stress_impact = {
honest = medium_stress_impact_gain
}
ai_chance = {
base = 100
ai_value_modifier = {
ai_honor = -1
ai_greed = -0.5
}
}
}
option = {
name = spymaster_task.0381.b
flavor = spymaster_task.0381.b.flavor
scope:character_to_hook = {
add_opinion = {
target = root
modifier = grateful_opinion
opinion = 30
}
}
ai_chance = {
base = 20
ai_value_modifier = {
ai_compassion = 0.5
}
}
}
}
weight_multiplier = {
base = 1
compare_modifier = {
trigger = {
scope:councillor = {
intrigue < medium_skill_rating
}
}
target = scope:councillor
value = intrigue
multiplier = -0.2
offset = inverted_high_skill_rating
}
}
immediate = {
#Calculate whether Spymaster thinks there are secrets to be found
random_list = {
5 = {
modifier = {
add = scope:councillor.intrigue
scope:target_character = {
OR = {
spymaster_task_find_secrets_court_has_minor_secrets_trigger = yes
spymaster_task_find_secrets_court_has_major_secrets_trigger = yes
}
}
}
save_scope_value_as = {
name = secrets_to_be_found
value = yes
}
}
5 = {
modifier = {
add = scope:councillor.intrigue
scope:target_character = {
NOR = {
spymaster_task_find_secrets_court_has_minor_secrets_trigger = yes
spymaster_task_find_secrets_court_has_major_secrets_trigger = yes
}
}
}
save_scope_value_as = {
name = no_secrets_here
value = yes
}
}
}
}
#####################
# Side Effects from Disrupt Schemes
# 1000-1999
#####################
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
any_vassal = {
is_powerful_vassal = yes
NOT = { this = scope:councillor }
save_temporary_scope_as = vassal
}
any_secret = {
NOT = { is_known_by = scope:vassal }
}
scope:councillor = {
intrigue < high_skill_rating
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.2
offset = inverted_high_skill_rating
}
}
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
random_vassal = {
limit = {
is_powerful_vassal = yes
NOT = { this = scope:councillor }
save_temporary_scope_as = vassal
root = {
any_secret = {
NOT = { is_known_by = scope:vassal }
}
}
}
save_scope_as = vassal
}
random_secret = {
limit = {
NOT = { is_known_by = scope:vassal }
}
save_scope_as = secret_to_reveal
}
scope:vassal = { #Fire the revelation event for the vassal
trigger_event = spymaster_task.1002
}
if = {
limit = {
OR = {
NOT = { has_trait = forgiving }
has_hook_of_type = {
target = scope:councillor
type = favor_hook
}
}
}
send_interface_message = {
type = event_spymaster_task_bad
title = spymaster.1001.notification
left_icon = scope:councillor
desc = {
desc = spymaster_task.1001.a.tt
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue <=
average_skill_level }
}
desc =
task_intrigue_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue >
average_skill_level }
}
desc =
task_intrigue_bad_skilled_notification_tooltip
}
}
add_opinion = {
target = scope:councillor
modifier = respect_opinion
opinion = -20
}
}
}
else = {
trigger_event = spymaster_task.1005
}
}
option = {
name = spymaster_task.1002.a
flavor = spymaster_task.1002.a.tt
scope:secret_to_reveal = {
reveal_to = root
}
}
}
scripted_trigger spymaster_task_1003_courtier_trigger = {
NOT = { this = scope:councillor }
any_secret = {
spymaster_task_1003_courtier_secret_trigger = yes
}
}
spymaster_task.1003 = {
hidden = yes
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
any_vassal = {
is_powerful_vassal = yes
save_temporary_scope_as = vassal
}
any_courtier = {
spymaster_task_1003_courtier_trigger = yes
}
scope:councillor = {
intrigue < high_skill_rating
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.2
offset = inverted_high_skill_rating
}
}
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
random_vassal = {
limit = {
is_powerful_vassal = yes
save_temporary_scope_as = vassal
root = {
any_courtier = {
spymaster_task_1003_courtier_trigger = yes
}
}
}
save_scope_as = vassal
}
random_courtier = {
limit = {
spymaster_task_1003_courtier_trigger = yes
}
random_secret = {
limit = {
spymaster_task_1003_courtier_secret_trigger = yes
}
save_scope_as = secret_to_reveal
}
save_scope_as = courtier
}
scope:vassal = { #Fire the revelation event for the vassal
trigger_event = spymaster_task.1004
}
send_interface_message = {
type = event_spymaster_task_bad
title = spymaster_task.1003.notification
right_icon = scope:courtier
left_icon = scope:councillor
desc = {
desc = spymaster_task.1003.a.tt
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue <=
average_skill_level }
}
desc =
task_intrigue_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue >
average_skill_level }
}
desc = task_intrigue_bad_skilled_notification_tooltip
}
}
add_opinion = {
target = scope:councillor
modifier = respect_opinion
opinion = -10
}
}
}
option = {
name = spymaster_task.1002.a
custom_tooltip = spymaster_task.1002.a.tt
scope:secret_to_reveal = {
reveal_to = root
}
}
}
scripted_trigger spymaster_task_1101_scheme_trigger = {
hostile_scheme_trigger = yes
scheme_owner = { is_ai = yes }
scheme_progress >= 2
scheme_power_resistance_difference > 0
}
spymaster_task.1101 = {
type = letter_event
opening = {
desc = spymaster_task.0399.opening
}
desc = {
desc = spymaster_task.1101.desc_opening
first_valid = {
triggered_desc = {
trigger = { scope:scheme = { scheme_type = murder } }
desc = spymaster_task.1101.murder
}
triggered_desc = {
trigger = { scope:scheme = { scheme_type = abduct } }
desc = spymaster_task.1101.abduct
}
desc = spymaster_task.1101.fallback
}
desc = spymaster_task.1101.ending
}
sender = scope:councillor
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
any_targeting_scheme = {
spymaster_task_1101_scheme_trigger = yes
}
scope:councillor = {
councillor_positive_event_opinion_trigger = yes
intrigue >= medium_skill_rating
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}
immediate = {
random_targeting_scheme = {
limit = {
spymaster_task_1101_scheme_trigger = yes
}
save_scope_as = scheme
scheme_owner = {
save_scope_as = owner
}
if = {
limit = {
is_scheme_exposed = no
}
hidden_effect = {
expose_scheme = yes
}
custom_tooltip = spymaster_task.1101.exposure_tt
}
}
}
option = {
name = spymaster_task.1101.a
scope:scheme = {
end_scheme = yes
}
}
}
#####################
# Side Effects from Support Schemes
# 2000-2999
#####################
#Loss of Piety
# by Petter Vilberg
spymaster_task.2001 = {
type = character_event
title = spymaster_task.2001.t
desc = spymaster_task.2001.desc
theme = intrigue
left_portrait = {
character = scope:councillor
animation = worry
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:councillor = {
intrigue < high_skill_rating
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.2
offset = inverted_high_skill_rating
}
}
immediate = {
set_variable = {
name = had_spymaster_task_side_effect
value = yes
days = spymaster_task_side_effect_cooldown
}
}
option = {
name = spymaster_task.2001.a
add_piety = medium_piety_loss
}
option = {
name = spymaster_task.2001.b
add_piety = major_piety_loss
add_dread = medium_dread_gain
stress_impact = {
zealous = medium_stress_impact_gain
just = major_stress_impact_gain
compassionate = major_stress_impact_gain
}
ai_chance = {
base = 0
modifier = {
add = 20
has_trait = arbitrary
}
modifier = {
add = 20
has_trait = callous
}
modifier = {
add = 100
has_trait = sadistic
}
modifier = {
add = 20
has_trait = cynical
}
}
}
}
#Loss of Prestige
# by Petter Vilberg
spymaster_task.2002 = {
hidden = yes
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:councillor = {
intrigue < high_skill_rating
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.2
offset = inverted_high_skill_rating
}
}
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
set_variable = {
name = had_spymaster_task_side_effect
value = yes
days = spymaster_task_side_effect_cooldown
}
send_interface_message = {
type = event_spymaster_task_bad
title = spymaster_task.2002.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue <=
average_skill_level }
}
desc =
task_intrigue_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue >
average_skill_level }
}
desc = task_intrigue_bad_skilled_notification_tooltip
}
}
left_icon = scope:councillor
add_prestige = medium_prestige_loss
}
}
}
#Scheme Fails
# by Petter Vilberg
scripted_trigger spymaster_task_2003_scheme_trigger = {
hostile_scheme_trigger = yes
scheme_progress >= 5
}
spymaster_task.2003 = {
type = character_event
title = spymaster_task.2003.t
desc = spymaster_task.2003.desc
theme = intrigue
left_portrait = {
character = scope:councillor
animation = shock
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:councillor = {
intrigue < high_skill_rating
}
any_scheme = {
spymaster_task_2003_scheme_trigger = yes
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.2
offset = inverted_high_skill_rating
}
}
immediate = {
random_scheme = {
limit = {
spymaster_task_2003_scheme_trigger = yes
}
save_scope_as = scheme
}
}
option = {
name = spymaster_task.2003.a
if = {
limit = { exists = scope:scheme }
scope:scheme = {
end_scheme = yes
}
}
}
}
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
any_vassal = {
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
}
}
weight_multiplier = {
base = 1
}
immediate = {
scope:councillor_liege = {
every_courtier = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
add_to_temporary_list = potential_secret_holder
}
every_vassal = {
limit = {
OR = {
root = { highest_held_title_tier =
tier_county }
highest_held_title_tier = tier_county
}
any_secret = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
}
add_to_temporary_list = potential_secret_holder
}
random_in_list = {
list = potential_secret_holder
save_scope_as = secret_owner
random_secret = {
limit = {
spymaster_task_find_secrets_suitable_minor_secret_trigger = yes
}
save_scope_as = secret_to_reveal
}
}
}
scope:councillor = {
trigger_event = spymaster_task.2102
}
}
}
spymaster_task.2102 = {
type = character_event
title = spymaster_task.2102.t
desc = spymaster_task.2102.desc
theme = intrigue
left_portrait = {
character = scope:secret_owner
animation = worry
}
trigger = {
exists = scope:secret_to_reveal
}
option = {
name = spymaster_task.2102.a
trigger = {
scope:secret_to_reveal = {
NOT = { is_known_by = root }
}
}
scope:secret_to_reveal = {
reveal_to = root
}
show_as_tooltip = {
scope:secret_to_reveal = {
reveal_to = scope:councillor_liege
}
}
hidden_effect = {
scope:councillor_liege = {
trigger_event = spymaster_task.2103
}
}
ai_chance = {
base = 200
opinion_modifier = {
opinion_target = scope:councillor_liege
}
}
}
option = {
name = spymaster_task.2102.b
trigger = {
scope:secret_to_reveal = {
is_known_by = root
}
}
show_as_tooltip = {
scope:secret_to_reveal = {
reveal_to = scope:councillor_liege
}
}
hidden_effect = {
scope:councillor_liege = {
trigger_event = spymaster_task.2103
}
}
ai_chance = {
base = 100
opinion_modifier = {
opinion_target = scope:councillor_liege
}
}
}
option = {
name = spymaster_task.2102.c
scope:secret_to_reveal = {
if = {
limit = {
NOT = { is_known_by = root }
}
reveal_to = root
}
}
custom_tooltip = spymaster_task.2102.c.tt
ai_chance = {
base = 50
}
}
}
spymaster_task.2103 = {
hidden = yes
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
send_interface_message = {
type = event_spymaster_task_good
title = spymaster_task.2103.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue <=
average_skill_level }
}
desc =
task_intrigue_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue >
average_skill_level }
}
desc =
task_intrigue_good_skilled_notification_tooltip
}
}
right_icon = scope:secret_owner
left_icon = scope:councillor
scope:secret_to_reveal = {
reveal_to = root
}
}
}
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:councillor = {
councillor_positive_event_opinion_trigger = yes
intrigue >= mediocre_skill_rating
}
scope:councillor_liege = {
any_courtier = {
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
any_vassal = {
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
}
}
weight_multiplier = {
base = 1
}
immediate = {
scope:councillor_liege = {
every_courtier = {
limit = {
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
add_to_temporary_list = potential_secret_holder
}
every_vassal = {
limit = {
OR = {
root = { highest_held_title_tier =
tier_county }
highest_held_title_tier = tier_county
}
any_secret = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
}
add_to_temporary_list = potential_secret_holder
}
random_in_list = {
list = potential_secret_holder
save_scope_as = secret_owner
random_secret = {
limit = {
spymaster_task_find_secrets_suitable_major_secret_trigger = yes
}
save_scope_as = secret_to_reveal
}
}
}
scope:councillor = {
trigger_event = spymaster_task.2105
}
}
}
spymaster_task.2105 = {
type = character_event
title = spymaster_task.2102.t
desc = spymaster_task.2102.desc
theme = intrigue
left_portrait = {
character = scope:secret_owner
animation = worry
}
option = {
name = spymaster_task.2102.a
trigger = {
scope:secret_to_reveal = {
NOT = { is_known_by = root }
}
}
scope:secret_to_reveal = {
reveal_to = root
}
show_as_tooltip = {
scope:secret_to_reveal = {
reveal_to = scope:councillor_liege
}
}
hidden_effect = {
scope:councillor_liege = {
trigger_event = spymaster_task.2106
}
}
}
option = {
name = spymaster_task.2102.b
trigger = {
scope:secret_to_reveal = {
is_known_by = root
}
}
show_as_tooltip = {
scope:secret_to_reveal = {
reveal_to = scope:councillor_liege
}
}
hidden_effect = {
scope:councillor_liege = {
trigger_event = spymaster_task.2106
}
}
}
option = {
name = spymaster_task.2102.c
scope:secret_to_reveal = {
if = {
limit = {
NOT = { is_known_by = root}
}
reveal_to = root
}
}
custom_tooltip = spymaster_task.2102.c.tt
}
}
spymaster_task.2106 = {
hidden = yes
immediate = {
cp:councillor_spymaster = {
save_scope_as = active_councillor
}
send_interface_message = {
type = event_spymaster_task_good
title = spymaster_task.2103.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue <=
average_skill_level }
}
desc =
task_intrigue_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { intrigue >
average_skill_level }
}
desc =
task_intrigue_good_skilled_notification_tooltip
}
}
right_icon = scope:secret_owner
left_icon = scope:councillor
scope:secret_to_reveal = {
reveal_to = root
}
}
}
}
###############
# Espionage Side Effects
# 3000-3999
###############
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:target_character = {
target_is_liege_or_above = root
}
}
weight_multiplier = {
base = 1
#Check whether the target's Spymaster is performing Disrupt Schemes
modifier = {
add = {
value =
scope:target_character.cp:councillor_spymaster.intrigue
multiply = 0.05
}
exists = scope:target_character.cp:councillor_spymaster
scope:target_character.cp:councillor_spymaster = {
is_performing_council_task = task_disrupt_schemes
}
}
# Reduce discovery chance by councillor's intrigue
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.05
}
}
immediate = {
set_variable = {
name = had_spymaster_task_side_effect
value = yes
days = spymaster_task_side_effect_cooldown
}
}
option = {
name = spymaster_task.3002.a
add_opinion = {
target = scope:councillor_liege
modifier = angry_opinion
opinion = -30
}
}
}
option = {
name = spymaster_task.3003.a
add_opinion = {
target = scope:councillor_liege
modifier = suspicion_opinion
opinion = -15
}
}
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
target_is_liege_or_above = scope:target_character
}
weight_multiplier = {
base = 1
#Check whether the target's Spymaster is performing Disrupt Schemes
modifier = {
add = {
value =
scope:target_character.cp:councillor_spymaster.intrigue
multiply = 0.05
}
exists = scope:target_character.cp:councillor_spymaster
scope:target_character.cp:councillor_spymaster = {
is_performing_council_task = task_disrupt_schemes
}
}
# Reduce discovery chance by councillor's intrigue
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.05
}
}
immediate = {
set_variable = {
name = had_spymaster_task_side_effect
value = yes
days = spymaster_task_side_effect_cooldown
}
}
option = {
name = spymaster_task.3005.a
add_opinion = {
target = scope:councillor_liege
modifier = angry_opinion
opinion = -30
}
}
}
option = {
name = spymaster_task.3006.a
add_opinion = {
target = scope:councillor_liege
modifier = suspicion_opinion
opinion = -15
}
}
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:target_character = { is_independent_ruler = yes }
NOT = { target_is_liege_or_above = scope:target_character }
NOT = { scope:target_character = root }
}
weight_multiplier = {
base = 1
#Check whether the target's Spymaster is performing Disrupt Schemes
modifier = {
add = {
value =
scope:target_character.cp:councillor_spymaster.intrigue
multiply = 0.05
}
exists = scope:target_character.cp:councillor_spymaster
scope:target_character.cp:councillor_spymaster = {
is_performing_council_task = task_disrupt_schemes
}
}
# Reduce discovery chance by councillor's intrigue
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.05
}
}
immediate = {
set_variable = {
name = had_spymaster_task_side_effect
value = yes
days = spymaster_task_side_effect_cooldown
}
}
option = {
name = spymaster_task.3005.a
add_opinion = {
target = scope:councillor_liege
modifier = angry_opinion
opinion = -30
}
}
}
option = {
name = spymaster_task.3006.a
add_opinion = {
target = scope:councillor_liege
modifier = suspicion_opinion
opinion = -15
}
}
}
trigger = {
exists = cp:councillor_spymaster
scope:councillor = cp:councillor_spymaster
scope:target_character = {
is_independent_ruler = no
NOT = { target_is_liege_or_above = root }
}
NOT = { target_is_liege_or_above = scope:target_character }
NOT = { scope:target_character = root }
}
weight_multiplier = {
base = 1
#Check whether the target's Spymaster is performing Disrupt Schemes
modifier = {
add = {
value =
scope:target_character.cp:councillor_spymaster.intrigue
multiply = 0.05
}
exists = scope:target_character.cp:councillor_spymaster
scope:target_character.cp:councillor_spymaster = {
is_performing_council_task = task_disrupt_schemes
}
}
# Reduce discovery chance by councillor's intrigue
compare_modifier = {
target = scope:councillor
value = intrigue
multiplier = -0.05
}
}
immediate = {
set_variable = {
name = had_spymaster_task_side_effect
value = yes
days = spymaster_task_side_effect_cooldown
}
scope:target_character.top_liege = {
save_scope_as = target_top_liege
}
}
option = {
name = spymaster_task.3006.a
add_opinion = {
target = scope:councillor_liege
modifier = suspicion_opinion
opinion = -15
}
scope:target_top_liege = {
add_opinion = {
target = scope:councillor_liege
modifier = plotting_against_vassals_opinion
opinion = -15
}
}
}
}