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

namespace = clan

#Events related to clan governments


#These events are very generalized to be applicable for a wide variety of
characters, and some inaccuracies will inevitably exist.

# Flavor events
# clan.1001-1999

#################
# #
# FLAVOR #
# #
#################

#########################################
# Powerful vassal requests marriage #
# by Linnéa Thimrén #
#########################################

scripted_trigger clan_1001_valid_vassal = {
is_powerful_vassal_of = root
has_government = clan_government
NOT = { is_allied_to = root }
any_child = {
save_temporary_scope_as = child_check
root = {
any_child = {
is_married = no
can_marry_character_trigger = { CHARACTER =
scope:child_check }
}
}
}
}

clan.1001 = {
type = character_event
title = clan.1001.t
desc = clan.1001.desc
theme = realm
left_portrait = scope:child
right_portrait = scope:vassal
lower_right_portrait = scope:vassal_child

trigger = {
has_government = clan_government
NOT = { has_character_flag = had_event_clan_1001 }
any_vassal = {
clan_1001_valid_vassal = yes
}
}

immediate = {
add_character_flag = {
flag = had_event_clan_1001
years = 10
}
every_child = {
limit = {
is_married = no
}
add_to_list = unmarried_children
}
random_vassal = {
limit = {
clan_1001_valid_vassal = yes
}
save_scope_as = vassal
random_child = {
limit = {
save_temporary_scope_as = child_check
any_in_list = {
list = unmarried_children
can_marry_character_trigger = { CHARACTER =
scope:child_check }
}
}
save_scope_as = vassal_child
}
}
random_in_list = {
list = unmarried_children
limit = {
can_marry_character_trigger = { CHARACTER =
scope:vassal_child }
}
weight = {
base = 1
modifier = {
add = 1
NOT = { is_primary_heir_of = root }
}
}
save_scope_as = child
}
}

option = { #They will marry!


name = clan.1001.a
if = {
limit = {
OR = {
scope:child = { is_adult = no }
scope:vassal_child = { is_adult = no }
}
}
scope:child = {
create_betrothal = scope:vassal_child
}
}
else = {
scope:child = {
marry = scope:vassal_child
}
}
scope:vassal = {
add_opinion = {
target = root
modifier = pleased_opinion
opinion = 20
}
}
set_variable = {
name = promised_to_marry_1
value = scope:vassal_child
years = 17
}
set_variable = {
name = promised_to_marry_2
value = scope:child
years = 17
}
ai_chance = {
base = 50
modifier = {
add = -40
exists = primary_heir
primary_heir = scope:child
}
modifier = {
add = 30
scope:vassal = {
exists = primary_heir
primary_heir = scope:vassal_child
}
}
}
}

option = { #nah
name = clan.1001.b
scope:vassal = {
add_opinion = {
target = root
modifier = refusal_opinion
opinion = -30
}
}
ai_chance = {
base = 50
}
}
}

#You broke the betrothal!


clan.1002 = {
type = character_event
title = clan.1001.t
desc = clan.1002.desc
theme = realm
left_portrait = scope:child
right_portrait = {
character = scope:vassal
animation = anger
}
lower_right_portrait = scope:vassal_child

immediate = {
scope:rejected_betrothed = {
save_scope_as = vassal_child
random_parent = {
limit = {
is_vassal_of = root
}
save_scope_as = vassal
add_opinion = {
target = root
modifier = broke_promise
}
}
}
scope:rejecting_betrothed = {
save_scope_as = child
}

option = { #It was a mistake!!


name = clan.1002.a
if = {
limit = {
OR = {
scope:child = { is_adult = no }
scope:vassal_child = { is_adult = no }
}
}
scope:child = {
create_betrothal = scope:vassal_child
}
}
else = {
scope:child = {
marry = scope:vassal_child
}
}
scope:vassal = {
add_opinion = {
target = root
modifier = pleased_opinion
opinion = 15
}
}
set_variable = {
name = promised_to_marry_1
value = scope:vassal_child
years = 15
}
set_variable = {
name = promised_to_marry_2
value = scope:child
years = 15
}
ai_chance = {
base = 0
}
}

option = { #Back off


name = clan.1002.b
ai_chance = {
base = 100
}
}
}

#################################
# A vassal asks for a perk #
# by Linnéa Thimrén #
#################################

clan.1011 = {
type = character_event
title = clan.1011.t
desc = {
desc = clan.1011.desc_opening
first_valid = {
triggered_desc = {
trigger = {
exists = scope:army_1
}
desc = clan.1011.desc_army
}
triggered_desc = {
trigger = {
exists = scope:prestige_1
}
desc = clan.1011.desc_prestige
}
triggered_desc = {
trigger = {
exists = scope:diplomacy_1
}
desc = clan.1011.desc_diplomacy
}
triggered_desc = {
trigger = {
exists = scope:prowess_1
}
desc = clan.1011.desc_prowess
}
desc = clan.1011.desc_fallback
}
}
theme = realm
left_portrait = scope:vassal
right_portrait = scope:allied_vassal
lower_center_portrait = scope:councillor
trigger = {
has_government = clan_government
NOT = { has_character_flag = had_event_clan_1011 }
any_vassal = {
has_government = clan_government
is_allied_to = root
}
any_vassal = {
has_government = clan_government
NOT = { is_allied_to = root }
}
}

immediate = {
add_character_flag = {
flag = had_event_clan_1011
years = 10
}
random_vassal = { #An ally you hopefully like somewhat
limit = {
has_government = clan_government
is_allied_to = root
has_friendly_relationship_with_root_trigger = yes
}
alternative_limit = {
has_government = clan_government
is_allied_to = root
has_any_bad_relationship_with_root_trigger = no
}
alternative_limit = {
has_government = clan_government
is_allied_to = root
}
weight = {
base = 1
opinion_modifier = {
opinion_target = root
}
}
save_scope_as = allied_vassal
}
random_vassal = { #A poor not-allied vassal :(
limit = {
has_government = clan_government
NOT = { is_allied_to = root }
has_friendly_relationship_with_root_trigger = no
}
alternative_limit = {
has_government = clan_government
NOT = { is_allied_to = root }
}
save_scope_as = vassal
}

#What will they request?


hidden_effect = {
random_list = {
10 = { #Help with army
trigger = {
max_military_strength >
scope:vassal.max_military_strength
AND = { #You have a martial councillor that's
at least ok
exists = cp:councillor_marshal
cp:councillor_marshal.martial >
average_skill_level
}
}
save_scope_value_as = {
name = army_1
value = yes
}
cp:councillor_marshal = {
save_scope_as = councillor
}
}
10 = { #Help with prestige
trigger = {
prestige > scope:vassal.prestige
}
save_scope_value_as = {
name = prestige_1
value = yes
}
}
10 = { #Help with diplomacy
trigger = {
diplomacy > scope:vassal.diplomacy
}
save_scope_value_as = {
name = diplomacy_1
value = yes
}
}
10 = { #Help with prowess
trigger = {
prowess > scope:vassal.prowess
}
save_scope_value_as = {
name = prowess_1
value = yes
}
}
}

#Second option if possible


random_list = {
10 = { #Help with army
trigger = {
NOT = { exists = scope:army }
max_military_strength >
scope:vassal.max_military_strength
AND = { #You have a martial councillor that's
at least ok
exists = cp:councillor_marshal
cp:councillor_marshal.martial >
average_skill_level
}
}
save_scope_value_as = {
name = army
value = yes
}
cp:councillor_marshal = {
save_scope_as = councillor
}
}
10 = { #Help with prestige
trigger = {
NOT = { exists = scope:prestige }
prestige > scope:vassal.prestige
}
save_scope_value_as = {
name = prestige
value = yes
}
}
10 = { #Help with diplomacy
trigger = {
NOT = { exists = scope:diplomacy }
NOT = { exists = scope:prowess }
diplomacy > scope:vassal.diplomacy
}
save_scope_value_as = {
name = diplomacy
value = yes
}
}
10 = { #Help with prowess
trigger = {
NOT = { exists = scope:prowess }
NOT = { exists = scope:diplomacy }
prowess > scope:vassal.prowess
}
save_scope_value_as = {
name = prowess
value = yes
}
}
}
}
}

option = { #army
name = clan.1011.army
trigger = {
OR = {
exists = scope:army_1
exists = scope:army
}
}
if = {
limit = {
NOT = { exists = scope:army_1 }
}
custom_tooltip = clan.1011.tt
}
scope:councillor = {
add_character_modifier = {
modifier = focused_on_teaching_martial_modifier
years = 5
}
}
scope:vassal = {
add_character_modifier = {
modifier = trained_troops_modifier
years = 5
}
}
ai_chance = {
base = 50
}
}

option = { #prestige
name = clan.1011.prestige
trigger = {
OR = {
exists = scope:prestige_1
exists = scope:prestige
}
}
if = {
limit = {
NOT = { exists = scope:prestige_1 }
}
custom_tooltip = clan.1011.tt
}
add_prestige = medium_prestige_loss
scope:vassal = {
add_prestige = medium_prestige_gain
}

ai_chance = {
base = 50
}
}

option = { #diplomacy
name = clan.1011.diplomacy
trigger = {
OR = {
exists = scope:diplomacy_1
exists = scope:diplomacy
}
}
if = {
limit = {
NOT = { exists = scope:diplomacy_1 }
}
custom_tooltip = clan.1011.tt
}
scope:vassal = {
add_character_modifier = {
modifier = diplomacy_student_modifier
years = 5
}
}

add_character_modifier = {
modifier = busy_tutoring_modifier
years = 5
}

ai_chance = {
base = 50
}
}

option = { #prowess
name = clan.1011.prowess
trigger = {
OR = {
exists = scope:prowess_1
exists = scope:prowess
}
}
if = {
limit = {
NOT = { exists = scope:prowess_1 }
}
custom_tooltip = clan.1011.tt
}
scope:vassal = {
add_character_modifier = {
modifier = prowess_student_modifier
years = 5
}
}

add_character_modifier = {
modifier = busy_tutoring_modifier
years = 5
}

ai_chance = {
base = 50
}
}

option = { #fallback
name = clan.1011.fallback
trigger = {
NOR = {
exists = scope:army
exists = scope:prestige
exists = scope:diplomacy
}
short_term_gold >= medium_gold_value
}
show_as_unavailable = {
short_term_gold < medium_gold_value
}
remove_short_term_gold = medium_gold_value
scope:vassal = {
add_gold = medium_gold_value
}

ai_chance = {
base = 50
}
}

option = { #nah
name = clan.1011.b
scope:vassal = {
add_opinion = {
target = root
modifier = refusal_opinion
opinion = -30
}
}
ai_chance = {
base = 10
}
}
}

#########################################
# Vassal Resents Nepotism #
# by Sean Hughes #
#########################################

scripted_trigger clan_1101_complaining_vassal = {
clan_1101_nondynastic_vassal = yes
is_available_ai_adult = yes

scripted_trigger clan_1101_nondynastic_vassal = {
has_government = clan_government
NOT = {
dynasty = root.dynasty
}
}

clan.1101 = {
type = character_event
title = clan.1101.t
desc = clan.1101.desc
theme = realm
left_portrait = {
character = scope:vassal
animation = beg
}

trigger = {
has_government = clan_government
any_vassal = {
clan_1101_complaining_vassal = yes
}
any_vassal = {
clan_1101_nondynastic_vassal = yes
percent <= 0.35
}
}

weight_multiplier = {
base = 0.5

modifier = {
any_vassal = {
clan_1101_nondynastic_vassal = yes
percent <= 0.25
}
add = 0.5
}
modifier = {
any_vassal = {
clan_1101_nondynastic_vassal = yes
percent <= 0.15
}
add = 1
}
}

immediate = {
random_vassal = {
limit = {
is_powerful_vassal_of = root
clan_1101_complaining_vassal = yes
}
alternative_limit = {
clan_1101_complaining_vassal = yes
}

weight = {
base = 1

compare_modifier = {
value = highest_held_title_tier
}
ai_value_modifier = {
ai_greed = 0.01 # Between +1 and -1
}
}
save_scope_as = vassal
}
}

# Option A (High Diplomacy): Talk your way out of it.


option = {
trigger = {
diplomacy >= high_skill_rating
}
name = clan.1101.a

skill = diplomacy
scope:vassal = {
add_opinion = {
modifier = pleased_opinion
target = root
opinion = 10
}
}
}

# Option B: Give in to the demands.


option = {
name = clan.1101.b

scope:vassal = {
add_opinion = {
modifier = pleased_opinion
target = root
opinion = 20
}
}

every_vassal_or_below = {
limit = {
dynasty = root.dynasty
}
custom = clan.1101.b.custom

custom_tooltip = clan.1101.b.tt
add_opinion = {
modifier = angry_opinion
target = root
opinion = -10
}
hidden_effect = {
reverse_add_opinion = {
modifier = curtailed_privileges_opinion
target = root
years = 5
}
}
}
}

# Option C: Imprison the uppity vassal.


option = {
name = clan.1101.c

imprison_character_effect = {
IMPRISONER = root
TARGET = scope:vassal
}
}

# Option D: Reject the demands.


option = {
name = clan.1101.d

scope:vassal = {
add_opinion = {
modifier = refusal_opinion
target = root
opinion = -20
}
}
every_vassal_or_below = {
limit = {
clan_1101_nondynastic_vassal = yes
NOT = { THIS = scope:vassal }
}
custom = clan.1101.d.custom

add_opinion = {
modifier = disappointed_opinion
target = root
opinion = -10
}
}
}
}

#########################################
# Culture seeks Representation #
# by Sean Hughes #
#########################################

scripted_trigger clan_1201_has_unrepresented_culture_trigger = {
save_temporary_scope_as = this_county
holder = {
# Ruled by a foreigner
NOT = { culture = scope:this_county.culture }

# Don't even think about poaching land from players!


is_ai = yes
}

# Check to see if the culture of this county is also unrepresented in the


upper eschelons of the sub-realm (no direct vassals of this culture).
root = {
NOT = {
any_vassal = {
culture = scope:this_county.culture

}
}
}
}

clan.1201 = {
type = character_event
title = clan.1201.t
desc = clan.1201.desc
theme = realm
left_portrait = {
character = scope:petitioner
}
right_portrait = {
character = scope:vassal
}
trigger = {
has_government = clan_government

any_sub_realm_county = {
clan_1201_has_unrepresented_culture_trigger = yes
NOT = { this = root.primary_title }
}
}

immediate = {
# Find a county of a culture that has no representation in government.
random_sub_realm_county = {
limit = {
clan_1201_has_unrepresented_culture_trigger = yes
NOT = { this = root.primary_title }
}
save_scope_as = county
culture = { save_scope_as = culture }

# If this county belongs to a duchy that contains multiple


counties of this culture, save the duchy.
if = {
limit = {
exists = duchy
duchy = {
is_title_created = yes
holder = {
is_vassal_of = root
}
}
any_in_de_jure_hierarchy = {
culture = scope:county.culture
percent >= 0.75
}
}
duchy = {
save_scope_as = target_title
holder = {
save_scope_as = vassal
}
every_in_de_jure_hierarchy = {
limit = {
tier = tier_county
culture = scope:county.culture
holder = {
target_is_liege_or_above = root
}
}
add_to_list = target_title_counties
}
}
}
# Otherwise, just save the county.
else = {
save_scope_as = target_title
add_to_list = target_title_counties
holder = {
save_scope_as = vassal
}
}
}

# Generate a petitioner from that county


create_character = {
age = { 25 40 }
gender_female_chance = {
if = {
limit = { root.faith = { has_doctrine =
doctrine_gender_male_dominated } }
add = 0
}
else_if = {
limit = { root.faith = { has_doctrine =
doctrine_gender_female_dominated } }
add = 100
}
else = {
add = 50
}
}
diplomacy = {4 8}
martial = {2 6}
stewardship = {4 8}
intrigue = {2 6}
learning = {4 8}
random_traits_list = {
count = 3
compassionate = {}
gregarious = {}
ambitious = {}
generous = {}
patient = {}
greedy = {}
brave = {}
just = {}
}
random_traits_list = {
count = 1
education_diplomacy_2 = {}
education_diplomacy_3 = {}
education_stewardship_2 = {}
education_stewardship_3 = {}
}
random_traits_list = {
count = 1
physique_good_1 = { weight = { base = 10 } }
intellect_good_1 = { weight = { base = 10 } }
shrewd = { weight = { base = 10 } }
strong = { weight = { base = 10 } }
pilgrim = { weight = { base = 10 } }
reckless = { weight = { base = 20 } }
}
random_traits = yes
location = scope:county.title_province
faith = scope:county.faith
culture = scope:county.culture
save_scope_as = petitioner
}
}

# Option A: Grant the petitioner all of the titles.


option = {
trigger = {
any_held_title = {
count >= 2 #Don't give away your only title in the name of
diversity
}
}

name = clan.1201.a

# Assign all titles in the duchy (including the duchy itself) to the
petitioner.
create_title_and_vassal_change = {
type = granted
save_scope_as = change
add_claim_on_loss = yes
}

if = {
limit = {
scope:target_title = {
tier = tier_duchy
}
}
scope:target_title = {
change_title_holder = {
holder = scope:petitioner
change = scope:change
}
holder = {
add_to_list = upset_vassals
}
}
}
every_in_list = {
list = target_title_counties
limit = {
holder = {
target_is_liege_or_above = root
}
}
holder = {
add_to_list = upset_vassals
}
change_title_holder = {
holder = scope:petitioner
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change

# Gain a strong hook against the petitioner.


reverse_add_opinion = {
modifier = grateful_opinion
target = scope:petitioner
opinion = 50
}
add_hook = {
type = loyalty_hook
target = scope:petitioner
}

every_in_list = {
list = upset_vassals

add_opinion = {
modifier = angry_opinion
target = root
opinion = -50
}
}
}

# Option B: Recruit petitioner, grant increased autonomy.


option = {
name = clan.1201.b

add_courtier = scope:petitioner
scope:petitioner = {
add_opinion = {
modifier = pleased_opinion
target = root
opinion = 30
}
}

every_in_list = {
list = target_title_counties
limit = {
holder = {
target_is_liege_or_above = root
}
}
change_county_control = -50
add_county_modifier = {
modifier = peasant_war_lost_county_modifier
years = 10
}
}
}

# Option C: Refuse the petitioner's request.


option = {
name = clan.1201.c
hidden_effect = {
scope:petitioner = {
death = {
death_reason = death_disappearance
}
}
}
}
}

You might also like