Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mindryu/4e279d1971fea827bf5544395232c721 to your computer and use it in GitHub Desktop.
Save mindryu/4e279d1971fea827bf5544395232c721 to your computer and use it in GitHub Desktop.
zz_fix_holy_order_events
namespace = holy_order
scripted_effect change_holder_before_lease_out = {
if = {
limit = { NOT = { $TARGET$.holder = root } }
create_title_and_vassal_change = {
type = leased_out
save_scope_as = change
add_claim_on_loss = no
}
$TARGET$ = {
change_title_holder_include_vassals = {
holder = root
change = scope:change
}
}
resolve_title_and_vassal_change = scope:change
}
}
holy_order.0203 = {
type = letter_event
opening = {
desc = char_interaction.0001.opening
}
desc = holy_order.0203.desc
sender = scope:recipient
trigger = {
has_character_flag = borrow_from_holy_order
any_held_title = {
tier = tier_barony
barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root }
}
}
on_trigger_fail = { #If no available children exists now
if = {
limit = {
has_character_flag = borrow_from_holy_order
any_child = {
holy_order_request_child_trigger = yes
}
}
trigger_event = holy_order.0204
}
else = { #No options left at all
trigger_event = holy_order.0205
}
}
immediate = {
random_held_title = {
limit = {
tier = tier_barony
barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root }
}
save_scope_as = province
}
}
option = {
name = holy_order.0203.a
custom_tooltip = holy_order.0204.a.tt
remove_character_flag = borrow_from_holy_order
### Fix
change_holder_before_lease_out = { TARGET = scope:province }
scope:province = {
lease_out_to = scope:holy_order
}
}
option = { #refuse
name = holy_order.0203.b
scope:recipient.faith.religious_head = {
add_opinion = {
modifier = not_repay_loan_opinion
target = root
}
}
scope:recipient = {
add_opinion = {
modifier = not_repay_loan_opinion
target = root
}
}
if = { #are we still of the same faith?
limit = {
scope:recipient.faith = root.faith
}
add_piety_level = -1
remove_character_flag = borrow_from_holy_order
}
}
}
holy_order.1001 = {
type = letter_event
opening = {
desc = holy_order_letter.opening
}
desc = {
desc = holy_order.1001.intro
desc = holy_order.1001.end
}
sender = scope:grandmaster
immediate = {
save_scope_as = ruler
add_character_flag = {
flag = holy_order_recently_requested_land
years = 3
}
if = {
limit = {
any_sub_realm_barony = {
holy_order_1001_alternative_barony_trigger = yes
holy_order_barony_value_calculation <= scope:target_barony.holy_order_barony_value_calculation
}
}
random_sub_realm_barony = {
limit = {
holy_order_1001_alternative_barony_trigger = yes
holy_order_barony_value_calculation < scope:target_barony.holy_order_barony_value_calculation
}
alternative_limit = {
holy_order_1001_alternative_barony_trigger = yes
holy_order_barony_value_calculation < scope:target_barony.holy_order_barony_value_calculation
}
save_scope_as = alternative_barony
}
}
}
option = {
name = holy_order.1001.a
add_gold = scope:target_barony.holy_order_barony_value_calculation
### Fix
change_holder_before_lease_out = { TARGET = scope:target_barony }
scope:target_barony = {
lease_out_to = scope:holy_order
}
scope:grandmaster = {
add_opinion = {
target = root
modifier = grateful_opinion
opinion = 25
}
}
hidden_effect = {
scope:holy_order.title = {
set_variable = {
name = received_new_land
value = yes
years = 3
}
}
add_character_flag = {
flag = holy_order_recently_received_land
years = 10
}
}
ai_chance = {
base = 100
ai_value_modifier = {
ai_greed = -1
ai_zeal = 1
}
}
}
option = {
name = holy_order.1001.b
trigger = {
exists = scope:alternative_barony
}
add_gold = scope:alternative_barony.holy_order_barony_value_calculation
### Fix
change_holder_before_lease_out = { TARGET = scope:alternative_barony }
scope:alternative_barony = {
lease_out_to = scope:holy_order
}
scope:grandmaster = {
add_opinion = {
target = root
modifier = grateful_opinion
opinion = 20
}
}
hidden_effect = {
scope:holy_order.title = {
set_variable = {
name = received_new_land
value = yes
years = 3
}
}
add_character_flag = {
flag = holy_order_recently_received_land
years = 10
}
}
ai_chance = {
base = 100
ai_value_modifier = {
ai_greed = -0.8
ai_zeal = 0.5
}
}
}
option = {
name = holy_order.1001.c
scope:grandmaster = {
add_opinion = {
target = root
modifier = disappointed_opinion
opinion = -10
}
}
ai_chance = {
base = 100
opinion_modifier = {
opinion_target = scope:grandmaster
multiplier = -0.9
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment