Академический Документы
Профессиональный Документы
Культура Документы
#
# Adventurers negotiation
#
# ADV.1-30
#
#########################################
#Mathilda Bjarnehed
namespace = ADV
character_event = {
id = ADV.1
is_triggered_only = yes
hide_window = yes
immediate = {
FROM = { save_event_target_as = raiding_adventurer }
if = {
limit = {
event_target:adventurer_decision_target_override = {
is_alive = yes
}
}
event_target:adventurer_decision_target_override = {
save_event_target_as = raiding_adventurer
}
}
save_event_target_as = adventurer_target
if = {
limit = {
event_target:adventurer_decision_taker_override = {
is_alive = yes
}
}
event_target:adventurer_decision_taker_override = {
save_event_target_as = adventurer_target
}
}
trigger_switch = {
on_trigger = num_of_settlements
7 = { change_variable = { which = price value = 700 } }
6 = { change_variable = { which = price value = 600 } }
5 = { change_variable = { which = price value = 500 } }
4 = { change_variable = { which = price value = 400 } }
3 = { change_variable = { which = price value = 300 } }
2 = { change_variable = { which = price value = 200 } }
1 = { change_variable = { which = price value = 100 } }
}
trigger_switch = {
on_trigger = num_of_empty_holdings
6 = { change_variable = { which = price value = 150 } }
5 = { change_variable = { which = price value = 125 } }
4 = { change_variable = { which = price value = 100 } }
3 = { change_variable = { which = price value = 75 } }
2 = { change_variable = { which = price value = 50 } }
1 = { change_variable = { which = price value = 25 } }
}
#If they can't afford your province, pick a vassal province (also a big
chance to happen even if they can afford it)
random_list = {
80 = {
random_vassal = {
limit = {
any_demesne_province = {
is_capital = no
num_of_settlements = 1
NOT = {
has_province_modifier =
nomad_agitation
}
OR = {
AND = {
event_target:raiding_adventurer = {
is_seafarer = yes }
port = yes
}
event_target:raiding_adventurer =
{ is_seafarer = no }
NOT = { any_demesne_province = { port =
yes } }
}
}
}
random_demesne_province = {
limit = {
is_capital = no
num_of_settlements = 1
NOT = {
has_province_modifier =
nomad_agitation
}
OR = {
AND = {
event_target:raiding_adventurer = {
is_seafarer = yes }
port = yes
}
event_target:raiding_adventurer =
{ is_seafarer = no }
NOT = { any_demesne_province = { port =
yes } }
}
}
trigger_switch = {
on_trigger = num_of_settlements
7 = { change_variable = { which = price value =
400 } }
6 = { change_variable = { which = price value =
350 } }
5 = { change_variable = { which = price value =
300 } }
4 = { change_variable = { which = price value =
250 } }
3 = { change_variable = { which = price value =
200 } }
2 = { change_variable = { which = price value =
150 } }
1 = { change_variable = { which = price value =
100 } }
}
trigger_switch = {
on_trigger = num_of_empty_holdings
6 = { change_variable = { which = price value =
60 } }
5 = { change_variable = { which = price value =
50 } }
4 = { change_variable = { which = price value =
40 } }
3 = { change_variable = { which = price value =
30 } }
2 = { change_variable = { which = price value =
20 } }
1 = { change_variable = { which = price value =
10 } }
}
save_event_target_as = selling_province
}
}
}
20 = {
modifier = {
NOT = { event_target:selling_province = { always = yes } }
factor = 0
}
#Empty, your demesne province is kept as selling_province
}
}
if = {
limit = { event_target:raiding_adventurer = { is_married = no } }
random_child = {
limit = {
OR = {
AND = {
event_target:raiding_adventurer = { is_female =
yes }
is_female = no
}
AND = {
event_target:raiding_adventurer = { is_female =
no }
is_female = yes
}
}
is_adult = yes
is_alive = yes
is_married = no
can_marry = yes
NOT = { is_primary_heir = ROOT }
is_ruler = no
NOR = {
is_dumb_trigger = yes
character_disease_trigger = yes
has_disability_trigger = yes
has_mental_disorder_trigger = yes
trait = homosexual
trait = celibate
trait = ugly
}
OR = {
is_smart_trigger = yes
has_attractive_trait_trigger = yes
has_pleasant_personality_trigger = yes
stewardship = 13
martial = 13
diplomacy = 13
intrigue = 13
learning = 15
}
}
save_event_target_as = marriage_child
}
}
#Ping event
character_event = {
id = ADV.2
hide_window = yes
is_triggered_only = yes
immediate = { FROM = { letter_event = { id = ADV.3 } } }
}
#Negotiation start
letter_event = {
id = ADV.3
border = GFX_event_letter_frame_war
desc = {
trigger = {
event_target:selling_province = { always = yes }
event_target:marriage_child = { always = yes }
}
text = EVTDESC_ADV_3_A
}
desc = {
trigger = {
event_target:selling_province = { always = yes }
NOT = { event_target:marriage_child = { always = yes } }
}
text = EVTDESC_ADV_3_B
}
desc = {
trigger = {
NOT = { event_target:selling_province = { always = yes } }
event_target:marriage_child = { always = yes }
}
text = EVTDESC_ADV_3_C
}
is_triggered_only = yes
hidden_effect = {
event_target:raiding_adventurer = { character_event = { id = ADV.10
days = 5 } }
}
ai_chance = {
factor = 20
modifier = { trait = craven factor = 2 }
modifier = { trait = greedy factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 1500 } } factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 3000 } } factor = 1.5 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 5000 } } factor = 1.5 }
}
}
tooltip = {
prestige = -50
event_target:selling_province = {
owner = {
opinion = {
who = ROOT
modifier = sold_my_province
years = 100
}
}
}
if = {
limit = { any_vassal = { NOT = { any_demesne_province =
{ province = event_target:selling_province } } } }
custom_tooltip = { text = EVTOPTA_ADV_5_tooltip }
}
hidden_effect = {
any_vassal = {
limit = { NOT = { any_demesne_province = { province =
event_target:selling_province } } }
opinion = {
who = ROOT
modifier = sold_vassal_province
years = 5
}
}
}
}
hidden_effect = {
event_target:raiding_adventurer = { character_event = { id = ADV.10
days = 5 } }
}
ai_chance = {
factor = 30
modifier = { trait = craven factor = 2 }
modifier = { trait = greedy factor = 2 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 1500 } } factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 3000 } } factor = 1.5 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 5000 } } factor = 1.5 }
}
}
#Agree to marriage
option = {
trigger = { event_target:marriage_child = { always = yes } }
name = EVTOPTC_ADV_3
custom_tooltip = { text = EVTOPTC_ADV_3_TT }
event_target:marriage_child = {
if = {
limit = { is_female = no }
add_spouse_matrilineal = event_target:raiding_adventurer
}
if = {
limit = { is_female = yes }
add_spouse = event_target:raiding_adventurer
}
}
hidden_effect = {
clr_character_flag = adventurer_unsafe_duchy_war
clr_character_flag = adventurer_safe_duchy_war
clr_character_flag = negotiating_with_adventurer
set_looter_hostility_days = {
who = event_target:raiding_adventurer
days = 0
}
event_target:raiding_adventurer = {
set_looter_hostility_days = {
who = ROOT
days = 0
}
}
}
ai_chance = {
factor = 100
modifier = { trait = craven factor = 2 }
modifier = { is_rival = event_target:marriage_child factor = 2 }
modifier = { is_friend = event_target:marriage_child factor = 0.5 }
modifier = { num_of_children = 5 factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 1500 } } factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 3000 } } factor = 1.5 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 5000 } } factor = 1.5 }
}
}
#No deal
option = {
name = EVTOPTD_ADV_3
custom_tooltip = { text = EVTOPTD_ADV_3_TT }
trigger = {
event_target:adventurer_target = {
NOT = {
has_character_flag = peaceful_negotiation
}
}
}
ai_chance = {
factor = 20
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 1000 } factor = 1.3 }
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 2500 } factor = 1.3 }
modifier = { trait = brave factor = 2 }
modifier = { trait = wroth factor = 1.5 }
modifier = { trait = ambitious factor = 1.5 }
}
}
trigger = {
event_target:adventurer_target = {
has_character_flag = peaceful_negotiation
}
}
clr_character_flag = peaceful_negotiation
ai_chance = {
factor = 20
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 1000 } factor = 1.3 }
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 2500 } factor = 1.3 }
modifier = { trait = brave factor = 2 }
modifier = { trait = wroth factor = 1.5 }
modifier = { trait = ambitious factor = 1.5 }
}
}
}
if = {
limit = {
NOT = { check_variable = { which = adventurer_treasury
value = 0 } }
}
log = "Adventurer [This.GetBestName]([This.GetID]) is forced to
haggle since [This.GetSheHe] can't afford the province."
}
random_list = {
50 = { #Deal
trigger = { check_variable = { which = adventurer_treasury
value = 0 } }
modifier = { NOT = { stewardship = 8 } factor = 2 }
modifier = { age = 50 factor = 2 }
modifier = { trait = craven factor = 2 }
modifier = { trait = content factor = 2 }
modifier = { trait = charitable factor = 2 }
modifier = { trait = just factor = 2 }
event_target:adventurer_target = { letter_event = { id =
ADV.4 } }
break = yes
}
50 = { #Haggle
modifier = { stewardship = 14 factor = 2 }
modifier = { trait = greedy factor = 2 }
modifier = { trait = ambitious factor = 2 }
modifier = { trait = arbitrary factor = 2 }
if = {
limit = { check_variable = { which =
adventurer_treasury value = 0 } }
set_variable = { which = province_offer value = 0 }
change_variable = { which = province_offer which =
haggle_price which = event_target:selling_province }
set_character_flag = haggle_price
}
if = {
limit = {
NOT = { check_variable = { which =
adventurer_treasury value = 0 } }
NOT = {
wealth = 100
}
}
set_character_flag = no_haggling
log = "[This.GetBestName]([This.GetID]) can't even
afford the reduced haggle price."
}
if = {
limit = {
NOT = { check_variable = { which =
adventurer_treasury value = 0 } }
wealth = 100
}
set_variable = { which = province_offer value = 0 }
export_to_variable = { which = province_offer value =
treasury }
set_character_flag = haggle_price
log = "[This.GetBestName]([This.GetID]) can't even
afford the reduced haggle price - they are offering what they have instead."
}
event_target:adventurer_target = { letter_event = { id =
ADV.5 } }
}
}
}
}
is_triggered_only = yes
immediate = {
hidden_effect = {
set_variable = { which = transfer_money value = 0 }
change_variable = { which = transfer_money which = price which =
event_target:selling_province }
event_target:raiding_adventurer = {
set_variable = { which = transfer_money value = 0 }
change_variable = { which = transfer_money which = price which =
event_target:selling_province }
multiply_variable = { which = transfer_money value = -1 }
}
}
}
option = {
name = EVTOPTA_ADV_4
hidden_effect = {
event_target:raiding_adventurer = {
wealth = transfer_money
clr_character_flag = raiding_adventurer #flag set in
hl_raiding_adventurers_events.txt
}
#Non-Aggression Pact
opinion = {
modifier = in_non_aggression_pact
years = 3
who = FROM
origin_description = EVTTITLE_ADV_4
}
FROM = {
opinion = {
modifier = in_non_aggression_pact
years = 3
who = ROOT
origin_description = EVTTITLE_ADV_4
}
}
}
prestige = -50
event_target:selling_province = {
owner = {
opinion = {
who = ROOT
modifier = sold_my_province
years = 100
}
}
}
if = {
limit = { any_vassal = { NOT = { any_demesne_province =
{ province = event_target:selling_province } } } }
custom_tooltip = { text = EVTOPTA_ADV_5_tooltip }
}
hidden_effect = {
any_vassal = {
limit = { NOT = { any_demesne_province = { province =
event_target:selling_province } } }
opinion = {
who = ROOT
modifier = sold_vassal_province
years = 5
}
}
}
}
#Government switch
if = {
limit = {
event_target:raiding_adventurer = { is_nomadic = yes }
is_nomadic = no
}
event_target:raiding_adventurer = {
if = {
limit = {
religion_group = muslim
}
set_government_type = muslim_government
}
else_if = {
limit = {
culture_group = tibetan_group
OR = {
religion = bon
religion = buddhist
religion = tibetan_pagan
}
}
set_government_type = theocratic_feudal_government
}
else = {
set_government_type = feudal_government
}
}
}
after = {
clr_character_flag = adventurer_unsafe_duchy_war
clr_character_flag = adventurer_safe_duchy_war
clr_character_flag = negotiating_with_adventurer
}
}
is_triggered_only = yes
immediate = {
#Calculates your gain before option so tooltips are correct
hidden_effect = {
set_variable = { which = transfer_money value = 0 }
change_variable = { which = transfer_money which = province_offer which
= event_target:raiding_adventurer }
}
}
#Accept
option = {
name = EVTOPTA_ADV_5
hidden_effect = {
if = {
limit = { FROM = { has_character_flag = haggle_price } }
event_target:raiding_adventurer = {
multiply_variable = { which = province_offer value = -1 }
wealth = province_offer
clr_character_flag = raiding_adventurer #flag set in
hl_raiding_adventurers_events.txt
}
}
#Non-Aggression Pact
opinion = {
modifier = in_non_aggression_pact
years = 3
who = FROM
origin_description = EVTTITLE_ADV_4
}
FROM = {
opinion = {
modifier = in_non_aggression_pact
years = 3
who = ROOT
origin_description = EVTTITLE_ADV_4
}
}
}
prestige = -50
event_target:selling_province = {
owner = {
opinion = {
who = ROOT
modifier = sold_my_province
years = 100
}
}
}
if = {
limit = { any_vassal = { NOT = { any_demesne_province =
{ province = event_target:selling_province } } } }
custom_tooltip = { text = EVTOPTA_ADV_5_tooltip }
}
hidden_effect = {
any_vassal = {
limit = { NOT = { any_demesne_province = { province =
event_target:selling_province } } }
opinion = {
who = ROOT
modifier = sold_vassal_province
years = 5
}
}
}
}
#Government switch
if = {
limit = {
event_target:raiding_adventurer = { is_nomadic = yes }
is_nomadic = no
}
event_target:raiding_adventurer = {
if = {
limit = {
religion_group = muslim
}
set_government_type = muslim_government
}
else_if = {
limit = {
culture_group = tibetan_group
OR = {
religion = bon
religion = buddhist
religion = tibetan_pagan
}
}
set_government_type = theocratic_feudal_government
}
else = {
set_government_type = feudal_government
}
}
}
ai_chance = {
factor = 50
modifier = { trait = craven factor = 2 }
modifier = { trait = greedy factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 1500 } } factor = 1.3 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 3000 } } factor = 1.5 }
modifier = { event_target:raiding_adventurer = { realm_levy_diff =
{ who = ROOT value = 5000 } } factor = 1.5 }
}
}
#Decline
option = {
name = EVTOPTD_ADV_5
custom_tooltip = { text = EVTOPTD_ADV_3_TT }
trigger = {
event_target:adventurer_target = {
NOT = {
has_character_flag = peaceful_negotiation
}
}
}
ai_chance = {
factor = 50
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 1000 } factor = 1.3 }
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 2500 } factor = 1.3 }
modifier = { trait = brave factor = 2 }
modifier = { trait = wroth factor = 1.5 }
modifier = { trait = ambitious factor = 1.5 }
modifier = { event_target:raiding_adventurer = { NOT =
{ has_character_flag = haggle_price } } factor = 5 }
modifier = { event_target:selling_province = { holder_scope =
{ character = ROOT } } factor = 1.5 }
}
}
#Decline - peaceful
option = {
name = EVTOPTE_ADV_5
custom_tooltip = { text = EVTOPTE_ADV_3_TT }
trigger = {
event_target:adventurer_target = {
has_character_flag = peaceful_negotiation
}
}
clr_character_flag = peaceful_negotiation
ai_chance = {
factor = 50
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 1000 } factor = 1.3 }
modifier = { realm_levy_diff = { who = event_target:raiding_adventurer
value = 2500 } factor = 1.3 }
modifier = { trait = brave factor = 2 }
modifier = { trait = wroth factor = 1.5 }
modifier = { trait = ambitious factor = 1.5 }
modifier = { event_target:raiding_adventurer = { NOT =
{ has_character_flag = haggle_price } } factor = 5 }
modifier = { event_target:selling_province = { holder_scope =
{ character = ROOT } } factor = 1.5 }
}
}
after = {
hidden_effect = {
clr_character_flag = adventurer_unsafe_duchy_war
clr_character_flag = adventurer_safe_duchy_war
clr_character_flag = negotiating_with_adventurer
event_target:raiding_adventurer = { clr_character_flag =
haggle_price }
}
}
}
immediate = {
random_list = {
80 = {
modifier = { trait = cynical factor = 5 }
modifier = { trait = content factor = 5 }
modifier = { trait = craven factor = 5 }
liege = {
ROOT = { religion = PREV }
character_event = { id = ADV.21 days = 7 }
}
any_courtier = {
limit = { is_landed = no }
religion = ROOT
}
}
20 = {
modifier = { trait = zealous factor = 5 }
#Does not convert
}
}
}
}
is_triggered_only = yes
option = {
name = EXCELLENT
}
}
# immediate = {
# random_list = {
# 10 = {
# wealth = 300
# }
# 10 = {
# wealth = 400
# }
# 10 = {
# wealth = 500
# }
# 10 = {
# wealth = 60
# }
# 10 = {
# wealth = 70
# }
# 10 = {
# wealth = 250
# }
# 10 = {
# wealth = 300
# }
# 10 = {
# wealth = 150
# }
# }
# random_independent_ruler = {
# limit = {
# NOT = { has_character_flag = negotiating_with_adventurer }
# ai = no
#
# }
# character_event = {
# id = ADV.1
# }
# }
# }
#}