Marshal Task Events

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 42

#Events related to the Marshal's tasks

namespace = marshal_task

####
#0001-0999: Task outcome events
# by Petter Vilberg
####
# 0301 - New Commander
# 0302 - Commander learns Marshal's Commander Trait

####
#1000-1999: Side effects from Organize the Levies
# by Petter Vilberg
####
# 1001 - Levy Desertions
# 1002 - Unused Farmland
# 1003 - Insufficient Guards

# 1101 - Organization of Service


# 1102 - Increased Military Presence

####
#2000-2999: Side effects from Train Commanders
# by Petter Vilberg
####
# 2001 - Wounded Commander
# 2002 - Severely Harmed Commander
# 2003 - Commander Killed

# 2101 - Commander Teaches Other Commander a Trait

####
#3000-3999: Side effects from Increase Control
# by Petter Vilberg
####
# 3001 - Reduce County Opinion
# 3002 - Loss of Control
# 3003 - Baron Opinion Loss

# 3101 - Increased County Opinion


# 3102 - Baron Opinion Gain

####
#4000-4999: Side effects from Manage Royal Guards
# by Claudia Baldassi
####
# 4001 - Knight is Wounded
# 4002 -

# 4101 - Knight Improved


# 4102 - Scheme Disrupted

##################
# Task Outcome Events
# 0001-0999
##################

########
# Train Commander Events
# 0301-0399
########

#New Commander
# by petter Vilberg
marshal_task.0301 = {
type = character_event
title = marshal_task.0301.t
desc = marshal_task.0301.desc

theme = martial
left_portrait = {
character = scope:commander
animation = ecstasy
}
right_portrait = {
character = cp:councillor_marshal
animation = personality_rational
}

trigger = {
is_ai = no
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
NOT = {
has_variable = had_new_commander_event
}
OR = {
exists = capital_province
exists = location
}

OR = {
number_of_knights < max_number_of_knights
any_knight = {
prowess < 8
}
}
}

weight_multiplier = {
base = 1
}

immediate = {
set_variable = {
name = had_new_commander_event
days = 730
}
random_sub_realm_county = {
save_scope_as = origin
}
hidden_effect = {
if = {
limit = {
exists = capital_province
}
capital_province = { save_scope_as = target_location }
}
else = {
location = { save_scope_as = target_location }
}
create_character = {
gender_female_chance = root_soldier_female_chance
location = scope:target_location
template = new_warrior_character
faith = scope:origin.faith
culture = scope:origin.culture
save_scope_as = commander
}
add_visiting_courtier = scope:commander
}
}

option = {
name = marshal_task.0301.a
recruit_courtier = scope:commander
ai_chance = {
base = 100
}
}

option = {
name = marshal_task.0301.b
scope:commander = {
select_and_move_to_pool_effect = yes
}
ai_chance = {
base = 10
}
}
}

# Teach a Commander Marshal's Commander Trait


# by Petter Vilberg
scripted_trigger marshal_task_0302_commander_trigger = {
number_of_commander_traits < commander_trait_limit
can_be_commander_now_trigger = { ARMY_OWNER = root }
number_of_commander_traits < 3
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
NOT = { has_variable = commander_trait_being_taught }
}

marshal_task.0302 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}
OR = {
any_courtier = {
marshal_task_0302_commander_trigger = yes
}
any_vassal = {
marshal_task_0302_commander_trigger = yes
}
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
every_courtier = {
limit = {
marshal_task_0302_commander_trigger = yes
}
add_to_temporary_list = possible_commander
}
every_vassal = {
limit = {
marshal_task_0302_commander_trigger = yes
}
add_to_temporary_list = possible_commander
}
random_in_list = {
list = possible_commander
limit = {
character_has_commander_trait_scope_does_not =
root.cp:councillor_marshal
has_education_martial_trigger = yes
}
alternative_limit = {
has_education_martial_trigger = yes
}
alternative_limit = {
always = yes
}

weight = {
base = 5
compare_modifier = {
value = martial
}
compare_modifier = {
value = prowess
multiplier = 0.5
}

modifier = {
add = 5
number_of_commander_traits < 2
}
modifier = {
add = 5
number_of_commander_traits < 1
}
}
save_scope_as = commander
}
cp:councillor_marshal = {
save_scope_as = teacher
}

random_list = {
75 = {
trigger = {
always = no
scope:commander = {
character_has_commander_trait_scope_does_not =
scope:teacher
}
}
select_ct_for_teacher_to_teach_student_effect = {
TEACHER = scope:teacher
STUDENT = scope:commander
}
save_scope_value_as = {
name = marshal_knows_selected_trait
value = yes
}
}
25 = {
scope:commander = {
discover_new_commander_trait_to_teach = yes
}
}
}

random_list = {
10 = {
compare_modifier = {
value = scope:teacher.martial
multiplier = 2
}
compare_modifier = {
value = scope:commander.learning
multiplier = 2
}
send_interface_message = {
type = event_marshal_task_good
title = marshal_task.0302.notification.a
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
learn_commander_trait_success_effect = yes
add_martial_skill = 1
}
}
}
90 = {
send_interface_message = {
type = event_marshal_task_good
title = marshal_task.0302.notification.b
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
add_martial_skill = 1
}
}
}
}
}
}

marshal_task.0303 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}
any_knight = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
every_knight = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
}
add_to_temporary_list = possible_knight
}
random_in_list = {
list = possible_knight
save_scope_as = commander
}

random_list = {
2 = {
trigger = {
scope:commander = {
NOT = {
has_trait = blademaster_3
}
}
}
compare_modifier = {
value = scope:active_councillor.martial
multiplier = 2
}
compare_modifier = {
value = scope:commander.learning
multiplier = 2
}
modifier = {
add = 2
scope:active_councillor.prowess >=
average_skill_level
}
modifier = {
add = 3
scope:active_councillor.prowess >= good_skill_level
}
send_interface_message = {
type = event_marshal_task_good
title = marshal_task.0303.notification.c
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
blademaster_lifestyle_rank_up_effect = yes
}
}
}
10 = {
compare_modifier = {
value = scope:active_councillor.martial
multiplier = 2
}
compare_modifier = {
value = scope:commander.learning
multiplier = 2
}
send_interface_message = {
type = event_marshal_task_good
title = marshal_task.0303.notification.a
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
add_prowess_skill = 2
}
}
}
90 = {
send_interface_message = {
type = event_marshal_task_good
title = marshal_task.2102.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip
left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
add_prowess_skill = 1
}
}
}
}
}
}

##########
# END Task Outcome Events
##########

##################
# Side Effects from Organize the Levies
# 1001-1999
# by Petter Vilberg
##################

###
# Bad Side Effects
###

#Levy Desertions
# by Petter Vilberg
marshal_task.1001 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
NOT = {
has_character_modifier = marshal_task_levy_desertions_modifier
}
cp:councillor_marshal = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.1001.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_organize_levies_notification_tooltip

left_icon = scope:councillor

add_character_modifier = {
modifier = marshal_task_levy_desertions_modifier
days = marshal_task_modifier_duration
}
}
}
}

#Unused Farmland
# by Petter Vilberg

marshal_task.1002 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
any_sub_realm_county = {
NOT = {
has_county_modifier = marshal_task_unused_farmland_modifier
}
}
cp:councillor_marshal = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
random_sub_realm_county = {
limit = {
NOT = {
has_county_modifier =
marshal_task_unused_farmland_modifier
}
}
save_scope_as = county
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.1002.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_organize_levies_notification_tooltip
goto = scope:county

left_icon = scope:councillor
right_icon = scope:county

scope:county = {
add_county_modifier = {
modifier = marshal_task_unused_farmland_modifier
days = marshal_task_modifier_duration
}
}
}
}
}

#Insufficient Guards
# by Petter Vilberg
marshal_task.1003 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
any_sub_realm_county = {
marshal_task_1003_county_trigger = yes
}
cp:councillor_marshal = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
random_sub_realm_county = {
limit = {
marshal_task_1003_county_trigger = yes
}
save_scope_as = county
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.1003.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_organize_levies_notification_tooltip

goto = scope:county
left_icon = scope:councillor
right_icon = scope:county

scope:county = {
random_list = {
1 = {
trigger = {
NOT = { has_county_modifier =
county_corruption_unsafe_highways_modifier }
}
add_county_modifier = {
modifier =
county_corruption_unsafe_highways_modifier
years = 5
}
}
1 = {
trigger = {
NOT = { has_county_modifier =
county_corruption_thieves_guild_modifier }
}
add_county_modifier = {
modifier =
county_corruption_thieves_guild_modifier
years = 5
}
}
1 = {
trigger = {
NOT = { has_county_modifier =
county_corruption_bandits_rampant_modifier }
}
add_county_modifier = {
modifier =
county_corruption_bandits_rampant_modifier
years = 5
}
}
}
}
}
}
}

####
# Good Side Effects
####

#Organization of Service
# by Petter Vilberg
marshal_task.1101 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
any_sub_realm_county = {
marshal_task_1101_county_trigger = yes
}
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
random_sub_realm_county = {
limit = {
marshal_task_1101_county_trigger = yes
}
save_scope_as = county
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.1101.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_organize_levies_notification_tooltip

goto = scope:county
left_icon = scope:councillor
right_icon = scope:county

scope:county = {
add_county_modifier = {
modifier = marshal_task_organized_service_modifier
days = marshal_task_modifier_duration
}
}
}
}
}

#Increased Military Presence


# by Petter Vilberg
marshal_task.1102 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
any_sub_realm_county = {
marshal_task_1102_county_trigger = yes
}
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
random_sub_realm_county = {
limit = {
marshal_task_1102_county_trigger = yes
}
save_scope_as = county
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.1102.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_organize_levies_notification_tooltip
goto = scope:county

left_icon = scope:councillor
right_icon = scope:county

scope:county = {
add_county_modifier = {
modifier = marshal_task_military_presence_modifier
days = marshal_task_modifier_duration
}
}
}
}
}

###############
# Side effects from Train Commanders
# 2000-2999
###############

####
# Bad Side Effects
####

#Commander is Wounded
# by Petter Vilberg
scripted_trigger marshal_task_2001_commander_trigger = {
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
NOT = { has_trait = wounded }
}

marshal_task.2001 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
martial < high_skill_rating
}
OR = {
any_courtier = {
marshal_task_2001_commander_trigger = yes
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
any_vassal = {
marshal_task_2001_commander_trigger = yes
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
get_valid_commander_list_effect = {
LIST = valid_commander_list
ARMY_OWNER = root
}
random_in_list = {
list = valid_commander_list
limit = {
marshal_task_2001_commander_trigger = yes
}
weight = {
base = 2
compare_modifier = {
value = prowess
multiplier = -0.1
}
}
save_scope_as = commander
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.2001.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:councillor

scope:commander = {
increase_wounds_effect = {
REASON = duel
}
}
}
}
}

#Commander is Severely Harmed


# by Petter Vilberg
scripted_trigger marshal_task_2002_commander_trigger = {
is_available_ai_adult = yes
OR = {
is_landed = no
highest_held_title_tier = tier_barony
}
NOT = { this = root.cp:councillor_marshal }
NOR = {
has_trait = wounded
has_trait = maimed
}
}

marshal_task.2002 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
martial < high_skill_rating
}
OR = {
any_courtier = {
marshal_task_2002_commander_trigger = yes
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
any_vassal = {
marshal_task_2002_commander_trigger = yes
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
get_valid_commander_list_effect = {
LIST = valid_commander_list
ARMY_OWNER = root
}
random_in_list = {
list = valid_commander_list
limit = {
marshal_task_2002_commander_trigger = yes
}
weight = {
base = 2
compare_modifier = {
value = prowess
multiplier = -0.1
}
}
save_scope_as = commander
}
random_list = {
1 = {
send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.2002.generic_title
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

right_icon = scope:commander
left_icon = scope:active_councillor

scope:commander = {
increase_wounds_effect = {
REASON = duel
}
add_trait = one_eyed
}
}
#save_scope_value_as = {
# name = injury
# value = flag:eye
#}
}
3 = {
send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.2002.generic_title
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

right_icon = scope:commander
left_icon = scope:active_councillor
scope:commander = {
increase_wounds_effect = {
REASON = duel
}
add_trait = one_legged
}
}
#save_scope_value_as = {
# name = injury
# value = flag:leg
#}
}
3 = {
send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.2002.generic_title
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial
<= average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial
> average_skill_level }
}
desc =
task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

right_icon = scope:commander
left_icon = scope:active_councillor

scope:commander = {
increase_wounds_effect = {
REASON = duel
}
add_trait = maimed
}
}
#save_scope_value_as = {
# name = injury
# value = flag:hand
#}
}
}
}

#Commander is Killed
# by Petter Vilberg
scripted_trigger marshal_task_2003_commander_trigger = {
is_available_ai_adult = yes
OR = {
is_landed = no
highest_held_title_tier = tier_barony
}
NOT = { this = root.cp:councillor_marshal }
NOT = { has_trait = wounded }
}

marshal_task.2003 = {
type = character_event
title = marshal_task.2003.t
desc = {
desc = marshal_task.2001.opening
desc = marshal_task.2003.ending
}
left_portrait = {
character = cp:councillor_marshal
animation = shock
}
right_portrait = {
character = scope:commander
animation = beg
}
theme = martial

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
martial < high_skill_rating
}
OR = {
any_courtier = {
marshal_task_2003_commander_trigger = yes
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
any_vassal = {
marshal_task_2003_commander_trigger = yes
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
get_valid_commander_list_effect = {
LIST = valid_commander_list
ARMY_OWNER = root
}
random_in_list = {
list = valid_commander_list
limit = {
marshal_task_2003_commander_trigger = yes
}
weight = {
base = 2
compare_modifier = {
value = prowess
multiplier = -0.1
}
}
save_scope_as = commander
}
}

option = {
name = marshal_task.2003.a
scope:commander = {
death = {
death_reason = death_duel
}
}
}
}

####
# Good Side Effects
####

#Commander may teach another Commander a trait


# by Petter Vilberg

scripted_trigger marshal_task_2101_teacher_trigger = {
number_of_commander_traits > 0
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
NOT = { has_variable = commander_trait_being_taught }
}

scripted_trigger marshal_task_2101_commander_trigger = {
number_of_commander_traits < commander_trait_limit
can_be_commander_now_trigger = { ARMY_OWNER = root }
character_has_commander_trait_scope_does_not = scope:teacher
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
NOT = { has_variable = commander_trait_being_taught }
}
marshal_task.2101 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}

#First, add every potential commander to a trigger list


any_courtier = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
count = all
add_to_temporary_list = possible_commanders
}
any_vassal = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
count = all
add_to_temporary_list = possible_commanders
}

#Find two candidates


any_in_list = {
list = possible_commanders
marshal_task_2101_teacher_trigger = yes
save_temporary_scope_as = teacher
}
any_in_list = {
list = possible_commanders
marshal_task_2101_commander_trigger = yes #This should ensure
there is another possible candidate that is not also the teacher
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}

#Build a list of possible characters involved


every_courtier = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
add_to_list = possible_commanders
}
every_vassal = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
}
add_to_list = possible_commanders
}

#Pick a teacher
random_in_list = {
list = possible_commanders
limit = {
marshal_task_2101_teacher_trigger = yes
#Check that there is still a valid commander to learn from
teacher:
save_temporary_scope_as = teacher
any_in_list = {
list = possible_commanders
marshal_task_2101_commander_trigger = yes
}
}
save_scope_as = teacher
}
#Find a commander to learn
random_in_list = {
list = possible_commanders
limit = {
marshal_task_2101_commander_trigger = yes
}
save_scope_as = commander
}

#Select a trait to be taught


select_ct_for_teacher_to_teach_student_effect = {
TEACHER = scope:teacher
STUDENT = scope:commander
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.2101.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
learn_commander_trait_success_effect = yes
}
}
}
}

marshal_task.2102 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}

any_knight = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
count = all
add_to_temporary_list = possible_commanders
}

any_in_list = {
list = possible_commanders
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}

#Build a list of possible characters involved


every_knight = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
}
add_to_list = possible_knights
}

#Find a knight to improve


random_in_list = {
list = possible_knights
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
}
save_scope_as = commander
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.2102.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_train_commanders_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
add_prowess_skill = 1
}
}
}
}

##################
# Side Effects from Increase Control
# 3001-3999
##################

###
#Bad Side Effects
###

#Reduce County Opinion


# by Petter Vilberg
marshal_task.3001 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
scope:county = {
NOR = {
has_county_modifier =
marshal_task_increase_control_decreased_opinion_modifier
has_county_modifier =
marshal_task_increase_control_increased_opinion_modifier
}
}
scope:councillor = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.3001.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_increase_control_notification_tooltip
goto = scope:county

left_icon = scope:councillor
right_icon = scope:county

scope:county = {
add_county_modifier = {
modifier =
marshal_task_increase_control_decreased_opinion_modifier
years = 5
}
}
}
}

#Loss of Control
# by Petter Vilberg
marshal_task.3002 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
scope:county = {
county_control > medium_county_control
}
scope:councillor = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.3002.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_increase_control_notification_tooltip
goto = scope:county

left_icon = scope:councillor
right_icon = scope:county

scope:county = {
change_county_control = medium_county_control_loss
}
}
}
}

#Baron opinion loss


# by Petter Vilberg

scripted_trigger marshal_task_3003_baron_trigger = {
NOR = {
has_opinion_modifier = {
target = root
modifier = marshal_task_increase_control_baron_increase_opinion
}
has_opinion_modifier = {
target = root
modifier = marshal_task_increase_control_baron_decrease_opinion
}
}
NOT = {
this = scope:councillor
}
}

scripted_trigger marshal_task_3003_county_trigger = {
any_in_de_facto_hierarchy = {
tier = tier_barony
exists = holder
NOT = { holder = ROOT }
holder = {
marshal_task_3003_baron_trigger = yes
}
}
}

marshal_task.3003 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
scope:county = {
marshal_task_3003_county_trigger = yes
}
scope:councillor = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
scope:county = {
random_in_de_facto_hierarchy = {
limit = {
tier = tier_barony
exists = holder
NOT = { holder = ROOT }
holder = {
marshal_task_3003_baron_trigger = yes
}
}
holder = {
save_scope_as = baron
}
}
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.3003.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_increase_control_notification_tooltip

left_icon = scope:councillor
right_icon = scope:baron

add_prestige = minor_prestige_loss
scope:baron = {
add_opinion = {
target = root
modifier =
marshal_task_increase_control_baron_decrease_opinion
days = marshal_task_modifier_duration
}
}
}
}

####
# Good Side Effects
####

#Increased County Opinion


# by Petter Vilberg
marshal_task.3101 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
scope:county = {
NOR = {
has_county_modifier =
marshal_task_increase_control_decreased_opinion_modifier
has_county_modifier =
marshal_task_increase_control_increased_opinion_modifier
}
}
scope:councillor = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.3101.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_increase_control_notification_tooltip

left_icon = scope:councillor
right_icon = scope:county

scope:county = {
add_county_modifier = {
modifier =
marshal_task_increase_control_increased_opinion_modifier
years = 5
}
}
}
}

#Baron opinion gain


# by Petter Vilberg

marshal_task.3102 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
scope:county = {
marshal_task_3003_county_trigger = yes
}

scope:councillor = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
scope:county = {
random_in_de_facto_hierarchy = {
limit = {
tier = tier_barony
exists = holder
NOT = { holder = ROOT }
holder = {
marshal_task_3003_baron_trigger = yes
}
}
holder = {
save_scope_as = baron
}
}
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.3102.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_increase_control_notification_tooltip

left_icon = scope:councillor
right_icon = scope:baron

scope:baron = {
add_opinion = {
target = root
modifier =
marshal_task_increase_control_baron_increase_opinion
days = marshal_task_modifier_duration
}
}
add_prestige = minor_prestige_gain
}
}
}

##################
# Side Effects from Manage Royal Guard
# 4001-4999
##################

####
# Bad Side Effects
####

#Knight is Wounded
# by Claudia Baldassi
scripted_trigger marshal_task_4001_knight_trigger = {
is_knight = yes
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
NOT = { has_trait = wounded }
}

marshal_task.4001 = {
hidden = yes
trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
martial < high_skill_rating
}
any_courtier = {
marshal_task_4001_knight_trigger = yes
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}
random_courtier = {
limit = {
marshal_task_4001_knight_trigger = yes
}
weight = {
base = 2
compare_modifier = {
value = prowess
multiplier = -0.1
}
}
save_scope_as = knight
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.2001.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_manage_guards_notification_tooltip

left_icon = scope:knight
right_icon = scope:councillor

scope:knight = {
increase_wounds_effect = {
REASON = duel
}
}
}
}
}

#Disorganized Royal Guards


# by Claudia Baldassi

marshal_task.4002 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
scope:councillor = {
martial < high_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = -0.2
offset = inverted_high_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}

send_interface_message = {
type = event_marshal_task_bad
title = marshal_task.4002.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_bad_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_bad_skilled_notification_tooltip
}
}
tooltip = task_manage_guards_notification_tooltip

left_icon = scope:councillor

scope:councillor_liege = {
add_character_modifier = {
modifier = task_manage_guards_disorganized_modifier
months = 6
}
}
}
}
}

####
# Good Side Effects
####

#Knight Improved
# by Claudia Baldassi
marshal_task.4101 = {
hidden = yes

trigger = {
exists = cp:councillor_marshal
scope:councillor = cp:councillor_marshal
cp:councillor_marshal = {
councillor_positive_event_opinion_trigger = yes
martial > mediocre_skill_rating
}

any_knight = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
count = all
add_to_temporary_list = possible_commanders
}

any_in_list = {
list = possible_commanders
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
}
}
weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
cp:councillor_marshal = {
save_scope_as = active_councillor
}
set_variable = {
name = had_marshal_task_side_effect
value = yes
days = marshal_task_side_effect_cooldown
}

#Build a list of possible characters involved


every_knight = {
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
}
add_to_list = possible_knights
}

#Find a knight to improve


random_in_list = {
list = possible_knights
limit = {
can_be_commander_now_trigger = { ARMY_OWNER = root }
is_available_ai_adult = yes
NOT = { this = root.cp:councillor_marshal }
}
save_scope_as = commander
}

send_interface_message = {
type = event_marshal_task_good
title = marshal_task.2102.notification
desc = {
triggered_desc = {
trigger = {
scope:active_councillor = { martial <=
average_skill_level }
}
desc =
task_martial_good_unskilled_notification_tooltip
}
triggered_desc = {
trigger = {
scope:active_councillor = { martial >
average_skill_level }
}
desc = task_martial_good_skilled_notification_tooltip
}
}
tooltip = task_manage_guards_notification_tooltip

left_icon = scope:commander
right_icon = scope:active_councillor

scope:commander = {
add_prowess_skill = 1
}
}
}
}

# Scheme Disrupted
#by Claudia Baldassi
scripted_trigger marshal_task_4101_scheme_trigger = {
hostile_scheme_trigger = yes
scheme_owner = { is_ai = yes }
scheme_progress >= 20
scheme_power_resistance_difference > 0
}

marshal_task.4102 = {
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_marshal
scope:councillor = cp:councillor_marshal
any_targeting_scheme = {
marshal_task_4101_scheme_trigger = yes
}
scope:councillor = {
councillor_positive_event_opinion_trigger = yes
martial >= medium_skill_rating
}
}

weight_multiplier = {
base = 1
compare_modifier = {
target = scope:councillor
value = martial
multiplier = 0.2
offset = inverted_mediocre_skill_rating
}
}

immediate = {
random_targeting_scheme = {
limit = {
marshal_task_4101_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
}
}
}

You might also like