From 227466a9e929b547180f25ceb254cdc0f1cea2cd Mon Sep 17 00:00:00 2001 From: trashmasteruni Date: Sat, 10 Oct 2026 19:37:00 +0200 Subject: [PATCH] scripted effects fixed somewhat --- .../scripted_effects/00_building_effects.txt | 2978 ---- .../scripted_effects/00_decisions_effects.txt | 3788 ---- .../00_ep1_artifact_effects.txt | 672 - .../scripted_effects/00_faction_effects.txt | 2146 --- .../00_major_decisions_scripted_effects.txt | 5016 ------ .../scripted_effects/00_nickname_effects.txt | 69 +- .../06_dlc_ce1_legend_effects.txt | 46 +- .../07_dlc_ep3_scripted_effects.txt | 2310 +-- .../NEOW_major_decisions_scripted_effects.txt | 1149 ++ common/scripted_effects/pam_effects.txt | 14582 ---------------- .../tgp_debate_scripted_effects.txt | 709 - ..._imperial_examination_scripted_effects.txt | 2012 --- .../tgp_mandala_scripted_effects.txt | 3777 ---- .../tgp_tribute_mission_scripted_effects.txt | 678 - 14 files changed, 2057 insertions(+), 37875 deletions(-) delete mode 100644 common/scripted_effects/00_building_effects.txt delete mode 100644 common/scripted_effects/00_decisions_effects.txt delete mode 100644 common/scripted_effects/00_ep1_artifact_effects.txt delete mode 100644 common/scripted_effects/00_faction_effects.txt delete mode 100644 common/scripted_effects/00_major_decisions_scripted_effects.txt create mode 100644 common/scripted_effects/NEOW_major_decisions_scripted_effects.txt delete mode 100644 common/scripted_effects/pam_effects.txt delete mode 100644 common/scripted_effects/tgp_debate_scripted_effects.txt delete mode 100644 common/scripted_effects/tgp_imperial_examination_scripted_effects.txt delete mode 100644 common/scripted_effects/tgp_mandala_scripted_effects.txt delete mode 100644 common/scripted_effects/tgp_tribute_mission_scripted_effects.txt diff --git a/common/scripted_effects/00_building_effects.txt b/common/scripted_effects/00_building_effects.txt deleted file mode 100644 index b83464e96..000000000 --- a/common/scripted_effects/00_building_effects.txt +++ /dev/null @@ -1,2978 +0,0 @@ -##################################################################### -# EFFECT LIST -##################################################################### -# !!! Remember to add all new effects with a short description here !!! - -#add_next_building_tier_effect -#add_random_building_effect -#add_random_building_variable_effect - -##################################################################### -# EFFECTS -##################################################################### - -# Builds or upgrades the specified building, e.g. outposts -add_next_building_tier_effect = { - if = { - limit = { - NOT = { has_building_or_higher = $BUILDING$_01 } - } - add_building = $BUILDING$_01 - } - else_if = { - limit = { has_building = $BUILDING$_01 } - add_building = $BUILDING$_02 - } - else_if = { - limit = { has_building = $BUILDING$_02 } - add_building = $BUILDING$_03 - } - else_if = { - limit = { has_building = $BUILDING$_03 } - add_building = $BUILDING$_04 - } - else_if = { - limit = { has_building = $BUILDING$_04 } - add_building = $BUILDING$_05 - } - else_if = { - limit = { has_building = $BUILDING$_05 } - add_building = $BUILDING$_06 - } - else_if = { - limit = { has_building = $BUILDING$_06 } - add_building = $BUILDING$_07 - } - else_if = { - limit = { has_building = $BUILDING$_07 } - add_building = $BUILDING$_08 - } -} - -#### Create Random Building - 2 Part Effect #### - -# creates a random building in a holding, limited by innovations and holding level, and weighted to cheapest/lowest level, excludes tribal holdings/buildings, only for use in castle/church/city baronies - -# ensure the event/script where this is used checks that a building can be built, based on innovations and holding level, as if noe can be built this effect will do absolutely nada - -# 1, sets variable based on fitness of possible buildings -add_random_building_variable_effect = { # Province scope - province_owner = { save_scope_as = build_owner } - province_owner = { save_scope_as = holder } #Since building requirements reference scope:holder. - random_list = { # Which building? - # Generic/Terrain - 10 = { # outposts : Cheap - trigger = { - add_random_building_trigger = { BUILDING = outposts } # Generic eligiblity - generic_recruitment_building_innovations_trigger = { BUILDING = outposts } - } - set_variable = { - name = random_building_variable - value = 0 - days = 365 - } - } - 10 = { # logging_camps : Cheap - trigger = { - add_random_building_trigger = { BUILDING = logging_camps } - generic_economic_building_innovation_trigger = { BUILDING = logging_camps } - } - set_variable = { - name = random_building_variable - value = 1 - days = 365 - } - } - 10 = { # peat_quarries : Cheap - trigger = { - add_random_building_trigger = { BUILDING = peat_quarries } - generic_economic_building_innovation_trigger = { BUILDING = peat_quarries } - } - set_variable = { - name = random_building_variable - value = 2 - days = 365 - } - } - 10 = { # hill_forts : Cheap - trigger = { - add_random_building_trigger = { BUILDING = hill_forts } - generic_fortification_building_innovations_trigger = { BUILDING = hill_forts } - } - set_variable = { - name = random_building_variable - value = 3 - days = 365 - } - } - 10 = { # plantations : Cheap - trigger = { - add_random_building_trigger = { BUILDING = plantations } - generic_economic_building_innovation_trigger = { BUILDING = plantations } - } - set_variable = { - name = random_building_variable - value = 4 - days = 365 - } - } - 10 = { # quarries : Cheap - trigger = { - add_random_building_trigger = { BUILDING = quarries } - generic_economic_building_innovation_trigger = { BUILDING = quarries } - } - set_variable = { - name = random_building_variable - value = 5 - days = 365 - } - } - 10 = { # hunting_grounds : Cheap - trigger = { - add_random_building_trigger = { BUILDING = hunting_grounds } - generic_economic_building_innovation_trigger = { BUILDING = hunting_grounds } - } - set_variable = { - name = random_building_variable - value = 6 - days = 365 - } - } - 10 = { # military_camps : Cheap - trigger = { - add_random_building_trigger = { BUILDING = military_camps } - generic_recruitment_building_innovations_trigger = { BUILDING = military_camps } - } - set_variable = { - name = random_building_variable - value = 7 - days = 365 - } - } - 10 = { # horse_pastures : Cheap - trigger = { - add_random_building_trigger = { BUILDING = horse_pastures } - generic_recruitment_building_innovations_trigger = { BUILDING = horse_pastures } - } - set_variable = { - name = random_building_variable - value = 8 - days = 365 - } - } - 10 = { # hillside_grazing : Cheap - trigger = { - add_random_building_trigger = { BUILDING = hillside_grazing } - generic_recruitment_building_innovations_trigger = { BUILDING = hillside_grazing } - } - set_variable = { - name = random_building_variable - value = 9 - days = 365 - } - } - 10 = { # warrior_lodges : Cheap - trigger = { - add_random_building_trigger = { BUILDING = warrior_lodges } - generic_recruitment_building_innovations_trigger = { BUILDING = warrior_lodges } - } - set_variable = { - name = random_building_variable - value = 10 - days = 365 - } - } - 2 = { # pastures : Normal - trigger = { - add_random_building_trigger = { BUILDING = pastures } - generic_economic_building_innovation_trigger = { BUILDING = pastures } - } - set_variable = { - name = random_building_variable - value = 11 - days = 365 - } - } - 2 = { # ramparts : Normal - trigger = { - add_random_building_trigger = { BUILDING = ramparts } - generic_fortification_building_innovations_trigger = { BUILDING = ramparts } - } - set_variable = { - name = random_building_variable - value = 12 - days = 365 - } - } - 2 = { # curtain_walls : Normal - trigger = { - add_random_building_trigger = { BUILDING = curtain_walls } - generic_fortification_building_innovations_trigger = { BUILDING = curtain_walls } - } - set_variable = { - name = random_building_variable - value = 13 - days = 365 - } - } - 2 = { # watchtowers : Normal - trigger = { - add_random_building_trigger = { BUILDING = watchtowers } - generic_fortification_building_innovations_trigger = { BUILDING = watchtowers } - } - set_variable = { - name = random_building_variable - value = 14 - days = 365 - } - } - 2 = { # cereal_fields : Normal - trigger = { - add_random_building_trigger = { BUILDING = cereal_fields } - generic_economic_building_innovation_trigger = { BUILDING = cereal_fields } - } - set_variable = { - name = random_building_variable - value = 15 - days = 365 - } - } - 2 = { # barracks : Normal - trigger = { - add_random_building_trigger = { BUILDING = barracks } - generic_recruitment_building_innovations_trigger = { BUILDING = barracks } - } - set_variable = { - name = random_building_variable - value = 16 - days = 365 - } - } - 2 = { # camel_farms : Normal - trigger = { - add_random_building_trigger = { BUILDING = camel_farms } - generic_recruitment_building_innovations_trigger = { BUILDING = camel_farms } - } - set_variable = { - name = random_building_variable - value = 17 - days = 365 - } - } - 2 = { # hill_farms : Normal - trigger = { - add_random_building_trigger = { BUILDING = hill_farms } - generic_economic_building_innovation_trigger = { BUILDING = hill_farms } - } - set_variable = { - name = random_building_variable - value = 18 - days = 365 - } - } - 2 = { # elephant_pens : Normal - trigger = { - add_random_building_trigger = { BUILDING = elephant_pens } - generic_economic_building_innovation_trigger = { BUILDING = elephant_pens } - } - set_variable = { - name = random_building_variable - value = 19 - days = 365 - } - } - 2 = { # common_tradeport : Normal - trigger = { - add_random_building_trigger = { BUILDING = common_tradeport } - # Innovation triggers - trigger_if = { - limit = { has_building_or_higher = common_tradeport_01 } - scope:build_owner.culture = { - OR = { - has_innovation = innovation_crop_rotation - has_cultural_parameter = next_level_trade_ports - } - } - } - trigger_if = { - limit = { has_building_or_higher = common_tradeport_02 } - building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture = { - OR = { - has_innovation = innovation_manorialism - AND = { - has_innovation = innovation_crop_rotation - has_cultural_parameter = next_level_trade_ports - } - } - } - } - trigger_if = { - limit = { has_building_or_higher = common_tradeport_04 } - building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture = { - OR = { - has_innovation = innovation_windmills - AND = { - has_innovation = innovation_manorialism - has_cultural_parameter = next_level_trade_ports - } - } - } - } - trigger_if = { - limit = { has_building_or_higher = common_tradeport_06 } - building_requirement_castle_city_church = { LEVEL = 04 } - scope:build_owner.culture = { - OR = { - has_innovation = innovation_cranes - AND = { - has_innovation = innovation_windmills - has_cultural_parameter = next_level_trade_ports - } - } - } - } - } - set_variable = { - name = random_building_variable - value = 20 - days = 365 - } - } - 2 = { # hospices : Normal - trigger = { - add_random_building_trigger = { BUILDING = hospices } - generic_economic_building_innovation_trigger = { BUILDING = hospices } - } - set_variable = { - name = random_building_variable - value = 21 - days = 365 - } - } - 2 = { # qanats : Normal - trigger = { - add_random_building_trigger = { BUILDING = qanats } - building_requirement_castle_city_church = { LEVEL = 01 } - trigger_if = { - limit = { - NOT = { - has_building_or_higher = qanats_01 - } - } - scope:build_owner.culture = { - has_cultural_parameter = unlocks_qanat_building - } - } - trigger_if = { - limit = { - has_building_or_higher = qanats_02 - } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { - has_building_or_higher = qanats_04 - } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { - has_building_or_higher = qanats_06 - } - building_requirement_castle_city_church = { LEVEL = 04 } - } - } - set_variable = { - name = random_building_variable - value = 22 - days = 365 - } - } - 2 = { # murex_farm : Normal - trigger = { - add_random_building_trigger = { BUILDING = murex_farm } - building_requirement_castle_city_church = { LEVEL = 01 } - county = { NOT = { has_county_modifier = backwater_county_modifier } } - trigger_if = { - limit = { - has_building_or_higher = murex_farm_02 - } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { - has_building_or_higher = murex_farm_04 - } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { - has_building_or_higher = murex_farm_06 - } - building_requirement_castle_city_church = { LEVEL = 03 } - } - } - set_variable = { - name = random_building_variable - value = 23 - days = 365 - } - } - 2 = { # wind_furnace : Normal - trigger = { - add_random_building_trigger = { BUILDING = wind_furnace } - building_requirement_castle_city_church = { LEVEL = 01 } - trigger_if = { - limit = { - has_building_or_higher = wind_furnace_01 - } - scope:build_owner.culture = { - has_innovation = innovation_barracks - } - } - trigger_if = { - limit = { - has_building_or_higher = wind_furnace_02 - } - building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture = { - has_innovation = innovation_burhs - } - } - trigger_if = { - limit = { - has_building_or_higher = wind_furnace_04 - } - building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture = { - has_innovation = innovation_castle_baileys - } - } - trigger_if = { - limit = { - has_building_or_higher = wind_furnace_05 - } - scope:build_owner.culture = { - has_innovation = innovation_royal_armory - } - } - trigger_if = { - limit = { - has_building_or_higher = wind_furnace_06 - } - building_requirement_castle_city_church = { LEVEL = 04 } - } - } - set_variable = { - name = random_building_variable - value = 24 - days = 365 - } - } - 2 = { # stables : Normal - trigger = { - add_random_building_trigger = { BUILDING = stables } - generic_recruitment_building_innovations_trigger = { BUILDING = stables } - } - set_variable = { - name = random_building_variable - value = 25 - days = 365 - } - } - 2 = { # smiths : Normal - trigger = { - add_random_building_trigger = { BUILDING = smiths } - generic_recruitment_building_innovations_trigger = { BUILDING = smiths } - } - set_variable = { - name = random_building_variable - value = 26 - days = 365 - } - } - 1 = { # orchards : Expensive - trigger = { - add_random_building_trigger = { BUILDING = orchards } - generic_economic_building_innovation_trigger = { BUILDING = orchards } - } - set_variable = { - name = random_building_variable - value = 27 - days = 365 - } - } - 1 = { # farm_estates : Expensive - trigger = { - add_random_building_trigger = { BUILDING = farm_estates } - generic_economic_building_innovation_trigger = { BUILDING = farm_estates } - } - set_variable = { - name = random_building_variable - value = 28 - days = 365 - } - } - 1 = { # regimental_grounds : Expensive - trigger = { - add_random_building_trigger = { BUILDING = regimental_grounds } - generic_recruitment_building_innovations_trigger = { BUILDING = regimental_grounds } - } - set_variable = { - name = random_building_variable - value = 29 - days = 365 - } - } - 1 = { # caravanserai : Expensive - trigger = { - is_county_capital = yes - building_caravanserai_requirement_terrain = yes - scope:build_owner.culture = { - has_innovation = innovation_guilds - } - building_requirement_castle_city_church = { LEVEL = 01 } - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = caravanserai_01 - } - trigger_if = { - limit = { has_building_or_higher = caravanserai_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = caravanserai } - } - } - # City level triggers - trigger_if = { - limit = { has_building_or_higher = caravanserai_02 } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { has_building_or_higher = caravanserai_04 } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { has_building_or_higher = caravanserai_05 } - scope:build_owner.culture = { has_innovation = innovation_cranes } - } - trigger_if = { - limit = { has_building_or_higher = caravanserai_06 } - building_requirement_castle_city_church = { LEVEL = 04 } - } - } - set_variable = { - name = random_building_variable - value = 30 - days = 365 - } - } - 1 = { # watermills : Expensive - trigger = { - is_county_capital = yes - building_watermills_requirement_terrain = yes - scope:build_owner.culture = { - has_innovation = innovation_windmills - } - building_requirement_castle_city_church = { LEVEL = 01 } - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = watermills_01 - } - trigger_if = { - limit = { has_building_or_higher = watermills_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = watermills } - } - } - # City level triggers - trigger_if = { - limit = { has_building_or_higher = watermills_02 } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { has_building_or_higher = watermills_04 } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { has_building_or_higher = watermills_05 } - scope:build_owner.culture = { has_innovation = innovation_cranes } - } - trigger_if = { - limit = { has_building_or_higher = watermills_06 } - building_requirement_castle_city_church = { LEVEL = 04 } - } - } - set_variable = { - name = random_building_variable - value = 31 - days = 365 - } - } - 1 = { # windmills : Expensive - trigger = { - is_county_capital = yes - building_windmills_requirement_terrain = yes - scope:build_owner.culture = { - has_innovation = innovation_windmills - } - building_requirement_castle_city_church = { LEVEL = 01 } - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = windmills_01 - } - trigger_if = { - limit = { has_building_or_higher = windmills_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = windmills } - } - } - # City level triggers - trigger_if = { - limit = { has_building_or_higher = windmills_02 } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { has_building_or_higher = windmills_04 } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { has_building_or_higher = windmills_05 } - scope:build_owner.culture = { has_innovation = innovation_cranes } - } - trigger_if = { - limit = { has_building_or_higher = windmills_06 } - building_requirement_castle_city_church = { LEVEL = 04 } - } - } - set_variable = { - name = random_building_variable - value = 32 - days = 365 - } - } - 1 = { # workshops : Expensive - trigger = { - add_random_building_trigger = { BUILDING = workshops } - building_requirement_castle_city_church = { LEVEL = 01 } - scope:build_owner.culture = { - has_innovation = innovation_advanced_bowmaking - } - trigger_if = { - limit = { - has_building_or_higher = workshops_02 - } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { - has_building_or_higher = workshops_04 - } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { - has_building_or_higher = workshops_05 - } - scope:build_owner.culture = { - has_innovation = innovation_royal_armory - } - } - trigger_if = { - limit = { - has_building_or_higher = workshops_06 - } - building_requirement_castle_city_church = { LEVEL = 04 } - } - } - set_variable = { - name = random_building_variable - value = 33 - days = 365 - } - } - # Holding Type Specific : Normal - 10 = { # monastic_schools : Normal - trigger = { - has_holding_type = church_holding - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = monastic_schools_01 - } - trigger_if = { - limit = { has_building_or_higher = monastic_schools_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = monastic_schools } - } - } - # Innovation triggers - trigger_if = { - limit = { has_building_or_higher = monastic_schools_01 } - scope:build_owner.culture = { has_innovation = innovation_city_planning } - } - trigger_if = { - limit = { has_building_or_higher = monastic_schools_02 } - building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture = { has_innovation = innovation_manorialism } - } - trigger_if = { - limit = { has_building_or_higher = monastic_schools_04 } - building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture = { has_innovation = innovation_windmills } - } - trigger_if = { - limit = { has_building_or_higher = monastic_schools_06 } - building_requirement_castle_city_church = { LEVEL = 04 } - scope:build_owner.culture = { has_innovation = innovation_cranes } - } - } - set_variable = { - name = random_building_variable - value = 34 - days = 365 - } - } - 10 = { # guild_halls : Normal - trigger = { - has_holding_type = city_holding - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = guild_halls_01 - } - trigger_if = { - limit = { has_building_or_higher = guild_halls_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = guild_halls } - } - } - # Innovation triggers - trigger_if = { - limit = { has_building_or_higher = guild_halls_01 } - scope:build_owner.culture = { - OR = { - has_innovation = innovation_crop_rotation - has_cultural_parameter = next_level_guild_halls - } - } - } - trigger_if = { - limit = { has_building_or_higher = guild_halls_02 } - OR = { - AND = { - building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture = { - has_innovation = innovation_manorialism - } - } - scope:build_owner.culture = { - has_cultural_parameter = next_level_guild_halls - has_innovation = innovation_crop_rotation - } - } - } - trigger_if = { - limit = { has_building_or_higher = guild_halls_04 } - OR = { - AND = { - building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture = { - has_innovation = innovation_guilds - } - } - AND = { - building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture = { - has_cultural_parameter = next_level_guild_halls - has_innovation = innovation_manorialism - } - } - } - } - trigger_if = { - limit = { has_building_or_higher = guild_halls_06 } - OR = { - AND = { - building_requirement_castle_city_church = { LEVEL = 04 } - scope:build_owner.culture = { - has_innovation = innovation_cranes - } - } - AND = { - building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture = { - has_cultural_parameter = next_level_guild_halls - has_innovation = innovation_guilds - } - } - } - } - } - set_variable = { - name = random_building_variable - value = 35 - days = 365 - } - } - 10 = { # scriptorium : Normal - trigger = { - has_holding_type = church_holding - scope:build_owner = { - has_dlc_feature = legends - } - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = scriptorium_01 - } - trigger_if = { - limit = { has_building_or_higher = scriptorium_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = scriptorium } - } - } - generic_economic_building_innovation_trigger = { BUILDING = scriptorium } - } - set_variable = { - name = random_building_variable - value = 36 - days = 365 - } - } - 10 = { # megalith : Normal - trigger = { - has_holding_type = church_holding - scope:build_owner.faith = { - has_doctrine_parameter = can_build_megaliths - } - trigger_if = { # if all slots are full, this building type exists already - limit = { free_building_slots = 0 } - has_building_or_higher = megalith_01 - } - trigger_if = { - limit = { has_building_or_higher = megalith_01 } - NOT = { - has_lesser_building_trigger = { COMPARE = megalith } - } - } - trigger_if = { - limit = { has_building_or_higher = megalith_02 } - scope:build_owner.culture = { - has_innovation = innovation_city_planning - } - } - trigger_if = { - limit = { has_building_or_higher = megalith_03 } - building_requirement_castle_city_church = { LEVEL = 02 } - } - } - set_variable = { - name = random_building_variable - value = 37 - days = 365 - } - } - 2 = { # waterworks : Normal - trigger = { - add_random_building_trigger = { BUILDING = waterworks } - building_requirement_castle_city_church = { LEVEL = 01 } - county = { NOT = { has_county_modifier = backwater_county_modifier } } - trigger_if = { - limit = { - has_building_or_higher = waterworks_02 - } - building_requirement_castle_city_church = { LEVEL = 02 } - } - trigger_if = { - limit = { - has_building_or_higher = waterworks_04 - } - building_requirement_castle_city_church = { LEVEL = 03 } - } - trigger_if = { - limit = { - has_building_or_higher = waterworks_06 - } - building_requirement_castle_city_church = { LEVEL = 03 } - } - } - set_variable = { - name = random_building_variable - value = 42 - days = 365 - } - } - 2 = { # paddy_fields : Normal - trigger = { - add_random_building_trigger = { BUILDING = paddy_fields } - generic_economic_building_innovation_trigger = { BUILDING = paddy_fields } - } - set_variable = { - name = random_building_variable - value = 43 - days = 365 - } - } - } -} - -# 2, builds based on variable -add_random_building_construct_effect = { # Province scope - if = { - limit = { has_variable = random_building_variable } - switch = { - trigger = var:random_building_variable - 0 = { - add_next_building_tier_effect = { BUILDING = outposts } - } - 1 = { - add_next_building_tier_effect = { BUILDING = logging_camps } - } - 2 = { - add_next_building_tier_effect = { BUILDING = peat_quarries } - } - 3 = { - add_next_building_tier_effect = { BUILDING = hill_forts } - } - 4 = { - add_next_building_tier_effect = { BUILDING = plantations } - } - 5 = { - add_next_building_tier_effect = { BUILDING = quarries } - } - 6 = { - add_next_building_tier_effect = { BUILDING = hunting_grounds } - } - 7 = { - add_next_building_tier_effect = { BUILDING = military_camps } - } - 8 = { - add_next_building_tier_effect = { BUILDING = horse_pastures } - } - 9 = { - add_next_building_tier_effect = { BUILDING = hillside_grazing } - } - 10 = { - add_next_building_tier_effect = { BUILDING = warrior_lodges } - } - 11 = { - add_next_building_tier_effect = { BUILDING = pastures } - } - 12 = { - add_next_building_tier_effect = { BUILDING = ramparts } - } - 13 = { - add_next_building_tier_effect = { BUILDING = curtain_walls } - } - 14 = { - add_next_building_tier_effect = { BUILDING = watchtowers } - } - 15 = { - add_next_building_tier_effect = { BUILDING = cereal_fields } - } - 16 = { - add_next_building_tier_effect = { BUILDING = barracks } - } - 17 = { - add_next_building_tier_effect = { BUILDING = camel_farms } - } - 18 = { - add_next_building_tier_effect = { BUILDING = hill_farms } - } - 19 = { - add_next_building_tier_effect = { BUILDING = elephant_pens } - } - 20 = { - add_next_building_tier_effect = { BUILDING = common_tradeport } - } - 21 = { - add_next_building_tier_effect = { BUILDING = hospices } - } - 22 = { - add_next_building_tier_effect = { BUILDING = qanats } - } - 23 = { - add_next_building_tier_effect = { BUILDING = murex_farm } - } - 24 = { - add_next_building_tier_effect = { BUILDING = wind_furnace } - } - 25 = { - add_next_building_tier_effect = { BUILDING = stables } - } - 26 = { - add_next_building_tier_effect = { BUILDING = smiths } - } - 27 = { - add_next_building_tier_effect = { BUILDING = orchards } - } - 28 = { - add_next_building_tier_effect = { BUILDING = farm_estates } - } - 29 = { - add_next_building_tier_effect = { BUILDING = regimental_grounds } - } - 30 = { - add_next_building_tier_effect = { BUILDING = caravanserai } - } - 31 = { - add_next_building_tier_effect = { BUILDING = windmills } - } - 32 = { - add_next_building_tier_effect = { BUILDING = watermills } - } - 33 = { - add_next_building_tier_effect = { BUILDING = workshops } - } - 34 = { - add_next_building_tier_effect = { BUILDING = monastic_schools } - } - 35 = { - add_next_building_tier_effect = { BUILDING = guild_halls } - } - 36 = { - add_next_building_tier_effect = { BUILDING = scriptorium } - } - 37 = { - add_next_building_tier_effect = { BUILDING = megalith } - } - 42 = { - add_next_building_tier_effect = { BUILDING = waterworks } - } - 43 = { - add_next_building_tier_effect = { BUILDING = paddy_fields } - } - } - remove_variable = random_building_variable - } -} - -# For stuff that has exactly _eight_ levels of upgrades. -destroy_or_downgrade_building_effect = { - if = { - limit = { has_building = $BUILDING$_08 } - remove_building = $BUILDING$_08 - hidden_effect = { add_building = $BUILDING$_07 } - } - else_if = { - limit = { has_building = $BUILDING$_07 } - remove_building = $BUILDING$_07 - hidden_effect = { add_building = $BUILDING$_06 } - } - else_if = { - limit = { has_building = $BUILDING$_06 } - remove_building = $BUILDING$_06 - hidden_effect = { add_building = $BUILDING$_05 } - } - else_if = { - limit = { has_building = $BUILDING$_05 } - remove_building = $BUILDING$_05 - hidden_effect = { add_building = $BUILDING$_04 } - } - else_if = { - limit = { has_building = $BUILDING$_04 } - remove_building = $BUILDING$_04 - hidden_effect = { add_building = $BUILDING$_03 } - } - else_if = { - limit = { has_building = $BUILDING$_03 } - remove_building = $BUILDING$_03 - hidden_effect = { add_building = $BUILDING$_02 } - } - else_if = { - limit = { has_building = $BUILDING$_02 } - remove_building = $BUILDING$_02 - hidden_effect = { add_building = $BUILDING$_01 } - } - else = { remove_building = $BUILDING$_01 } -} - -# For stuff that has exactly _three_ levels of upgrades. -destroy_or_downgrade_ducal_building_effect = { - if = { - limit = { has_building = $BUILDING$_03 } - remove_building = $BUILDING$_03 - hidden_effect = { add_building = $BUILDING$_02 } - } - else_if = { - limit = { has_building = $BUILDING$_02 } - remove_building = $BUILDING$_02 - hidden_effect = { add_building = $BUILDING$_01 } - } - else = { remove_building = $BUILDING$_01 } -} - -# For stuff that has exactly _two_ levels of upgrades. -destroy_or_downgrade_tribal_building_effect = { - if = { - limit = { has_building = $BUILDING$_02 } - remove_building = $BUILDING$_02 - hidden_effect = { add_building = $BUILDING$_01 } - } - else = { remove_building = $BUILDING$_01 } -} - -destroy_random_building_variable_effect = { # Province scope - save_scope_as = raid_province - if = { - limit = { has_variable = destroyed_building_variable } - remove_variable = destroyed_building_variable - } - random_list = { # Which building? - # Generic/Terrain - 10 = { # outposts : Cheap - trigger = { has_building_or_higher = outposts_01 } - set_variable = { - name = destroyed_building_variable - value = 0 - months = 1 - } - } - 10 = { # logging_camps : Cheap - trigger = { has_building_or_higher = logging_camps_01 } - set_variable = { - name = destroyed_building_variable - value = 1 - months = 1 - } - } - 10 = { # peat_quarries : Cheap - trigger = { has_building_or_higher = peat_quarries_01 } - set_variable = { - name = destroyed_building_variable - value = 2 - months = 1 - } - } - 10 = { # hill_forts : Cheap - trigger = { has_building_or_higher = hill_forts_01 } - set_variable = { - name = destroyed_building_variable - value = 3 - months = 1 - } - } - 10 = { # plantations : Cheap - trigger = { has_building_or_higher = plantations_01 } - set_variable = { - name = destroyed_building_variable - value = 4 - months = 1 - } - } - 10 = { # quarries : Cheap - trigger = { has_building_or_higher = quarries_01 } - set_variable = { - name = destroyed_building_variable - value = 5 - months = 1 - } - } - 10 = { # hunting_grounds : Cheap - trigger = { has_building_or_higher = hunting_grounds_01 } - set_variable = { - name = destroyed_building_variable - value = 6 - months = 1 - } - } - 10 = { # military_camps : Cheap - trigger = { has_building_or_higher = military_camps_01 } - set_variable = { - name = destroyed_building_variable - value = 7 - months = 1 - } - } - 10 = { # horse_pastures : Cheap - trigger = { has_building_or_higher = horse_pastures_01 } - set_variable = { - name = destroyed_building_variable - value = 8 - months = 1 - } - } - 10 = { # hillside_grazing : Cheap - trigger = { has_building_or_higher = hillside_grazing_01 } - set_variable = { - name = destroyed_building_variable - value = 9 - months = 1 - } - } - 10 = { # warrior_lodges : Cheap - trigger = { has_building_or_higher = warrior_lodges_01 } - set_variable = { - name = destroyed_building_variable - value = 10 - months = 1 - } - } - 2 = { # pastures : Normal - trigger = { has_building_or_higher = pastures_01 } - set_variable = { - name = destroyed_building_variable - value = 11 - months = 1 - } - } - 2 = { # ramparts : Normal - trigger = { has_building_or_higher = ramparts_01 } - set_variable = { - name = destroyed_building_variable - value = 12 - months = 1 - } - } - 2 = { # curtain_walls : Normal - trigger = { has_building_or_higher = curtain_walls_01 } - set_variable = { - name = destroyed_building_variable - value = 13 - months = 1 - } - } - 2 = { # watchtowers : Normal - trigger = { has_building_or_higher = watchtowers_01 } - set_variable = { - name = destroyed_building_variable - value = 14 - months = 1 - } - } - 2 = { # cereal_fields : Normal - trigger = { has_building_or_higher = cereal_fields_01 } - set_variable = { - name = destroyed_building_variable - value = 15 - months = 1 - } - } - 2 = { # barracks : Normal - trigger = { has_building_or_higher = barracks_01 } - set_variable = { - name = destroyed_building_variable - value = 16 - months = 1 - } - } - 2 = { # camel_farms : Normal - trigger = { has_building_or_higher = camel_farms_01 } - set_variable = { - name = destroyed_building_variable - value = 17 - months = 1 - } - } - 2 = { # hill_farms : Normal - trigger = { has_building_or_higher = hill_farms_01 } - set_variable = { - name = destroyed_building_variable - value = 18 - months = 1 - } - } - 2 = { # paddy_fields : Normal - trigger = { has_building_or_higher = hill_farms_01 } - set_variable = { - name = destroyed_building_variable - value = 43 - months = 1 - } - } - 2 = { # elephant_pens : Normal - trigger = { has_building_or_higher = elephant_pens_01 } - set_variable = { - name = destroyed_building_variable - value = 19 - months = 1 - } - } - 2 = { # common_tradeport : Normal - trigger = { has_building_or_higher = common_tradeport_01 } - set_variable = { - name = destroyed_building_variable - value = 20 - months = 1 - } - } - 2 = { # hospices : Normal - trigger = { has_building_or_higher = hospices_01 } - set_variable = { - name = destroyed_building_variable - value = 21 - months = 1 - } - } - 2 = { # qanats : Normal - trigger = { has_building_or_higher = qanats_01 } - set_variable = { - name = destroyed_building_variable - value = 22 - months = 1 - } - } - 2 = { # murex_farm : Normal - trigger = { has_building_or_higher = murex_farm_01 } - set_variable = { - name = destroyed_building_variable - value = 23 - months = 1 - } - } - 2 = { # waterworks : Normal - trigger = { has_building_or_higher = waterworks_01 } - set_variable = { - name = destroyed_building_variable - value = 42 - months = 1 - } - } - 2 = { # wind_furnace : Normal - trigger = { has_building_or_higher = wind_furnace_01 } - set_variable = { - name = destroyed_building_variable - value = 24 - months = 1 - } - } - 2 = { # stables : Normal - trigger = { has_building_or_higher = stables_01 } - set_variable = { - name = destroyed_building_variable - value = 25 - months = 1 - } - } - 2 = { # smiths : Normal - trigger = { has_building_or_higher = smiths_01 } - set_variable = { - name = destroyed_building_variable - value = 26 - months = 1 - } - } - 1 = { # orchards : Expensive - trigger = { has_building_or_higher = orchards_01 } - set_variable = { - name = destroyed_building_variable - value = 27 - months = 1 - } - } - 1 = { # farm_estates : Expensive - trigger = { has_building_or_higher = farm_estates_01 } - set_variable = { - name = destroyed_building_variable - value = 28 - months = 1 - } - } - 1 = { # regimental_grounds : Expensive - trigger = { has_building_or_higher = regimental_grounds_01 } - set_variable = { - name = destroyed_building_variable - value = 29 - months = 1 - } - } - 1 = { # caravanserai : Expensive - trigger = { has_building_or_higher = caravanserai_01 } - set_variable = { - name = destroyed_building_variable - value = 30 - months = 1 - } - } - 1 = { # watermills : Expensive - trigger = { has_building_or_higher = watermills_01 } - set_variable = { - name = destroyed_building_variable - value = 31 - months = 1 - } - } - 1 = { # windmills : Expensive - trigger = { has_building_or_higher = windmills_01 } - set_variable = { - name = destroyed_building_variable - value = 32 - months = 1 - } - } - 1 = { # workshops : Expensive - trigger = { has_building_or_higher = workshops_01 } - set_variable = { - name = destroyed_building_variable - value = 33 - months = 1 - } - } - # Holding Type Specific : Normal - 10 = { # monastic_schools : Normal - trigger = { has_building_or_higher = monastic_schools_01 } - set_variable = { - name = destroyed_building_variable - value = 21 - months = 1 - } - } - 10 = { # guild_halls : Normal - trigger = { has_building_or_higher = guild_halls_01 } - set_variable = { - name = destroyed_building_variable - value = 35 - months = 1 - } - } - 10 = { # scriptorium : Normal - trigger = { has_building_or_higher = scriptorium_01 } - set_variable = { - name = destroyed_building_variable - value = 36 - months = 1 - } - } - 10 = { # megalith : Normal - trigger = { has_building_or_higher = megalith_01 } - set_variable = { - name = destroyed_building_variable - value = 37 - months = 1 - } - } - 10 = { # Waterworks - trigger = { has_building_or_higher = waterworks_01 } - set_variable = { - name = destroyed_building_variable - value = 42 - months = 1 - } - } - 10 = { # Paddy Fields - trigger = { has_building_or_higher = paddy_fields_01 } - set_variable = { - name = destroyed_building_variable - value = 43 - months = 1 - } - } - # Tribal - 10 = { # Market Villages - trigger = { has_building_or_higher = market_villages_01 } - set_variable = { - name = destroyed_building_variable - value = 38 - months = 1 - } - } - 10 = { # Palisades - trigger = { has_building_or_higher = palisades_01 } - set_variable = { - name = destroyed_building_variable - value = 39 - months = 1 - } - } - 10 = { # War Camps - trigger = { has_building_or_higher = war_camps_01 } - set_variable = { - name = destroyed_building_variable - value = 40 - months = 1 - } - } - 10 = { # Longhouses - trigger = { has_building_or_higher = longhouses_01 } - set_variable = { - name = destroyed_building_variable - value = 41 - months = 1 - } - } - } -} - -destroy_random_building_effect = { - if = { - limit = { has_variable = destroyed_building_variable } - switch = { - trigger = var:destroyed_building_variable - 0 = { # outposts : Cheap - destroy_or_downgrade_building_effect = { BUILDING = outposts } - } - 1 = { # logging_camps : Cheap - destroy_or_downgrade_building_effect = { BUILDING = logging_camps } - } - 2 = { # peat_quarries : Cheap - destroy_or_downgrade_building_effect = { BUILDING = peat_quarries } - } - 3 = { # hill_forts : Cheap - destroy_or_downgrade_building_effect = { BUILDING = hill_forts } - } - 4 = { # plantations : Cheap - destroy_or_downgrade_building_effect = { BUILDING = plantations } - } - 5 = { # quarries : Cheap - destroy_or_downgrade_building_effect = { BUILDING = quarries } - } - 6 = { # hunting_grounds : Cheap - destroy_or_downgrade_building_effect = { BUILDING = hunting_grounds } - } - 7 = { # military_camps : Cheap - destroy_or_downgrade_building_effect = { BUILDING = military_camps } - } - 8 = { # horse_pastures : Cheap - destroy_or_downgrade_building_effect = { BUILDING = horse_pastures } - } - 9 = { # hillside_grazing : Cheap - destroy_or_downgrade_building_effect = { BUILDING = hillside_grazing } - } - 10 = { # warrior_lodges : Cheap - destroy_or_downgrade_building_effect = { BUILDING = warrior_lodges } - } - 11 = { # pastures : Normal - destroy_or_downgrade_building_effect = { BUILDING = pastures } - } - 12 = { # ramparts : Normal - destroy_or_downgrade_building_effect = { BUILDING = ramparts } - } - 13 = { # curtain_walls : Normal - destroy_or_downgrade_building_effect = { BUILDING = curtain_walls } - } - 14 = { # watchtowers : Normal - destroy_or_downgrade_building_effect = { BUILDING = watchtowers } - } - 15 = { # cereal_fields : Normal - destroy_or_downgrade_building_effect = { BUILDING = cereal_fields } - } - 16 = { # barracks : Normal - destroy_or_downgrade_building_effect = { BUILDING = barracks } - } - 17 = { # camel_farms : Normal - destroy_or_downgrade_building_effect = { BUILDING = camel_farms } - } - 18 = { # hill_farms : Normal - destroy_or_downgrade_building_effect = { BUILDING = hill_farms } - } - 19 = { # elephant_pens : Normal - destroy_or_downgrade_building_effect = { BUILDING = elephant_pens } - } - 20 = { # common_tradeport : Normal - destroy_or_downgrade_building_effect = { BUILDING = common_tradeport } - } - 21 = { # hospices : Normal - destroy_or_downgrade_building_effect = { BUILDING = hospices } - } - 22 = { # qanats : Normal - destroy_or_downgrade_building_effect = { BUILDING = qanats } - } - 23 = { # murex_farm : Normal - destroy_or_downgrade_building_effect = { BUILDING = murex_farm } - } - 24 = { # wind_furnace : Normal - destroy_or_downgrade_building_effect = { BUILDING = wind_furnace } - } - 25 = { # stables : Normal - destroy_or_downgrade_building_effect = { BUILDING = stables } - } - 26 = { # smiths : Normal - destroy_or_downgrade_building_effect = { BUILDING = smiths } - } - 27 = { # orchards : Expensive - destroy_or_downgrade_building_effect = { BUILDING = orchards } - } - 28 = { # farm_estates : Expensive - destroy_or_downgrade_building_effect = { BUILDING = farm_estates } - } - 29 = { # regimental_grounds : Expensive - destroy_or_downgrade_building_effect = { BUILDING = regimental_grounds } - } - 30 = { # caravanserai : Expensive - destroy_or_downgrade_building_effect = { BUILDING = caravanserai } - } - 31 = { # watermills : Expensive - destroy_or_downgrade_building_effect = { BUILDING = watermills } - } - 32 = { # windmills : Expensive - destroy_or_downgrade_building_effect = { BUILDING = windmills } - } - 33 = { # workshops : Expensive - destroy_or_downgrade_building_effect = { BUILDING = workshops } - } - # Holding Type Specific : Normal - 34 = { # monastic_schools : Normal - destroy_or_downgrade_building_effect = { BUILDING = monastic_schools } - } - 35 = { # guild_halls : Normal - destroy_or_downgrade_building_effect = { BUILDING = guild_halls } - } - 36 = { # scriptorium : Normal - destroy_or_downgrade_building_effect = { BUILDING = scriptorium } - } - 37 = { # megalith : Normal - destroy_or_downgrade_building_effect = { BUILDING = megalith } - } - 42 = { # waterworks : Normal - destroy_or_downgrade_building_effect = { BUILDING = waterworks } - } - 43 = { # paddy_fields : Normal - destroy_or_downgrade_building_effect = { BUILDING = paddy_fields } - } - # Tribal - 38 = { # megalith : Normal - destroy_or_downgrade_tribal_building_effect = { BUILDING = market_villages } - } - 39 = { # megalith : Normal - destroy_or_downgrade_tribal_building_effect = { BUILDING = palisades } - } - 40 = { # megalith : Normal - destroy_or_downgrade_tribal_building_effect = { BUILDING = war_camps } - } - 41 = { # megalith : Normal - destroy_or_downgrade_tribal_building_effect = { BUILDING = longhouses } - } - } - remove_variable = destroyed_building_variable - } -} - -destroy_or_downgrade_estate_building_2_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_02 } - lower_domicile_building_no_refund = $BUILDING$_02 - } - else = { remove_domicile_building_no_refund = $BUILDING$_01 } -} - -destroy_or_downgrade_estate_building_3_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_03 } - lower_domicile_building_no_refund = $BUILDING$_03 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_02 } - lower_domicile_building_no_refund = $BUILDING$_02 - } - else = { remove_domicile_building_no_refund = $BUILDING$_01 } -} - -destroy_or_downgrade_estate_building_4_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_04 } - lower_domicile_building_no_refund = $BUILDING$_04 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_03 } - lower_domicile_building_no_refund = $BUILDING$_03 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_02 } - lower_domicile_building_no_refund = $BUILDING$_02 - } - else = { remove_domicile_building_no_refund = $BUILDING$_01 } -} - -destroy_or_downgrade_estate_building_5_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_05 } - lower_domicile_building_no_refund = $BUILDING$_05 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_04 } - lower_domicile_building_no_refund = $BUILDING$_04 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_03 } - lower_domicile_building_no_refund = $BUILDING$_03 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_02 } - lower_domicile_building_no_refund = $BUILDING$_02 - } - else = { remove_domicile_building_no_refund = $BUILDING$_01 } -} - -destroy_or_downgrade_estate_building_6_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_06 } - lower_domicile_building_no_refund = $BUILDING$_06 - } - if = { - limit = { has_domicile_building = $BUILDING$_05 } - lower_domicile_building_no_refund = $BUILDING$_05 - } - if = { - limit = { has_domicile_building = $BUILDING$_04 } - lower_domicile_building_no_refund = $BUILDING$_04 - } - if = { - limit = { has_domicile_building = $BUILDING$_03 } - lower_domicile_building_no_refund = $BUILDING$_03 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_02 } - lower_domicile_building_no_refund = $BUILDING$_02 - } - else = { remove_domicile_building_no_refund = $BUILDING$_01 } -} - -destroy_or_downgrade_estate_building_2_4_replacement_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_04 } - lower_domicile_building_no_refund = $BUILDING$_04 - } - else = { - lower_domicile_building_no_refund = $BUILDING$_03 - } -} - -destroy_or_downgrade_estate_building_2_6_replacement_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_06 } - lower_domicile_building_no_refund = $BUILDING$_06 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_05 } - lower_domicile_building_no_refund = $BUILDING$_05 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_04 } - lower_domicile_building_no_refund = $BUILDING$_04 - } - else = { - lower_domicile_building_no_refund = $BUILDING$_03 - } -} - -destroy_or_downgrade_estate_building_3_6_replacement_effect = { - if = { - limit = { has_domicile_building = $BUILDING$_06 } - lower_domicile_building_no_refund = $BUILDING$_06 - } - else_if = { - limit = { has_domicile_building = $BUILDING$_05 } - lower_domicile_building_no_refund = $BUILDING$_05 - } - else = { - lower_domicile_building_no_refund = $BUILDING$_04 - } -} - -destroy_random_estate_building_variable_effect = { # Domicile scope - save_scope_as = raid_domicile - if = { - limit = { has_variable = destroyed_building_variable } - remove_variable = destroyed_building_variable - } - random_list = { # Which building? - # Generic/Terrain - 10 = { # barracks : Normal - trigger = { has_domicile_building_or_higher = barracks_01 } - set_variable = { - name = destroyed_building_variable - value = 0 - months = 1 - } - } - 10 = { # watchtower : Normal - trigger = { has_domicile_building_or_higher = watchtower_01 } - set_variable = { - name = destroyed_building_variable - value = 1 - months = 1 - } - } - 10 = { # guardhouse : Normal - trigger = { has_domicile_building_or_higher = guardhouse_01 } - set_variable = { - name = destroyed_building_variable - value = 2 - months = 1 - } - } - 10 = { # garden : Normal - trigger = { has_domicile_building_or_higher = garden_01 } - set_variable = { - name = destroyed_building_variable - value = 3 - months = 1 - } - } - 10 = { # stable : Normal - trigger = { has_domicile_building_or_higher = stable_01 } - set_variable = { - name = destroyed_building_variable - value = 4 - months = 1 - } - } - 10 = { # workshop : Normal - trigger = { has_domicile_building_or_higher = workshop_01 } - set_variable = { - name = destroyed_building_variable - value = 5 - months = 1 - } - } - 10 = { # storage : Normal - trigger = { has_domicile_building_or_higher = storage_01 } - set_variable = { - name = destroyed_building_variable - value = 6 - months = 1 - } - } - 10 = { # market : Normal - trigger = { has_domicile_building_or_higher = market_01 } - set_variable = { - name = destroyed_building_variable - value = 7 - months = 1 - } - } - 10 = { # grazing_land : Normal - trigger = { has_domicile_building_or_higher = grazing_land_01 } - set_variable = { - name = destroyed_building_variable - value = 8 - months = 1 - } - } - 10 = { # grain_field : Normal - trigger = { has_domicile_building_or_higher = grain_field_01 } - set_variable = { - name = destroyed_building_variable - value = 9 - months = 1 - } - } - 10 = { # living_quarters : Normal - trigger = { has_domicile_building_or_higher = living_quarters_01 } - set_variable = { - name = destroyed_building_variable - value = 10 - months = 1 - } - } - 10 = { # vineyard : Normal - trigger = { has_domicile_building_or_higher = vineyard_01 } - set_variable = { - name = destroyed_building_variable - value = 11 - months = 1 - } - } - 10 = { # olive : Normal - trigger = { has_domicile_building_or_higher = olive_01 } - set_variable = { - name = destroyed_building_variable - value = 12 - months = 1 - } - } - 10 = { # temple : Normal - trigger = { has_domicile_building_or_higher = temple_small_01 } - set_variable = { - name = destroyed_building_variable - value = 13 - months = 1 - } - } - 10 = { # grand_solar : Normal - trigger = { has_domicile_building_or_higher = grand_solar_01 } - set_variable = { - name = destroyed_building_variable - value = 14 - months = 1 - } - } - 10 = { # cabinet_of_curiosities : Normal - trigger = { has_domicile_building_or_higher = cabinet_of_curiosities_01 } - set_variable = { - name = destroyed_building_variable - value = 15 - months = 1 - } - } - 10 = { # reception_hall : Normal - trigger = { has_domicile_building_or_higher = reception_hall_01 } - set_variable = { - name = destroyed_building_variable - value = 16 - months = 1 - } - } - 10 = { # prison : Normal - trigger = { has_domicile_building_or_higher = prison_01 } - set_variable = { - name = destroyed_building_variable - value = 17 - months = 1 - } - } - 10 = { # courtyard : Normal - trigger = { has_domicile_building_or_higher = courtyard_01 } - set_variable = { - name = destroyed_building_variable - value = 18 - months = 1 - } - } - 10 = { # wine_cellar : Normal - trigger = { has_domicile_building_or_higher = wine_cellar_01 } - set_variable = { - name = destroyed_building_variable - value = 19 - months = 1 - } - } - 10 = { # guest_room : Normal - trigger = { has_domicile_building_or_higher = guest_room_01 } - set_variable = { - name = destroyed_building_variable - value = 20 - months = 1 - } - } - 10 = { # bath : Normal - trigger = { has_domicile_building_or_higher = bath_01 } - set_variable = { - name = destroyed_building_variable - value = 21 - months = 1 - } - } - 10 = { # library : Normal - trigger = { has_domicile_building_or_higher = library_01 } - set_variable = { - name = destroyed_building_variable - value = 22 - months = 1 - } - } - 10 = { # servants_quarters : Normal - trigger = { has_domicile_building_or_higher = servants_quarters_01 } - set_variable = { - name = destroyed_building_variable - value = 23 - months = 1 - } - } - 10 = { # office : Normal - trigger = { has_domicile_building_or_higher = office_01 } - set_variable = { - name = destroyed_building_variable - value = 24 - months = 1 - } - } - 10 = { # trophy_room : Normal - trigger = { has_domicile_building_or_higher = trophy_room_01 } - set_variable = { - name = destroyed_building_variable - value = 25 - months = 1 - } - } - 10 = { # silk : Normal - trigger = { has_domicile_building_or_higher = silk_01 } - set_variable = { - name = destroyed_building_variable - value = 26 - months = 1 - } - } - } -} - -destroy_random_estate_building_effect = { - if = { - limit = { has_variable = destroyed_building_variable } - switch = { - trigger = var:destroyed_building_variable - 0 = { # barracks : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = barracks } - } - 1 = { # watchtower : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = watchtower } - } - 2 = { # guardhouse : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = guardhouse } - } - 3 = { # garden : Cheap - if = { - limit = { has_domicile_building_or_higher = garden_leisure_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = garden_leisure } - } - else_if = { - limit = { has_domicile_building_or_higher = garden_fruit_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = garden_fruit } - } - else = { - destroy_or_downgrade_estate_building_3_effect = { BUILDING = garden } - } - } - 4 = { # stable : Cheap - if = { - limit = { has_domicile_building_or_higher = stable_grand_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = stable_grand } - } - else_if = { - limit = { has_domicile_building_or_higher = stable_kennel_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = stable_kennel } - } - else_if = { - limit = { has_domicile_building_or_higher = stable_chariot_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = stable_chariot } - } - else = { - destroy_or_downgrade_estate_building_3_effect = { BUILDING = stable } - } - } - 5 = { # workshop : Cheap - if = { - limit = { has_domicile_building_or_higher = workshop_carpenter_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = workshop_carpenter } - } - else_if = { - limit = { has_domicile_building_or_higher = workshop_mason_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = workshop_mason } - } - else_if = { - limit = { has_domicile_building_or_higher = workshop_textile_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = workshop_textile } - } - else = { - destroy_or_downgrade_estate_building_2_effect = { BUILDING = workshop } - } - } - 6 = { # storage : Cheap - if = { - limit = { has_domicile_building_or_higher = storage_warehouse_03 } - destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = storage_warehouse } - } - else_if = { - limit = { has_domicile_building_or_higher = storage_granary_03 } - destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = storage_granary } - } - else = { - destroy_or_downgrade_estate_building_2_effect = { BUILDING = storage } - } - } - 7 = { # market : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = market } - } - 8 = { # grazing_land : Cheap - if = { - limit = { has_domicile_building_or_higher = horse_pasture_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = horse_pasture } - } - else_if = { - limit = { has_domicile_building_or_higher = camel_pasture_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = camel_pasture } - } - else_if = { - limit = { has_domicile_building_or_higher = elephant_pasture_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = elephant_pasture } - } - else = { - destroy_or_downgrade_estate_building_6_effect = { BUILDING = grazing_land } - } - } - 9 = { # grain_field : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = grain_field } - } - 10 = { # living_quarters : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = living_quarters } - } - 11 = { # vineyard : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = vineyard } - } - 12 = { # olive : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = olive } - } - 13 = { # temple : Cheap - if = { - limit = { has_domicile_building_or_higher = temple_crypt_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = temple_crypt } - } - else_if = { - limit = { has_domicile_building_or_higher = temple_large_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = temple_large } - } - else_if = { - limit = { has_domicile_building_or_higher = temple_monastery_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = temple_monastery } - } - else = { - destroy_or_downgrade_estate_building_3_effect = { BUILDING = temple_small } - } - } - 14 = { # grand_solar : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = grand_solar } - } - 15 = { # cabinet_of_curiosities : Cheap - destroy_or_downgrade_estate_building_3_effect = { BUILDING = cabinet_of_curiosities } - } - 16 = { # reception_hall : Cheap - destroy_or_downgrade_estate_building_5_effect = { BUILDING = reception_hall } - } - 17 = { # prison : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = prison } - } - 18 = { # courtyard : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = courtyard } - } - 19 = { # wine_cellar : Cheap - destroy_or_downgrade_estate_building_3_effect = { BUILDING = wine_cellar } - } - 20 = { # guest_room : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = guest_room } - } - 21 = { # bath : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = bath } - } - 22 = { # library : Cheap - if = { - limit = { has_domicile_building_or_higher = library_observatory_03 } - destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = library_observatory } - } - else_if = { - limit = { has_domicile_building_or_higher = library_education_03 } - destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = library_education } - } - else = { - destroy_or_downgrade_estate_building_2_effect = { BUILDING = library } - } - } - 23 = { # servants_quarters : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = servants_quarters } - } - 24 = { # office : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = office } - } - 25 = { # trophy_room : Cheap - destroy_or_downgrade_estate_building_4_effect = { BUILDING = trophy_room } - } - 26 = { # silk : Cheap - destroy_or_downgrade_estate_building_6_effect = { BUILDING = silk } - } - } - remove_variable = destroyed_building_variable - } -} - -# Destroy building effects for chinese estates - In domicile scope -destroy_random_east_asian_estate_building_variable_effect = { - save_scope_as = raid_domicile - if = { - limit = { has_variable = destroyed_building_variable } - remove_variable = destroyed_building_variable - } - random_list = { # Which building? - # Upgrades/internal buildings - 10 = { # living_quarters - trigger = { has_domicile_building_or_higher = east_asian_estate_living_quarters_01 } - set_variable = { - name = destroyed_building_variable - value = 1 - months = 1 - } - } - 10 = { # commander's study - trigger = { has_domicile_building_or_higher = east_asian_estate_commander_study_01 } - set_variable = { - name = destroyed_building_variable - value = 2 - months = 1 - } - } - 10 = { # office - trigger = { has_domicile_building_or_higher = east_asian_estate_office_01 } - set_variable = { - name = destroyed_building_variable - value = 3 - months = 1 - } - } - 10 = { # servants_quarters - trigger = { has_domicile_building_or_higher = east_asian_estate_servants_quarters_01 } - set_variable = { - name = destroyed_building_variable - value = 4 - months = 1 - } - } - 10 = { # library - trigger = { has_domicile_building_or_higher = east_asian_estate_library_01 } - set_variable = { - name = destroyed_building_variable - value = 5 - months = 1 - } - } - 10 = { # bath - trigger = { has_domicile_building_or_higher = east_asian_estate_bath_01 } - set_variable = { - name = destroyed_building_variable - value = 6 - months = 1 - } - } - 10 = { # guest_room - trigger = { has_domicile_building_or_higher = east_asian_estate_guest_room_01 } - set_variable = { - name = destroyed_building_variable - value = 7 - months = 1 - } - } - 10 = { # wine_cellar - trigger = { has_domicile_building_or_higher = east_asian_estate_wine_cellar_01 } - set_variable = { - name = destroyed_building_variable - value = 8 - months = 1 - } - } - 10 = { # courtyard - trigger = { has_domicile_building_or_higher = east_asian_estate_courtyard_01 } - set_variable = { - name = destroyed_building_variable - value = 9 - months = 1 - } - } - 10 = { # prison - trigger = { has_domicile_building_or_higher = east_asian_estate_prison_01 } - set_variable = { - name = destroyed_building_variable - value = 10 - months = 1 - } - } - 10 = { # reception_hall - trigger = { has_domicile_building_or_higher = east_asian_estate_reception_hall_01 } - set_variable = { - name = destroyed_building_variable - value = 11 - months = 1 - } - } - 10 = { # cabinet_of_curiosities - trigger = { has_domicile_building_or_higher = east_asian_estate_cabinet_of_curiosities_01 } - set_variable = { - name = destroyed_building_variable - value = 12 - months = 1 - } - } - # External buildings - 10 = { # ancestral shrine - trigger = { has_domicile_building_or_higher = east_asian_estate_ancestral_shrine_01 } - set_variable = { - name = destroyed_building_variable - value = 13 - months = 1 - } - } - 10 = { # pagoda - trigger = { has_domicile_building_or_higher = east_asian_estate_temple_01 } - set_variable = { - name = destroyed_building_variable - value = 14 - months = 1 - } - } - 10 = { # barracks - trigger = { has_domicile_building_or_higher = east_asian_estate_barracks_01 } - set_variable = { - name = destroyed_building_variable - value = 15 - months = 1 - } - } - 10 = { # watchtower - trigger = { has_domicile_building_or_higher = east_asian_estate_watchtower_01 } - set_variable = { - name = destroyed_building_variable - value = 16 - months = 1 - } - } - 10 = { # garden - trigger = { has_domicile_building_or_higher = east_asian_estate_garden_01 } - set_variable = { - name = destroyed_building_variable - value = 18 - months = 1 - } - } - 10 = { # stable - trigger = { has_domicile_building_or_higher = east_asian_estate_stable_01 } - set_variable = { - name = destroyed_building_variable - value = 19 - months = 1 - } - } - 10 = { # workshop - trigger = { has_domicile_building_or_higher = east_asian_estate_workshop_01 } - set_variable = { - name = destroyed_building_variable - value = 20 - months = 1 - } - } - 10 = { # storage - trigger = { has_domicile_building_or_higher = east_asian_estate_storage_01 } - set_variable = { - name = destroyed_building_variable - value = 21 - months = 1 - } - } - 10 = { # market - trigger = { has_domicile_building_or_higher = east_asian_estate_market_01 } - set_variable = { - name = destroyed_building_variable - value = 22 - months = 1 - } - } - 10 = { # grazing_land - trigger = { has_domicile_building_or_higher = east_asian_estate_grazing_land_01 } - set_variable = { - name = destroyed_building_variable - value = 23 - months = 1 - } - } - 10 = { # rice_field - trigger = { has_domicile_building_or_higher = east_asian_estate_rice_field_01 } - set_variable = { - name = destroyed_building_variable - value = 25 - months = 1 - } - } - 10 = { # tea plantation - trigger = { has_domicile_building_or_higher = east_asian_estate_tea_01 } - set_variable = { - name = destroyed_building_variable - value = 27 - months = 1 - } - } - 10 = { # physician's office - trigger = { has_domicile_building_or_higher = east_asian_estate_health_01 } - set_variable = { - name = destroyed_building_variable - value = 28 - months = 1 - } - } - 10 = { # silk - trigger = { has_domicile_building_or_higher = east_asian_estate_silk_01 } - set_variable = { - name = destroyed_building_variable - value = 29 - months = 1 - } - } - 10 = { # study - trigger = { has_domicile_building_or_higher = east_asian_estate_study_01 } - set_variable = { - name = destroyed_building_variable - value = 30 - months = 1 - } - } - 10 = { # minister's office - trigger = { has_domicile_building_or_higher = east_asian_estate_minister_office_01 } - set_variable = { - name = destroyed_building_variable - value = 31 - months = 1 - } - } - 10 = { # dynastic pavilion/movement leader building - trigger = { has_domicile_building_or_higher = east_asian_estate_movement_study_01 } - set_variable = { - name = destroyed_building_variable - value = 32 - months = 1 - } - } - 10 = { # archive - trigger = { has_domicile_building_or_higher = east_asian_estate_archive_01 } - set_variable = { - name = destroyed_building_variable - value = 33 - months = 1 - } - } - 10 = { # gate - trigger = { has_domicile_building_or_higher = east_asian_estate_gate_01 } - set_variable = { - name = destroyed_building_variable - value = 34 - months = 1 - } - } - 10 = { # taxation office - trigger = { has_domicile_building_or_higher = east_asian_estate_taxation_01 } - set_variable = { - name = destroyed_building_variable - value = 35 - months = 1 - } - } - 10 = { # yamen office - trigger = { has_domicile_building_or_higher = east_asian_peasant_quarters_01 } - set_variable = { - name = destroyed_building_variable - value = 36 - months = 1 - } - } - } -} - -destroy_random_east_asian_estate_building_effect = { - if = { - limit = { has_variable = destroyed_building_variable } - switch = { - trigger = var:destroyed_building_variable - 1 = { # living_quarters - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_living_quarters } - } - 2 = { # commander's study - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_commander_study } - } - 3 = { # office - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_office } - } - 4 = { # servants_quarters - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_servants_quarters } - } - 5 = { # library - if = { - limit = { has_domicile_building_or_higher = east_asian_estate_library_education_03 } - destroy_or_downgrade_estate_building_2_4_replacement_effect = { BUILDING = east_asian_estate_library_education } - } - else = { - destroy_or_downgrade_estate_building_2_effect = { BUILDING = east_asian_estate_library } - } - } - 6 = { # bath - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_bath } - } - 7 = { # guest_room - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_guest_room } - } - 8 = { # wine_cellar - destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_wine_cellar } - } - 9 = { # courtyard - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_courtyard } - } - 10 = { # prison - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_prison } - } - 11 = { # reception_hall - destroy_or_downgrade_estate_building_5_effect = { BUILDING = east_asian_estate_reception_hall } - } - 12 = { # cabinet_of_curiosities - destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_cabinet_of_curiosities } - } - 13 = { # ancestral shrine - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_ancestral_shrine } - } - 14 = { # pagoda - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_temple } - } - 15 = { # barracks - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_barracks } - } - 16 = { # watchtower - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_watchtower } - } - 18 = { # garden - if = { - limit = { has_domicile_building_or_higher = east_asian_estate_garden_leisure_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_garden_leisure } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_garden_fruit_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_garden_fruit } - } - else = { - destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_garden } - } - } - 19 = { # stable - if = { - limit = { has_domicile_building_or_higher = east_asian_estate_stable_grand_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_stable_grand } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_stable_kennel_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_stable_kennel } - } - else = { - destroy_or_downgrade_estate_building_3_effect = { BUILDING = east_asian_estate_stable } - } - } - 20 = { # workshop - if = { - limit = { has_domicile_building_or_higher = east_asian_estate_workshop_carpenter_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_workshop_carpenter } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_workshop_mason_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_workshop_mason } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_workshop_textile_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_workshop_textile } - } - else = { - destroy_or_downgrade_estate_building_2_effect = { BUILDING = east_asian_estate_workshop } - } - } - 21 = { # storage - if = { - limit = { has_domicile_building_or_higher = east_asian_estate_storage_warehouse_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_storage_warehouse } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_storage_granary_03 } - destroy_or_downgrade_estate_building_2_6_replacement_effect = { BUILDING = east_asian_estate_storage_granary } - } - else = { - destroy_or_downgrade_estate_building_2_effect = { BUILDING = east_asian_estate_storage } - } - } - 22 = { # market - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_market } - } - 23 = { # grazing_land - if = { - limit = { has_domicile_building_or_higher = east_asian_estate_horse_pasture_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_horse_pasture } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_camel_pasture_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_camel_pasture } - } - else_if = { - limit = { has_domicile_building_or_higher = east_asian_estate_elephant_pasture_04 } - destroy_or_downgrade_estate_building_3_6_replacement_effect = { BUILDING = east_asian_estate_elephant_pasture } - } - else = { - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_grazing_land } - } - } - 25 = { # rice_field - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_rice_field } - } - 27 = { # tea - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_tea } - } - 28 = { # health - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_health } - } - 29 = { # silk - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_silk } - } - 30 = { # study - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_study } - } - 31 = { # minister's office - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_minister_office } - } - 32 = { # dynastic pavilion/movement leader building - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_movement_study } - } - 33 = { # archive - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_archive } - } - 34 = { # gate - destroy_or_downgrade_estate_building_6_effect = { BUILDING = east_asian_estate_gate } - } - 35 = { # tax office - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_estate_taxation } - } - 36 = { # peasants quarters - destroy_or_downgrade_estate_building_4_effect = { BUILDING = east_asian_peasant_quarters } - } - } - remove_variable = destroyed_building_variable - } -} - -add_random_economic_building_effect = { - save_scope_as = building_scope - custom_tooltip = random_economic_building_tt - hidden_effect = { - random_list = { - 10 = { # Caravanserai - trigger = { - NOT = { has_building_or_higher = caravanserai_01 } - building_caravanserai_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - culture = { - has_innovation = innovation_guilds - } - } - add_building = caravanserai_01 - } - 10 = { # Watermills - trigger = { - NOT = { has_building_or_higher = watermills_01 } - building_watermills_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - culture = { - has_innovation = innovation_windmills - } - } - add_building = watermills_01 - } - 10 = { # Windmills - trigger = { - NOT = { has_building_or_higher = windmills_01 } - building_windmills_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - culture = { - has_innovation = innovation_windmills - } - } - add_building = windmills_01 - } - 10 = { # Trade Port - trigger = { - NOT = { has_building_or_higher = common_tradeport_01 } - building_common_tradeport_requirement_terrain = yes - OR = { - AND = { - culture = { - has_cultural_parameter = trade_ports_enabled_for_tribals - } - has_building_or_higher = tribe_01 - } - building_requirement_castle_city_church = { LEVEL = 01 } - } - } - add_building = common_tradeport_01 - } - 10 = { # Pastures - trigger = { - NOT = { has_building_or_higher = pastures_01 } - building_pastures_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = pastures_01 - } - 10 = { # Hunting Grounds - trigger = { - NOT = { has_building_or_higher = hunting_grounds_01 } - building_hunting_grounds_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = hunting_grounds_01 - } - 10 = { # Orchards - trigger = { - NOT = { has_building_or_higher = orchards_01 } - building_orchards_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = orchards_01 - } - 10 = { # Farm Estates - trigger = { - NOT = { has_building_or_higher = farm_estates_01 } - building_farm_estates_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = farm_estates_01 - } - 10 = { # Cereal Fields - trigger = { - NOT = { has_building_or_higher = cereal_fields_01 } - building_cereal_fields_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = cereal_fields_01 - } - 10 = { # Logging Camps - trigger = { - NOT = { has_building_or_higher = logging_camps_01 } - building_logging_camps_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = logging_camps_01 - } - 10 = { # Peat Quarries - trigger = { - NOT = { has_building_or_higher = peat_quarries_01 } - building_peat_quarries_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = peat_quarries_01 - } - 10 = { # Hill Farms - trigger = { - NOT = { has_building_or_higher = hill_farms_01 } - building_hill_farms_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = hill_farms_01 - } - 10 = { # Elephant Pens - trigger = { - NOT = { has_building_or_higher = elephant_pens_01 } - building_elephant_pens_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = elephant_pens_01 - } - 10 = { # Plantations - trigger = { - NOT = { has_building_or_higher = plantations_01 } - building_plantations_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = plantations_01 - } - 10 = { # Quarries - trigger = { - NOT = { has_building_or_higher = quarries_01 } - building_quarries_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = quarries_01 - } - 10 = { # Qanats - trigger = { - NOT = { has_building_or_higher = qanats_01 } - building_qanats_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - culture = { - has_cultural_parameter = unlocks_qanat_building - } - } - add_building = qanats_01 - } - 10 = { # Murex Farms - trigger = { - NOT = { has_building_or_higher = murex_farm_01 } - building_murex_farm_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = murex_farm_01 - } - 10 = { # Guild Halls - City Specific - trigger = { - NOT = { has_building_or_higher = guild_halls_01 } - has_building_or_higher = city_01 - } - add_building = guild_halls_01 - } - 10 = { # Monastic Schools - Temple Specific - trigger = { - NOT = { has_building_or_higher = monastic_schools_01 } - has_building_or_higher = temple_01 - } - add_building = monastic_schools_01 - } - } - } -} - -add_random_fortification_building_effect = { - save_scope_as = building_scope - custom_tooltip = random_fortification_building_tt - hidden_effect = { - random_list = { - 10 = { # Ramparts - trigger = { - NOT = { has_building_or_higher = ramparts_01 } - building_ramparts_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = ramparts_01 - } - 10 = { # Curtain Walls - trigger = { - NOT = { has_building_or_higher = curtain_walls_01 } - building_curtain_walls_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = curtain_walls_01 - } - 10 = { # Watchtowers - trigger = { - NOT = { has_building_or_higher = watchtowers_01 } - building_watchtowers_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = watchtowers_01 - } - 10 = { # Hill Forts - trigger = { - NOT = { has_building_or_higher = hill_forts_01 } - building_hill_forts_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = hill_forts_01 - } - } - } -} - -add_random_military_building_effect = { - save_scope_as = building_scope - custom_tooltip = random_military_building_tt - hidden_effect = { - random_list = { - 10 = { # Wind Furnace - trigger = { - NOT = { has_building_or_higher = wind_furnace_01 } - building_wind_furnace_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = wind_furnace_01 - } - 10 = { # Workshops - trigger = { - NOT = { has_building_or_higher = workshops_01 } - building_workshops_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - scope:building_scope.county.holder.culture = { - has_innovation = innovation_advanced_bowmaking - } - } - add_building = workshops_01 - } - 10 = { # Horse Pastures - trigger = { - NOT = { has_building_or_higher = windmills_01 } - building_horse_pastures_requirement_terrain = yes - } - add_building = windmills_01 - } - 10 = { # Hillside Grazing - trigger = { - NOT = { has_building_or_higher = hillside_grazing_01 } - building_hillside_grazing_requirement_terrain = yes - } - add_building = hillside_grazing_01 - } - 10 = { # Warrior Lodges - trigger = { - NOT = { has_building_or_higher = warrior_lodges_01 } - building_warrior_lodges_requirement_terrain = yes - } - add_building = warrior_lodges_01 - } - 10 = { # Military Camps - trigger = { - NOT = { has_building_or_higher = military_camps_01 } - building_military_camps_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = military_camps_01 - } - 10 = { # Regimental Grounds - trigger = { - NOT = { has_building_or_higher = regimental_grounds_01 } - building_regimental_grounds_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = regimental_grounds_01 - } - 10 = { # Outposts - trigger = { - NOT = { has_building_or_higher = outposts_01 } - building_outposts_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = outposts_01 - } - 10 = { # Barracks - trigger = { - NOT = { has_building_or_higher = barracks_01 } - building_barracks_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = barracks_01 - } - 10 = { # Camel Farms - trigger = { - NOT = { has_building_or_higher = camel_farms_01 } - building_camel_farms_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = camel_farms_01 - } - 10 = { # Stables - trigger = { - NOT = { has_building_or_higher = stables_01 } - building_stables_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = stables_01 - } - 10 = { # Smiths - trigger = { - NOT = { has_building_or_higher = smiths_01 } - building_smiths_requirement_terrain = yes - building_requirement_castle_city_church = { LEVEL = 01 } - } - add_building = smiths_01 - } - } - } -} - -destroy_or_downgrade_temple_effect = { - if = { - limit = { has_building = temple_04 } - remove_building = temple_04 - hidden_effect = { add_building = temple_03 } - } - else_if = { - limit = { has_building = temple_03 } - remove_building = temple_03 - hidden_effect = { add_building = temple_02 } - } - else_if = { - limit = { has_building = temple_02 } - remove_building = temple_02 - hidden_effect = { add_building = temple_01 } - } - else = { remove_building = temple_01 } -} - -add_next_temple_tier_effect = { - if = { - limit = { - NOT = { has_building_or_higher = temple_01 } - } - add_building = temple_01 - } - else_if = { - limit = { has_building = temple_01 } - add_building = temple_02 - } - else_if = { - limit = { has_building = temple_02 } - add_building = temple_03 - } - else_if = { - limit = { has_building = temple_03 } - add_building = temple_04 - } -} diff --git a/common/scripted_effects/00_decisions_effects.txt b/common/scripted_effects/00_decisions_effects.txt deleted file mode 100644 index 332317625..000000000 --- a/common/scripted_effects/00_decisions_effects.txt +++ /dev/null @@ -1,3788 +0,0 @@ -#reclaim_britannia_decision_effect = { -# every_sub_realm_county = { -# limit = { -# NOR = { -# culture = { has_cultural_pillar = heritage_goidelic } -# culture = { has_cultural_pillar = heritage_brythonic } -# } -# title_province = { geographical_region = world_europe_west_britannia } -# } -# custom = british_isles.0001.custom -# add_county_modifier = { -# modifier = reclaim_britannia_culture_modifier -# days = 3650 -# } -# } -# capital_county = { -# set_county_culture = root.culture -# } -# if = { -# limit = { -# culture = { has_cultural_pillar = heritage_goidelic } -# } -# give_nickname = nick_the_tuatha_de_danann -# } -# else = { -# give_nickname = nick_pendragon -# } -#} -# -#restore_the_danelaw_effect = { -# hidden_effect = { #Should shift all dejure of all Empires owned at the time. -# title:k_england = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = title:k_danelaw -# } -# } -# title:k_danelaw = { -# set_de_jure_liege_title = title:k_england.de_jure_liege -# } -# } -# give_nickname = nick_the_dane -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:k_danelaw = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# title:k_danelaw = { -# add_title_law = scandinavian_elective_succession_law -# } -# -# if = { -# limit = { -# NOT = { highest_held_title_tier = tier_empire } -# NOT = { has_primary_title = title:k_danelaw } -# } -# set_primary_title_to = title:k_danelaw -# } -# -# #Destroy england -# destroy_title = title:k_england -#} - -create_holy_order_effect = { - hidden_effect = { - if = { # set up currencies for the HO leader, has to be saved as scope:leader - limit = { - exists = scope:leader - } - scope:leader = { - add_gold = 100 #So that they have some money to lend out - add_piety_level = 2 - add_gold = holy_order_starting_gold - every_courtier = { - add_trait = order_member - } - } - - # send messages - send_interface_toast = { - type = holy_order_founded_message - desc = i_created_holy_order_message - left_icon = scope:leader - right_icon = scope:new_holy_order.title - } - } - # send messages to relevant characters that HO got created - save_scope_as = holy_order_creator - every_player = { - limit = { - faith = scope:holy_order_creator.faith - this != scope:holy_order_creator - } - send_interface_message = { - type = holy_order_founded_message - desc = someone_created_holy_order_message - left_icon = scope:holy_order_creator - right_icon = scope:new_holy_order.title - } - } - every_neighboring_top_liege_realm_owner = { - limit = { - faith != scope:holy_order_creator.faith - } - send_interface_message = { - type = enemy_holy_order_founded_message - desc = other_faith_neighbor_created_holy_order_message - left_icon = scope:holy_order_creator - right_icon = scope:new_holy_order.title - } - } - # get the achievements for creating a HO - add_achievement_flag_effect = { FLAG = achievement_non_nobis_domine_flag } - if = { - limit = { exists = global_var:started_give_a_dog_a_bone_achievement } - add_achievement_global_variable_effect = { - VARIABLE = holy_order_give_a_dog_a_bone_achievement - VALUE = yes - } - } - } - # gain opinion with your HoF, if you have one and it's not you - if = { - limit = { - exists = faith.religious_head - faith.religious_head != root - } - faith.religious_head = { - add_opinion = { - target = root - modifier = founded_holy_order_opinion - } - } - } - # get a nice modifier - if = { - limit = { - NOT = { has_character_modifier = founded_holy_order_modifier } - } - add_character_modifier = { - modifier = founded_holy_order_modifier - years = 5 - } - } - # and boost the fervor - faith = { - change_fervor = { - value = 10 - desc = fervor_gain_holy_order_founded - } - } -} - -#embrace_english_culture_effect = { -# # Scopes saves for localization -# root = { -# save_scope_as = embracer -# } -# -# # Prestige Bonus -# add_prestige = medium_prestige_gain -# -# #Convert your, and your whole family's, culture -# set_culture = culture:english -# if = { -# limit = { any_spouse = { is_playable_character = no } } -# every_spouse = { -# limit = { -# is_playable_character = no -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# } -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_close_family_member = { -# is_playable_character = no -# NOT = { is_spouse_of = root } -# } -# } -# every_close_family_member = { -# limit = { -# is_playable_character = no -# NOT = { is_spouse_of = root } -# } -# custom = all_unlanded_family_members -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_child = { -# NOT = { is_spouse_of = root } -# } -# } -# every_child = { -# limit = { -# NOT = { is_spouse_of = root } -# } -# custom = all_children_custom -# set_culture = culture:english -# } -# } -# -# #Convert appropriate vassals, and their family -# if = { -# limit = { -# any_vassal_or_below = { -# is_ai = yes -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# primary_title = { -# OR = { -# de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege.de_jure_liege = title:k_england -# } -# } -# } -# } -# every_vassal_or_below = { -# custom = embrace_english_culture_vassals_custom -# limit = { -# is_ai = yes -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# primary_title = { -# OR = { -# de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege.de_jure_liege = title:k_england -# } -# } -# } -# set_culture = culture:english -# hidden_effect = { -# if = { -# limit = { any_spouse = { is_playable_character = no } } -# every_spouse = { -# limit = { -# is_playable_character = no -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# } -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_close_family_member = { -# is_playable_character = no -# NOT = { is_spouse_of = prev } -# } -# } -# every_close_family_member = { -# limit = { -# is_playable_character = no -# NOT = { is_spouse_of = prev } -# } -# custom = all_unlanded_family_members -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_child = { -# NOT = { is_spouse_of = prev } -# } -# } -# every_child = { -# limit = { -# NOT = { is_spouse_of = prev } -# } -# custom = all_children_custom -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_vassal_or_below = { -# is_ai = yes -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# primary_title = { -# OR = { -# de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege.de_jure_liege = title:k_england -# } -# } -# } -# } -# every_vassal_or_below = { -# custom = embrace_english_culture_vassals_custom -# limit = { -# is_ai = yes -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# primary_title = { -# OR = { -# de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege = title:k_england -# de_jure_liege.de_jure_liege.de_jure_liege = title:k_england -# } -# } -# } -# set_culture = culture:english -# hidden_effect = { -# if = { -# limit = { any_spouse = { is_playable_character = no } } -# every_spouse = { -# limit = { -# is_playable_character = no -# OR = { -# culture = culture:norman -# culture = culture:french -# } -# } -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_close_family_member = { -# is_playable_character = no -# NOT = { is_spouse_of = prev } -# } -# } -# every_close_family_member = { -# limit = { -# is_playable_character = no -# NOT = { is_spouse_of = prev } -# } -# custom = all_unlanded_family_members -# set_culture = culture:english -# } -# } -# if = { -# limit = { -# any_child = { -# NOT = { is_spouse_of = prev } -# } -# } -# every_child = { -# limit = { -# NOT = { is_spouse_of = prev } -# } -# custom = all_children_custom -# set_culture = culture:english -# } -# } -# } -# } -# } -# } -# } -# } -# -# #Flip Counties -# every_county_in_region = { -# region = custom_england -# custom = embrace_english_culture_counties_custom -# limit = { -# target_is_de_facto_liege_or_above = root.primary_title -# } -# random = { -# chance = 40 -# set_county_culture = culture:english -# } -# } -# -# culture:english = { -# custom_tooltip = decision_embrace_english_culture_get_innovations -# hidden_effect = { -# reset_culture_creation_date = yes -# get_all_innovations_from = culture:norman -# get_all_innovations_from = culture:anglo_saxon -# } -# } -# -# remove_global_variable = harrying_of_the_north -# every_player = { -# limit = { -# capital_province = { -# geographical_region = world_europe_west_britannia -# } -# } -# trigger_event = ep3_story_cycle_harrying.0004 -# } -# global_var:harrying_of_the_north = { end_story = yes } -#} -# -#form_portugal_decision_effects = { -# #Create the title and set proper de jure -# hidden_effect = { -# title:d_porto = { -# save_scope_as = title_d_porto -# set_de_jure_liege_title = title:k_portugal -# } -# title:d_coimbra = { -# save_scope_as = title_d_coimbra -# set_de_jure_liege_title = title:k_portugal -# } -# title:d_beja = { -# save_scope_as = title_d_beja -# set_de_jure_liege_title = title:k_portugal -# } -# title:d_algarve = { -# save_scope_as = title_d_algarve -# set_de_jure_liege_title = title:k_portugal -# } -# title:k_portugal = { -# save_scope_as = title_k_portugal -# } -# } -# custom_tooltip = form_portugal_decision_effects_de_jure_tt -# -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_portugal = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# save_scope_as = title_k_portugal -# } -# resolve_title_and_vassal_change = scope:title_change -# -# if = { -# limit = { -# NOR = { -# primary_title = { this = title:k_portugal } -# highest_held_title_tier = tier_empire -# } -# } -# set_primary_title_to = title:k_portugal -# } -# -# hidden_effect = { -# if = { -# limit = { has_global_variable = fp2_struggle_compromise_ending } -# title:k_portugal = { fp2_struggle_compromise_create_new_empire_effect = yes } -# } -# } -# -# #Covert self & court to portuguese culture -# if = { -# limit = { NOT = { has_culture = culture:portuguese } } -# -# every_courtier = { -# limit = { has_same_culture_as = scope:portugal_former } -# add_to_list = convert_list -# } -# #transfer over innovations from previous culture. -# culture:portuguese = { -# hidden_effect = { reset_culture_creation_date = yes } -# get_all_innovations_from = scope:portugal_former.culture -# } -# set_culture = culture:portuguese -# -# every_in_list = { -# list = convert_list -# custom = portguese_convert_list #This says "every subject in the realm" even though vassals and their courts only covert later, through event -# set_culture = culture:portuguese -# } -# } -# -# # Convert Iberian counties to Portugese culture -# every_sub_realm_county = { -# limit = { -# tier = tier_county -# culture = { has_cultural_pillar = heritage_iberian } -# OR = { -# de_jure_liege = title:d_porto -# de_jure_liege = title:d_coimbra -# de_jure_liege = title:d_beja -# de_jure_liege = title:d_algarve -# } -# } -# custom = portugese_convert_iberian_counties -# set_county_culture = culture:portuguese -# } -# every_sub_realm_county = { -# limit = { -# tier = tier_county -# NOT = { culture = { has_cultural_pillar = heritage_iberian } } -# OR = { -# de_jure_liege = title:d_porto -# de_jure_liege = title:d_coimbra -# de_jure_liege = title:d_beja -# de_jure_liege = title:d_algarve -# } -# } -# custom = portugese_convert_non_iberian_counties -# random = { -# chance = 50 -# set_county_culture = culture:portuguese -# } -# } -# -# #Innovations -# culture:portuguese = { -# add_random_innovation = culture_group_military -# add_random_innovation = culture_group_civic -# } -# -# #Prestige -# add_prestige = massive_prestige_gain -#} -# -# -#declare_canarias_decision_effects = { -# #Create the title and set proper de jure -# title:d_canarias = { -# save_scope_as = d_canarias -# set_de_jure_liege_title = title:k_canarias -# } -# title:k_canarias = { -# save_scope_as = title_k_canarias -# } -# -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_canarias = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# save_scope_as = title_k_canarias -# } -# resolve_title_and_vassal_change = scope:title_change -# -# if = { -# limit = { -# NOR = { -# primary_title = { this = title:k_canarias } -# highest_held_title_tier = tier_empire -# } -# } -# set_primary_title_to = title:k_canarias -# } -# -# #Prestige -# add_prestige = massive_prestige_gain -#} -# -# -# -#unite_the_spanish_thrones_decision_effects = { -# #Prestige -# add_prestige = massive_prestige_gain -# -# #Laws -# if = { -# limit = { has_realm_law = crown_authority_0 } -# add_realm_law_skip_effects = crown_authority_2 -# } -# else_if = { -# limit = { -# OR = { -# has_realm_law = crown_authority_1 -# has_realm_law = crown_authority_2 -# } -# } -# add_realm_law_skip_effects = crown_authority_3 -# } -# -# # Coat of Arms -# if = { -# limit = { scope:spain_uniter.primary_title = title:k_castille } -# primary_title = { set_coa = k_castille_leon } -# } -# else_if = { -# limit = { scope:spain_uniter.primary_title = title:k_leon } -# primary_title = { set_coa = k_leon_castille } -# } -# -# #Handle other Kingdom titles -# title:k_castille = { add_to_list = spanish_kingdoms } -# title:k_leon = { add_to_list = spanish_kingdoms } -# title:k_spanish_galicia = { add_to_list = spanish_kingdoms } -# title:k_portugal = { add_to_list = spanish_kingdoms } -# title:k_aragon = { add_to_list = spanish_kingdoms } -# title:k_navarra = { add_to_list = spanish_kingdoms } -# title:k_andalusia = { add_to_list = spanish_kingdoms } -# title:k_badajoz = { add_to_list = spanish_kingdoms } -# title:k_valencia = { add_to_list = spanish_kingdoms } -# title:k_toledo = { add_to_list = spanish_kingdoms } -# -# custom_tooltip = unite_the_spanish_thrones_decision_titles_tt -# hidden_effect = { -# every_in_list = { -# list = spanish_kingdoms -# limit = { -# this != scope:spain_uniter.primary_title -# scope:spain_uniter = { completely_controls = prev } -# } -# -# #De jure shift all held spanish titles into your primary title -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = scope:spain_uniter.primary_title -# } -# -# #Destroys them all! -# scope:spain_uniter = { destroy_title = prev } -# } -# } -#} -# -#unite_africa_decision_effects = { -# #Prestige -# add_prestige = massive_prestige_gain -# -# #Religion bonuses -# if = { -# limit = { -# faith = { -# OR = { -# religion_tag = islam_religion -# religion_tag = west_african_roog_religion -# religion_tag = west_african_religion -# religion_tag = west_african_bori_religion -# this = faith:coptic -# -# } -# } -# } -# add_piety = massive_piety_gain -# faith = { -# change_fervor = { -# value = medium_fervor_gain -# desc = fervor_gain_united_africa -# } -# } -# -# if = { -# limit = { -# any_vassal_or_below = { -# faith != scope:africa_uniter.faith -# is_ai = yes -# capital_province ?= { geographical_region = world_africa } -# } -# } -# every_vassal_or_below = { -# custom = every_non_root_faith_vassal_africa -# limit = { -# faith != scope:africa_uniter.faith -# is_ai = yes -# capital_province ?= { geographical_region = world_africa } -# } -# random = { -# chance = 33 -# set_character_faith = scope:africa_uniter.faith -# } -# } -# } -# -# if = { -# limit = { -# any_realm_province = { -# faith != scope:africa_uniter.faith -# geographical_region = world_africa -# } -# } -# every_realm_province = { -# limit = { -# faith != scope:africa_uniter.faith -# geographical_region = world_africa -# } -# county = { add_to_list = every_realm_county } -# } -# -# every_in_list = { -# list = every_realm_county -# custom = every_non_root_faith_county_africa -# random = { -# chance = 33 -# custom_tooltip = every_non_africa_uniter_faith_convert -# hidden_effect = { set_county_faith = scope:africa_uniter.faith } -# } -# } -# } -# } -#} -# -#avenge_the_battle_of_tours_decision_effects = { -# -# give_nickname = nick_the_avenger -# add_character_modifier = { -# modifier = avenger_of_the_martyrs -# } -# -# add_prestige = massive_prestige_gain -# -# #Religious bonuses -# add_piety = massive_piety_gain -# faith = { -# change_fervor = { -# value = medium_fervor_gain -# desc = fervor_gain_avenged_battle_of_tours -# } -# } -# -# add_achievement_flag_effect = { FLAG = achievement_al_andalus_flag } -# -# if = { -# limit = { -# any_vassal_or_below = { -# faith != scope:avenger.faith -# is_ai = yes -# capital_province ?= { geographical_region = world_europe_west } -# } -# } -# every_vassal_or_below = { -# custom = every_non_root_faith_vassal_west_europe -# limit = { -# faith != scope:avenger.faith -# is_ai = yes -# capital_province ?= { geographical_region = world_europe_west } -# } -# random = { -# chance = 33 -# set_character_faith = scope:avenger.faith -# } -# } -# } -# -# if = { -# limit = { -# any_realm_province = { -# faith != scope:avenger.faith -# geographical_region = world_europe_west -# } -# } -# every_realm_province = { -# limit = { -# faith != scope:avenger.faith -# geographical_region = world_europe_west -# } -# county = { -# add_to_list = every_realm_county -# } -# } -# -# every_in_list = { -# list = every_realm_county -# custom = every_non_root_faith_county_west_europe -# random = { -# chance = 33 -# custom_tooltip = every_non_avenger_faith_convert -# hidden_effect = { set_county_faith = scope:avenger.faith } -# } -# } -# } -# -# #Christian penalty -# if = { -# limit = { exists = scope:frankish_christian_faith } -# scope:frankish_christian_faith = { -# change_fervor = { -# value = medium_fervor_loss -# desc = fervor_loss_avenged_battle_of_tours -# } -# } -# } -# -# # Rattach south of France to the e_hispania -# title:e_france = { -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# any_in_de_jure_hierarchy = { -# tier = tier_county -# title_province = { geographical_region = custom_south_francia } -# } -# } -# set_de_jure_liege_title = title:e_spain -# } -# } -#} -# -#unite_the_western_slavs_decision_effects = { -# #Prestige -# add_prestige = massive_prestige_gain -# -# #Innovations -# culture = { -# add_random_innovation = culture_group_military -# add_random_innovation = culture_group_civic -# } -# -# #Laws -# if = { -# limit = { has_realm_law = crown_authority_0 } -# add_realm_law_skip_effects = crown_authority_2 -# } -# else_if = { -# limit = { -# OR = { -# has_realm_law = crown_authority_1 -# has_realm_law = crown_authority_2 -# } -# } -# add_realm_law_skip_effects = crown_authority_3 -# } -# -# #Handle de jure drift & destructions of other kingdom titles -# title:k_poland = { add_to_list = west_slavic_kingdoms } -# title:k_pomerania = { add_to_list = west_slavic_kingdoms } -# title:k_bohemia = { add_to_list = west_slavic_kingdoms } -# title:k_sorbia = { add_to_list = west_slavic_kingdoms } -# title:k_moravia = { add_to_list = west_slavic_kingdoms } -# -# if = { -# limit = { highest_held_title_tier = tier_kingdom } -# custom_tooltip = unite_the_western_slavs_decision_titles_tt -# } -# custom_tooltip = unite_the_western_slavs_decision_titles_empire_tt -# # If Saxony has been created, shift everything back into Polabia -# if = { -# limit = { -# is_target_in_global_variable_list = { -# name = unavailable_unique_decisions -# target = flag:flag_formed_saxony -# } -# } -# title:k_saxony = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = title:k_sorbia -# } -# } -# } -# hidden_effect = { -# every_duchy = { -# limit = { -# title_capital_county.title_province ?= { -# geographical_region = custom_west_slavia -# } -# kingdom ?= { -# NOR = { -# this = title:k_poland -# this = title:k_pomerania -# this = title:k_bohemia -# this = title:k_moravia -# this = title:k_sorbia -# } -# } -# } -# set_de_jure_liege_title = title:k_sorbia -# } -# scope:western_slav_uniter = { -# #If king-tier, give them the West-Slavia title -# if = { -# limit = { highest_held_title_tier = tier_kingdom } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_west_slavia = { -# change_title_holder = { -# holder = scope:western_slav_uniter -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# } -# # Drift kingdoms to empire -# every_in_list = { -# list = west_slavic_kingdoms -# set_de_jure_liege_title = scope:western_slav_uniter.primary_title -# } -# } -# } -#} -# -#unite_the_southern_slavs_decision_effects = { -# #Prestige -# add_prestige = massive_prestige_gain -# -# #Innovations -# culture = { -# add_random_innovation = culture_group_military -# add_random_innovation = culture_group_civic -# } -# -# #Handle de jure drift & destructions of other kingdom titles -# title:k_croatia = { add_to_list = south_slavic_kingdoms } -# title:k_serbia = { add_to_list = south_slavic_kingdoms } -# title:k_bulgaria = { add_to_list = south_slavic_kingdoms } -# title:k_dacia = { add_to_list = south_slavic_kingdoms } -# title:k_moldavia = { add_to_list = south_slavic_kingdoms } -# -# custom_tooltip = unite_the_southern_slavs_decision_titles_tt -# hidden_effect = { -# every_in_list = { -# list = south_slavic_kingdoms -# limit = { -# this != scope:southern_slav_uniter.primary_title -# scope:southern_slav_uniter = { completely_controls = prev } -# } -# -# #De jure shift all held west slavic titles into your primary title -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = scope:southern_slav_uniter.primary_title -# } -# -# #Destroys them all! -# scope:southern_slav_uniter = { destroy_title = prev } -# } -# } -#} -# -#unite_the_slavs_decision_effects = { -# #Prestige -# add_prestige = massive_prestige_gain -# -# #Innovations -# custom_tooltip = unite_the_slavs_decision_effects_innovations_tt -# hidden_effect = { -# #Add all Slavic cultures in the realm in a list -# every_vassal_or_below = { -# limit = { -# OR = { -# culture = { has_cultural_pillar = heritage_west_slavic } -# culture = { has_cultural_pillar = heritage_east_slavic } -# culture = { has_cultural_pillar = heritage_south_slavic } -# } -# save_temporary_scope_as = slavic_vassal -# NOT = { -# any_in_list = { -# list = slavic_cultures -# this = scope:slavic_vassal.culture -# } -# } -# } -# culture = { -# add_to_list = slavic_cultures -# } -# } -# #Add innovations from 3 random cultures -# every_in_list = { -# list = slavic_cultures -# save_scope_as = culture_getting_innovations -# -# set_while_counter_variable_effect = yes -# while = { -# limit = { var:while_counter < 3 } -# random_in_list = { -# limit = { scope:culture_getting_innovations = { can_get_innovation_from = prev } } -# list = slavic_cultures -# scope:culture_getting_innovations = { get_random_innovation_from = prev } -# } -# increase_while_counter_variable_effect = yes -# } -# remove_while_counter_variable_effect = yes -# } -# } -# -# #Create the title and make it primary -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_slavia = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# set_primary_title_to = title:e_slavia -# title:e_slavia = { save_scope_as = slavia } #For localisation -# -# #Destroy the other three empires if I have them -# if = { -# limit = { has_title = title:e_russia } -# destroy_title = title:e_russia -# } -# if = { -# limit = { has_title = title:e_wendish_empire } -# destroy_title = title:e_wendish_empire -# } -# if = { -# limit = { has_title = title:e_carpathia } -# destroy_title = title:e_carpathia -# } -# -# ###Handle de jure drift and empire destruction### -# -# #First: add all the kingdoms -# title:k_poland = { add_to_list = slavic_kingdoms } -# title:k_pomerania = { add_to_list = slavic_kingdoms } -# title:k_bohemia = { add_to_list = slavic_kingdoms } -# title:k_moravia = { add_to_list = slavic_kingdoms } -# title:k_croatia = { add_to_list = slavic_kingdoms } -# title:k_serbia = { add_to_list = slavic_kingdoms } -# title:k_bulgaria = { add_to_list = slavic_kingdoms } -# title:k_dacia = { add_to_list = slavic_kingdoms } -# title:k_moldavia = { add_to_list = slavic_kingdoms } -# title:k_white_rus = { add_to_list = slavic_kingdoms } -# title:k_galicia-volhynia = { add_to_list = slavic_kingdoms } -# title:k_ruthenia = { add_to_list = slavic_kingdoms } -# title:k_novgorod = { add_to_list = slavic_kingdoms } -# title:k_opolye = { add_to_list = slavic_kingdoms } -# title:k_hungary = { add_to_list = slavic_kingdoms } -# title:k_bosnia = { add_to_list = slavic_kingdoms } -# -# # Inform players of the de jure drift -# title:e_slavia = { custom_tooltip = unite_the_slavs_decision_titles_tt } #Scope change for tooltip formatting. -# -# if = { -# limit = { has_dlc_feature = legends } -# create_legend_seed = { -# type = legitimizing -# quality = illustrious -# chronicle = new_title -# properties = { -# title = title:e_slavia -# founder = root -# } -# } -# } -# # Actually do the de jure drift -# hidden_effect = { -# every_in_list = { -# list = slavic_kingdoms -# -# set_de_jure_liege_title = scope:slav_uniter.primary_title -# } -# } -#} -# -#unite_india_decision_effect = { -# #Create the title and make it primary -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:h_india = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# set_primary_title_to = title:h_india -# -# title:e_rajastan = { set_de_jure_liege_title = title:h_india } -# title:e_deccan = { set_de_jure_liege_title = title:h_india } -# title:e_bengal = { set_de_jure_liege_title = title:h_india } -# -# hidden_effect = { -# if = { -# limit = { has_title = title:e_rajastan } -# destroy_title = title:e_rajastan -# } -# if = { -# limit = { has_title = title:e_deccan } -# destroy_title = title:e_deccan -# } -# if = { -# limit = { has_title = title:e_bengal } -# destroy_title = title:e_bengal -# } -# } -#} -# -#become_saoshyant_decision_effect = { -# set_nickname_effect = { NICKNAME = nick_the_saoshyant } -# add_trait = saoshyant -# custom_tooltip = become_saoshyant_decision_decendant_trait_tooltip -# dynasty = { -# add_dynasty_modifier = { -# modifier = resurging_saoshyant -# years = 25 -# } -# } -# if = { -# limit = { -# any_held_title = { -# title_tier = county -# faith != root.faith -# } -# } -# every_held_title = { -# custom = all_held_counties -# title_tier = county -# limit = { -# faith != root.faith -# } -# random = { -# chance = 35 -# set_county_faith = root.faith -# } -# } -# } -# faith = { -# change_fervor = { -# value = 15 -# desc = fervor_gain_saoshyant -# } -# } -#} - -build_grand_church_decision_effect = { - #faith = { activate_holy_site = segrada_familia } - if = { - limit = { - prestige_level < 5 - } - add_prestige_level = 1 - } -} - -accept_cannibalism_decision_effect = { - custom_tooltip = faith_accept_cannibalism - root.faith = { - set_variable = { - name = accepted_cannibalism - value = yes - } - } - root = { - if = { - limit = { - any_spouse = { - is_cannibal_trigger = no - is_ai = yes - } - } - every_spouse = { - limit = { - is_cannibal_trigger = no - is_ai = yes - } - add_trait = cannibal - } - } - if = { - limit = { - any_close_family_member = { - is_cannibal_trigger = no - is_playable_character = no - is_ai = yes - } - } - every_close_family_member = { - limit = { - is_cannibal_trigger = no - is_playable_character = no - is_ai = yes - } - custom = all_my_family_members - add_trait = cannibal - } - } - if = { - limit = { - any_vassal = { - is_cannibal_trigger = no - is_ai = yes - dread_modified_ai_boldness = { #all vassals that are intimidated - dreaded_character = root - value <= -50 - } - } - } - every_vassal = { - limit = { - is_cannibal_trigger = no - is_ai = yes - dread_modified_ai_boldness = { - dreaded_character = root - value <= -50 - } - } - custom = all_my_intimidated_vassals - add_trait = cannibal - } - } - } - give_nickname = nick_the_devourer -} - -found_university_decision_event_effect = { - if = { - limit = { - OR = { - has_bad_nickname = yes - has_any_nickname = no - } - } - give_nickname = nick_the_scholar - } - - hidden_effect = { - #Event that gives you highly skilled courtier - trigger_event = { - id = major_decisions.2011 - days = { 50 365 } - } - } -} - -found_university_decision_effect = { - found_university_decision_event_effect = yes - - if = { - limit = { - NOT = { has_variable = university } - } - show_as_tooltip = { - every_held_title = { - custom = decision_found_university_custom - title_tier = barony - title_capital_county.title_province = { - add_special_building_slot = generic_university - } - } - } - } -} - -lunatic_building_decision_effect = { - capital_province = { - set_variable = { #To unlock the building - name = variable_greenhouse - value = yes - } - add_special_building_slot = special_greenhouse_01 - add_special_building = special_greenhouse_01 - #add_province_modifier = extra_building_slot - #add_building = special_greenhouse_01 - } - - give_nickname = nick_the_glass -} - -found_witch_coven_decision_effects = { - save_scope_as = founder - custom_tooltip = found_witch_coven_decision_effects.children.tt - custom_tooltip = found_witch_coven_decision_effects.convert.tt - custom_tooltip = found_witch_coven_decision_effects.grand_rite.tt - house = { - add_house_modifier = { - modifier = witch_coven - } - } - # Check for the Volva achievement. - if = { - limit = { - # DLC check. - has_fp1_dlc_trigger = yes - fp1_achievement_religious_norse_trigger = yes - } - add_achievement_flag_effect = { FLAG = volva_achievement_flag } - } -} - -convert_whole_realm_to_feudalism_effect = { - #TOOLTIP INFO - #PLAYER EFFECTS - - hidden_effect = { - ## Spawn holdings in tribal counties - - every_sub_realm_county = { # Spawn temples in your holy sites - limit = { - any_county_province = { - has_holding_type = tribal_holding - } - NOT = { - any_county_province = { - has_holding_type = church_holding - } - } - any_county_province = { - has_holding = no - barony = { - is_holy_site_of = root.faith - } - } - } - random_county_province = { - limit = { - has_holding = no - barony_cannot_construct_holding = no - barony = { - is_holy_site_of = root.faith - } - } - set_holding_type = church_holding - } - hidden_effect = { - if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier } - remove_county_modifier = mpo_siberian_permafrost_modifier - } - else_if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier_bad } - remove_county_modifier = mpo_siberian_permafrost_modifier_bad - } - } - } - - every_sub_realm_county = { # Spawn a City - limit = { - any_county_province = { - has_holding_type = tribal_holding - } - any_county_province = { - has_holding = no - } - NOT = { - any_county_province = { - has_holding_type = city_holding - } - } - } - random_county_province = { - limit = { - has_holding = no - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - is_coastal = yes - has_special_building_slot = no - barony_cannot_construct_holding = no - } - alternative_limit = { - has_holding = no - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - has_special_building_slot = no - barony_cannot_construct_holding = no - } - alternative_limit = { - has_holding = no - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - barony_cannot_construct_holding = no - } - alternative_limit = { - has_holding = no - barony_cannot_construct_holding = no - } - random = { - chance = 60 - modifier = { - add = county.development_level - } - modifier = { - add = 50 - this.county = root.capital_county - } - modifier = { - add = 20 - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - } - set_holding_type = city_holding - } - } - hidden_effect = { - if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier } - remove_county_modifier = mpo_siberian_permafrost_modifier - } - else_if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier_bad } - remove_county_modifier = mpo_siberian_permafrost_modifier_bad - } - } - } - - every_sub_realm_county = { # Spawn a Temple - limit = { - any_county_province = { - has_holding_type = tribal_holding - } - any_county_province = { - has_holding = no - } - NOT = { - any_county_province = { - has_holding_type = church_holding - } - } - } - random_county_province = { - limit = { - has_holding = no - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - is_coastal = yes - has_special_building_slot = no - barony_cannot_construct_holding = no - } - alternative_limit = { - has_holding = no - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - has_special_building_slot = no - barony_cannot_construct_holding = no - } - alternative_limit = { - has_holding = no - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - barony_cannot_construct_holding = no - } - alternative_limit = { - has_holding = no - barony_cannot_construct_holding = no - } - random = { - chance = 50 - modifier = { - add = county.development_level - } - modifier = { - add = 50 - this.county = root.capital_county - } - modifier = { - add = 20 - OR = { - terrain = floodplains - terrain = oasis - terrain = farmlands - terrain = terraced_hills - } - } - set_holding_type = church_holding - } - } - hidden_effect = { - if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier } - remove_county_modifier = mpo_siberian_permafrost_modifier - } - else_if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier_bad } - remove_county_modifier = mpo_siberian_permafrost_modifier_bad - } - } - } - - ##Sort out new buildings for liege and all vassals - every_realm_province = { - limit = { - has_holding_type = tribal_holding - NOT = { is_in_list = feudal_conversion } - } - add_to_list = feudal_conversion - } - every_vassal_or_below = { - every_realm_province = { - limit = { - has_holding_type = tribal_holding - NOT = { is_in_list = feudal_conversion } - } - add_to_list = feudal_conversion - } - } - every_in_list = { - list = feudal_conversion - set_variable = { - name = tribal_to_feudal_building_level - value = combined_building_level - days = 1 - } - set_holding_type = castle_holding - while = { - limit = { - var:tribal_to_feudal_building_level > 1 - } - generate_building = yes - change_variable = { - name = tribal_to_feudal_building_level - subtract = 1 - } - } - remove_variable = tribal_to_feudal_building_level - remove_from_list = feudal_conversion - hidden_effect = { - county = { - if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier } - remove_county_modifier = mpo_siberian_permafrost_modifier - } - else_if = { - limit = { has_county_modifier = mpo_siberian_permafrost_modifier_bad } - remove_county_modifier = mpo_siberian_permafrost_modifier_bad - } - } - } - } - } - - ##Liege has Soryo? Convert to Soryo! - if = { - limit = { - has_tgp_dlc_trigger = yes - top_liege != this - liege = { government_has_flag = government_is_japan_feudal } - } - change_government = japan_feudal_government - if = { - limit = { - is_house_head = yes - } - save_scope_as = new_head - house = { - set_house_name = japanese_dynasty_name - save_scope_as = new_house - } - create_noble_family_effect = { GOVERNMENT_GIVER = this } - scope:new_title = { - #set_title_name_dynamic = japanese_noble_family_name - set_coa = scope:new_house - } - } - } - ##Liege has clan? Convert to clan! - else_if = { - limit = { - top_liege != this - OR = { - liege = { government_has_flag = government_is_clan } - AND = { - liege = { government_has_flag = government_is_tribal } - religion = religion:islam_religion - } - } - } - change_government = clan_government - } - ##Liege has feudal? Convert to feudal! - else_if = { - limit = { - top_liege != this - OR = { - liege = { government_has_flag = government_is_feudal } - AND = { - liege = { government_has_flag = government_is_tribal } - NOT = { religion = religion:islam_religion } - } - } - } - change_government = feudal_government - } - ##You're an independent Japanese Heritage Character? Convert to Soryo! - else_if = { - limit = { - has_tgp_dlc_trigger = yes - top_liege = this - culture.culture_head ?= { government_is_japanese_trigger = yes } - } - add_character_flag = can_become_japanese_feudal # Used in the can_get_government of japan_feudal_government - change_government = japan_feudal_government - if = { - limit = { - is_house_head = yes - } - save_scope_as = new_head - house = { - set_house_name = japanese_dynasty_name - save_scope_as = new_house - } - create_noble_family_effect = { GOVERNMENT_GIVER = this } - scope:new_title = { - #set_title_name_dynamic = japanese_noble_family_name - set_coa = scope:new_house - } - } - } - ##You're an independent Muslim? Convert to clan! - else_if = { - limit = { - top_liege = this - faith = { religion_tag = islam_religion } - } - change_government = clan_government - } - ##You're an independent anything else? Convert to feudal! - else = { change_government = feudal_government } - if = { - limit = { - government_has_flag = government_is_tribal - } - ##General - custom_tooltip = all_holding_will_change - if = { - limit = { - any_sub_realm_county = { - OR = { - has_county_modifier = mpo_siberian_permafrost_modifier - has_county_modifier = mpo_siberian_permafrost_modifier_bad - } - } - } - custom_tooltip = all_permafrost_will_clear - } - ##Liege has clan? Convert to clan! - if = { - limit = { - top_liege != this - liege = { government_has_flag = government_is_clan } - } - custom_tooltip = clan_liege_vassals_will_convert - } - #Liege has feudal? Convert to feudal! - if = { - limit = { - top_liege != this - liege = { government_has_flag = government_is_feudal } - } - custom_tooltip = feudal_liege_vassals_will_convert - } - ##If I am Islamic, we will become clan. - if = { - limit = { - top_liege = this - faith = { religion_tag = islam_religion } - } - custom_tooltip = islamic_vassals_will_convert - } - ##If I am not Islamic, we will become feudal. - else_if = { - limit = { top_liege = this } - custom_tooltip = other_vassals_will_convert - } - } - - hidden_effect = { - #Nuke tribal authorities. - if = { - limit = { has_realm_law = tribal_authority_0 } - remove_realm_law = tribal_authority_0 - } - if = { - limit = { has_realm_law = tribal_authority_1 } - remove_realm_law = tribal_authority_1 - } - if = { - limit = { has_realm_law = tribal_authority_2 } - remove_realm_law = tribal_authority_2 - } - if = { - limit = { has_realm_law = tribal_authority_3 } - remove_realm_law = tribal_authority_3 - } - #Start off crown authorities. - if = { - limit = { - NOT = { has_realm_law = crown_authority_0 } - } - add_realm_law_skip_effects = crown_authority_0 - } - - #Also convert every vassal. - #Liege has taken soryo, so become soryo. - if = { - limit = { - government_has_flag = government_is_japan_feudal - } - every_vassal_or_below = { - limit = { government_has_flag = government_is_tribal } - add_character_flag = can_become_japanese_feudal # Used in the can_get_government of japan_feudal_government - change_government = japan_feudal_government - if = { - limit = { - is_house_head = yes - } - save_scope_as = new_head - house = { - set_house_name = japanese_dynasty_name - save_scope_as = new_house - } - if = { - limit = { - highest_held_title_tier >= tier_county - } - create_noble_family_effect = { GOVERNMENT_GIVER = this } - scope:new_title = { - #set_title_name_dynamic = japanese_noble_family_name - set_coa = scope:new_house - } - } - } - #Nuke tribal authorities. - if = { - limit = { has_realm_law = tribal_authority_0 } - remove_realm_law = tribal_authority_0 - } - if = { - limit = { has_realm_law = tribal_authority_1 } - remove_realm_law = tribal_authority_1 - } - if = { - limit = { has_realm_law = tribal_authority_2 } - remove_realm_law = tribal_authority_2 - } - if = { - limit = { has_realm_law = tribal_authority_3 } - remove_realm_law = tribal_authority_3 - } - if = { - limit = { - NOT = { has_realm_law = japanese_bureaucracy_0 } - } - add_realm_law_skip_effects = japanese_bureaucracy_0 - } - } - } - #Liege has taken clan, so become clan. - else_if = { - limit = { - government_has_flag = government_is_clan - } - every_vassal_or_below = { - limit = { government_has_flag = government_is_tribal } - change_government = clan_government - #Nuke tribal authorities. - if = { - limit = { has_realm_law = tribal_authority_0 } - remove_realm_law = tribal_authority_0 - } - if = { - limit = { has_realm_law = tribal_authority_1 } - remove_realm_law = tribal_authority_1 - } - if = { - limit = { has_realm_law = tribal_authority_2 } - remove_realm_law = tribal_authority_2 - } - if = { - limit = { has_realm_law = tribal_authority_3 } - remove_realm_law = tribal_authority_3 - } - if = { - limit = { - NOT = { has_realm_law = crown_authority_0 } - } - add_realm_law_skip_effects = crown_authority_0 - } - } - } - #Liege is not clan, become feudal. - else = { - every_vassal_or_below = { - limit = { government_has_flag = government_is_tribal } - change_government = feudal_government - #Nuke tribal authorities. - if = { - limit = { has_realm_law = tribal_authority_0 } - remove_realm_law = tribal_authority_0 - } - if = { - limit = { has_realm_law = tribal_authority_1 } - remove_realm_law = tribal_authority_1 - } - if = { - limit = { has_realm_law = tribal_authority_2 } - remove_realm_law = tribal_authority_2 - } - if = { - limit = { has_realm_law = tribal_authority_3 } - remove_realm_law = tribal_authority_3 - } - if = { - limit = { - NOT = { has_realm_law = crown_authority_0 } - } - add_realm_law_skip_effects = crown_authority_0 - } - } - } - } -} - -################################################## -# Add Special Succession Effects - -special_succession_witengamot_effect = { - if = { - limit = { highest_held_title_tier = tier_empire } - every_held_title = { - title_tier = empire - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = saxon_elective_succession_law - } - every_vassal = { - limit = { special_succession_witengamot_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_witengamot - } - } - else = { - every_held_title = { - title_tier = kingdom - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = saxon_elective_succession_law - } - every_vassal = { - limit = { special_succession_witengamot_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_witengamot - } - } -} - -special_succession_thing_effect = { - if = { - limit = { highest_held_title_tier = tier_empire } - every_held_title = { - title_tier = empire - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = scandinavian_elective_succession_law - } - every_vassal = { - limit = { special_succession_thing_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_thing - } - } - else = { - every_held_title = { - title_tier = kingdom - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = scandinavian_elective_succession_law - } - every_vassal = { - limit = { special_succession_thing_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_thing - } - } -} - -special_succession_tanistry_effect = { - if = { - limit = { highest_held_title_tier = tier_empire } - every_held_title = { - title_tier = empire - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = gaelic_elective_succession_law - } - every_vassal = { - limit = { special_succession_tanistry_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_tanistry - } - } - else = { - every_held_title = { - title_tier = kingdom - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = gaelic_elective_succession_law - } - every_vassal = { - limit = { special_succession_tanistry_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_tanistry - } - } -} - -special_succession_jirga_effect = { - if = { - limit = { highest_held_title_tier = tier_empire } - every_held_title = { - title_tier = empire - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = tribal_elective_succession_law - } - every_vassal = { - limit = { special_succession_jirga_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_thing - } - } - else = { - every_held_title = { - title_tier = kingdom - limit = { - NOR = { - has_title_law_flag = advanced_succession_law - has_title_law_flag = elective_succession_law - } - } - add_title_law = tribal_elective_succession_law - } - every_vassal = { - limit = { special_succession_jirga_trigger = yes } - add_opinion = { - modifier = implemented_traditional_succession_law_opinion - years = 20 - target = root - } - custom = major_decisions.3100.tt_opinion_jirga - } - } -} -# -################################################### -## Launch Hungarian Migration Effects -# -#launch_hungarian_migration_scripted_effect = { -# $INVADER$ = { -# #If Hungary already exists, just tell us it's getting a name change. -# if = { -# limit = { -# title:k_hungary = { is_title_created = yes } -# } -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.pannonia_renamed -# title:k_hungary = { set_title_name = k_hungary } -# } -# #Otherwise, if Hungary doesn't exist, create & acquire it _whilst_ giving it a name change. -# else_if = { -# limit = { -# title:k_hungary = { is_title_created = no } -# } -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.pannonia_renamed_and_usurped -# hidden_effect = { -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:k_hungary = { -# change_title_holder = { -# holder = $INVADER$ -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# title:k_hungary = { set_title_name = k_hungary } -# } -# } -# -# #If $INVADER$ has both k_hungary & any other kingdom-tier title, destroy the excess titles. -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.destroy_other_kingdoms -# hidden_effect = { -# if = { -# limit = { -# has_title = title:k_hungary -# any_held_title = { -# title_tier >= kingdom -# count >= 2 -# } -# } -# every_held_title = { -# title_tier >= kingdom -# limit = { -# NOT = { this = title:k_hungary } -# } -# save_temporary_scope_as = excess_kingdom -# $INVADER$ = { destroy_title = scope:excess_kingdom } -# } -# } -# } -# -# #Replace all Avar territories within Pannonia with Mogyer, excepting Keve & Krasso. -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.mogyers_move_to_pannonia -# hidden_effect = { -# every_sub_realm_county = { -# limit = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# culture = culture:avar -# NOR = { -# this = title:c_keve -# this = title:c_krasso -# holder = { -# AND = { -# is_ai = no -# has_culture = prev.culture -# } -# } -# } -# } -# set_county_culture = culture:mogyer -# #Switch 'em to $INVADER$'s faith if unreformed & $INVADER$ is any Magyar pagan. -# if = { -# limit = { -# $INVADER$.faith.religion = religion:magyar_religion -# faith = { has_doctrine_parameter = unreformed } -# } -# set_county_faith = $INVADER$.faith -# } -# } -# } -# -# #Replace all Mogyer territories outside of the Pannonian Basin -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.mogyers_outside_pannonia -# hidden_effect = { -# every_sub_realm_county = { -# limit = { -# NOT = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# culture = culture:mogyer -# } -# set_county_culture = culture:pecheneg -# } -# #Switch 'em to Tengri if Magyar pagan. -# every_sub_realm_county = { -# limit = { -# NOT = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# culture = culture:pecheneg -# religion = religion:magyar_religion -# } -# set_county_faith = faith:tengri_pagan -# } -# } -# -# #All territory outside Pannonia is given to new holders and/or made independent. -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.territory_outside_pannonia.non_mogyer_vassals -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.territory_outside_pannonia.mogyer_vassals -# custom_tooltip = launch_hungarian_migration_scripted_effect.tt.territory_outside_pannonia.former_territories -# hidden_effect = { -# #All direct vassal non-Mogyers are given their independence, unless they hold land within Pannonia. -# every_vassal = { -# limit = { -# NOT = { culture = culture:mogyer } -# highest_held_title_tier >= tier_county -# any_held_title = { -# count = all -# NOT = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# } -# } -# create_title_and_vassal_change = { -# type = independency -# save_scope_as = change -# add_claim_on_loss = no -# } -# becomes_independent = { change = scope:change } -# resolve_title_and_vassal_change = scope:change -# } -# #... And catch the stragglers. Has to be a separate effect block, or we'll ruin the de facto structure. -# every_vassal_or_below = { -# limit = { -# NOT = { culture = culture:mogyer } -# highest_held_title_tier >= tier_county -# any_held_title = { -# count = all -# NOT = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# } -# } -# create_title_and_vassal_change = { -# type = independency -# save_scope_as = change -# add_claim_on_loss = no -# } -# becomes_independent = { change = scope:change } -# resolve_title_and_vassal_change = scope:change -# } -# #Reserve a duchy, preferring the capital, for $INVADER$. -# if = { -# limit = { title:k_hungary.title_capital_county.duchy.holder = $INVADER$ } -# title:k_hungary.title_capital_county.duchy = { save_scope_as = reserved_title } -# } -# #... Of course, if we can't have the capital for some reason, grab any random duchy in Pannonia. -# else = { -# random_held_title = { -# title_tier = duchy -# #Filter out Syrmia, because Syrmia sucks. -# limit = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# NOT = { this = title:d_syrmia } -# } -# #But if we have no other choice, Syrmia is better than no duchy. -# alternative_limit = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# tier = tier_duchy -# } -# #If we have no possible duchy, make sure to reserve at least *one* county within Pannonia. -# alternative_limit = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# save_scope_as = reserved_title -# } -# } -# #Find all Mogyer vassals outside of Pannonia. -# every_vassal_or_below = { -# limit = { -# culture = culture:mogyer -# highest_held_title_tier >= tier_county -# } -# add_to_list = mogyer_vassals_list -# } -# #Find all Pannonian titles held by $INVADER$ that aren't reserved. -# every_held_title = { -# limit = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# #Technically we could use any_this_title_or_de_jure_above for the following two checks, but it was being problematic and this does the same thing (just more cumbersomely). -# OR = { -# tier = tier_county -# tier = tier_duchy -# } -# exists = scope:reserved_title -# this != scope:reserved_title -# } -# add_to_list = spare_pannonian_titles_list -# } -# #Attempt to give out Pannonian holdings to the vassals who are about to lose land, prioritising players by tier, then NPCs by tier. -# ##Now, process duchy title assignment. -# every_in_list = { -# list = mogyer_vassals_list -# #Players first. -# limit = { -# is_ai = no -# launch_hungarian_migration_ducal_processing_trigger = yes -# } -# #NPCs after that. -# alternative_limit = { -# is_ai = yes -# launch_hungarian_migration_ducal_processing_trigger = yes -# } -# #Grab the appropriate vassal. -# save_temporary_scope_as = receiving_vassal -# #If $INVADER$ has a suitable spare ducal title, hand it over. -# if = { -# limit = { -# any_in_list = { -# list = spare_pannonian_titles_list -# tier = tier_duchy -# holder = $INVADER$ -# } -# } -# #Save the suitable title. -# random_in_list = { -# list = spare_pannonian_titles_list -# limit = { -# tier = tier_duchy -# holder = $INVADER$ -# } -# every_in_de_jure_hierarchy = { -# limit = { -# holder = $INVADER$ -# tier >= tier_county -# } -# add_to_list = multiple_donated_titles -# } -# } -# #Hand it to the receiving vassal. -# create_title_and_vassal_change = { -# type = granted -# save_scope_as = change -# add_claim_on_loss = no -# } -# every_in_list = { -# list = multiple_donated_titles -# save_temporary_scope_as = donated_title -# scope:donated_title = { -# change_title_holder = { -# holder = scope:receiving_vassal -# change = scope:change -# } -# } -# remove_from_list = multiple_donated_titles -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# ##Finally, process county title assignment. -# ###First, attempt to pair de facto sub-vassals to their lieges. -# every_in_list = { -# list = mogyer_vassals_list -# #Players first. -# limit = { -# is_ai = no -# launch_hungarian_migration_count_processing_trigger = yes -# } -# #NPCs after that. -# alternative_limit = { -# is_ai = yes -# launch_hungarian_migration_count_processing_trigger = yes -# } -# #Grab the appropriate vassal. -# save_temporary_scope_as = receiving_vassal -# #If $INVADER$ has a suitable spare county title, hand it over. -# if = { -# #Try to pair vassals with their lieges first. -# limit = { -# #Direct vassals shouldn't bother to try pairing. -# NOT = { liege = $INVADER$ } -# any_in_list = { -# list = spare_pannonian_titles_list -# launch_hungarian_migration_sub_vassal_liege_pairing_trigger = yes -# } -# } -# #Save the suitable title. -# random_in_list = { -# list = spare_pannonian_titles_list -# limit = { -# #Direct vassals shouldn't bother to try pairing. -# NOT = { scope:receiving_vassal.liege = $INVADER$ } -# #Run the stock trigger. -# launch_hungarian_migration_sub_vassal_liege_pairing_trigger = yes -# #Don't give away the new liege's primary title's capital county. -# this != holder.primary_title.title_capital_county -# } -# save_temporary_scope_as = donated_title -# } -# #Hand it to the receiving vassal. -# create_title_and_vassal_change = { -# type = granted -# save_scope_as = change -# add_claim_on_loss = no -# } -# scope:donated_title = { -# change_title_holder = { -# holder = scope:receiving_vassal -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# ###Then, filter through any remaining direct vassals. -# every_in_list = { -# list = mogyer_vassals_list -# #Players first. -# limit = { -# is_ai = no -# launch_hungarian_migration_count_processing_trigger = yes -# } -# #NPCs after that. -# alternative_limit = { -# is_ai = yes -# launch_hungarian_migration_count_processing_trigger = yes -# } -# #Grab the appropriate vassal. -# save_temporary_scope_as = receiving_vassal -# #If $INVADER$ has a suitable spare county title, hand it over. -# if = { -# #Otherwise, grab any spare valid title that $INVADER$ has lying around. -# limit = { -# any_in_list = { -# list = spare_pannonian_titles_list -# launch_hungarian_migration_direct_vassal_requirements_trigger = { INVADER = $INVADER$ } -# } -# } -# #Save the suitable title. -# random_in_list = { -# list = spare_pannonian_titles_list -# limit = { -# launch_hungarian_migration_direct_vassal_requirements_trigger = { INVADER = $INVADER$ } -# } -# save_temporary_scope_as = donated_title -# } -# #Hand it to the receiving vassal. -# create_title_and_vassal_change = { -# type = granted -# save_scope_as = change -# add_claim_on_loss = no -# } -# scope:donated_title = { -# change_title_holder = { -# holder = scope:receiving_vassal -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# ##Clean-up: any landless characters should move to $INVADER$'s court. -# every_in_list = { -# list = mogyer_vassals_list -# limit = { is_ruler = no} -# save_temporary_scope_as = landless_mogyer_vassal -# $INVADER$ = { add_courtier = scope:landless_mogyer_vassal } -# } -# #Sum all remaining territory outside of Pannonia & give that territory to created local characters. -# ##Start by trying to group duchies. -# every_sub_realm_title = { -# #First we try to make duchy power blocks. -# if = { -# #Grab duchies outside of Pannonia. -# limit = { -# NOT = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# tier = tier_duchy -# } -# save_temporary_scope_as = seceding_duchy -# #Now grab the duchy & any sub-realm counties beneath it outside of Pannonia, and filter them to a list for processing. -# scope:seceding_duchy = { -# every_in_de_jure_hierarchy = { -# limit = { -# tier >= tier_county -# OR = { -# holder = $INVADER$ -# holder = { -# any_liege_or_above = { this = $INVADER$ } -# } -# } -# } -# add_to_temporary_list = seceding_duchy_list -# } -# } -# #Create a local peasant warlord for the duchy & counties. -# create_character = { -# location = scope:seceding_duchy.title_capital_county.title_province -# template = post_migration_local_warlord_template -# save_scope_as = local_warlord -# } -# #Assign the seceding titles to the new peasant warlord. -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = change -# add_claim_on_loss = no -# } -# every_in_list = { -# list = seceding_duchy_list -# limit = { -# NAND = { -# tier = tier_county -# title_province = { geographical_region = custom_hungary } -# } -# } -# change_title_holder = { -# holder = scope:local_warlord -# change = scope:change -# take_baronies = yes -# } -# remove_from_list = seceding_duchy_list -# } -# resolve_title_and_vassal_change = scope:change -# #And give the warlord their independence. -# create_title_and_vassal_change = { -# type = independency -# save_scope_as = change -# add_claim_on_loss = no -# } -# scope:local_warlord = { -# becomes_independent = { change = scope:change } -# } -# resolve_title_and_vassal_change = scope:change -# #If any vassals within Pannonia have gotten mixed up, shunt them back to $INVADER$, and try to find a suitable duke. -# ##Start off by assembling a suitable list of affected vassals (should only ever be the one, but you never know). -# scope:local_warlord = { -# every_vassal = { -# limit = { -# #We're only interested in counts... -# highest_held_title_tier = tier_county -# #... Within Panonnia. -# any_held_title = { launch_hungarian_migration_county_is_within_custom_hungary_trigger = yes } -# } -# add_to_list = vassals_to_shunt -# } -# } -# ##Sort through the list, see who should be the new liege of the misplaced vassals. -# every_in_list = { -# list = vassals_to_shunt -# #First off, check if there's a valid duke to hand 'em over to. -# if = { -# limit = { -# any_held_title = { -# launch_hungarian_migration_misplaced_count_suitable_liege_trigger = { INVADER = $INVADER$ } -# } -# } -# #If there is, we make a note of them for liege determination. -# random_held_title = { -# limit = { -# launch_hungarian_migration_misplaced_count_suitable_liege_trigger = { INVADER = $INVADER$ } -# } -# duchy.holder = { save_scope_as = appropriate_liege } -# } -# } -# #Otherwise, we just grab $INVADER$ as a solid fallback. -# else = { -# $INVADER$ = { save_scope_as = appropriate_liege } -# } -# #Reassign the errant vassal back to their rightful Pannonian realm. -# create_title_and_vassal_change = { -# type = conquest -# save_scope_as = change -# add_claim_on_loss = no -# } -# change_liege = { -# liege = scope:appropriate_liege -# change = scope:change -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# } -# ##... Then we catch the straggler counties. -# every_sub_realm_title = { -# #First we try to make duchy power blocks. -# if = { -# #Grab duchies outside of Pannonia. -# limit = { -# NOT = { -# title_capital_county.title_province = { geographical_region = custom_hungary } -# } -# tier = tier_county -# } -# save_temporary_scope_as = seceding_county -# #Create a local peasant warlord for the county. -# create_character = { -# location = scope:seceding_county.title_province -# template = post_migration_minor_warlord_template -# save_scope_as = minor_warlord -# } -# #Assign the seceding title to the new peasant warlord. -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = change -# add_claim_on_loss = no -# } -# scope:seceding_county = { -# change_title_holder = { -# holder = scope:minor_warlord -# change = scope:change -# take_baronies = yes -# } -# } -# resolve_title_and_vassal_change = scope:change -# #And give the warlord their independence. -# create_title_and_vassal_change = { -# type = independency -# save_scope_as = change -# add_claim_on_loss = no -# } -# scope:minor_warlord = { -# becomes_independent = { change = scope:change } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# } -# } -#} - -tribal_transfer_liege_title_effect = { - create_title_and_vassal_change = { - type = usurped - save_scope_as = change - add_claim_on_loss = no - } - scope:title_being_fought_over = { - change_title_holder = { - holder = scope:challenger - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - if = { - limit = { - root = scope:challenger - } - scope:liege_to_challenge = { - add_opinion = { - target = scope:challenger - modifier = usurped_title - } - } - } - else = { - hidden_effect = { - scope:liege_to_challenge = { - add_opinion = { - target = scope:challenger - modifier = usurped_title - } - } - } - } -} - -tribal_challenger_lost_effect = { - if = { - limit = { - root = scope:liege_to_challenge - } - scope:liege_to_challenge = { - add_prestige = medium_prestige_gain - } - } - else = { - hidden_effect = { - scope:liege_to_challenge = { - add_prestige = medium_prestige_gain - } - } - } - add_prestige_level = -1 - if = { - limit = { - root = scope:challenger - } - scope:liege_to_challenge = { - add_opinion = { - target = scope:challenger - modifier = tried_to_usurped_title - } - } - } - else = { - hidden_effect = { - scope:liege_to_challenge = { - add_opinion = { - target = scope:challenger - modifier = tried_to_usurped_title - } - } - } - } -} - -################################################### -## Negotiate the Danelaw Effects -# -#negotiate_the_danelaw_accept_effect = { -# # Mark the partition as being active. -# custom_tooltip = negotiate_the_danelaw_accept_effect.partition_active.tt -# set_global_variable = { -# name = partition_active_danelaw -# value = title:k_england -# } -# # Kingdoms for all! -# ## Scope:ntd_brit receives k_england. -# scope:ntd_brit = { -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# } -# title:k_england = { -# change_title_holder = { -# holder = scope:ntd_brit -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# title:k_england = { add_title_law = saxon_elective_succession_law } -# } -# ## Whilst scope:ntd_nord receives k_danelaw. -# scope:ntd_nord = { -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# } -# title:k_danelaw = { -# change_title_holder = { -# holder = scope:ntd_nord -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# title:k_danelaw = { -# add_title_law = scandinavian_elective_succession_law -# # And make sure it follows appropriate de jures. -# hidden_effect = { set_de_jure_liege_title = title:k_england.de_jure_liege } -# } -# } -# # Give k_danelaw various de jures. -# ## Firstly, any duchy that it has at least one county in which isn't scope:ntd_brit's capital duchy. -# custom_tooltip = negotiate_the_danelaw_accept_effect.de_jure_holdings_recognised.tt -# hidden_effect = { -# scope:ntd_nord = { -# every_sub_realm_county = { -# limit = { -# kingdom = title:k_england -# duchy != scope:ntd_brit.capital_county.duchy -# } -# duchy = { set_de_jure_liege_title = title:k_danelaw } -# } -# } -# } -# ## Then, any independent duchy held by a Scandi-side ruler (again exempting scope:ntd_brit's capital, just in case). -# custom_tooltip = negotiate_the_danelaw_accept_effect.independent_holdings_recognised.tt -# hidden_effect = { -# every_county_in_region = { -# region = world_europe_west_britannia -# limit = { -# kingdom = title:k_england -# exists = duchy.holder -# duchy.holder = { negotiate_the_danelaw_norse_side_trigger = yes } -# duchy != scope:ntd_brit.capital_county.duchy -# } -# duchy = { set_de_jure_liege_title = title:k_danelaw } -# } -# } -# # Set up a ceasefire & some opinion gain between the two rulers. -# scope:ntd_brit = { -# add_truce_both_ways = { -# character = scope:ntd_nord -# years = 25 -# name = TRUCE_SIGNED_PARTITION -# } -# add_opinion = { -# target = scope:ntd_nord -# modifier = respect_opinion -# opinion = 50 -# } -# reverse_add_opinion = { -# target = scope:ntd_nord -# modifier = respect_opinion -# opinion = 50 -# } -# } -# # Independent rulers on both sides are extremely unimpressed with this divvying. -# ## First, grab everyone applicable. -# title:k_england = { -# every_in_de_jure_hierarchy = { -# limit = { -# holder ?= { -# top_liege = this -# NOR = { -# this = scope:ntd_actor -# this = scope:ntd_recipient -# } -# } -# } -# holder = { add_to_list = riled_danelaw_independents_list } -# } -# } -# ## Then, apply opinion & hidden rivalry effects. -# every_in_list = { -# list = riled_danelaw_independents_list -# custom = negotiate_the_danelaw_accept_effect.riled_independents_list -# add_opinion = { -# target = scope:ntd_brit -# modifier = weak_opinion -# opinion = -40 -# } -# add_opinion = { -# target = scope:ntd_nord -# modifier = weak_opinion -# opinion = -40 -# } -# # We hide the rivalry stuff, both to make it seem less unappealing, and to encourage valid-feeling drama without deliberately signalling it. -# hidden_effect = { -# if = { -# limit = { -# can_set_relation_potential_rival_trigger = { CHARACTER = scope:ntd_brit } -# } -# set_relation_potential_rival = scope:ntd_brit -# } -# if = { -# limit = { -# can_set_relation_potential_rival_trigger = { CHARACTER = scope:ntd_nord } -# } -# set_relation_potential_rival = scope:ntd_nord -# } -# } -# } -#} -# -#negotiate_the_danelaw_reject_effect = { -# scope:ntd_actor = { -# # If possible, scope:ntd_actor & scope:ntd_recipient immediately become nemeses. -# if = { -# limit = { -# can_set_relation_nemesis_trigger = { CHARACTER = scope:ntd_recipient } -# } -# set_relation_nemesis = { -# reason = nemesis_danelaw_rejection -# copy_reason = rival -# target = scope:ntd_recipient -# } -# } -# else = { -# add_opinion = { -# target = scope:ntd_recipient -# modifier = humiliated_opinion -# opinion = -75 -# } -# } -# # Scope:ntd_actor loses a huge amount of prestige. -# add_prestige = massive_prestige_loss -# # Scope:ntd_actor gets a derrogatory nickname. -# give_nickname = nick_the_weak -# } -#} -# -#negotiate_the_danelaw_each_way_effect = { -# random_list = { -# # The offer is accepted. -# 100 = { -# show_chance = no -# desc = negotiate_the_danelaw_each_way_effect.accepted -# negotiate_the_danelaw_accept_effect = yes -# } -# # The offier is rejected. -# 100 = { -# show_chance = no -# desc = negotiate_the_danelaw_each-way_effect.rejected -# negotiate_the_danelaw_reject_effect = yes -# } -# } -#} -# -#resolve_danelaw_partition_effect = { -# # Drift all k_danelaw cores into England. -# custom_tooltip = resolve_danelaw_partition_effect.adjust_de_jures.tt -# hidden_effect = { -# title:k_danelaw = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = title:k_england -# } -# } -# } -# # If k_danelaw is victorious, take care of various bits'n'pieces. -# if = { -# limit = { scope:partition_winner = title:k_danelaw } -# # If appropriate, create k_england. -# if = { -# limit = { -# NOT = { exists = title:k_england.holder } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# } -# title:k_england = { -# change_title_holder = { -# holder = scope:victor -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# } -# # Else usurp k_england. -# else_if = { -# limit = { -# NOT = { title:k_england.holder = scope:victor } -# } -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = title_change -# add_claim_on_loss = yes -# } -# title:k_england = { -# change_title_holder = { -# holder = scope:victor -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# } -# # Sundry cosmetic changes. -# title:k_england = { -# if = { # Only do Scandinavian things for Scandinavians -# limit = { -# holder.culture = { has_cultural_pillar = heritage_north_germanic } -# } -# # Set k_england's CoA to k_danelaw's. -# custom_tooltip = resolve_danelaw_partition_effect.coa_changed.tt -# title:k_england = { set_coa = title:k_danelaw } -# # Give k_england the appropriate succession law. -# add_title_law = scandinavian_elective_succession_law -# } -# # Use k_danelaw's title history, as they won the cold war. -# copy_title_history = title:k_danelaw -# # And make York the de jure capital. -# set_capital_county = title:c_north_riding -# } -# # Remove k_danelaw. -# destroy_title = title:k_danelaw -# # All claims on k_danelaw become claims on k_england. -# title:k_danelaw = { -# every_claimant = { -# custom = resolve_danelaw_partition_effect.all_claimants -# remove_claim = title:k_danelaw -# add_unpressed_claim = title:k_england -# } -# } -# # Finally, mark that this has happened for HKotNS purposes. -# set_global_variable = { -# name = danelaw_became_england -# value = yes -# } -# } -# # If k_england is victorious, we also have a few little things to do. -# if = { -# limit = { scope:partition_winner = title:k_england } -# # If it still exists, destroy k_danelaw. -# if = { -# limit = { exists = title:k_danelaw.holder } -# destroy_title = title:k_danelaw -# } -# # All claims on k_danelaw are removed. -# title:k_danelaw = { -# every_claimant = { -# custom = resolve_danelaw_partition_effect.all_claimants -# remove_claim = title:k_danelaw -# } -# } -# } -#} -# -#formalise_the_daneland_effect = { -# # To start with, remove the partition variable (so that we don't calculate partition resolution whilst taking the alternate route). -# remove_global_variable = partition_active_danelaw -# # Clarify the status of the partition for the player. -# custom_tooltip = formalise_the_daneland_effect.partition_status.tt -# # Sort the title swap. -# ## First, flip everything in k_danelaw to k_daneland. -# custom_tooltip = formalise_the_daneland_effect.adjust_de_jures.tt -# hidden_effect = { -# title:k_danelaw = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = title:k_daneland -# } -# } -# # Add k_daneland to whatever empire k_danelaw is part of. -# title:k_daneland = { set_de_jure_liege_title = title:k_danelaw.de_jure_liege } -# } -# ## Then, swap the two titles out. -# ### Give k_daneland to scope:founder. -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# } -# title:k_daneland = { -# change_title_holder = { -# holder = scope:founder -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# ### Do some assorted aesthetic prep-work on k_daneland. -# hidden_effect = { -# title:k_daneland = { -# # Give them k_danelaw's CoA. -# set_coa = title:k_danelaw -# # & title history. -# copy_title_history = title:k_danelaw -# } -# } -# ### Destroy k_danelaw. -# destroy_title = title:k_danelaw -# # All claims on k_danelaw become claims on k_daneland -# title:k_danelaw = { -# every_claimant = { -# custom = formalise_the_daneland_effect.all_claimants -# remove_claim = title:k_danelaw -# add_unpressed_claim = title:k_daneland -# } -# } -# # Step a rivalry with scope:england. -# scope:founder = { -# progress_towards_rival_effect = { -# CHARACTER = scope:england -# OPINION = -75 -# REASON = rival_daneland -# } -# } -#} - -################################################## -# Found Cadet House Effects -found_cadet_house_decision_effect = { - $CHARACTER$ = { - save_scope_as = new_head - save_scope_as = new_house_head # don't ask - hidden_effect = { - house.house_head = { - save_scope_as = former_house_head - } - house = { - save_scope_as = former_house - } - add_achievement_flag_effect = { FLAG = achievement_a_house_of_my_own_flag } - - #Cultural variation for Cadet Branch Naming: - - if = { # Prefixed Primary Title - (PREFIX) (TITLE) - limit = { - is_landed = yes - highest_held_title_tier <= tier_duchy - OR = { - culture = { has_cultural_pillar = heritage_frankish } - top_liege = { - has_title = title:k_france - culture = { has_cultural_pillar = heritage_frankish } - } - } - } - create_cadet_branch = { - prefix = dynnp_de - name = cadet_name_style_primary_title - save_scope_as = new_house - } - } - else_if = { # Barony Dynasty - (BARONY) (DYNASTY) - limit = { - is_landed = yes - culture = { - OR = { - # India - has_cultural_pillar = heritage_indo_aryan - has_cultural_pillar = heritage_dravidian - # Vietnam - has_cultural_pillar = heritage_viet - has_name_list = name_list_vietnamese - # Khmer - has_name_list = name_list_khmer - # Mon - has_name_list = name_list_mon - # Cham - has_name_list = name_list_cham - # Tai - has_name_list = name_list_tai - # China - has_cultural_pillar = heritage_chinese - has_name_list = name_list_han - # Korea - has_cultural_pillar = heritage_korean - has_name_list = name_list_korean - # Buyeo - has_cultural_pillar = heritage_buyeo - has_name_list = name_list_balhae - } - } - NOT = { faith.religion = religion:islam_religion } - } - create_cadet_branch = { - name = cadet_name_style_barony_dynasty - save_scope_as = new_house - } - scope:new_house = { generate_coa = yes } # Avoid western style cadet CoA - } - else_if = { # County Dynasty - (COUNTY) (DYNASTY) - limit = { - is_landed = yes - culture = { - OR = { - # Malaysia - has_name_list = name_list_malay - } - } - } - create_cadet_branch = { - name = cadet_name_style_county_dynasty - save_scope_as = new_house - } - scope:new_house = { generate_coa = yes } # Avoid western style cadet CoA - } - else_if = { # Japanese - (PLACE) - limit = { - exists = var:new_japanese_house_name - culture = { - # Japan - OR = { - has_cultural_pillar = heritage_japonic - has_name_list = name_list_yamato - } - } - } - create_cadet_branch = { - name = { - first_valid = { - triggered_desc = { - trigger = { scope:new_head.var:new_japanese_house_name ?= flag:japanese_house_random_barony } - desc = japanese_house_random_barony - } - triggered_desc = { - trigger = { scope:new_head.var:new_japanese_house_name ?= flag:japanese_house_primary_county } - desc = japanese_house_primary_county - } - triggered_desc = { - trigger = { scope:new_head.var:new_japanese_house_name ?= flag:japanese_house_domicile_barony } - desc = japanese_house_domicile_barony - } - triggered_desc = { - trigger = { scope:new_head.var:new_japanese_house_name ?= flag:japanese_house_domicile_county } - desc = japanese_house_domicile_county - } - triggered_desc = { - trigger = { scope:new_head.var:new_japanese_house_name ?= flag:japanese_house_first_name } - desc = japanese_house_first_name - } - triggered_desc = { - trigger = { scope:new_head.var:new_japanese_house_name ?= flag:custom } - desc = japanese_house_name_custom - } - triggered_desc = { - trigger = { exists = scope:new_head.var:new_japanese_house_name } - desc = japanese_house_name_flag - } - desc = japanese_house_name_fallback - } - } - save_scope_as = new_house - } - scope:new_house = { generate_coa = yes } # Avoid western style cadet CoA - } - else = { #Standard Name Generation - create_cadet_branch = { save_scope_as = new_house } - } - } - - add_prestige = $PRESTIGE$ - - hidden_effect_new_object = { - save_scope_as = new_head - every_player = { - limit = { - exists = house - scope:new_house ?= house - NOT = { this = $CHARACTER$ } - } - send_interface_toast = { - type = msg_created_new_house - title = created_cadet_branch_toast_new_house_desc - left_icon = scope:new_head - desc = created_cadet_branch_toast_new_house_other_tt - } - } - send_interface_toast = { - type = msg_created_new_house - title = created_cadet_branch_toast_new_house_desc - left_icon = scope:new_head - right_icon = scope:former_house_head - desc = created_cadet_branch_toast_new_house_other_tt - } - } - - random_artifact = { - limit = { - var:banner_dynasty ?= $CHARACTER$.dynasty - artifact_owner = { - NOT = { this = $CHARACTER$ } - in_diplomatic_range = $CHARACTER$ - } - NOT = { - any_artifact_house_claimant = { - scope:new_house ?= this - } - } - } - save_scope_as = new_branch_dynasty_banner - scope:new_house ?= { - add_house_artifact_claim = scope:new_branch_dynasty_banner - } - } - -# # Struggle Catalysts -# if = { -# limit = { -# $CHARACTER$ = { -# exists = house.house_head -# any_character_struggle = { -# involvement = involved -# phase_has_catalyst = catalyst_cadet_branch_created -# } -# } -# } -# every_character_struggle = { -# involvement = involved -# activate_struggle_catalyst = { -# catalyst = catalyst_cadet_branch_created -# character = $CHARACTER$ -# } -# log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_cadet_branch_created } -# } -# } - - every_child = { - limit = { - has_trait = bastard - is_lowborn = no - dynasty = scope:new_head.dynasty - NOT = { house = scope:new_house } - } - set_house = scope:new_house - } - - # If eligible, create a cadet branch for admin type governments - if = { - limit = { - government_allows = noble_families - OR = { - highest_held_title_tier >= main_administrative_tier - AND = { - government_has_flag = government_has_county_tier_noble_families - highest_held_title_tier >= tier_county - } - } - } - create_noble_family_effect = { GOVERNMENT_GIVER = this } - change_influence = major_influence_gain - } - } -} - -learn_language_linguist_effect = { - hidden_effect = { add_courtier = $LINGUIST$ } - $LINGUIST$ = { save_scope_as = selected_linguist } - custom_tooltip = ep1_decision.0201.tt.aptitude - send_interface_toast = { - title = learn_court_language_toast_title - left_icon = root - right_icon = $LINGUIST$ - court_position_grant_effect = { - EMPLOYER = root - POS = court_tutor - CANDIDATE = $LINGUIST$ - } - if = { - limit = { - NOT = { knows_language_of_culture = $LINGUIST$.culture } - } - start_scheme = { - type = learn_language - target_character = $LINGUIST$ - } - } - } -} - -linguist_bonus_culture_effect = { - if = { - limit = { exists = scope:$CULTURE$ } - if = { - limit = { - any_culture_global = { - exists = culture_head - has_same_culture_heritage = scope:$CULTURE$ - NOR = { - has_same_culture_language = scope:$CULTURE$ - has_same_culture_language = root.culture - AND = { - exists = scope:target_court_language.culture - has_same_culture_language = scope:target_court_language.culture - } - AND = { - exists = scope:ling_cul_1_bonus - THIS = scope:ling_cul_1_bonus - } - AND = { - exists = scope:ling_cul_2_bonus - THIS = scope:ling_cul_2_bonus - } - AND = { - exists = scope:ling_cul_3_bonus - THIS = scope:ling_cul_3_bonus - } - } - } - } - random_culture_global = { # Find a culture that speaks this language natively - limit = { - exists = culture_head - has_same_culture_heritage = scope:$CULTURE$ - NOR = { - has_same_culture_language = scope:$CULTURE$ - has_same_culture_language = root.culture - AND = { - exists = scope:target_court_language.culture - has_same_culture_language = scope:target_court_language.culture - } - AND = { - exists = scope:ling_cul_1_bonus - THIS = scope:ling_cul_1_bonus - } - AND = { - exists = scope:ling_cul_2_bonus - THIS = scope:ling_cul_2_bonus - } - AND = { - exists = scope:ling_cul_3_bonus - THIS = scope:ling_cul_3_bonus - } - } - } - save_scope_as = $CULTURE$_bonus - } - } - else = { - random_kingdom = { - limit = { - exists = holder - NOR = { - holder = root - AND = { - exists = scope:target_court_language - holder = scope:target_court_language - } - } - holder = { - in_diplomatic_range = root - culture = { - NOR = { - has_same_culture_language = scope:$CULTURE$ - has_same_culture_language = root.culture - AND = { - exists = scope:target_court_language - has_same_culture_language = scope:target_court_language.culture - } - AND = { - exists = scope:ling_cul_1_bonus - this = scope:ling_cul_1_bonus - } - AND = { - exists = scope:ling_cul_2_bonus - this = scope:ling_cul_2_bonus - } - AND = { - exists = scope:ling_cul_3_bonus - this = scope:ling_cul_3_bonus - } - } - } - } - } - holder.culture = { save_scope_as = $CULTURE$_bonus } - } - } - } -} - -linguist_random_realm_effect = { - # Save random culture realm to fetch faith - if = { - limit = { - any_independent_ruler = { culture = scope:$CULTURE$ } - } - ordered_independent_ruler = { - limit = { culture = scope:$CULTURE$ } - order_by = primary_title.tier - save_scope_as = $CULTURE$_ruler - } - } - # Save fallback to fetch faith - else = { - scope:target_court_language = { save_scope_as = $CULTURE$_ruler } - } -} - -isolate_single_character_effect = { - add_character_flag = { - flag = blocked_from_leaving - years = 5 - } - add_character_modifier = { - modifier = isolating_modifier - years = 5 - } - if = { - limit = { exists = involved_activity } - if = { - limit = { involved_activity.activity_host = root } - invalidate_activity = involved_activity - } - else = { - remove_from_activity = involved_activity - } - } -} - -isolate_family_decision_effect = { - show_as_tooltip = { - every_close_family_member = { - custom = every_close_family_member_at_court - limit = { - is_courtier_of = root - } - add_character_modifier = { - modifier = isolating_modifier - years = 5 - } - } - add_character_modifier = { - modifier = isolating_modifier - years = 5 - } - if = { - limit = { exists = involved_activity } - if = { - limit = { involved_activity.activity_host = root } - invalidate_activity = involved_activity - } - else = { - remove_from_activity = involved_activity - } - } - } - if = { - limit = { NOT = { exists = current_travel_plan } } - custom_tooltip = travelling_will_break_isolation_tt - } - hidden_effect = { - every_close_family_member = { - custom = every_close_family_member_at_court - limit = { - is_courtier_of = root - } - root = { - add_to_variable_list = { - name = isolating_relatives - target = prev - } - } - isolate_single_character_effect = yes - } - every_consort = { - limit = { - is_courtier_of = root - } - root = { - add_to_variable_list = { - name = isolating_relatives - target = prev - } - } - isolate_single_character_effect = yes - } - isolate_single_character_effect = yes - set_variable = { - name = isolating_cooldown_var - years = 1 - } - add_character_flag = { # Prevent the AI from constantly coming in and out of isolation - flag = ai_unisolate_cooldown - years = 1 - } - } - stress_impact = { - brave = minor_stress_impact_gain - gregarious = minor_stress_impact_gain - } -} - -unisolate_family_decision_effect = { - show_as_tooltip = { - every_close_family_member = { - custom = every_close_family_member_at_court - limit = { - is_courtier_of = root - } - remove_character_modifier = isolating_modifier - } - } - hidden_effect = { - every_in_list = { - variable = isolating_relatives - limit = { is_alive = yes } - remove_character_modifier = isolating_modifier - remove_character_flag = blocked_from_leaving - } - clear_variable_list = isolating_relatives - } - remove_character_modifier = isolating_modifier - stress_impact = { - paranoid = minor_stress_impact_gain - shy = minor_stress_impact_gain - } -} - - -#Whippy whippy -flagellation_decision_effect = { - #Get both rewards - if = { - limit = { - has_trait = flagellant - faith = { has_doctrine_parameter = self_mutilation_active } - } - add_stress = major_stress_loss - add_piety = medium_piety_value - } - #Only Piety - else_if = { - limit = { - faith = { has_doctrine_parameter = self_mutilation_active } - } - add_piety = medium_piety_value - } - #Only Stress-loss - else = { add_stress = major_stress_loss } - - #Be kind to the AI - if = { - limit = { is_ai = yes } - random_list = { - 75 = { - #No increase - } - 25 = { - increase_wounds_effect = { REASON = whipping } - } - } - } - else = { - increase_wounds_effect = { REASON = whipping } - } - - #Not already flagellant? - if = { - limit = { - NOT = { has_trait = flagellant } - } - random = { - chance = 20 - add_trait = flagellant - add_stress = major_stress_loss - } - } - -} -#restore_carthage_scripted_effect = { -# -# dynasty = { add_dynasty_prestige = monumental_dynasty_prestige_gain } -# house = { -# add_house_modifier = { -# modifier = restore_carthage_house_modifier -# years = 100 -# } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# -# #Create Kingdoms -# hidden_effect = { -# # Carthage -# title:k_carthage = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# set_de_jure_liege_title = title:e_carthage -# } -# # Carthage Duchies -# title:d_gabes = { -# set_de_jure_liege_title = title:k_carthage -# } -# title:d_kairouan = { -# set_de_jure_liege_title = title:k_carthage -# } -# title:d_kroumerie = { -# set_de_jure_liege_title = title:k_carthage -# } -# title:d_tunis = { -# set_de_jure_liege_title = title:k_carthage -# } -# title:d_jerid = { -# set_de_jure_liege_title = title:k_carthage -# } -# title:d_sicily = { -# set_de_jure_liege_title = title:k_carthage -# } -# title:d_sardinia = { -# set_de_jure_liege_title = title:k_carthage -# } -# # And "Tunis" Carthage as capital -# title:c_tunis = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# # Tripolitania -# title:k_tripolitania = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# set_de_jure_liege_title = title:e_carthage -# } -# # Tripolitania Duchies -# title:d_tripolitania = { -# set_de_jure_liege_title = title:k_tripolitania -# } -# title:d_syrte = { -# set_de_jure_liege_title = title:k_tripolitania -# } -# # Mauretania -# title:k_mauretania = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# set_de_jure_liege_title = title:e_carthage -# } -# # Mauretania Duchies -# title:d_bejaia = { -# set_de_jure_liege_title = title:k_mauretania -# } -# title:d_zab = { -# set_de_jure_liege_title = title:k_mauretania -# } -# title:d_tlemcen = { -# set_de_jure_liege_title = title:k_mauretania -# } -# title:d_rif = { -# set_de_jure_liege_title = title:k_mauretania -# } -# title:d_alger = { -# set_de_jure_liege_title = title:k_mauretania -# } -# # Carthago Nova -# title:k_carthago_nova = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# set_de_jure_liege_title = title:e_carthage -# } -# # Carthago Nova Duchies -# title:d_sevilla = { -# set_de_jure_liege_title = title:k_carthago_nova -# } -# title:d_granada = { -# set_de_jure_liege_title = title:k_carthago_nova -# } -# title:d_murcia = { -# set_de_jure_liege_title = title:k_carthago_nova -# } -# title:d_valencia = { -# set_de_jure_liege_title = title:k_carthago_nova -# } -# } -# -# #Create Empire -# title:e_carthage = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# -# resolve_title_and_vassal_change = scope:title_change -# -# hidden_effect = { -# every_held_title = { #Should destroy Kingdoms without dejure land -# title_tier = kingdom -# if = { -# limit = { -# any_direct_de_jure_vassal_title = { count < 1 } -# title_capital_county.empire = title:e_carthage -# } -# root = { destroy_title = prev } -# } -# } -# } -# -# if = { -# limit = { -# capital_county != title:c_tunis -# } -# set_realm_capital = title:c_tunis -# } -# -# hidden_effect = { -# set_primary_title_to = title:e_carthage -# } -#} - -################################################## -# ##Create Cossack Kingdom Decision Effect## -# ## By: Björn S -################################################## -# -#create_cossack_scripted_effect = { -# # Pseudo character to derive culture from without converting the founder by default -# create_character = { -# location = root.location -# culture = root.culture -# faith = root.faith -# gender = root -# dynasty = none -# random_traits = no -# save_scope_as = cossack -# } -# ## We make all nomad holdings tribal, or the government change won't work -# custom_tooltip = { -# every_sub_realm_county = { -# limit = { -# title_province = { -# OR = { -# has_holding_type = nomad_holding -# has_holding_type = herder_holding -# } -# } -# } -# ## Add_to_list = holding_conversion -# title_province = { -# set_holding_type = tribal_holding -# } -# } -# text = create_cossack_tribal_tooltip -# } -# change_government = tribal_government -# -# ## Create the Cossack Culture ## -# culture = { save_scope_as = founder_culture } -# every_player = { -# add_character_flag = { -# flag = hide_hybridization_event -# days = 1 -# } -# } -# custom_tooltip = { -# text = cossack_custom_culture_hybrid -# scope:cossack = { create_hybrid_culture = culture:kazak } -# } -# scope:new_culture ?= { -# set_culture_name = { -# noun = cossack -# collective_noun = cossack_prefix -# prefix = cossack_collective_noun -# } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_cossack = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# ## Set up the Cossack Kingdom title with de jure duchies -# custom_tooltip = { -# text = cossack_custom_de_jure -# title:k_cossack = { set_de_jure_liege_title = title:e_caspian-pontic_steppe } -# title:d_tana = { set_de_jure_liege_title = title:k_cossack } -# title:d_zaporizhzhia = { set_de_jure_liege_title = title:k_cossack } -# title:d_kharkiv = { set_de_jure_liege_title = title:k_cossack } -# title:d_don_valley = { set_de_jure_liege_title = title:k_cossack } -# title:d_astrakhan = { set_de_jure_liege_title = title:k_cossack } -# } -# -# ##Add Cossack Culture to all de jure duchies in the Cossack Kingdom -# if = { -# limit = { exists = scope:new_culture } -# custom_tooltip = { -# text = cossack_custom_county_culture -# every_held_county = { -# limit = { kingdom = title:k_cossack } -# ## Convert all the counties to Cossack Culture ## -# set_county_culture = scope:new_culture -# } -# } -# } -# else = { custom_tooltip = cossack_custom_county_culture_fallback } -# -# hidden_effect = { -# scope:cossack ?= { silent_disappearance_effect = yes } -# } -#} -# \ No newline at end of file diff --git a/common/scripted_effects/00_ep1_artifact_effects.txt b/common/scripted_effects/00_ep1_artifact_effects.txt deleted file mode 100644 index 5e4aae0de..000000000 --- a/common/scripted_effects/00_ep1_artifact_effects.txt +++ /dev/null @@ -1,672 +0,0 @@ -steal_artifact_in_siege_effect = { - if = { - limit = { NOT = { has_variable = artifact_prevent_transfer } } - # Save scopes for localization - $LOCATION$ = { save_scope_as = SAISE_location } - $ATTACKER$ = { save_scope_as = SAISE_attacker } - $DEFENDER$ = { save_scope_as = SAISE_defender } - $ARTIFACT$ = { save_scope_as = this_artifact } - - scope:this_artifact = { - # Suppress generic notifications, as we will send custom ones - set_variable = { - name = suppress_artifact_notifications - value = yes - days = 1 - } - if = { - limit = { - NOT = { has_variable = stolen_artifact } - } - set_variable = { - name = stolen_artifact - value = 1 - } - } - else = { - change_variable = { - name = stolen_artifact - add = 1 - } - } - - # Transfer the artifact to its new owner - if = { - limit = { - has_variable = ai_to_ai_destroy_in_sieges - scope:SAISE_attacker = { - is_ai = yes - } - scope:SAISE_defender = { - is_ai = yes - } - } - destroy_artifact = this - } - else = { - set_owner = { - target = scope:SAISE_attacker - history = { - location = scope:SAISE_location - actor = scope:SAISE_defender - recipient = scope:SAISE_attacker - type = taken_in_siege - } - } - scope:SAISE_defender = { add_personal_artifact_claim = scope:this_artifact } - if = { - limit = { - scope:SAISE_attacker = { - has_ep3_dlc_trigger = yes - is_roman_emperor_trigger = yes - culture = { has_cultural_parameter = holds_triumphs } - } - } - scope:SAISE_attacker = { - set_variable = { - name = byz_valid_for_trophy - value = scope:this_artifact - years = 9 - } - } - } - - # Send notifications to the relevant parties - scope:SAISE_defender = { - send_interface_toast = { - type = msg_artifact_lost - title = artifact_lost_toast - left_icon = scope:this_artifact - right_icon = scope:SAISE_attacker - if = { - limit = { $IS_RAID$ = yes } - custom_tooltip = artifact_lost_in_raid - } - else = { - custom_tooltip = artifact_lost_in_siege - } - } - } - scope:SAISE_attacker = { - send_interface_toast = { - type = msg_artifact_gained - right_icon = scope:this_artifact - } - if = { - limit = { - NOT = { any_claimed_artifact = { this = scope:this_artifact } } - } - scope:this_artifact = { - set_variable = { - name = last_person_to_steal - value = scope:SAISE_attacker - } - } - } - } - } - } - } -} - -steal_artifact_in_event_effect = { - if = { - limit = { exists = $VICTIM$.capital_province } - set_local_variable = { - name = location - value = $VICTIM$.capital_province - } - } - else_if = { - limit = { exists = $VICTIM$.location } - set_local_variable = { - name = location - value = $VICTIM$.location - } - } - - $ARTIFACT$ = { - save_scope_as = artifact_to_steal - hidden_effect = { - if = { - limit = { - exists = local_var:location - } - set_owner = { - target = $THIEF$ - history = { - type = stolen - actor = $VICTIM$ #stolen from - recipient = $THIEF$ #stealer - location = local_var:location - } - } - } - else = { #If no location exists it is "conquered" - set_owner = { - target = $THIEF$ - history = { - type = conquest - actor = $THIEF$ #stealer - recipient = $VICTIM$ #stolen from - } - } - } - if = { - limit = { - NOT = { has_variable = stolen_artifact } - } - set_variable = { - name = stolen_artifact - value = 1 - } - } - else = { - change_variable = { - name = stolen_artifact - add = 1 - } - } - } - } - $VICTIM$ = { - add_personal_artifact_claim = scope:artifact_to_steal - } -} - -damage_artifact_in_battle_effect = { - # Save scopes for localization - $OWNER$ = { - save_scope_as = DAIBE_owner - } - $OPPONENT$ = { save_scope_as = DAIBE_opponent } - $LOCATION$ = { save_scope_as = DAIBE_location } - $ARTIFACT$ = { - save_scope_as = DAIBE_artifact - - # Suppress generic notifications, as we will send custom ones - set_variable = { - name = suppress_artifact_notifications - value = yes - days = 1 - } - - set_variable = { - name = DAIBE_damage - value = $DURABILITY_LOSS$ - days = 1 - } - - # Damage the artifact by the specified amount - add_durability = { - value = 0 - subtract = var:DAIBE_damage - } - } - - # Transformed into an if / else as I found the following note somewhere else: - # NOTE: We must not run ANY script after we destroy an artifact, or we will cause errors - if = { - # If the artifact has no durability left, destroy it now. - limit = { scope:DAIBE_artifact.artifact_durability <= 0 } - destroy_artifact = scope:DAIBE_artifact - } - # Send notifications to the relevant party IF the artifact was not destroyed - else = { - $OWNER$ = { - # Send the toast - send_interface_toast = { - title = artifact_damaged_toast - left_icon = scope:DAIBE_artifact - right_icon = scope:DAIBE_opponent - if = { - limit = { - $IS_DUEL$ = yes - } - custom_tooltip = artifact_damaged_in_duel - } - else = { - custom_tooltip = artifact_damaged_in_siege - } - } - } - } -} - -flag_as_trash_artifact = { - set_variable = { - name = ai_to_ai_destroy_in_sieges - value = yes - } -} - -flag_as_unwanted_artifact = { - set_variable = { - name = unwanted_artifact - value = yes - } -} - -flag_as_cursed_artifact = { - set_variable = { - name = cursed_artifact - value = yes - } -} - -#For use with trinket looks / call this effect (set_up_trinket_adjective_effect = yes) in the line before creating the trinket -#Use this in the trinket's name/description in the loc-file [ROOT.Char.Custom('TrinketLookAdjective')] /and/ [ROOT.Char.Custom('TrinketLookAdverbFollowup')] -#Remember to clear the var:trinket_adjective_followup in your after = { ... } -set_up_trinket_adjective_effect = { - random_list = { - 50 = { - set_variable = { - name = trinket_adjective_followup - value = flag:adorned - } - } - 50 = { - set_variable = { - name = trinket_adjective_followup - value = flag:decorated - } - } - 50 = { - set_variable = { - name = trinket_adjective_followup - value = flag:embellished - } - } - 50 = { - set_variable = { - name = trinket_adjective_followup - value = flag:ornamented - } - } - - } -} - -# Grant claims on familial banners -grant_banner_house_claim_effect = { - save_scope_as = familial_banner - hidden_effect = { - if = { # Dynasty banner not owned or claimed by all child house's already - limit = { - exists = var:banner_dynasty - var:banner_dynasty = { - any_dynasty_member = { - this = house.house_head - house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already - } - } - } - var:banner_dynasty = { - every_dynasty_member = { - limit = { - this = house.house_head - house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already - } - house = { add_house_artifact_claim = scope:familial_banner } - } - } - } - else_if = { # House banner not owned or claimed by creating house already - limit = { - exists = var:banner_house - var:banner_house = { artifact_house_not_owns_or_claims_trigger = yes } # House not owns or claims already - } - var:banner_house = { add_house_artifact_claim = scope:familial_banner } - } - } -} - -#Determine what type of artifact a court artifact is, for defacement -determine_artifact_damage_type_effect = { - $ARTIFACT$ = { save_scope_as = artifact_to_determine } - scope:artifact_to_determine = { - random_list = { - 10 = { - trigger = { - OR = { - artifact_type = chest - artifact_type = box - artifact_type = cabinet - artifact_type = pedestal - artifact_type = tapestry - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big - artifact_type = wall_shield - artifact_type = throne - artifact_type = throne_special - artifact_type = book - } - } - set_variable = artifact_burned - } - 10 = { - trigger = { - OR = { - artifact_type = sculpture - artifact_type = box - artifact_type = goblet - artifact_type = pedestal - artifact_type = book - artifact_type = elixir - artifact_type = panacea - artifact_type = philosophers_stone - } - } - set_variable = artifact_knocked_over - } - 10 = { - trigger = { - OR = { - artifact_type = sculpture - artifact_type = chest - artifact_type = box - artifact_type = cabinet - artifact_type = goblet - artifact_type = pedestal - artifact_type = tapestry #cloth - artifact_type = animal_skull - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big #shields, banners - artifact_type = wall_small #animal trophy - artifact_type = wall_shield - artifact_type = wall_shield_special #kite shields - artifact_type = throne - artifact_type = throne_special - artifact_type = book - artifact_type = elixir - artifact_type = panacea - artifact_type = philosophers_stone #box - } - } - set_variable = artifact_smeared_food - } - 10 = { - trigger = { - OR = { - artifact_type = chest - artifact_type = box - artifact_type = cabinet - artifact_type = pedestal - artifact_type = tapestry - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big - artifact_type = wall_small - artifact_type = throne - artifact_type = throne_special - artifact_type = book - } - } - set_variable = artifact_spilled_drink - } - 10 = { - trigger = { - OR = { - artifact_type = tapestry - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = book - } - } - set_variable = artifact_tear - } - 10 = { - trigger = { - OR = { - artifact_type = tapestry - artifact_type = animal_skull - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big - artifact_type = wall_small - artifact_type = wall_shield - artifact_type = wall_shield_special - } - } - set_variable = artifact_tear_down - } - 10 = { - trigger = { - OR = { - artifact_type = chest - artifact_type = box - artifact_type = pedestal - artifact_type = tapestry - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big - artifact_type = wall_small - artifact_type = wall_shield - artifact_type = wall_shield_special - artifact_type = throne - artifact_type = throne_special - artifact_type = book - } - } - set_variable = artifact_threw_up - } - 10 = { - trigger = { - OR = { - artifact_type = sculpture - artifact_type = chest - artifact_type = box - artifact_type = cabinet - artifact_type = goblet - artifact_type = pedestal - artifact_type = tapestry #cloth - artifact_type = animal_skull - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big #shields, banners - artifact_type = wall_small #animal trophy - artifact_type = wall_shield - artifact_type = wall_shield_special #kite shields - artifact_type = throne - artifact_type = throne_special - artifact_type = book - artifact_type = elixir - artifact_type = panacea - artifact_type = philosophers_stone #box - } - } - set_variable = artifact_unspeakable - } - 10 = { - trigger = { - NOR = { - artifact_type = sculpture - artifact_type = chest - artifact_type = box - artifact_type = cabinet - artifact_type = goblet - artifact_type = pedestal - artifact_type = tapestry #cloth - artifact_type = animal_skull - artifact_type = animal_hide - artifact_type = animal_hide_big - artifact_type = wall_big #shields, banners - artifact_type = wall_small #animal trophy - artifact_type = wall_shield - artifact_type = wall_shield_special #kite shields - artifact_type = throne - artifact_type = throne_special - artifact_type = book - artifact_type = elixir - artifact_type = panacea - artifact_type = philosophers_stone #box - } - } - set_variable = artifact_damage_fallback - } - } - } -} - -# Destroy Artifact effect -# DESTROYER = Character destroying the artifact -# ARTIFACT = The artifact to destroy -destroy_artifact_aniconist_effect = { - $ARTIFACT$ = { - save_temporary_scope_as = artifact - } - - $DESTROYER$ = { - if = { - limit = { - OR = { - $DESTROYER$.faith = { has_doctrine_parameter = destroying_artifacts_is_pious } - $PIETY_BY_DEFAULT$ = yes - } - } - give_destroyed_artifact_piety = yes - } - if = { - limit = { - OR = { - $DESTROYER$.faith = { has_doctrine_parameter = destroying_artifacts_costs_piety } - $PIETY_BY_DEFAULT$ = yes - } - } - add_piety = medium_piety_loss - } - if = { - limit = { - $GIVE_GOLD$ = yes - } - add_gold = { - if = { - limit = { - scope:artifact = { rarity = illustrious } - } - add = { - value = 25 - } - } - else_if = { - limit = { - scope:artifact = { rarity = famed } - } - add = { - value = 15 - } - } - else_if = { - limit = { - scope:artifact = { rarity = masterwork } - } - add = { - value = 8 - } - } - else = { - add = { - value = 4 - } - } - - # Boost the value up to something meaningful - multiply = { - value = 10 - } - - # multiply by durability percentage - multiply = { - add = scope:artifact.artifact_durability - divide = scope:artifact.artifact_max_durability - divide = 2 - add = 0.5 - } - - #Nerf it to bits for LAAMPs - if = { - limit = { - $DESTROYER$ = { has_government = landless_adventurer_government } - } - multiply = { - value = 0.1 - round = yes - } - } - if = { - limit = { - exists = scope:artifact.var:ai_to_ai_destroy_in_sieges # Trash artifact - } - max = { - value = $DESTROYER$.tiny_gold_value - multiply = 0.5 - } - } - - min = 1 - } - } - destroy_owned_artifact = scope:artifact - } -} - -give_destroyed_artifact_piety = { - add_piety = { - # Base value - value = 5 - # Add the artifact's quality - if = { - limit = { exists = scope:artifact.var:quality } - add = scope:artifact.var:quality - } - # If none can be found, add its wealth - else_if = { - limit = { exists = scope:artifact.var:wealth } - add = scope:artifact.var:wealth - } - # Artifact has no quality or wealth (typical for court artifacts), add something based on rarity - else_if = { - limit = { - scope:artifact = { rarity = illustrious } - } - add = { - value = 20 - } - } - else_if = { - limit = { - scope:artifact = { rarity = famed } - } - add = { - value = 12 - } - } - else_if = { - limit = { - scope:artifact = { rarity = masterwork } - } - add = { - value = 8 - } - } - else = { - add = { - value = 4 - } - } - # Boost the value up to something meaningful - multiply = 20 - # Relics are way cooler to burn, double the final value - if = { - limit = { - scope:artifact = { exists = var:relic } - } - multiply = { - value = 2 - desc = aniconist_destroying_relic - } - } - } -} diff --git a/common/scripted_effects/00_faction_effects.txt b/common/scripted_effects/00_faction_effects.txt deleted file mode 100644 index 3211ad35a..000000000 --- a/common/scripted_effects/00_faction_effects.txt +++ /dev/null @@ -1,2146 +0,0 @@ - - -##################################################################### -# EFFECT LIST -##################################################################### - -# join_faction_with_leave_blocker_effect - make a character join a faction, and prevent them from leaving -# leave_faction_with_cooldown_effect - makes a character leave a FACTION and not rejoin another faction for YEARS years -# get_popular_revolt_target_effect - looks for a valid title for a popular revolt to target (may not be the title the revolt gets if successful, just determines the 'region' the revolt is supposed to occur within), -# successful_popular_revolt_outcome_effect - handles all of the title changes necessary for a successful popular revolt to break away as an independent realm. -# get_popular_revolt_title_name - Script logic to check what the new name of dynamically-created peasant titles should be (e.g., Kingdom of Isma'ili Arabia). - -join_faction_with_leave_blocker_effect = { - join_faction = $FACTION$ - hidden_effect = { - save_temporary_scope_value_as = { - name = join_faction_with_leave_blocker_effect_number - value = flag:$YEARS$ - } - add_character_flag = { - flag = leaving_faction_block - years = $YEARS$ - } - } - if = { - limit = { this = root } - custom_tooltip = join_faction_with_leave_blocker_effect_first.tt - } - else = { - custom_tooltip = join_faction_with_leave_blocker_effect_third.tt - } - - #and to prevent angry error messages :D:D:D:D - if = { - limit = { - scope:join_faction_with_leave_blocker_effect_number = flag:1 - } - } -} - -add_faction_cooldown_effect = { - if = { - limit = { is_landless_adventurer = no } - custom_description = { - text = faction_cooldown_effect - value = $YEARS$ - add_character_flag = { - flag = joining_faction_block - years = $YEARS$ - } - } - } -} - -leave_faction_with_cooldown_effect = { - leave_faction = $FACTION$ - add_faction_cooldown_effect = { YEARS = $YEARS$ } -} - -imprisonment_retribution_start_faction_war_if_valid = { - scope:recipient = { - custom_tooltip = FACTION_IMPRISONMENT_RETALIATION_WARNING - } - hidden_effect = { - if = { - limit = { - faction_power > faction_power_threshold - NOT = { faction_is_type = populist_faction } - } - - if = { - limit = { - faction_is_type = claimant_faction - } - special_title = { - save_scope_as = target_title - } - faction_start_war = { - title = scope:target_title - } - } - else = { - faction_start_war = {} - } - every_faction_member = { - trigger_event = faction_demand.9001 - } - } - } -} - -# Get the most appropriate 'target title' we can for a popular revolt (determines the de jure area the war will target, not final titles granted). -get_popular_revolt_target_effect = { - $FACTION$ = { - save_scope_as = faction - faction_target = { - save_scope_as = faction_target - } - - # First check if there are any valid kingdoms to target. - if = { - limit = { - # Only large revolts in large realms are eligible to target an entire kingdom. - any_faction_county_member = { - count >= 11 - } - scope:faction_target.primary_title.tier >= tier_kingdom - } - every_faction_county_member = { - kingdom = { - if = { - # Do not target titles held by rulers outside of our realm. - limit = { - NOT = { exists = holder } - holder.top_liege = scope:faction_target - } - } - add_to_list = tmp_potential_kingdoms - } - } - - # Out of the valid kingdoms (if any), pick the 'best' one - ordered_in_list = { - list = tmp_potential_kingdoms - - order_by = { - # First look at the total number of rebels within the kingdom's de jure territory. - value = 0 - add = { - value = 0 - every_in_de_jure_hierarchy = { - limit = { - tier = tier_county - any_title_joined_faction = { - this = $FACTION$ - } - } - add = total_county_levies - } - } - - if = { - limit = { - exists = holder - } - if = { - # Prefer targeting titles held by the faction target... - limit = { - holder != scope:faction_target - } - multiply = 0.5 - } - else_if = { - #...but not the target's primary title (we don't want to usurp them if we can help it!) - limit = { - this = scope:faction_target.primary_title - } - multiply = 0.5 - } - } - - } - save_scope_as = tmp_target_title - } - } - - # If we were ineligible for kingdom-tier or failed to find a valid one, look for duchies. - if = { - limit = { - NOT = { exists = scope:tmp_target_title} - - # Mid-sized or larger revolts in medium realms are eligible for duchy titles. - any_faction_county_member = { - count >= 5 - } - faction_target.primary_title.tier >= tier_duchy - } - every_faction_county_member = { - duchy = { - if = { - # Do not target titles held by rulers outside of our realm. - limit = { - NOT = { exists = holder } - holder.top_liege = scope:faction_target - } - } - add_to_list = tmp_potential_duchies - } - } - - # Out of the valid duchies (if any), pick the 'best' one - ordered_in_list = { - list = tmp_potential_duchies - - order_by = { - value = 0 - # First look at the total number of rebels within the duchy's de jure territory. - add = { - value = 0 - every_in_de_jure_hierarchy = { - limit = { - tier = tier_county - any_title_joined_faction = { - this = $FACTION$ - } - } - add = total_county_levies - } - } - - if = { - limit = { - exists = holder - } - if = { - # Prefer targeting titles held by the faction target... - limit = { - holder != scope:faction_target - } - multiply = 0.5 - } - else_if = { - #...but not the target's primary title (we don't want to usurp them if we can help it!) - limit = { - this = scope:faction_target.primary_title - } - multiply = 0.5 - } - } - } - save_scope_as = tmp_target_title - } - } - - # If we still don't have a target title, pick the largest county. - if = { - limit = { - NOT = { exists = scope:tmp_target_title} - } - ordered_faction_county_member = { - order_by = total_county_levies - - save_scope_as = tmp_target_title - } - } - - # Re-save our temporary scope as the 'official' target scope, then clear all temporary scopes. - if = { - limit = { - exists = scope:tmp_target_title - } - scope:tmp_target_title = { - save_scope_as = target_title - } - set_special_title = scope:target_title - clear_saved_scope = tmp_target_title - } - every_in_list = { - list = tmp_potential_kingdoms - remove_from_list = tmp_potential_kingdoms - } - every_in_list = { - list = tmp_potential_duchies - remove_from_list = tmp_potential_duchies - } - } -} - -add_adjacent_valid_counties_to_list = { - every_neighboring_county = { - limit = { - faith = $FAITH$ - holder = { - is_ai = yes # Without this, successful Populist Revolts can lead to suprise Game Overs for players without any warning. - top_liege = $TOP_LIEGE$ - } - NOT = { is_in_list = $LIST$ } - } - add_to_list = $LIST$ - } -} - -# Shared effect between the Popular Faction's demand event and victory outcome. -# -# Parameters: -# $FACTION_LEADER$ -# $TARGET_TITLE$ -# $SOURCE_GOVERNMENT$ -# -successful_popular_revolt_outcome_effect = { - # Save scopes for later usage. - $FACTION_LEADER$ = { - save_scope_as = faction_leader - joined_faction = { - save_scope_as = popular_faction - every_faction_member = { - add_to_list = faction_members - } - faction_target = { - save_scope_as = faction_target - } - } - add_to_list = faction_members - } - $TARGET_TITLE$ = { - save_scope_as = some_title - } - if = { # Populists factions in an admin realm should aim to change state faith, if they are of the capital culture - limit = { - $SOURCE_GOVERNMENT$ = { government_allows = state_faith } - $FACTION_LEADER$.culture = scope:faction_target.capital_county.culture - $FACTION_LEADER$.faith != scope:faction_target.primary_title.state_faith - } - - $SOURCE_GOVERNMENT$.primary_title = { - # Change the state faith - set_state_faith = $FACTION_LEADER$.faith - - # Try grabbing someone from the line of succession who practices the State Faith - if = { - limit = { - any_title_heir = { - faith = $FACTION_LEADER$.faith - } - } - ordered_title_heir = { - order_by = "appointment_candidate_score(prev)" - limit = { - faith = $FACTION_LEADER$.faith - } - save_scope_as = new_ruler - } - } - # Otherwise, make the peasant leader the new emperor - else = { $FACTION_LEADER$ = { save_scope_as = new_ruler } } - - # Actually make the switch - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change - } - # Transfer all titles to heir of primary title if only one governorship is held - hidden_effect = { - $SOURCE_GOVERNMENT$ = { - every_held_title = { - title_tier >= county - limit = { - is_landless_type_title = no - is_noble_family_title = no - } - change_title_holder_include_vassals = { - holder = scope:new_ruler - change = scope:change - take_baronies = no - } - } - } - } - resolve_title_and_vassal_change = scope:change - } - } - else_if = { # Populists factions of the state faith in an admin realm where the emperor is of a heretical faith simply take the empire - limit = { - $SOURCE_GOVERNMENT$ = { government_allows = state_faith } - $FACTION_LEADER$.faith = scope:faction_target.primary_title.state_faith - $FACTION_LEADER$.faith != scope:faction_target.faith - } - - $SOURCE_GOVERNMENT$.primary_title = { - - $FACTION_LEADER$ = { save_scope_as = new_ruler } - - # Actually make the switch - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change - } - # Transfer all titles to heir of primary title if only one governorship is held - hidden_effect = { - $SOURCE_GOVERNMENT$ = { - every_held_title = { - title_tier >= county - limit = { - is_landless_type_title = no - is_noble_family_title = no - } - change_title_holder_include_vassals = { - holder = scope:new_ruler - change = scope:change - take_baronies = no - } - } - } - } - resolve_title_and_vassal_change = scope:change - } - } - else = { # Otherwise we run the normal script - # Compile a list of all counties belonging to the faction. - scope:popular_faction = { - every_faction_county_member = { - duchy = { - add_to_list = seized_duchies - every_de_jure_county = { - limit = { - holder.top_liege = scope:faction_target - } - add_to_list = seized_counties - } - } - } - } - # Additionally, if we're at war (and not just pressing demands)... - if = { - limit = { - scope:faction_leader = { - is_at_war_with = scope:faction_target - } - } - # Add all occupied counties of the correct culture/faith. - scope:faction_target = { - every_sub_realm_county = { - limit = { - county_controller = scope:faction_leader - OR = { - culture = scope:faction_leader.culture - faith = scope:faction_leader.faith - } - } - add_to_list = seized_counties - } - } - - # And add any war members that aren't already in the faction. - scope:faction_leader = { - every_character_war = { - limit = { - is_defender = scope:faction_target - } - every_war_attacker = { - limit = { - NOT = { is_in_list = faction_members } - } - add_to_list = faction_members - } - } - } - } - show_as_tooltip = { - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change_tooltip - add_claim_on_loss = yes - } - every_in_list = { - list = seized_duchies - change_title_holder = { - holder = scope:faction_leader - change = scope:change_tooltip - take_baronies = no - } - becomes_independent = { - change = scope:change_tooltip - } - } - resolve_title_and_vassal_change = scope:change_tooltip - } - # Give out titles in such way that each leader gets all titles within the same Kingdom - # Step 1: Duplicate the list of all members - every_in_list = { - list = faction_members - add_to_list = faction_members_loop - } - # Step 2: Create a while loop to give out counties to each faction member until we run out of the counties - while = { - limit = { - list_size:seized_counties >= 1 - } - # Step 3: If there is no more leaders, create new one - if = { - limit = { - list_size:faction_members_loop < 1 - } - # Step 3.1: Pick the best county that is still available to base all other title handovers on - ordered_in_list = { - list = seized_counties - order_by = { - value = total_county_levies - multiply = { - value = 1 - # Up to 50% bonus points for counties of the correct culture/faith. - if = { - limit = { culture != scope:faction_leader.culture } - add = 0.25 - } - if = { - limit = { faith != scope:faction_leader.faith } - add = 0.25 - } - } - } - save_scope_as = capital_county - } - create_character = { - location = scope:capital_county.title_province - culture = scope:capital_county.culture - faith = scope:capital_county.faith - template = peasant_faction_leader_template - gender_female_chance = scope:capital_county.location_faith_dominant_gender_female_chance - save_scope_as = new_county_holder - } - scope:new_county_holder = { - add_to_list = faction_members - add_to_list = faction_members_loop - add_trait_xp = { - trait = peasant_leader - value = peasant_leader_xp_value - } - } - } - # Step 4: Grab a faction member with highest peasant leader xp, but always grab the faction leader first - ordered_in_list = { - list = faction_members_loop - order_by = { - value = "has_trait_xp(peasant_leader)" - if = { - limit = { - this = scope:faction_leader - } - add = 1000 - } - } - save_scope_as = next_leader - # Step 4.1: Pick the best county that is still available to base all other title handovers on - if = { - limit = { - NOT = { exists = scope:capital_county } - } - if = { - limit = { - is_landed = yes - } - capital_county = { - save_scope_as = capital_county - } - } - else = { - ordered_in_list = { - list = seized_counties - order_by = { - value = total_county_levies - multiply = { - value = 1 - # Up to 300% bonus points for counties of the correct culture/faith. - if = { - limit = { culture = scope:next_leader.culture } - add = 1 - } - if = { - limit = { faith = scope:next_leader.faith } - add = 1 - } - } - } - save_scope_as = capital_county - } - } - } - # Step 5: CHANGE ONE - Give them the selected county and make them go independent - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change_one - add_claim_on_loss = yes - } - scope:capital_county = { - change_title_holder = { - holder = scope:next_leader - change = scope:change_one - take_baronies = no - } - } - becomes_independent = { - change = scope:change_one - } - resolve_title_and_vassal_change = scope:change_one - # Step 6: CHANGE TWO - Give them all Duchies and Counties within the Kingdom of the capital county - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change_two - add_claim_on_loss = yes - } - every_in_list = { - list = seized_counties - limit = { - kingdom = scope:capital_county.kingdom - } - change_title_holder = { - holder = scope:next_leader - change = scope:change_two - take_baronies = no - } - remove_from_list = seized_counties - } - every_in_list = { - list = seized_duchies - limit = { - kingdom = scope:capital_county.kingdom - } - change_title_holder = { - holder = scope:next_leader - change = scope:change_two - take_baronies = no - } - remove_from_list = seized_duchies - } - resolve_title_and_vassal_change = scope:change_two - - # Step 6: CHANGE THREE - Usurp the Kingdom if they hold enough land - if = { - limit = { - primary_title.kingdom = { - any_de_jure_county = { - percent > 0.5 - holder = scope:next_leader - } - } - } - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change_three - add_claim_on_loss = yes - } - primary_title.kingdom = { - change_title_holder = { - holder = scope:next_leader - change = scope:change_three - take_baronies = no - } - } - resolve_title_and_vassal_change = scope:change_three - } - # Step 6.1: If the title we gave is a new dynamic title, generate a CoA for it. - if = { - limit = { - exists = scope:new_title - } - scope:new_title = { - set_capital_county = scope:capital_county - generate_coa = yes - } - } - # Step 7: Destroy their peasant uprising title - if = { - limit = { - has_variable = peasant_title - exists = var:peasant_title.holder - } - destroy_title = var:peasant_title - } - # Step 8: Set up government type correctly. - scope:capital_county = { - previous_holder ?= { - if = { - limit = { - is_alive = yes - } - save_scope_as = old_holder - switch = { - trigger = government_has_flag - government_is_administrative = { - save_scope_value_as = { name = old_government value = flag:admin } - } - government_is_clan = { - save_scope_value_as = { name = old_government value = flag:clan } - } - government_is_tribal = { - save_scope_value_as = { name = old_government value = flag:tribal } - } - government_is_wanua = { - save_scope_value_as = { name = old_government value = flag:wanua } - } - government_is_nomadic = { - save_scope_value_as = { name = old_government value = flag:nomad } - } - government_is_celestial = { - save_scope_value_as = { name = old_government value = flag:admin } - } - government_is_steppe_admin = { - save_scope_value_as = { name = old_government value = flag:admin } - } - government_is_meritocratic = { - save_scope_value_as = { name = old_government value = flag:admin } - } - government_is_japan_administrative = { - save_scope_value_as = { name = old_government value = flag:admin } - } - government_is_japan_feudal = { - save_scope_value_as = { name = old_government value = flag:japan_feudal } - } - government_is_mandala = { - save_scope_value_as = { name = old_government value = flag:mandala } - } - } - } - } - } - # Change our government according to the government of our liege. - ## Nomad. - if = { - limit = { - OR = { - government_has_flag = government_is_nomadic - scope:old_government ?= flag:nomad - scope:capital_county.title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - } - change_government = nomad_government - } - ## Clan. - else_if = { - limit = { - OR = { - government_has_flag = government_is_clan - scope:old_government ?= flag:clan - ep3_is_clan_inclined_trigger = yes - } - } - change_government = clan_government - } - ## Wanua or Tribal. - else_if = { - limit = { - scope:capital_county.title_province = { - has_holding_type = tribal_holding - } - } - if = { - limit = { - OR = { - government_has_flag = government_is_wanua - scope:old_government ?= flag:wanua - scope:capital_county.title_province = { - geographical_region = world_asia_southeast_islands - } - } - } - change_government = wanua_government - } - else = { - change_government = tribal_government - } - } - ## Ritsuryo. - else_if = { - limit = { - OR = { - government_has_flag = government_is_japan_feudal - scope:old_government ?= flag:japan_feudal - culture = culture:japanese - culture = { - any_parent_culture_or_above = { this = culture:japanese } - } - } - } - change_government = japan_feudal_government - } - ## Mandala. - else_if = { - limit = { - OR = { - AND = { - has_mandala_culture_trigger = yes - has_mandala_faith_trigger = yes - scope:capital_county.title_province = { - has_holding_type = temple_citadel_holding - } - } - government_has_flag = government_is_mandala - } - } - change_government = mandala_government - } - ## Administrative. - ## Celestial. - ## Steppe admin. - ## Meritocratic. - ## Soryo. - else_if = { - limit = { - OR = { - government_allows = administrative - scope:old_government ?= flag:admin - } - } - change_to_administrative_effect = yes - } - ## Else feudal. - else = { change_government = feudal_government } - # Step 9: Give them some gold/treasury if they don't have any - if = { - limit = { - gold <= 100 - } - add_gold = { - value = stewardship - multiply = realm_size - } - } - if = { - limit = { - has_treasury = yes - treasury <= 100 - } - add_treasury = { - value = gold - multiply = stewardship - max = 4000 - } - } - # Step 10: Remove them from the looping list - remove_from_list = faction_members_loop - # Step 11: Clear the scopes, otherwise the while loop will break - clear_saved_scope = next_leader - clear_saved_scope = capital_county - } - } - } - hidden_effect = { - # Make sure to destroy all peasant uprising titles and clean all variables - every_in_list = { - list = faction_members - every_held_title = { - limit = { - has_variable = faction - } - prev = { - destroy_title = prev - } - } - remove_variable = peasant_war_escalates - remove_variable = peasant_title - remove_variable = rebel_leader_peasants - remove_variable = peasant_faction_random_peasant - remove_variable = peasant_revolt_do_not_kill - } - # If the faction still exists, dissolve it (it's no longer relevant). - if = { - limit = { - exists = scope:popular_faction - } - scope:popular_faction = { - destroy_faction = yes - } - } - } - if = { - limit = { - scope:faction_target.top_participant_group:dynastic_cycle ?= { - participant_group_type = hegemon_ruler - } - situation:dynastic_cycle = { - situation_top_has_catalyst = catalyst_hegemon_lost_defensive_territorial_war - } - } - situation:dynastic_cycle = { - trigger_situation_catalyst = { - catalyst = catalyst_hegemon_lost_defensive_territorial_war - character = scope:faction_leader - } - } - } -} - -create_popular_revolt_title_effect = { - $FACTION$ = { - ordered_faction_county_member = { - limit = { - faith = $FACTION_LEADER$.faith - culture = $FACTION_LEADER$.culture - } - alternative_limit = { - always = yes - } - - order_by = total_county_levies - - save_scope_as = base_county - } - $FACTION_LEADER$.culture = { save_scope_as = founder_culture } - create_dynamic_title = { - tier = $TIER$ - name = FACTION_POPULIST_CREATED_TITLE_NAME - } - scope:new_title = { - set_variable = { - name = faction - value = $FACTION$ - } - set_color_from_title = scope:base_county - } - } -} - -successful_nomadic_revolt_outcome_effect = { - hidden_effect = { - # Save scopes for later usage. - $FACTION_LEADER$ = { - add_character_flag = successful_nomad_revolt_leader - joined_faction = { - save_scope_as = nomadic_faction - every_faction_member = { - add_to_list = faction_members - } - faction_target = { - save_scope_as = faction_target - } - } - if = { - limit = { - has_variable = peasant_title - exists = this.var:peasant_title.holder - } - destroy_title = this.var:peasant_title - } - } - # Compile a list of all duchies and counties belonging to the faction. - scope:nomadic_faction = { - every_faction_county_member = { - add_to_list = seized_counties - duchy = { - every_de_jure_county = { # Seize entire duchies - limit = { - holder.top_liege = scope:faction_target - NOT = { is_in_list = seized_counties } - } - add_to_list = seized_counties - } - if = { - limit = { - holder.top_liege = scope:faction_target - NOT = { is_in_list = seized_duchies } - } - add_to_list = seized_duchies - } - } - } - } - - # Select a 'capital' county for the faction leader. - scope:nomadic_faction = { - ordered_in_list = { - list = seized_counties - order_by = { - value = 0 - if = { - limit = { - uses_county_fertility = yes - } - add = county_fertility - } - else = { - add = development_level - } - - multiply = { - value = 1 - if = { - limit = { culture = $FACTION_LEADER$.culture } - add = 200 - } - if = { - limit = { faith = $FACTION_LEADER$.faith } - add = 50 - } - } - } - save_scope_as = capital_county - } - } - - # Give the leader the counties they should have and make them a nomad. - $FACTION_LEADER$ = { - add_to_list = independent_nomads - change_government = nomad_government - } - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change - add_claim_on_loss = yes - } - scope:capital_county = { - change_title_holder = { - holder = $FACTION_LEADER$ - change = scope:change - take_baronies = no - } - add_to_list = divided_titles - duchy = { - every_de_jure_county = { # Seize entire duchies - limit = { - is_in_list = seized_counties - NOT = { is_in_list = divided_titles } - } - change_title_holder = { - holder = $FACTION_LEADER$ - change = scope:change - take_baronies = no - } - add_to_list = divided_titles - } - if = { - limit = { - OR = { - NOT = { exists = holder } - trigger_if = { - limit = { exists = holder } - holder.top_liege = scope:faction_target - } - } - NOT = { is_in_list = divided_titles } - } - change_title_holder = { - holder = $FACTION_LEADER$ - change = scope:change - } - add_to_list = divided_titles - } - } - } - resolve_title_and_vassal_change = scope:change - - while = { - limit = { - any_in_list = { - list = seized_counties - NOT = { - is_in_list = divided_titles - } - } - } - random_in_list = { - list = seized_counties - limit = { - NOT = { - is_in_list = divided_titles - } - } - save_scope_as = handout_county - hidden_effect = { - create_character = { - location = scope:handout_county.title_province - template = nomadic_faction_leader_template - faith = scope:handout_county.faith - culture = scope:handout_county.culture - dynasty = generate - gender_female_chance = { - if = { - limit = { scope:handout_county.faith = { has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { scope:handout_county.faith = { has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } - } - save_scope_as = new_nomad - } - scope:new_nomad = { - add_to_list = independent_nomads - } - } - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change - add_claim_on_loss = yes - } - scope:handout_county = { - change_title_holder = { - holder = scope:new_nomad - change = scope:change - take_baronies = no - } - add_to_list = divided_titles - duchy = { - every_de_jure_county = { # Seize entire duchies - limit = { - is_in_list = seized_counties - NOT = { is_in_list = divided_titles } - } - change_title_holder = { - holder = scope:new_nomad - change = scope:change - take_baronies = no - } - add_to_list = divided_titles - } - if = { - limit = { - OR = { - NOT = { exists = holder } - trigger_if = { - limit = { exists = holder } - holder.top_liege = scope:faction_target - } - } - NOT = { is_in_list = divided_titles } - } - change_title_holder = { - holder = scope:new_nomad - change = scope:change - } - add_to_list = divided_titles - } - } - } - resolve_title_and_vassal_change = scope:change - } - } - - # Make sure everyone is independent - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = independent_nomads - limit = { - is_independent_ruler = no - } - hidden_effect = { - becomes_independent = { - change = scope:change - } - } - } - resolve_title_and_vassal_change = scope:change - - # Set them up for success - every_in_list = { - list = independent_nomads - - hidden_effect = { - save_temporary_scope_as = nomad_becoming_independent - every_held_title = { - limit = { - tier = tier_county - } - if = { - limit = { - title_province = { - has_holding_type = herder_holding - } - } - title_province = { - set_holding_type = nomad_holding - } - } - add_county_modifier = { - modifier = county_increased_opinion_modifier - years = 25 - } - if = { - limit = { - has_county_modifier = peasant_war_lost_county_modifier - } - remove_county_modifier = peasant_war_lost_county_modifier - } - } - if = { - limit = { - gold < 50 - } - add_gold = 150 - } - if = { - limit = { - is_ruler = yes - NOT = { - government_has_flag = government_is_nomadic - } - } - change_government = nomad_government - } - if = { - limit = { - NOT = { government_has_flag = government_allows_nomad_domicile_titles } - NOT = { - any_held_title = { - is_nomad_title = yes - } - } - } - save_scope_as = holder - create_nomad_title = { - name = nomad_title_name - holder = scope:holder - government = nomad_government - save_scope_as = new_nomad_title - } - } - if = { - limit = { - NOT = { has_realm_law = nomadic_authority_1 } - } - add_realm_law_skip_effects = nomadic_authority_1 - } - if = { - limit = { - highest_held_title_tier >= tier_duchy - NOT = { has_realm_law = nomadic_authority_2 } - } - if = { - limit = { - has_realm_law = nomadic_authority_1 - } - remove_realm_law = nomadic_authority_1 - add_realm_law_skip_effects = nomadic_authority_2 - } - } - if = { limit = { has_realm_law = crown_authority_0 } remove_realm_law = crown_authority_0 } - if = { limit = { has_realm_law = crown_authority_1 } remove_realm_law = crown_authority_1 } - if = { limit = { has_realm_law = crown_authority_2 } remove_realm_law = crown_authority_2 } - if = { limit = { has_realm_law = crown_authority_3 } remove_realm_law = crown_authority_3 } - domicile ?= { - change_herd = { - value = scope:nomad_becoming_independent.capital_county.county_fertility - min = 20 - multiply = 150 - } - } - } - } - - # If the faction still exists, dissolve it (it's no longer relevant). - hidden_effect = { - if = { - limit = { - exists = scope:nomadic_faction - } - scope:nomadic_faction = { - destroy_faction = yes - } - } - } - } - show_as_tooltip = { - $FACTION_LEADER$ = { - save_scope_as = tooltip_leader - custom_tooltip = nomads_take_everything_tt - } - create_title_and_vassal_change = { - type = conquest_populist - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = seized_duchies - change_title_holder = { - holder = $FACTION_LEADER$ - change = scope:change - take_baronies = no - } - } - every_in_list = { - list = seized_counties - change_title_holder = { - holder = $FACTION_LEADER$ - change = scope:change - take_baronies = no - } - } - resolve_title_and_vassal_change = scope:change - } -} - -spawn_popular_revolt_troops = { - # Spawn Levies - spawn_army = { - levies = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = county_levies_to_raise - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - - # Spawn MAAs - An appropriate amount of troops dependent on the terrain type they spawn in - if = { - limit = { - scope:local_center_of_rebellion = { - OR = { - terrain = forest - terrain = taiga - terrain = jungle - terrain = plains - terrain = drylands - terrain = oasis - terrain = desert - terrain = wetlands - terrain = steppe - } - } - } - spawn_army = { - men_at_arms = { - type = light_footmen - stacks = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = county_maa_to_raise - } - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else_if = { - limit = { - scope:local_center_of_rebellion = { - OR = { - terrain = mountains - terrain = desert_mountains - } - } - } - spawn_army = { - men_at_arms = { - type = pikemen_unit - stacks = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = county_maa_to_raise - } - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else_if = { - limit = { - scope:local_center_of_rebellion = { - OR = { - terrain = hills - terrain = farmlands - terrain = floodplains - } - } - } - spawn_army = { - men_at_arms = { - type = bowmen - stacks = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = county_maa_to_raise - } - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - - # Spawn Siege Weapons depending on discovered innovations - if = { - limit = { - culture = { has_innovation = innovation_gunpowder } - } - spawn_army = { - men_at_arms = { - type = bombard - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else_if = { - limit = { - culture = { has_innovation = innovation_trebuchet } - } - spawn_army = { - men_at_arms = { - type = trebuchet - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - - } - else_if = { - limit = { - culture = { has_innovation = innovation_mangonel } - } - spawn_army = { - men_at_arms = { - type = mangonel - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else_if = { - limit = { - culture = { has_innovation = innovation_catapult } - } - spawn_army = { - men_at_arms = { - type = onager - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - - if = { - limit = { has_variable = ep3_governor_yearly_8150_ignored } - root.faction_leader = { - spawn_army = { - name = ep3_governor_yearly_8150_troop_name - men_at_arms = { - type = light_footmen - stacks = 2 - } - war = root.faction_war - location = scope:local_center_of_rebellion - origin = scope:local_center_of_rebellion - inheritable = no - } - } - remove_variable = ep3_governor_yearly_8150_ignored - } -} - -spawn_nomadic_revolt_troops = { - # Spawn Horde Riders - spawn_army = { - men_at_arms = { - type = nomadic_riders - men = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = county_horde_riders_to_raise - } - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = nomadic_faction_event_troops - } - - spawn_army = { - men_at_arms = { - type = steppe_raiders - men = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = { - value = county_horde_riders_to_raise - divide = 2 - } - } - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = nomadic_faction_event_troops - } - - spawn_army = { - men_at_arms = { - type = horse_archers - men = { - value = 0 - joined_faction = { - every_faction_county_member = { - limit = { - duchy = scope:local_center_of_rebellion.duchy - } - add = { - value = county_horde_riders_to_raise - divide = 2 - } - } - } - } - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = nomadic_faction_event_troops - } - - # Spawn Siege Weapons depending on discovered innovations - if = { - limit = { - culture = { has_innovation = innovation_gunpowder } - } - spawn_army = { - men_at_arms = { - type = bombard - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else_if = { - limit = { - culture = { has_innovation = innovation_trebuchet } - } - spawn_army = { - men_at_arms = { - type = trebuchet - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - - } - else_if = { - limit = { - culture = { has_innovation = innovation_mangonel } - } - spawn_army = { - men_at_arms = { - type = mangonel - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else_if = { - limit = { - culture = { has_innovation = innovation_catapult } - } - spawn_army = { - men_at_arms = { - type = onager - stacks = 1 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } - else = { - spawn_army = { - men_at_arms = { - type = torch_bearers - stacks = 5 - } - location = scope:local_center_of_rebellion - war = root.faction_war - name = populist_faction_event_troops - } - } -} - -peasant_faction_demands_enforced = { - # escalate if in the Cycle - if = { - limit = { - NOT = { exists = scope:defender } - } - save_scope_as = defender - } - if = { - limit = { - scope:defender != scope:defender.top_liege - #only in Dynastic Cycle - scope:defender.top_liege.top_participant_group:dynastic_cycle ?= { - participant_group_type = hegemon_ruler - } - } - scope:defender.top_liege = { - set_variable = { - name = peasant_war_escalates - days = 365 - } - } - $FACTION$ = { - faction_leader = { - save_scope_as = attacker - add_character_flag = peasant_revolt_do_not_kill - set_variable = { - name = peasant_war_escalates - days = 365 - } - add_trait_xp = { - trait = peasant_leader - value = 20 - } - } - every_faction_county_member = { - add_to_list = faction_counties - add_county_modifier = { - modifier = peasant_war_lost_county_modifier - years = 10 - } - } - destroy_faction = yes - } - if = { - limit = { - NOT = { exists = scope:attacker } - } - scope:peasant_leader = { - save_scope_as = attacker - } - } - if = { - limit = { - scope:defender.top_liege = { - any_targeting_faction = { - faction_type = escalated_peasant_faction - save_temporary_scope_as = escalated_faction - } - } - } - scope:defender.top_liege = { - send_interface_message = { - type = msg_faction_grows - left_icon = scope:attacker - right_icon = scope:defender - every_in_list = { - list = faction_counties - title_join_faction = scope:escalated_faction - } - scope:attacker = { - join_faction_skip_check = scope:escalated_faction - } - } - } - } - else = { - scope:attacker = { - create_faction = { - type = escalated_peasant_faction - target = scope:defender.top_liege - } - } - scope:defender.top_liege = { - random_targeting_faction = { - faction_type = escalated_peasant_faction - save_scope_as = escalated_faction - set_special_character = scope:attacker - } - } - custom_tooltip = { - text = county_and_leader_join_faction_against_top_liege - if = { - limit = { - exists = scope:escalated_faction - } - every_in_list = { - list = faction_counties - limit = { - title_is_a_faction_member = no - } - title_join_faction = scope:escalated_faction - } - scope:attacker = { - set_variable = { - name = rebel_leader_peasants - value = scope:escalated_faction - } - join_faction_skip_check = scope:escalated_faction - primary_title = { - set_title_name_dynamic = peasant_leader_title_name - } - } - } - } - } - } - # otherwise finish the faction as usual - else = { - $FACTION$ = { - every_faction_county_member = { - custom = peasant_faction_every_county - change_county_control = peasant_war_victory_county_control_loss - add_county_modifier = { - modifier = peasant_war_lost_county_modifier - years = 10 - } - } - hidden_effect = { - clean_revolt_county_modifiers_from_faction_members_effect = yes - destroy_faction = yes - } - } - } -} - -invalidate_claimant_factions_on_death_effect = { - every_in_list = { - variable = claimant_factions - if = { - limit = { - exists = faction_war - } - faction_war = { - clear_claimant = yes - set_casus_belli = depose_war - } - faction_remove_war = yes # else the war gets invalidated when we destroy the faction - } - destroy_faction = yes - } - clear_variable_list = claimant_factions -} - -invalidate_ceremonial_claimant_factions_on_death_effect = { - every_in_list = { - variable = ceremonial_claimant_factions - if = { - limit = { - exists = faction_war - } - faction_war = { - clear_claimant = yes - set_casus_belli = depose_war - } - faction_remove_war = yes # else the war gets invalidated when we destroy the faction - } - destroy_faction = yes - } - clear_variable_list = ceremonial_claimant_factions -} - -setup_nomadic_leader_effect = { - save_scope_as = faction - - random_faction_county_member = { - save_scope_as = peasant_county - } - - # Create a leader for the nomadic faction. - create_character = { - location = scope:peasant_county.title_province - template = nomadic_faction_leader_template - faith = scope:peasant_county.faith - culture = scope:peasant_county.culture - gender_female_chance = { - if = { - limit = { scope:peasant_county.faith = { has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { scope:peasant_county.faith = { has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } - } - save_scope_as = peasant_leader - } - scope:peasant_leader = { - add_character_flag = peasant_faction_random_peasant - } - - # Create a new title for the peasant. - create_dynamic_title = { - tier = duchy - name = FACTION_NOMADIC_REVOLT_TITLE_NAME - } - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - scope:new_title = { - set_capital_county = scope:peasant_county - set_landless_title = yes - set_destroy_on_succession = yes - set_delete_on_destroy = yes - set_no_automatic_claims = yes - set_definitive_form = yes - set_can_be_named_after_dynasty = no - change_title_holder = { - holder = scope:peasant_leader - change = scope:change - } - set_variable = { - name = faction - value = scope:faction - } - } - resolve_title_and_vassal_change = scope:change - scope:peasant_leader = { - set_variable = { - name = peasant_title - value = scope:new_title - } - if = { - limit = { - is_ruler = yes - NOT = { - government_has_flag = government_is_nomadic - } - } - change_government = nomad_government - } - } - scope:new_title = { generate_coa = factions } - - # Set the peasant leader as the head of the faction. - scope:peasant_leader = { - set_variable = { - name = rebel_leader_peasants - value = scope:faction - } - join_faction_skip_check = scope:faction - } - set_special_character = scope:peasant_leader -} - -setup_populist_leader_effect = { - save_scope_as = faction - - random_faction_county_member = { - save_scope_as = peasant_county - } - - # Runs the scripted effect to find the best title to target for the rebellion. - get_popular_revolt_target_effect = { FACTION = this } - - # Find or create a leader for the populist faction. - scope:target_title = { - # Look to see if there are any displaced characters who are legitimate claimants to the target title that the populists might support. - random_claimant = { - limit = { - # Checks the 'is_character_valid' and 'can_character_join' triggers above, plus the faction hard/soft blocks in 00_rules.txt - can_join_faction = scope:faction - can_join_or_create_faction_against = scope:faction.faction_target - - # Must share a faith & culture with the revolting county. - faith = scope:peasant_county.faith - culture = scope:peasant_county.culture - - # Must be allowed to rule in their faith. - trigger_if = { - limit = { - faith = { has_doctrine = doctrine_gender_male_dominated } - } - is_male = yes - } - trigger_else_if = { - limit = { - faith = { has_doctrine = doctrine_gender_female_dominated } - } - is_female = yes - } - trigger_else = { - always = yes - } - - # Must not already be a landed ruler, or set to inheirit a landed title. - AND = { - is_ruler = no - is_playable_character = no - NOT = { - any_heir_title = { - exists = this - } - } - } - } - - save_scope_as = peasant_leader - add_character_flag = peasant_faction_claimant_without_title - add_trait = populist_leader - } - } - if = { - limit = { - NOT = { exists = scope:peasant_leader } - exists = special_character - } - special_character = { - save_scope_as = peasant_leader - } - } - # If we can't find any, then generate a new character to be the populist leader of the revolt. - else = { - create_character = { - location = scope:peasant_county.title_province - template = populist_faction_leader_template - faith = scope:peasant_county.faith - culture = scope:peasant_county.culture - gender_female_chance = { - if = { - limit = { scope:peasant_county.faith = { has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { scope:peasant_county.faith = { has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } - } - trait = populist_leader - save_scope_as = peasant_leader - } - scope:peasant_leader = { - add_character_flag = peasant_faction_random_peasant - } - } - if = { - limit = { - NOT = { exists = scope:peasant_leader.primary_title } - } - # Create a new title for the peasant. - create_dynamic_title = { - tier = duchy - name = FACTION_POPULIST_REVOLT_TITLE_NAME - } - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - scope:new_title = { - set_capital_county = scope:peasant_county - set_landless_title = yes - set_destroy_on_succession = yes - set_delete_on_destroy = yes - set_no_automatic_claims = yes - set_definitive_form = yes - set_can_be_named_after_dynasty = no - set_can_use_nomadic_naming = no - change_title_holder = { - holder = scope:peasant_leader - change = scope:change - } - set_variable = { - name = faction - value = scope:faction - } - } - resolve_title_and_vassal_change = scope:change - scope:peasant_leader = { - set_variable = { - name = peasant_title - value = scope:new_title - } - } - scope:new_title = { generate_coa = factions } - - # Set the peasant leader as the head of the faction. - scope:peasant_leader = { - set_variable = { - name = rebel_leader_peasants - value = scope:faction - } - join_faction_skip_check = scope:faction - } - set_special_character = scope:peasant_leader - } -} - -setup_peasant_leader_effect = { - save_scope_as = faction - # Does a peasant capital county already exist? - if = { - limit = { - NOT = { exists = scope:peasant_county } - } - random_faction_county_member = { save_scope_as = peasant_county } - } - # Does a peasant leader already exist? - if = { - limit = { - NOT = { exists = scope:peasant_leader } - } - create_character = { - location = scope:peasant_county.title_province - template = peasant_faction_leader_template - faith = scope:peasant_county.faith - culture = scope:peasant_county.culture - gender_female_chance = { - if = { - limit = { scope:peasant_county.faith = { has_doctrine = doctrine_gender_male_dominated } } - add = 0 - } - else_if = { - limit = { scope:peasant_county.faith = { has_doctrine = doctrine_gender_female_dominated } } - add = 100 - } - else = { - add = 50 - } - } - save_scope_as = peasant_leader - } - } - scope:peasant_leader = { - add_character_flag = peasant_faction_random_peasant - } - - - create_dynamic_title = { - tier = duchy - name = FACTION_PEASANT_TITLE_NAME - } - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - scope:new_title = { - set_capital_county = scope:peasant_county - set_landless_title = yes - set_destroy_on_succession = yes - set_delete_on_destroy = yes - set_no_automatic_claims = yes - set_definitive_form = yes - set_can_be_named_after_dynasty = no - set_can_use_nomadic_naming = no - change_title_holder = { - holder = scope:peasant_leader - change = scope:change - } - - set_variable = { - name = faction - value = scope:faction - } - - # avoid unused variable error. This variable is referenced in code - var:faction = {} - } - resolve_title_and_vassal_change = scope:change - scope:peasant_leader = { - set_variable = { - name = peasant_title - value = scope:new_title - } - } - scope:new_title = { generate_coa = factions } - - scope:peasant_leader = { - set_variable = { - name = rebel_leader_peasants - value = scope:faction - } - join_faction_skip_check = scope:faction - add_trait_xp = { - trait = peasant_leader - value = peasant_leader_xp_value - } - } - - set_special_character = scope:peasant_leader -} - -faction_spawn_member_county_armies_effect = { - every_faction_county_member = { - custom = peasant_faction_every_county - hidden_effect = { - save_scope_as = county - title_province = { - save_scope_as = county_location - } - } - - # Reduce county control in faction member counties - change_county_control = peasant_war_starts_county_control_loss - - # Spawn an army in each faction member county - custom_tooltip = peasant_faction_spawn_county_levies - hidden_effect = { - $ARMY_OWNER$ = { - spawn_army = { - levies = scope:county.county_levies_to_raise - location = scope:county_location - war = $FACTION$.faction_war - name = $PEASANT_ARMY_NAME$ - } - } - } - } -} diff --git a/common/scripted_effects/00_major_decisions_scripted_effects.txt b/common/scripted_effects/00_major_decisions_scripted_effects.txt deleted file mode 100644 index fe91ab846..000000000 --- a/common/scripted_effects/00_major_decisions_scripted_effects.txt +++ /dev/null @@ -1,5016 +0,0 @@ -#create_roman_empire_scripted_effect = { -# primary_title = { save_scope_as = old_primary_title } -# add_trait = augustus -# if = { -# limit = { has_dlc_feature = legends } -# create_legend_seed = { -# type = legitimizing -# quality = illustrious -# chronicle = new_title -# properties = { -# title = title:h_roman_empire -# founder = root -# } -# } -# } -# #Create Roman Empire, shift dejure/history/laws, destroy e_byzantium. -# -# if = { -# limit = { capital_county = { this = title:c_byzantion } } -# title:h_roman_empire = { -# set_capital_county = title:c_byzantion -# } -# } -# -# hidden_effect = { -# every_held_title = { #Should shift all dejure of all Empires owned at the time. -# title_tier = empire -# -# set_de_jure_liege_title = title:h_roman_empire -# } -# every_empire = { -# limit = { -# NOT = { exists = hegemony } -# any_de_jure_county = { -# percent >= 0.6 -# holder = { -# OR = { -# this = root -# any_liege_or_above = { this = root } -# } -# } -# } -# } -# set_de_jure_liege_title = title:h_roman_empire -# } -# } -# split_byzantine_empire_effect = yes -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:h_roman_empire = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# copy_title_history = title:e_byzantium -# } -# resolve_title_and_vassal_change = scope:change -# if = { # Move your Title MaAs to your new title if you have any -# limit = { -# government_allows = administrative -# primary_title = { -# any_title_maa_regiment = { } -# } -# } -# hidden_effect = { -# primary_title = { transfer_title_maa_ownership = title:h_roman_empire } -# } -# } -# if = { # If you have founded the Varangian Guard, you get to keep the benefits -# limit = { -# scope:old_primary_title = { has_variable = founded_varangian_guard } -# } -# hidden_effect = { -# title:h_roman_empire = { set_variable = founded_varangian_guard } -# } -# } -# hidden_effect = { set_primary_title_to = title:h_roman_empire } -# every_held_title = { #Should destroy all other Empires owned at the time. -# title_tier = empire -# -# root = { destroy_title = prev } -# } -# -# if = { #Automatically move capital to Constantinople, unless it's been set to Rome. -# limit = { -# NOT = { capital_county = { this = title:c_roma } } -# NOT = { capital_county = { this = title:c_byzantion } } -# culture = { has_cultural_pillar = heritage_byzantine } -# } -# hidden_effect = { -# if = { #Usurp if not held personally. -# limit = { -# NOT = { this = title:c_byzantion.holder } -# } -# create_title_and_vassal_change = { -# type = returned -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:c_byzantion = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# root = { set_realm_capital = title:c_byzantion } -# } -# else_if = { -# limit = { -# NOT = { capital_county = { this = title:c_roma } } -# NOT = { capital_county = { this = title:c_byzantion } } -# NOT = { culture = { has_cultural_pillar = heritage_byzantine } } -# exists = title:h_roman_empire.holder -# } -# hidden_effect = { -# if = { #Usurp if not held personally. -# limit = { -# NOT = { this = title:c_roma.holder } -# } -# create_title_and_vassal_change = { -# type = returned -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:c_roma = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# root = { set_realm_capital = title:c_roma } -# } -# hidden_effect = { -# add_character_flag = flag_restorer_of_rome #used for Eulogy. -# title:h_roman_empire = { -# set_variable = rome_was_restored_by_byzantium -# } -# } -#} -# -#create_roman_empire_holy_scripted_effect = { -# add_trait = augustus -# #Create Roman Empire, shift dejure/history/laws, destroy e_hre. -# hidden_effect = { -# every_held_title = { #Should shift all dejure of all Empires owned at the time. -# title_tier = empire -# -# set_de_jure_liege_title = title:h_roman_empire -# } -# primary_title = { -# if = { -# limit = { -# any_in_de_jure_hierarchy = { -# tier = tier_kingdom -# OR = { -# title:k_france ?= this -# title:k_aquitaine ?= this -# title:k_brittany ?= this -# } -# } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# OR = { -# title:k_france ?= this -# title:k_aquitaine ?= this -# title:k_brittany ?= this -# } -# } -# set_de_jure_liege_title = title:e_france -# title:e_france = { set_de_jure_liege_title = title:h_roman_empire } -# } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# } -# set_de_jure_liege_title = title:e_germany -# title:e_germany = { set_de_jure_liege_title = title:h_roman_empire } -# } -# } -# every_empire = { -# limit = { -# NOT = { exists = hegemony } -# any_de_jure_county = { -# percent >= 0.6 -# holder = { -# OR = { -# this = root -# any_liege_or_above = { this = root } -# } -# } -# } -# } -# set_de_jure_liege_title = title:h_roman_empire -# } -# } -# split_byzantine_empire_effect = yes -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:h_roman_empire = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# set_variable = { -# name = variable_restored_hre #Used for flavor later. -# value = yes -# } -# copy_title_history = title:e_hre -# } -# resolve_title_and_vassal_change = scope:change -# if = { # Move your Title MaAs to your new title if you have any -# limit = { -# government_allows = administrative -# primary_title = { -# any_title_maa_regiment = { } -# } -# } -# hidden_effect = { -# primary_title = { transfer_title_maa_ownership = title:h_roman_empire } -# } -# } -# if = { # If you have founded the Varangian Guard, you get to keep the benefits (you are not likely to have done it here, but better safe than sorry) -# limit = { -# primary_title = { has_variable = founded_varangian_guard } -# } -# hidden_effect = { -# title:h_roman_empire = { set_variable = founded_varangian_guard } -# } -# } -# hidden_effect = { set_primary_title_to = title:h_roman_empire } -# every_held_title = { #Should destroy all other Empires owned at the time. -# title_tier = empire -# -# root = { destroy_title = prev } -# } -# hidden_effect = { -# title:h_roman_empire = { -# set_coa = e_hre_roman -# set_title_color = { 255 255 255 } -# } -# } -# -# if = { #Automatically move capital to Rome. -# limit = { -# NOT = { capital_county = { this = title:c_roma } } -# exists = title:h_roman_empire.holder -# } -# hidden_effect = { -# if = { #Usurp if not held personally. -# limit = { -# NOT = { title:c_roma.holder = { this = root } } -# } -# create_title_and_vassal_change = { -# type = returned -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:c_roma = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# title:h_roman_empire.holder = { set_realm_capital = title:c_roma } -# } -# hidden_effect = { -# create_story = restoring_roman_provinces_story -# add_character_flag = flag_restorer_of_rome #used for Eulogy. -# } -#} -# -#create_roman_empire_italy_scripted_effect = { -# add_trait = augustus -# #Create Roman Empire, shift dejure/history/laws, destroy e_italy. -# hidden_effect = { -# every_held_title = { #Should shift all dejure of all Empires owned at the time. -# title_tier = empire -# -# set_de_jure_liege_title = title:h_roman_empire -# } -# every_empire = { -# limit = { -# NOT = { exists = hegemony } -# any_de_jure_county = { -# percent >= 0.6 -# holder = { -# OR = { -# this = root -# any_liege_or_above = { this = root } -# } -# } -# } -# } -# set_de_jure_liege_title = title:h_roman_empire -# } -# } -# split_byzantine_empire_effect = yes -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:h_roman_empire = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# set_variable = { -# name = variable_restored_italy #Used for flavor later. -# value = yes -# } -# copy_title_history = title:e_italy -# } -# resolve_title_and_vassal_change = scope:change -# if = { # Move your Title MaAs to your new title if you have any -# limit = { -# government_allows = administrative -# primary_title = { -# any_title_maa_regiment = { } -# } -# } -# hidden_effect = { -# primary_title = { transfer_title_maa_ownership = title:h_roman_empire } -# } -# } -# if = { # If you have founded the Varangian Guard, you get to keep the benefits (you are not likely to have done it here, but better safe than sorry) -# limit = { -# primary_title = { has_variable = founded_varangian_guard } -# } -# hidden_effect = { -# title:h_roman_empire = { set_variable = founded_varangian_guard } -# } -# } -# hidden_effect = { set_primary_title_to = title:h_roman_empire } -# every_held_title = { #Should destroy all other Empires owned at the time. -# title_tier = empire -# -# root = { destroy_title = prev } -# } -# if = { #Automatically move capital to Rome. -# limit = { -# NOT = { capital_county = { this = title:c_roma } } -# exists = title:h_roman_empire.holder -# } -# hidden_effect = { -# if = { #Usurp if not held personally. -# limit = { -# NOT = { title:c_roma.holder = { this = root } } -# } -# create_title_and_vassal_change = { -# type = returned -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:c_roma = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# } -# title:h_roman_empire.holder = { set_realm_capital = title:c_roma } -# } -# hidden_effect = { -# create_story = restoring_roman_provinces_story -# add_character_flag = flag_restorer_of_rome #used for Eulogy. -# } -#} -# -#split_byzantine_empire_effect = { -# hidden_effect = { -# title:e_byzantium = { -# if = { -# limit = { -# OR = { -# NOT = { exists = holder } -# holder ?= root -# } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# title:e_italy ?= { is_titular = no } -# tier = tier_kingdom -# OR = { -# title:k_trinacria ?= this -# title:k_sicily ?= this -# title:k_naples ?= this -# title:k_venice ?= this -# } -# } -# set_de_jure_liege_title = title:e_italy -# title:e_italy = { set_de_jure_liege_title = title:h_roman_empire } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# OR = { -# title:k_trinacria ?= this -# title:k_epirus ?= this -# title:k_croatia ?= this -# title:k_serbia ?= this -# title:k_bosnia ?= this -# title:k_sicily ?= this -# title:k_venice ?= this -# title:k_naples ?= this -# } -# } -# set_de_jure_liege_title = title:e_illyria -# title:e_illyria = { set_de_jure_liege_title = title:h_roman_empire } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# OR = { -# title:k_thessalonika ?= this -# title:k_hellas ?= this -# title:k_krete ?= this -# title:k_bulgaria ?= this -# } -# } -# set_de_jure_liege_title = title:e_macedonia -# title:e_macedonia = { set_de_jure_liege_title = title:h_roman_empire } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# OR = { -# title:k_saruhan ?= this -# title:k_tekke ?= this -# title:k_trebizond ?= this -# title:k_ottoman ?= this -# title:k_rum ?= this -# title:k_mentese ?= this -# title:k_karaman ?= this -# title:k_germiyan ?= this -# title:k_cyprus ?= this -# title:k_eretnid ?= this -# title:k_candar ?= this -# title:k_nikaea ?= this -# title:k_pontus ?= this -# title:k_armenia ?= this -# title:k_georgia ?= this -# title:k_armenian_principality ?= this -# title:k_old_armenia ?= this -# title:k_anatolia ?= this -# title:k_aydin ?= this -# } -# } -# set_de_jure_liege_title = title:e_anatolia -# title:e_anatolia = { set_de_jure_liege_title = title:h_roman_empire } -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# } -# if = { -# limit = { -# any_title_to_title_neighboring_and_across_water_empire = { -# count >= 1 -# } -# } -# random_title_to_title_neighboring_and_across_water_empire = { -# save_scope_as = new_empire_de_jure -# } -# set_de_jure_liege_title = scope:new_empire_de_jure -# } -# } -# } -# } -# } -#} -# -#create_eastern_roman_empire_scripted_effect = { -# if = { # First we move the domicile of root, if necessary -# limit = { -# exists = domicile -# domicile.domicile_location = { -# geographical_region = custom_ep3_restore_rome_eastern_empire -# } -# } -# domicile = { -# move_domicile = root.capital_province -# } -# } -# scope:new_holder = { # Secondly, we handle the new liege -# add_trait = augustus -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# if = { # We ensure they get Byzantion -# limit = { -# scope:new_holder != title:c_byzantion.holder -# } -# title:c_byzantion = { -# change_title_holder = { -# holder = scope:new_holder -# change = scope:change -# } -# } -# } -# # We move over the De Jure for all the basic titles -# title:e_byzantium ?= { set_de_jure_liege_title = title:h_eastern_roman_empire } -# title:e_illyria ?= { set_de_jure_liege_title = title:h_eastern_roman_empire } -# title:e_macedonia ?= { set_de_jure_liege_title = title:h_eastern_roman_empire } -# title:e_anatolia ?= { set_de_jure_liege_title = title:h_eastern_roman_empire } -# title:h_eastern_roman_empire = { # They get the new Roman Empire title -# change_title_holder = { -# holder = scope:new_holder -# change = scope:change -# } -# } -# root = { # They get every held title from current root in the greater region -# every_held_title = { -# limit = { -# tier = tier_county -# is_landless_type_title = no -# title_province = { geographical_region = custom_ep3_restore_rome_eastern_empire } -# } -# change_title_holder = { -# holder = scope:new_holder -# change = scope:change -# } -# } -# } -# resolve_title_and_vassal_change = scope:change -# set_primary_title_to = title:h_eastern_roman_empire -# set_realm_capital = title:c_byzantion -# } -# -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# # Then all the direct vassals who should move over -# every_vassal = { -# limit = { -# highest_held_title_tier >= tier_county -# capital_province = { geographical_region = custom_ep3_restore_rome_eastern_empire } -# } -# change_liege = { -# liege = scope:new_holder -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# # Then vassals who are not directly in line -# every_vassal_or_below = { -# limit = { -# highest_held_title_tier >= tier_county -# capital_province = { geographical_region = custom_ep3_restore_rome_eastern_empire } -# } -# change_liege = { -# liege = scope:new_holder -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# -# # Then change the de_jure for empires that are de jure part of the Roman Empire, but who has mostly broken free -# every_empire = { -# limit = { -# hegemony ?= title:h_roman_empire -# any_de_jure_county = { -# percent >= 0.51 -# title_province = { -# geographical_region = custom_ep3_restore_rome_eastern_empire -# } -# } -# } -# set_de_jure_liege_title = title:h_eastern_roman_empire -# } -# -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# # Then every title that aren't county title held by root, but they have a majority of the titles under their rule -# every_held_title = { -# limit = { -# NOR = { -# tier = tier_county -# tier = tier_hegemony -# this = root.primary_title -# } -# is_landless_type_title = no -# any_de_jure_county = { -# percent >= 0.51 -# title_province = { -# geographical_region = custom_ep3_restore_rome_eastern_empire -# } -# } -# } -# change_title_holder = { -# holder = scope:new_holder -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# -# every_empire = { -# limit = { -# OR = { -# any_de_jure_county = { -# percent >= 0.75 -# holder = { -# OR = { -# this = scope:new_holder -# any_liege_or_above = { this = scope:new_holder } -# } -# } -# } -# AND = { -# de_jure_liege = title:h_eastern_roman_empire -# any_de_jure_county = { -# percent >= 0.51 -# holder = { -# OR = { -# this = scope:new_holder -# any_liege_or_above = { this = scope:new_holder } -# } -# } -# } -# } -# } -# } -# set_de_jure_liege_title = title:h_eastern_roman_empire -# } -#} -# -#mend_great_schism_scripted_effect = { -# root.faith = { -# if = { #If from obscure branch of Christianity, make it official. -# limit = { -# root.faith = { NOT = { has_doctrine = special_doctrine_ecumenical_christian } } -# } -# add_doctrine = special_doctrine_ecumenical_christian -# } -# change_fervor = { -# value = 25 -# desc = fervor_gain_mended_schism -# } -# hidden_effect = { -# religion = { -# every_faith = { -# limit = { -# this != religious_head.faith -# } -# remove_religious_head_title = yes -# } -# } -# } -# } -# every_player = { #Notify all players of the same Faith. -# limit = { -# this != root -# faith = root.faith -# } -# trigger_event = roman_restoration.0103 -# } -# every_ruler = { #Notify rulers of other Christian branches that they are no longer valid and offer chance at conversion. -# limit = { -# faith.religion = root.faith.religion -# faith != root.faith -# NOT = { government_has_flag = government_is_theocracy } -# this != this.faith.religious_head -# faith = { -# has_doctrine = special_doctrine_ecumenical_christian -# } -# } -# trigger_event = roman_restoration.0101 -# } -# every_player = { #Then notify all infidel players that might be around. -# limit = { -# OR = { -# AND = { #Either filthy heretics... -# faith.religion = root.faith.religion -# faith = { NOT = { has_doctrine = special_doctrine_ecumenical_christian } } -# } -# faith.religion != root.faith.religion #...Or Heathens. -# } -# } -# trigger_event = roman_restoration.0102 -# } -# religion:eastern_orthodox_religion = { -# every_faith = { #All main branches of Christianity that were considered Ecumenical are now heresies. -# custom = every_ecumenical_christian_faith.tt -# limit = { -# this.religion = root.faith.religion -# has_doctrine = special_doctrine_ecumenical_christian -# this != root.faith -# } -# remove_doctrine = special_doctrine_ecumenical_christian -# change_fervor = { -# value = -25 -# desc = fervor_loss_mended_schism -# } -# } -# } -# religion:catholic_religion = { -# every_faith = { #All main branches of Christianity that were considered Ecumenical are now heresies. -# custom = every_ecumenical_christian_faith.tt -# limit = { -# this.religion = root.faith.religion -# has_doctrine = special_doctrine_ecumenical_christian -# this != root.faith -# } -# remove_doctrine = special_doctrine_ecumenical_christian -# change_fervor = { -# value = -25 -# desc = fervor_loss_mended_schism -# } -# } -# } -# religion:protestant_religion = { -# every_faith = { #All main branches of Christianity that were considered Ecumenical are now heresies. -# custom = every_ecumenical_christian_faith.tt -# limit = { -# this.religion = root.faith.religion -# has_doctrine = special_doctrine_ecumenical_christian -# this != root.faith -# } -# remove_doctrine = special_doctrine_ecumenical_christian -# change_fervor = { -# value = -25 -# desc = fervor_loss_mended_schism -# } -# } -# } -# -# set_nickname_effect = { NICKNAME = nick_the_ecumenist } -#} - -restore_papacy_scripted_effect = { - save_scope_as = reformer - if = { #Pick your chaplain first. - limit = { - exists = cp:councillor_court_chaplain - cp:councillor_court_chaplain = { religion = religion:catholic_religion } - } - cp:councillor_court_chaplain = { save_scope_as = new_pope } - } - else = { - hidden_effect = { - create_character = { - employer = root - template = religious_leader_character - random_traits = no - save_scope_as = new_pope - } - } - scope:new_pope = { - add_trait = education_learning_3 - add_trait = zealous - add_trait = intellect_good_1 - random_list = { - 1 = { add_trait = lustful } - 1 = { add_trait = chaste } - 1 = { add_trait = wrathful } - 1 = { add_trait = diligent } - 1 = { add_trait = impatient } - 1 = { add_trait = arrogant } - 1 = { add_trait = humble } - 1 = { add_trait = gregarious } - } - random_list = { - 1 = { add_trait = honest } - 1 = { add_trait = ambitious } - 1 = { add_trait = just } - 1 = { add_trait = cynical } - 1 = { add_trait = zealous } - 1 = { add_trait = compassionate } - 1 = { add_trait = stubborn } - } - } - } - create_title_and_vassal_change = { - type = returned - save_scope_as = change - add_claim_on_loss = no - } - title:k_papal_state = { - change_title_holder = { - holder = scope:new_pope - change = scope:change - } - } - title:c_roma = { - change_title_holder = { - holder = scope:new_pope - change = scope:change - } - } - title:d_latium = { - change_title_holder = { - holder = scope:new_pope - change = scope:change - } - } - title:d_spoleto = { - change_title_holder = { - holder = scope:new_pope - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - faith:roman_catholic = { - change_fervor = { - value = 15 - desc = fervor_gain_papacy_restored - } - if = { - limit = { NOT = { has_doctrine = special_doctrine_ecumenical_christian } } - add_doctrine = special_doctrine_ecumenical_christian - } - if = { - limit = { has_doctrine = doctrine_no_head } - hidden_effect = { remove_doctrine = doctrine_no_head } - add_doctrine = doctrine_spiritual_head - } - set_religious_head_title = title:k_papal_state - } -} - -destroy_papacy_scripted_effect = { - save_scope_as = scoped_destroyer - if = { - limit = { exists = title:k_papal_state.holder } - title:k_papal_state.holder = { save_scope_as = scoped_pope } - } - add_piety = massive_piety_gain - root.faith = { - change_fervor = { - value = 50 - desc = fervor_gain_papacy_destroyed - } - } - - # Destroy the papacy title if it exists. - if = { - limit = { - exists = title:k_papal_state - } - destroy_title = title:k_papal_state - } - - # If the Pope exists, they will suffer some kind of humiliating or tragic fate. - if = { - limit = { - exists = scope:scoped_pope - } - if = { - limit = { - faith = { - has_doctrine_parameter = human_sacrifice_active - } - } - scope:scoped_pope = { - death = { - death_reason = death_sacrificed_to_gods - killer = root - } - } - } - else_if = { - limit = { - faith.religion = faith:megalocratic.religion - } - scope:scoped_pope = { - death = { - death_reason = death_crucified - killer = root - } - } - } - else = { - scope:scoped_pope = { set_character_faith = root.faith } - } - - if = { - limit = { scope:scoped_pope.gold > 0 } - scope:scoped_pope = { - hidden_effect = { remove_short_term_gold = scope:scoped_pope.gold } - } - } - } - - # Catholicism is now sad. - faith:roman_catholic = { - change_fervor = { - value = -100 - desc = fervor_loss_papacy_destroyed - } - if = { - limit = { has_doctrine = special_doctrine_ecumenical_christian } - remove_doctrine = special_doctrine_ecumenical_christian - } - if = { - limit = { has_doctrine = doctrine_spiritual_head } - remove_doctrine = doctrine_spiritual_head - hidden_effect = { add_doctrine = doctrine_no_head } - } - } -} - -#form_switzerland_scripted_effect = { -# save_scope_as = scoped_ruler -# title:e_hre.holder = { save_scope_as = scoped_emperor } -# title:d_savoie = { save_scope_as = savoy } -# title:k_switzerland = { save_scope_as = switzerland } -# #De jure shifts. -# title:d_mittelland = { set_de_jure_liege_title = title:k_switzerland } -# title:d_transjurania = { set_de_jure_liege_title = title:k_switzerland } -# if = { -# limit = { completely_controls = title:d_savoie } -# title:d_savoie = { set_de_jure_liege_title = title:k_switzerland } -# } -# else = { custom_tooltip = form_switzerland_kingdom_decision_effect_tooltip } -# title:k_switzerland = { set_de_jure_liege_title = root.top_liege.primary_title } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:k_switzerland = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# hidden_effect = { set_primary_title_to = title:k_switzerland } -# add_prestige = major_prestige_gain -# if = { -# limit = { -# OR = { -# has_realm_law = crown_authority_0 -# has_realm_law = crown_authority_1 -# has_realm_law = crown_authority_2 -# } -# } -# add_realm_law_skip_effects = crown_authority_3 -# } -#} -# -#form_austria_scripted_effect = { -# #Grab scopes for loc and such. -# save_scope_as = scoped_ruler -# title:e_hre.holder = { save_scope_as = scoped_emperor } -# title:d_carinthia = { save_scope_as = carinthia } -# title:d_slovenia = {save_scope_as = krain } -# title:d_istria = { save_scope_as = istria } -# title:k_austria = { save_scope_as = austria} -# title:d_croatia.de_jure_liege = { save_scope_as = new_controller} -# #Hand over k_austria. -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:k_austria = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# copy_title_history = title:d_lower_austria -# } -# resolve_title_and_vassal_change = scope:change -# #Try to make it the primary title, unless it's the Emperor doing this. -# hidden_effect = { -# if = { -# limit = { primary_title.tier <= tier_kingdom } -# set_primary_title_to = title:k_austria -# } -# } -# #Save d_austria's current de jure liege for future reference. -# title:d_lower_austria.de_jure_liege = { save_scope_as = previous_kingdom } -# #Transfer custom_core_austria (d_austria & d_steyermark) to the new Archduchy. -# hidden_effect = { -# title:k_austria = { -# set_de_jure_liege_title = scope:previous_kingdom.de_jure_liege -# } -# -# every_county_in_region = { -# region = custom_core_austria -# duchy = { add_to_list = austrian_heartlands_list } -# } -# every_in_list = { -# list = austrian_heartlands_list -# limit = { -# NOT = { de_jure_liege = title:k_austria } -# } -# set_de_jure_liege_title = title:k_austria -# } -# -# } -# #Sort Carinthia. -# if = { -# limit = { completely_controls = title:d_carinthia } -# title:d_carinthia = { set_de_jure_liege_title = title:k_austria } -# } -# else = { custom_tooltip = form_austria_kingdom_decision_effect_stretch_goals_tt } -# #Sort d_slovenia, giving it to k_austria, the de jure liege of d_croatia, or leaving it as-is, depending on if it borders any part of scope:previous_kingdom other than d_istria. -# if = { -# limit = { -# completely_controls = title:d_slovenia -# #d_slovenia must be part of d_lower_austria's former kingdom. -# title:d_slovenia.de_jure_liege = scope:previous_kingdom -# } -# title:d_slovenia = { set_de_jure_liege_title = title:k_austria } -# } -# else_if = { -# limit = { -# #Krain must be part of d_lower_austria's former kingdom. -# title:d_slovenia.de_jure_liege = scope:previous_kingdom -# #Cannot border any other part of the former kingdom other than Istria. -# NOR = { -# title:d_slavonia.de_jure_liege = scope:previous_kingdom -# title:d_croatia.de_jure_liege = scope:previous_kingdom -# title:d_friuli.de_jure_liege = scope:previous_kingdom -# } -# #Check d_carinthia separately, since before the effect is run (i.e., in the decision tooltip) its liege will still be scope:previous_kingdom. -# completely_controls = title:d_carinthia -# } -# hidden_effect = { -# title:d_slovenia = { set_de_jure_liege_title = title:d_croatia.de_jure_liege } -# save_scope_value_as = { -# name = krain_isolated -# value = yes -# } -# } -# } -# #Sort d_istria, giving it to k_austria, the de jure liege of d_croatia, or leaving it as-is, depending on if it borders any part of scope:previous_kingdom other than d_slovenia. -# if = { -# limit = { -# completely_controls = title:d_istria -# #d_istria must be part of d_lower_austria's former kingdom. -# title:d_istria.de_jure_liege = scope:previous_kingdom -# } -# title:d_istria = { set_de_jure_liege_title = title:k_austria } -# } -# else_if = { -# limit = { -# #d_istria must be part of d_lower_austria's former kingdom. -# title:d_istria.de_jure_liege = scope:previous_kingdom -# #Cannot border any other part of the former kingdom. -# NOR = { -# title:d_croatia.de_jure_liege = scope:previous_kingdom -# title:d_friuli.de_jure_liege = scope:previous_kingdom -# } -# #Check d_slovenia separately, since before the effect is run (i.e., in the decision tooltip) its liege will still be scope:previous_kingdom. -# completely_controls = title:d_carinthia -# } -# hidden_effect = { -# title:d_istria = { set_de_jure_liege_title = title:d_croatia.de_jure_liege } -# save_scope_value_as = { -# name = istria_isolated -# value = yes -# } -# } -# } -# #Sort notice of what's happening to Istria/Krain. -# if = { -# limit = { -# exists = scope:krain_isolated -# exists = scope:istria_isolated -# } -# custom_tooltip = form_austria_kingdom_decision_effect_stretch_fail_both_tt -# } -# else_if = { -# limit = { exists = scope:krain_isolated } -# custom_tooltip = form_austria_kingdom_decision_effect_stretch_fail_krain_tt -# } -# else_if = { -# limit = { exists = scope:istria_isolated} -# custom_tooltip = form_austria_kingdom_decision_effect_stretch_fail_istria_tt -# } -# #Sundry other rewards. -# add_prestige = major_prestige_gain -# if = { -# limit = { -# NOT = { has_realm_law = single_heir_succession_law } -# } -# add_realm_law_skip_effects = single_heir_succession_law -# } -# #Check to see if we're using that strong hook! -# if = { -# limit = { -# NOT = { dynasty = title:e_hre.holder.dynasty } -# } -# use_hook = title:e_hre.holder -# } -#} -# -#form_carolingian_empire_scripted_effect = { -# save_scope_as = scoped_ruler -# title:e_hre.holder ?= { save_scope_as = scoped_emperor } -# #De jure shifts. -# hidden_effect = { -# title:k_france = { set_de_jure_liege_title = title:e_france } -# title:k_burgundy = { set_de_jure_liege_title = title:e_france } -# title:k_aquitaine = { set_de_jure_liege_title = title:e_france } -# title:k_brittany = { set_de_jure_liege_title = title:e_france } -# title:k_frisia = { set_de_jure_liege_title = title:e_france } -# title:k_lotharingia = { set_de_jure_liege_title = title:e_france } -# title:k_bavaria = { set_de_jure_liege_title = title:e_france } -# title:k_east_francia = { set_de_jure_liege_title = title:e_france } -# title:k_italy = { set_de_jure_liege_title = title:e_france } -# title:k_navarra = { set_de_jure_liege_title = title:e_france } -# title:k_aragon = { set_de_jure_liege_title = title:e_france } -# if = { -# limit = { -# OR = { -# #exists = title:k_austria.holder -# title:k_austria = { is_titular = yes } -# title:e_hre = { -# any_in_de_jure_hierarchy = { -# continue = { tier >= tier_kingdom } -# this = title:k_austria -# } -# } -# } -# } -# title:k_austria = { set_de_jure_liege_title = title:e_france } -# } -# if = { -# limit = { -# OR = { -# #exists = title:k_switzerland.holder -# title:k_switzerland = { is_titular = yes } -# title:e_hre = { -# any_in_de_jure_hierarchy = { -# continue = { tier >= tier_kingdom } -# this = title:k_switzerland -# } -# } -# } -# } -# title:k_switzerland = { set_de_jure_liege_title = title:e_france } -# } -# } -# # Prestige -# add_prestige = major_prestige_gain -# # Law -# if = { -# limit = { -# NOT = { has_realm_law = single_heir_succession_law } -# } -# add_realm_law_skip_effects = single_heir_succession_law -# } -# # HRE goes bye-bye -# if = { -# limit = { exists = scope:scoped_emperor } -# destroy_title = title:e_hre -# scope:scoped_emperor ?= { -# add_prestige = major_prestige_loss -# add_opinion = { -# target = scope:scoped_ruler -# modifier = pretender_opinion -# } -# } -# } -# # Innovations -# culture:french = { -# if = { -# limit = { -# NOT = { has_innovation = innovation_knighthood } -# } -# add_innovation = innovation_knighthood -# } -# if = { -# limit = { -# NOT = { has_innovation = innovation_royal_prerogative } -# } -# add_innovation = innovation_royal_prerogative -# } -# if = { -# limit = { -# NOT = { has_innovation = innovation_heraldry } -# } -# add_innovation = innovation_heraldry -# } -# } -#} -# -#unite_burgundies_scripted_effect = { -# add_prestige = medium_prestige_gain -# save_scope_as = scoped_ruler -# liege = { save_scope_as = former_liege } -# #De jure shifts. -# hidden_effect = { -# title:d_burgundy = { -# set_de_jure_liege_title = title:k_burgundy -# } -# title:d_provence = { #Just in case they drifted in the meantime. -# set_de_jure_liege_title = title:k_burgundy -# } -# title:d_savoie = { -# set_de_jure_liege_title = title:k_burgundy -# } -# title:d_dauphine = { -# set_de_jure_liege_title = title:k_burgundy -# } -# title:d_upper_burgundy = { -# set_de_jure_liege_title = title:k_burgundy -# } -# } -# if = { -# limit = { -# culture:occitan = { -# NOT = { -# has_innovation = innovation_guilds -# } -# } -# } -# culture:occitan = { -# add_innovation = innovation_guilds -# } -# } -# if = { -# limit = { -# culture:occitan = { -# NOT = { -# has_innovation = innovation_burhs -# } -# } -# } -# culture:occitan = { -# add_innovation = innovation_burhs -# } -# } -# if = { -# limit = { -# culture:occitan = { -# NOT = { -# has_innovation = innovation_baliffs -# } -# } -# } -# culture:occitan = { -# add_innovation = innovation_baliffs -# } -# } -# #Make ruler independent and give Burgundy to him. -# create_title_and_vassal_change = { -# type = independency -# save_scope_as = change -# add_claim_on_loss = no -# } -# change_liege_or_become_independent = { -# CHANGE = scope:change -# VASSAL = this -# } -# hidden_effect = { -# add_truce_both_ways = { -# character = scope:former_liege -# days = 1825 -# name = TRUCE_GRANT_INDEPENDENCE_ROOT -# } -# } -# resolve_title_and_vassal_change = scope:change -# create_title_and_vassal_change = { -# type = created -# save_scope_as = new_burgundy -# add_claim_on_loss = no -# } -# title:k_burgundy = { -# change_title_holder = { -# holder = root -# change = scope:new_burgundy -# } -# } -# resolve_title_and_vassal_change = scope:new_burgundy -# scope:former_liege = { -# add_prestige = major_prestige_loss -# add_unpressed_claim = title:k_burgundy #Give chance to retaliate -# add_opinion = { -# target = scope:scoped_ruler -# modifier = pretender_opinion -# } -# } -#} -# -#form_outremer_scripted_effect = { -# add_prestige = medium_prestige_gain -# add_piety = medium_piety_gain -# -# #Saving Scope to refer to it fervor localization -# title:e_outremer = { -# save_scope_as = outremer_title -# } -# faith = { -# change_fervor = { -# value = 15 -# desc = fervor_gain_formed_outremer -# } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:e_outremer = { -# change_title_holder = { -# holder = root -# change = scope:change -# } -# hidden_effect = { -# copy_title_history = title:k_jerusalem -# } -# } -# resolve_title_and_vassal_change = scope:change -# hidden_effect = { set_primary_title_to = title:e_outremer } -# if = { #The Sunni Caliphate is dismantled -# limit = { -# faith:aqlani = { exists = religious_head } -# } -# root = { destroy_title = title:d_sunni } -# } -# culture = { save_scope_as = former_culture } -# capital_county.title_province.culture = { save_scope_as = capital_culture } -# -# # If the player's capital is Arabic and the player is not, hybridize with the capital culture -# if = { -# limit = { -# scope:capital_culture != scope:former_culture -# NOT = { scope:former_culture = { has_cultural_pillar = heritage_arabic } } -# scope:capital_culture = { has_cultural_pillar = heritage_arabic } -# culture = { -# OR = { -# is_hybrid_culture = no -# AND = { -# NOT = { has_cultural_pillar = heritage_arabic } -# NOT = { any_parent_culture = { has_cultural_pillar = heritage_arabic } } -# } -# } -# } -# } -# scope:capital_culture = { save_scope_as = hybrid_culture } -# create_hybrid_culture = scope:capital_culture -# } -# -# # If the player has not become Arabic, hybridize with Mashiriqi (Levantine) -# else_if = { -# limit = { -# NOT = { scope:former_culture = { has_cultural_pillar = heritage_arabic } } -# culture = { -# OR = { -# is_hybrid_culture = no -# AND = { -# NOT = { has_cultural_pillar = heritage_arabic } -# NOT = { any_parent_culture = { has_cultural_pillar = heritage_arabic } } -# } -# } -# } -# } -# culture:levantine = { save_scope_as = hybrid_culture } -# create_hybrid_culture = culture:levantine -# } -# -# # If the player has become Arabic, hybridize with Occitan -# else_if = { -# limit = { -# culture = { -# OR = { -# is_hybrid_culture = no -# AND = { -# NOT = { has_cultural_pillar = heritage_arabic } -# NOT = { any_parent_culture = { has_cultural_pillar = heritage_arabic } } -# } -# } -# } -# } -# culture:occitan = { save_scope_as = hybrid_culture } -# create_hybrid_culture = culture:occitan -# } -# #If the player is already a European-Arabic hybrid, just save the existing culture -# else = { -# scope:former_culture = { save_scope_as = new_culture } -# } -# -# if = { -# limit = { exists = scope:new_culture } -# capital_county = { set_county_culture = scope:new_culture } -# scope:new_culture = { -# if = { -# limit = { -# OR = { -# has_cultural_pillar = heritage_frankish -# any_parent_culture = { has_cultural_pillar = heritage_frankish } -# } -# } -# set_name_list = name_list_outremer -# } -# if = { -# limit = { -# NOT = { has_innovation = innovation_men_at_arms } -# } -# add_innovation = innovation_men_at_arms -# } -# if = { -# limit = { -# NOT = { has_innovation = innovation_desert_tactics } -# } -# add_innovation = innovation_desert_tactics -# } -# hidden_effect = { -# if = { -# limit = { -# NOT = { has_same_culture_language = scope:former_culture } -# } -# set_language_from = scope:former_culture -# } -# if = { -# limit = { -# exists = scope:hybrid_culture -# NOT = { has_same_culture_heritage = scope:hybrid_culture } -# } -# set_heritage_from = scope:hybrid_culture -# } -# } -# } -# } -# else = { -# show_as_tooltip = { -# if = { -# limit = { exists = scope:hybrid_culture } -# custom_tooltip = outremer_decision_hybrid_tt -# } -# } -# } -#} - -restore_sunni_caliphate_scripted_effect = { - add_piety = major_piety_gain - save_scope_as = reformer - create_title_and_vassal_change = { - type = returned - save_scope_as = change - add_claim_on_loss = no - } - title:d_sunni = { - save_scope_as = sunni_caliphate - change_title_holder = { - holder = scope:reformer - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - faith:aqlani = { - change_fervor = { - value = 15 - desc = fervor_gain_restored_sunni_caliphate - } - } -} -#create_israel_scripted_effect = { -# save_scope_as = scoped_ruler -# create_title_and_vassal_change = { -# type = created -# save_scope_as = change -# add_claim_on_loss = no -# } -# title:k_israel = { -# change_title_holder = { -# holder = scope:scoped_ruler -# change = scope:change -# } -# } -# resolve_title_and_vassal_change = scope:change -# hidden_effect = { -# set_primary_title_to = title:k_israel -# title:d_palestine = { -# set_de_jure_liege_title = title:k_israel -# } -# title:d_urdunn = { -# set_de_jure_liege_title = title:k_israel -# } -# title:d_oultrejourdain = { -# set_de_jure_liege_title = title:k_israel -# } -# title:k_israel = { -# set_de_jure_liege_title = title:k_jerusalem.de_jure_liege -# } -# } -#} -#create_rum_scripted_effect = { -# add_prestige = medium_prestige_gain -# #If under a liege, make independent. -# if = { -# limit = { -# top_liege != this -# } -# if = { -# limit = { -# NOT = { -# exists = scope:former_liege -# } -# } -# liege = { -# save_scope_as = former_liege -# } -# } -# create_title_and_vassal_change = { -# type = independency -# save_scope_as = change -# add_claim_on_loss = no -# } -# change_liege_or_become_independent = { -# CHANGE = scope:change -# VASSAL = this -# } -# hidden_effect = { -# add_truce_both_ways = { -# character = scope:former_liege -# days = 1825 -# name = TRUCE_GRANT_INDEPENDENCE_ROOT -# } -# } -# resolve_title_and_vassal_change = scope:change -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = new_rum -# add_claim_on_loss = no -# } -# title:k_rum = { -# change_title_holder = { -# holder = root -# change = scope:new_rum -# } -# set_can_be_named_after_dynasty = no -# set_can_use_nomadic_naming = no -# } -# resolve_title_and_vassal_change = scope:new_rum -# if = { -# limit = { -# exists = scope:former_liege -# } -# scope:former_liege = { -# add_prestige = major_prestige_loss -# add_unpressed_claim = title:k_rum #Give chance to retaliate -# add_opinion = { -# target = root -# modifier = pretender_opinion -# } -# } -# } -# hidden_effect = { set_primary_title_to = title:k_rum } -#} - -declare_bloodline_holy_decision_effect = { - save_scope_as = progenitor_holy_blood - if = { - limit = { - NOT = { - has_character_flag = con_blood_leg - } - } - add_character_flag = con_blood_leg - hidden_effect = { - legend_seed_great_deed_dynasty_effect = yes - } - } - - faith = { - set_variable = { - name = variable_savior_found - value = yes - } - change_fervor = { - value = 25 - desc = fervor_gain_holy_bloodline - } - } - if = { #Temporal. - limit = { - root.faith.religious_head = root - } - add_trait = savior - root.dynasty = { - add_dynasty_prestige = 1000 - add_dynasty_prestige_level = 1 - } - } - else = { #Spiritual. - add_trait = paragon - root.dynasty = { - add_dynasty_prestige = 500 - } - } - - every_child = { - even_if_dead = yes - trigger_event = major_decisions.0101 - - every_child = { - even_if_dead = yes - limit = { - OR = { - is_grandchild_of = scope:progenitor_holy_blood - is_great_grandchild_of = scope:progenitor_holy_blood - } - } - trigger_event = major_decisions.0101 - - every_child = { - even_if_dead = yes - limit = { - OR = { - is_grandchild_of = scope:progenitor_holy_blood - is_great_grandchild_of = scope:progenitor_holy_blood - } - } - trigger_event = major_decisions.0101 - } - } - } -} - -sicilian_parliament_building_scripted_effect = { - #this is the County title. - title_province = { - set_variable = { - name = variable_sicilian_parliament_county - value = yes - } - if = { - limit = { - has_special_building_slot = no - } - add_special_building_slot = special_sicilian_parliament_01 - } - add_special_building = special_sicilian_parliament_01 - } -} -sicilian_parliament_kingdom_split_scripted_effect = { #If the decision is taken when the ruler doesn't hold the entirety of k_sicily, it results in the Naples/Trinacria split. (this is the ruler) - root = { - destroy_title = title:k_sicily - } - title:d_sicily = { - set_de_jure_liege_title = title:k_trinacria - } - title:d_benevento = { - set_de_jure_liege_title = title:k_naples - } - title:d_capua = { - set_de_jure_liege_title = title:k_naples - } - title:d_apulia = { - set_de_jure_liege_title = title:k_naples - } - title:d_salerno = { - set_de_jure_liege_title = title:k_naples - } - title:d_calabria = { - set_de_jure_liege_title = title:k_naples - } -} - -empower_sicilian_parliament_decision_scripted_effect = { - root = { - if = { - limit = { - has_realm_law = crown_authority_0 - } - add_realm_law_skip_effects = crown_authority_1 - } - else_if = { - limit = { - has_realm_law = crown_authority_1 - } - add_realm_law_skip_effects = crown_authority_2 - } - else_if = { - limit = { - has_realm_law = crown_authority_2 - } - add_realm_law_skip_effects = crown_authority_3 - } - } - if = { - limit = { has_title = title:k_sicily } - title:k_sicily = { - every_in_de_jure_hierarchy = { - custom = empower_sicilian_parliament_decision_every_province_custom - limit = { - tier = tier_county - title_province = { geographical_region = custom_sicily } - holder = { - OR = { - this = root - target_is_liege_or_above = root - } - } - } - title_province = { - add_province_modifier = { - modifier = parliamentary_bureaucracy_modifier - years = 150 - } - } - } - } - } - else_if = { - limit = { has_title = title:k_naples } - title:k_naples = { - every_in_de_jure_hierarchy = { - custom = empower_sicilian_parliament_decision_every_province_custom - limit = { - tier = tier_county - title_province = { geographical_region = custom_sicily } - holder = { - OR = { - this = root - target_is_liege_or_above = root - } - } - } - title_province = { - add_province_modifier = { - modifier = parliamentary_bureaucracy_modifier - years = 150 - } - } - } - } - } - else_if = { - limit = { has_title = title:k_trinacria } - title:k_trinacria = { - every_in_de_jure_hierarchy = { - custom = empower_sicilian_parliament_decision_every_province_custom - limit = { - tier = tier_county - title_province = { geographical_region = custom_sicily } - holder = { - OR = { - this = root - target_is_liege_or_above = root - } - } - } - title_province = { - add_province_modifier = { - modifier = parliamentary_bureaucracy_modifier - years = 150 - } - } - } - } - } -} - -promote_gothic_innovations_decision_scripted_effect = { - if = { - limit = { - has_realm_law = crown_authority_0 - } - add_realm_law_skip_effects= crown_authority_1 - } - else_if = { - limit = { - has_realm_law = crown_authority_1 - } - add_realm_law_skip_effects = crown_authority_2 - } - else_if = { - limit = { - has_realm_law = crown_authority_2 - } - add_realm_law_skip_effects = crown_authority_3 - } - culture = { - if = { - limit = { - NOT = { has_innovation = innovation_french_peerage } - } - add_innovation = innovation_french_peerage - } - } - if = { - limit = { - this = { completely_controls = title:d_valois } - } - title:c_ile_de_france = { - title_province = { - add_province_modifier = { - modifier = flourishing_culture_modifier - years = 150 - } - } - } - } - if = { - limit = { - this = { completely_controls = title:d_orleanais } - } - title:c_orleans = { - title_province = { - add_province_modifier = { - modifier = flourishing_culture_modifier - years = 150 - } - } - } - } - if = { - limit = { - this = { completely_controls = title:d_provence } - } - title:c_nice = { - title_province = { - add_province_modifier = { - modifier = flourishing_culture_modifier - years = 150 - } - } - } - } - if = { - limit = { - this = { completely_controls = title:d_toulouse } - } - title:c_toulouse = { - title_province = { - add_province_modifier = { - modifier = flourishing_culture_modifier - years = 150 - } - } - } - } -} -# -#promote_hungarian_settlement_decision_scripted_effect = { -# if = { -# limit = { -# culture = culture:mogyer -# } -# -# # Convert my culture to Hungarian Culture -# set_culture = culture:hungarian -# culture:hungarian = { -# reset_culture_creation_date = yes -# get_all_innovations_from = culture:mogyer -# } -# -# # Convert my courtiers to Hungarian -# hidden_effect = { -# every_courtier = { -# limit = { -# culture = culture:mogyer -# } -# set_culture = culture:hungarian -# } -# } -# -# # Convert my vassals to Hungarian -# every_vassal_or_below = { -# limit = { -# culture = culture:mogyer -# } -# -# custom = promote_hungarian_settlement_decision_every_vassal_custom -# set_culture = culture:hungarian -# -# # Convert their courtiers as well -# hidden_effect = { -# every_courtier = { -# limit = { -# culture = culture:mogyer -# } -# set_culture = culture:hungarian -# } -# } -# } -# } -# -# title:k_hungary = { -# every_in_de_jure_hierarchy = { -# custom = promote_hungarian_settlement_decision_every_province_custom -# limit = { -# tier = tier_county -# culture = culture:mogyer -# title_province = { geographical_region = custom_hungary } -# holder = { -# OR = { -# this = root -# target_is_liege_or_above = root -# } -# } -# } -# set_county_culture = culture:hungarian -# add_county_modifier = { -# modifier = hungarian_resettlement_modifier -# years = 100 -# } -# custom_tooltip = promote_hungarian_settlement_decision_increased_development -# custom_tooltip = promote_hungarian_settlement_decision_convert_county -# hidden_effect = { -# if = { -# limit = { -# development_level < 5 -# } -# change_development_level = 1 -# } -# random_list = { -# 30 = { -# # Nothing happens -# } -# 30 = { -# trigger = { -# NOT = { -# faith = { has_doctrine = special_doctrine_ecumenical_christian } -# } -# } -# set_county_faith = root.faith -# } -# 30 = { -# trigger = { -# NOT = { -# faith = { has_doctrine = special_doctrine_ecumenical_christian } -# } -# any_neighboring_county = { -# faith = { has_doctrine = special_doctrine_ecumenical_christian } -# } -# } -# random_neighboring_county = { -# limit = { -# faith = { has_doctrine = special_doctrine_ecumenical_christian } -# } -# save_scope_as = neighboring_county -# } -# set_county_faith = scope:neighboring_county.faith -# } -# } -# } -# } -# } -#} -# -#revive_magyar_paganism_decision_scripted_effect = { -# #Change yourself, and any willing vassals/family, over to Magyar Paganism. -# set_character_faith_with_conversion = faith:magyar_pagan -# #Gain nickname for your troubles. -# give_nickname = nick_the_apostate -# #Magyar_group counties of your old religion may defect back to the old ways. -# custom_tooltip = revive_magyar_paganism_decision_scripted_effect.county_conversions.tt -# hidden_effect = { -# primary_title = { -# every_in_de_facto_hierarchy = { -# limit = { -# tier = tier_county -# culture = { has_cultural_pillar = heritage_magyar } -# exists = scope:old_faith -# religion = scope:old_faith.religion -# } -# #Mogyers remember the old ways best, and have a high chance to flip. -# if = { -# limit = { culture = culture:mogyer } -# random = { -# chance = 70 -# set_county_faith = faith:magyar_pagan -# } -# } -# #Slightly up the chances for the apostate. -# else_if = { -# limit = { holder = root } -# random = { -# chance = 50 -# set_county_faith = faith:magyar_pagan -# } -# } -# #Other magyar_group cultures still have a moderate chance to flip. -# else = { -# random = { -# chance = 30 -# set_county_faith = faith:magyar_pagan -# } -# } -# } -# } -# } -# #Make flipping counties deliriously happy about the whole affair. -# primary_title = { -# every_in_de_facto_hierarchy = { -# limit = { -# tier = tier_county -# faith = faith:magyar_pagan -# } -# custom = hungarian_resettlement.every_converted_province -# add_county_modifier = { -# modifier = magyar_appreciation_modifier -# years = 25 -# } -# } -# } -# #Finally, give magyar_pagans a hefty fervour boost, just so that they don't immediately convert back. -# hidden_effect = { -# faith:magyar_pagan = { -# save_temporary_scope_as = magyar_faith -# change_fervor = { -# value = 100 -# desc = fervor_gain_magyar_revivalism -# } -# } -# } -#} -# -#restore_dumnonia_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_cornwall = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# hidden_effect = { -# title:d_somerset = { save_scope_as = cornwall_somerset } -# title:d_gloucester = { save_scope_as = cornwall_gloucester } -# title:d_cornwall = { set_de_jure_liege_title = title:k_cornwall } -# if = { #If owned, annex Somerset/Wessex. -# limit = { -# title:d_somerset = { holder = root } -# } -# title:d_somerset = { set_de_jure_liege_title = title:k_cornwall } -# } -# if = { #If owned, annex Gloucestershire/Hwicce. -# limit = { -# title:d_gloucester = { holder = root } -# } -# title:d_gloucester = { set_de_jure_liege_title = title:k_cornwall } -# } -# } -# custom_tooltip = restore_dumnonia_decision_effects_de_jure_tt -#} -# -#revive_armenian_empire_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_armenia = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# hidden_effect = { -# title:k_armenia = { save_scope_as = armenian_armenia } -# title:k_georgia = { save_scope_as = armenian_georgia } -# title:k_daylam = { save_scope_as = armenian_daylam } -# title:k_jazira = { save_scope_as = armenian_jazira } -# title:k_syria = { save_scope_as = armenian_syria } -# title:k_jerusalem = { save_scope_as = armenian_jerusalem } -# title:k_anatolia = { save_scope_as = armenian_anatolia } -# title:k_pontus = { save_scope_as = armenian_pontus } -# title:e_armenia = { save_scope_as = armenian_armenia_empire } -# title:k_armenia = { set_de_jure_liege_title = title:e_armenia } -# if = { -# limit = { -# title:k_armenia = { is_title_created = yes } -# } -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_armenia = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# else_if = { -# limit = { -# title:k_armenia = { is_title_created = no } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_armenia = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# if = { #If any have drifted out, then k_armenia's constituent duchies are flipped back. -# limit = { -# title:d_greater_armenia = { -# NOT = { target_is_de_jure_liege_or_above = title:k_armenia } -# } -# } -# title:d_greater_armenia = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If any have drifted out, then k_armenia's constituent duchies are flipped back. -# limit = { -# title:d_vaspurakan = { -# NOT = { target_is_de_jure_liege_or_above = title:k_armenia } -# } -# } -# title:d_vaspurakan = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If any have drifted out, then k_armenia's constituent duchies are flipped back. -# limit = { -# title:d_mesopotamia = { -# NOT = { target_is_de_jure_liege_or_above = title:k_armenia } -# } -# } -# title:d_mesopotamia = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Daylam & exempt Azerbaijan from de jure flipping to Armenia. -# limit = { -# title:k_daylam = { holder = root } -# title:d_azerbaijan = { target_is_de_jure_liege_or_above = title:k_daylam } -# } -# title:k_daylam = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Daylam & flip Azerbaijan to Armenia. -# limit = { -# title:k_daylam = { holder = root } -# NOT = { -# title:d_azerbaijan = { target_is_de_jure_liege_or_above = title:k_daylam } -# } -# } -# title:k_daylam = { set_de_jure_liege_title = title:e_armenia } -# title:d_azerbaijan = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_azerbaijan = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Daylam & exempt Shirvan from de jure flipping to Armenia. -# limit = { -# title:k_daylam = { holder = root } -# title:d_shirvan = { target_is_de_jure_liege_or_above = title:k_daylam } -# } -# title:k_daylam = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Daylam & flip Shirvan to Armenia. -# limit = { -# title:k_daylam = { holder = root } -# NOT = { -# title:d_shirvan = { target_is_de_jure_liege_or_above = title:k_daylam } -# } -# } -# title:k_daylam = { set_de_jure_liege_title = title:e_armenia } -# title:d_shirvan = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_shirvan = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Georgia & exempt ducal Georgia from de jure flipping to Armenia. -# limit = { -# title:k_georgia = { holder = root } -# title:d_georgia = { target_is_de_jure_liege_or_above = title:k_georgia } -# } -# title:k_georgia = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Georgia & flip ducal Georgia to Armenia. -# limit = { -# title:k_georgia = { holder = root } -# NOT = { -# title:d_georgia = { target_is_de_jure_liege_or_above = title:k_georgia } -# } -# } -# title:k_georgia = { set_de_jure_liege_title = title:e_armenia } -# title:d_georgia = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_georgia = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Anatolia & exempt Cilicia from de jure flipping to Armenia. -# limit = { -# title:k_anatolia = { holder = root } -# title:d_cilicia = { target_is_de_jure_liege_or_above = title:k_anatolia } -# } -# title:k_anatolia = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Anatolia & flip Cilicia to Armenia. -# limit = { -# title:k_anatolia = { holder = root } -# NOT = { -# title:d_cilicia = { target_is_de_jure_liege_or_above = title:k_anatolia } -# } -# } -# title:k_anatolia = { set_de_jure_liege_title = title:e_armenia } -# title:d_cilicia = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_cilicia = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Jazira & exempt Diyarbakr from de jure flipping to Armenia. -# limit = { -# title:k_jazira = { holder = root } -# title:d_diyarbakr = { target_is_de_jure_liege_or_above = title:k_jazira } -# } -# title:k_jazira = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Jazira & flip Diyarbakr to Armenia. -# limit = { -# title:k_jazira = { holder = root } -# NOT = { -# title:d_diyarbakr = { target_is_de_jure_liege_or_above = title:k_jazira } -# } -# } -# title:k_jazira = { set_de_jure_liege_title = title:e_armenia } -# title:d_diyarbakr = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_diyarbakr = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Syria & exempt Edessa from de jure flipping to Armenia. -# limit = { -# title:k_syria = { holder = root } -# title:d_edessa = { target_is_de_jure_liege_or_above = title:k_syria } -# } -# title:k_syria = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Syria & flip Edessa to Armenia. -# limit = { -# title:k_syria = { holder = root } -# NOT = { -# title:d_edessa = { target_is_de_jure_liege_or_above = title:k_syria } -# } -# } -# title:k_syria = { set_de_jure_liege_title = title:e_armenia } -# title:d_edessa = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_edessa = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & de jure has not drifted, annex Syria & exempt Antioch from de jure flipping to Armenia. -# limit = { -# title:k_syria = { holder = root } -# title:d_antioch = { target_is_de_jure_liege_or_above = title:k_syria } -# } -# title:k_syria = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & de jure has drifted, annex Syria & flip Antioch to Armenia. -# limit = { -# title:k_syria = { holder = root } -# NOT = { -# title:d_antioch = { target_is_de_jure_liege_or_above = title:k_syria } -# } -# } -# title:k_syria = { set_de_jure_liege_title = title:e_armenia } -# title:d_antioch = { set_de_jure_liege_title = title:k_armenia } -# } -# else = { -# title:d_antioch = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned & Kurdistan is already part of Jazira, annex Jazira & exempt Kurdistan from de jure flipping to Armenia. -# limit = { -# title:k_jazira = { holder = root } -# title:d_kurdistan = { target_is_de_jure_liege_or_above = title:k_jazira } -# } -# title:k_jazira = { set_de_jure_liege_title = title:e_armenia } -# } -# else_if = { #If owned & Kurdistan is not part of Jazira, but Jazira is owned entirely, annex Jazira & flip Kurdistan to Jazira, because bordergore. -# limit = { -# title:k_jazira = { holder = root } -# NOT = { -# title:d_kurdistan = { target_is_de_jure_liege_or_above = title:k_jazira } -# } -# } -# title:k_jazira = { set_de_jure_liege_title = title:e_armenia } -# title:d_kurdistan = { set_de_jure_liege_title = title:k_jazira } -# } -# else = { -# title:d_kurdistan = { set_de_jure_liege_title = title:k_armenia } -# } -# if = { #If owned, annex Pontus. -# limit = { -# title:k_pontus = { holder = root } -# } -# title:k_pontus = { set_de_jure_liege_title = title:e_armenia } -# } -# if = { #If owned, annex Jerusalem. -# limit = { -# title:k_jerusalem = { holder = root } -# } -# title:k_jerusalem = { set_de_jure_liege_title = title:e_armenia } -# } -# } -# custom_tooltip = create_armenian_empire_decision_effects_de_jure_tt_a -# custom_tooltip = create_armenian_empire_decision_effects_de_jure_tt_b -#} -# -#form_dai_viet_empire_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_viet = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# root.dynasty = { -# add_dynasty_prestige = major_dynasty_prestige_gain -# } -# -# if = { -# limit = { -# title:k_viet = { -# is_title_created = yes -# NOT = { -# holder = ROOT -# } -# } -# } -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_viet = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# else_if = { -# limit = { -# title:k_viet = { is_title_created = no } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_viet = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# #Viet controls -# if = { #If owned, annex Dai Viet. -# limit = { -# title:k_viet = { holder = root } -# } -# title:k_viet = { set_de_jure_liege_title = title:e_viet } -# } -# if = { #If owned, annex Champa. -# limit = { -# title:k_champa = { holder = root } -# } -# title:k_champa = { set_de_jure_liege_title = title:e_viet } -# } -# if = { #If any have drifted out, then k_viet's constituent duchies are flipped back. -# limit = { -# title:d_hai_dong = { -# NOT = { target_is_de_jure_liege_or_above = title:k_viet } -# } -# } -# title:d_hai_dong = { set_de_jure_liege_title = title:k_viet } -# } -# if = { #If any have drifted out, then k_viet's constituent duchies are flipped back. -# limit = { -# title:d_lam_tay = { -# NOT = { target_is_de_jure_liege_or_above = title:k_viet } -# } -# } -# title:d_lam_tay = { set_de_jure_liege_title = title:k_viet } -# } -# if = { #If any have drifted out, then k_viet's constituent duchies are flipped back. -# limit = { -# title:d_nghe_an = { -# NOT = { target_is_de_jure_liege_or_above = title:k_viet } -# } -# } -# title:d_nghe_an = { set_de_jure_liege_title = title:k_viet } -# } -# if = { #If any have drifted out, then k_viet's constituent duchies are flipped back. -# limit = { -# title:d_hai_dong = { -# NOT = { target_is_de_jure_liege_or_above = title:k_viet } -# } -# } -# title:d_thang_long = { set_de_jure_liege_title = title:k_viet } -# } -# #Champa controls -# if = { #If any have drifted out, then k_champa's constituent duchies are flipped back. -# limit = { -# title:d_indrapura = { -# NOT = { target_is_de_jure_liege_or_above = title:k_champa } -# } -# } -# title:d_indrapura = { set_de_jure_liege_title = title:k_champa } -# } -# if = { #If any have drifted out, then k_champa's constituent duchies are flipped back. -# limit = { -# title:d_vijaya = { -# NOT = { target_is_de_jure_liege_or_above = title:k_champa } -# } -# } -# title:d_vijaya = { set_de_jure_liege_title = title:k_champa } -# } -# if = { #If any have drifted out, then k_champa's constituent duchies are flipped back. -# limit = { -# title:d_baigaur = { -# NOT = { target_is_de_jure_liege_or_above = title:k_champa } -# } -# } -# title:d_baigaur = { set_de_jure_liege_title = title:k_champa } -# } -# -# if = { -# limit = { -# government_has_flag = government_is_meritocratic -# } -# add_realm_law = single_heir_succession_law -# } -#} -# -#form_majapahit_empire_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_majapahit = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# root.dynasty = { -# add_dynasty_modifier = majapahit_empire_founding_modifier -# } -# -# hidden_effect = { -# title:k_yavakadvipa = { save_scope_as = javanese_yavakadvipa } -# title:d_SUM_palembang = { save_scope_as = javanese_palembang } -# title:d_JAV_taruma = { save_scope_as = javanese_taruma } -# title:d_JAV_mataram = { save_scope_as = javanese_mataram } -# title:c_JAV_madura = { save_scope_as = javanese_madura } -# title:e_majapahit = { save_scope_as = javanese_majapahit_empire } -# title:k_yavakadvipa = { set_de_jure_liege_title = title:e_majapahit } -# if = { -# limit = { -# title:k_yavakadvipa = { -# is_title_created = yes -# NOT = { -# holder = ROOT -# } -# } -# } -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_yavakadvipa = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# else_if = { -# limit = { -# title:k_yavakadvipa = { is_title_created = no } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_yavakadvipa = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# if = { -# limit = { -# title:d_SUM_palembang = { -# NOT = { target_is_de_jure_liege_or_above = title:k_yavakadvipa } -# } -# } -# title:d_SUM_palembang = { set_de_jure_liege_title = title:k_yavakadvipa } -# } -# if = { -# limit = { -# title:d_JAV_taruma = { -# NOT = { target_is_de_jure_liege_or_above = title:k_yavakadvipa } -# } -# } -# title:d_JAV_taruma = { set_de_jure_liege_title = title:k_yavakadvipa } -# } -# if = { -# limit = { -# title:d_JAV_mataram = { -# NOT = { target_is_de_jure_liege_or_above = title:k_yavakadvipa } -# } -# } -# title:d_JAV_mataram = { set_de_jure_liege_title = title:k_yavakadvipa } -# } -# if = { -# limit = { -# title:c_JAV_madura = { -# NOT = { target_is_de_jure_liege_or_above = title:d_JAV_mataram } -# } -# } -# title:c_JAV_madura = { set_de_jure_liege_title = title:d_JAV_mataram } -# } -# if = { #If owned, annex Champa. -# limit = { -# title:k_yavakadvipa = { holder = root } -# } -# title:k_yavakadvipa = { set_de_jure_liege_title = title:e_majapahit } -# } -# } -# custom_tooltip = form_majapahit_empire_decision_effects_de_jure_tt_a -# custom_tooltip = form_majapahit_empire_decision_effects_de_jure_tt_b -# custom_tooltip = form_majapahit_empire_decision_effects_de_jure_tt_c -#} -# -#form_ryukyu_empire_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_ruucuu = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# capital_county = { -# every_county_province = { -# add_province_modifier = ryukyu_empire_founding_province_modifier -# } -# } -# -# hidden_effect = { -# title:k_ruucuu = { save_scope_as = ryukyuan_ruucuu_kingdom } -# title:d_ruucuu = { save_scope_as = ryukyuan_ruucuu_duchy } -# title:e_ruucuu = { save_scope_as = ryukyuan_ruucuu_empire } -# title:k_ruucuu = { set_de_jure_liege_title = title:e_ruucuu } -# if = { -# limit = { -# title:k_ruucuu = { -# is_title_created = yes -# NOT = { -# holder = ROOT -# } -# } -# } -# create_title_and_vassal_change = { -# type = usurped -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_ruucuu = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# else_if = { -# limit = { -# title:k_ruucuu = { is_title_created = no } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change_2 -# add_claim_on_loss = no -# } -# title:k_ruucuu = { -# change_title_holder = { -# holder = root -# change = scope:title_change_2 -# } -# } -# resolve_title_and_vassal_change = scope:title_change_2 -# } -# if = { -# limit = { -# title:d_ruucuu = { -# NOT = { target_is_de_jure_liege_or_above = title:k_ruucuu } -# } -# } -# custom_tooltip = form_ryukyu_empire_decision_effects_de_jure_tt_b -# title:d_ruucuu = { set_de_jure_liege_title = title:k_ruucuu } -# } -# if = { -# limit = { -# title:c_ucinaa = { -# NOT = { target_is_de_jure_liege_or_above = title:d_ruucuu } -# } -# } -# title:c_ucinaa = { set_de_jure_liege_title = title:d_ruucuu } -# } -# if = { -# limit = { -# title:c_amami = { -# NOT = { target_is_de_jure_liege_or_above = title:d_ruucuu } -# } -# } -# title:c_amami = { set_de_jure_liege_title = title:d_ruucuu } -# } -# } -# custom_tooltip = form_ryukyu_empire_decision_effects_de_jure_tt_a -#} -# -#form_siam_kingdom_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_siam = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# add_prestige_experience = major_fame_gain -# -# hidden_effect = { -# title:k_siam = { save_scope_as = siam_kingdom } -# title:d_sukhothai = { save_scope_as = sukhotai_duchy } -# title:d_lop_buri = { save_scope_as = lop_buri } -# title:d_sukhothai = { set_de_jure_liege_title = title:k_siam } -# title:d_lop_buri = { set_de_jure_liege_title = title:k_siam } -# every_held_title = { # add other duchies if I hold any in the region -# limit = { -# tier = tier_duchy -# any_de_jure_county = { -# title_province = { -# OR = { -# geographical_region = world_asia_thailand -# geographical_region = world_asia_malaysia -# } -# } -# } -# NOT = { -# this = title:d_sukhothai -# this = title:d_lop_buri -# } -# } -# set_de_jure_liege_title = title:k_siam -# } -# } -# custom_tooltip = form_siam_kingdom_decision_effects_de_jure_tt_a -#} -# -#restore_holy_roman_empire_decision_scripted_effect = { -# save_scope_as = founder -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:e_hre = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# set_primary_title_to = title:e_hre -# -# #Papal hook management. -# if = { -# limit = { -# faith.religious_head = { -# exists = this -# opinion = { -# target = root -# value < high_positive_opinion -# } -# } -# OR = { -# has_weak_hook = faith.religious_head -# has_strong_usable_hook = faith.religious_head -# } -# } -# use_hook = faith.religious_head -# } -# -# #Sort title laws. -# if = { -# limit = { -# OR = { -# has_title = title:k_east_francia -# any_vassal = { -# has_title = title:k_east_francia -# } -# } -# } -# destroy_title = title:k_east_francia #Make Germany inalienable. -# } -# title:e_hre = { -# add_title_law = princely_elective_succession_law -# if = { #Add Salic law. -# limit = { -# root = { -# OR = { -# has_realm_law = male_preference_law -# has_realm_law = male_only_law -# } -# } -# } -# add_title_law = male_only_law -# } -# if = { #Ignore Salic law. -# limit = { -# root = { has_realm_law = equal_law } -# } -# add_title_law = equal_law -# } -# if = { #Invert Salic law. Take that, Clovis, y'big nerd. -# limit = { -# root = { -# OR = { -# has_realm_law = female_preference_law -# has_realm_law = female_only_law -# } -# } -# } -# add_title_law = female_only_law -# } -# custom_tooltip = hre_elector_list_creation_tt -# } -# -# #Add de jures. -# hidden_effect = { -# if = { #If Germania is nae a thing, merge it into the HRE. -# limit = { -# OR = { -# has_title = title:k_east_francia -# has_title = title:k_bavaria -# has_title = title:k_lotharingia -# has_title = title:k_frisia -# any_vassal = { -# OR = { -# has_title = title:k_east_francia -# has_title = title:k_bavaria -# has_title = title:k_lotharingia -# has_title = title:k_frisia -# } -# } -# } -# OR = { -# NOT = { exists = title:e_germany.holder } -# title:e_germany.holder ?= root -# } -# } -# title:e_germany = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_kingdom } -# set_de_jure_liege_title = title:e_hre -# } -# } -# } -# every_held_title = { -# title_tier = kingdom -# limit = { -# NOT = { #The Pope retains vague dibs on Italy. -# any_this_title_or_de_jure_above = { this = title:e_italy } -# } -# save_temporary_scope_as = this_title -# #root = { completely_controls = scope:this_title } -# } -# set_de_jure_liege_title = title:e_hre -# } -# every_vassal = { -# every_held_title = { -# title_tier = kingdom -# limit = { -# NOT = { #The Pope retains vague dibs on Italy. -# any_this_title_or_de_jure_above = { this = title:e_italy } -# } -# save_temporary_scope_as = this_title -# #prev = { completely_controls = scope:this_title } -# } -# set_de_jure_liege_title = title:e_hre -# } -# } -# if = { # Merge Francia into the HRE under certain conditions -# limit = { -# OR = { -# NOT = { exists = title:e_france.holder } -# title:e_france.holder ?= root -# } -# OR = { -# title:k_france = { # If core West Francia is part of the HRE -# target_is_de_jure_liege_or_above = title:e_hre -# } -# calc_true_if = { # Or 2+ of the other francian Kingdoms -# amount >= 2 -# title:k_burgundy = { -# target_is_de_jure_liege_or_above = title:e_hre -# } -# title:k_aquitaine = { -# target_is_de_jure_liege_or_above = title:e_hre -# } -# title:k_brittany = { -# target_is_de_jure_liege_or_above = title:e_hre -# } -# } -# } -# } -# title:e_france = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_kingdom } -# set_de_jure_liege_title = title:e_hre -# } -# } -# } -# every_vassal = { -# limit = { -# is_ai = yes -# } -# every_held_title = { -# title_tier = kingdom -# root = { -# destroy_title = prev -# } -# } -# } -# every_held_title = { -# title_tier >= kingdom -# limit = { -# NOT = { -# this = title:e_hre -# } -# save_temporary_scope_as = this_title -# } -# root = { -# destroy_title = prev -# } -# } -# } -# custom_tooltip = restore_holy_roman_empire_decision_effects_de_jure.tt -# -# #And add a bit of prestige for the trouble. -# add_prestige = massive_prestige_value -#} -# -#found_kingdom_of_bosnia_decision_scripted_effect = { -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_bosnia = { -# change_title_holder = { -# holder = scope:founder -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# title:d_bosna = { set_de_jure_liege_title = title:k_bosnia } -# title:d_lower_bosna = { set_de_jure_liege_title = title:k_bosnia } -# title:d_usora = { set_de_jure_liege_title = title:k_bosnia } -#} -# -#found_kingdom_of_livonia_decision_scripted_effect = { -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_livonia = { -# change_title_holder = { -# holder = scope:founder -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# title:d_latgalia = { set_de_jure_liege_title = title:k_livonia } -# title:d_courland = { set_de_jure_liege_title = title:k_livonia } -# title:d_livonia = { set_de_jure_liege_title = title:k_livonia } -# if = { -# limit = { -# title:d_esthonia = { holder = root } -# } -# title:d_esthonia = { set_de_jure_liege_title = title:k_livonia } -# } -# if = { -# limit = { -# has_faith = faith:baltic_pagan -# root.culture = { NOT = { has_innovation = innovation_longboats } } -# } -# root.culture = { add_innovation = innovation_longboats } -# } -#} -# -#unite_bene_israel_effect = { -# add_prestige = major_prestige_gain -# add_piety = major_piety_gain -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_bene_israel = { -# change_title_holder = { -# holder = scope:founder -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# -# title:d_chera_nadu = { set_de_jure_liege_title = title:k_bene_israel } -# title:d_konkana = { set_de_jure_liege_title = title:k_bene_israel } -# if = { -# limit = { -# title:d_lata = { holder = root } -# } -# title:d_lata = { set_de_jure_liege_title = title:k_bene_israel } -# } -# if = { -# limit = { -# title:d_nasikya = { holder = root } -# } -# title:d_nasikya = { set_de_jure_liege_title = title:k_bene_israel } -# } -# random_held_title = { -# title_tier = barony -# limit = { -# is_holy_site_of = faith:malabarism -# } -# county = { set_county_culture = culture:kochinim } -# county = { set_county_faith = faith:malabarism } -# } -#} -# -#hre_elector_list_save_effect = { -# ordered_in_global_list = { -# variable = hre_elector_list -# max = 7 -# check_range_bounds = no -# order_by = tier -# save_temporary_scope_as = hre_elector_title -# title:e_hre = { -# if = { -# limit = { NOT = { has_variable = hre_elector_1 } } -# set_variable = { name = hre_elector_1 value = scope:hre_elector_title } -# } -# else_if = { -# limit = { NOT = { has_variable = hre_elector_2 } } -# set_variable = { name = hre_elector_2 value = scope:hre_elector_title } -# } -# else_if = { -# limit = { NOT = { has_variable = hre_elector_3 } } -# set_variable = { name = hre_elector_3 value = scope:hre_elector_title } -# } -# else_if = { -# limit = { NOT = { has_variable = hre_elector_4 } } -# set_variable = { name = hre_elector_4 value = scope:hre_elector_title } -# } -# else_if = { -# limit = { NOT = { has_variable = hre_elector_5 } } -# set_variable = { name = hre_elector_5 value = scope:hre_elector_title } -# } -# else_if = { -# limit = { NOT = { has_variable = hre_elector_6 } } -# set_variable = { name = hre_elector_6 value = scope:hre_elector_title } -# } -# else_if = { -# limit = { NOT = { has_variable = hre_elector_7 } } -# set_variable = { name = hre_elector_7 value = scope:hre_elector_title } -# } -# } -# } -#} -# -#favour_the_countryside_basques_decision_generic_effects_scripted_effect = { -# scope:religious_leader = { -# # If you weren't Basque, become so. -# if = { -# limit = { favour_the_countryside_basques_counts_as_basque_trigger = no } -# # Now, we need to work out which Basque culture you should be. -# ## First, we gather our candidates. -# ### Going through counties. -# every_sub_realm_county = { -# limit = { -# favour_the_countryside_basques_counts_as_basque_trigger = yes -# NOT = { -# culture = { is_in_list = realm_basque_cultures_list } -# } -# } -# culture = { add_to_list = realm_basque_cultures_list } -# } -# ### Plus vassals. -# every_vassal_or_below = { -# limit = { -# favour_the_countryside_basques_counts_as_basque_trigger = yes -# NOT = { -# culture = { is_in_list = realm_basque_cultures_list } -# } -# } -# culture = { add_to_list = realm_basque_cultures_list } -# } -# ### And those close to you. -# every_close_or_extended_family_member = { -# limit = { -# favour_the_countryside_basques_counts_as_basque_trigger = yes -# NOT = { -# culture = { is_in_list = realm_basque_cultures_list } -# } -# } -# culture = { add_to_list = realm_basque_cultures_list } -# } -# every_consort = { -# limit = { -# favour_the_countryside_basques_counts_as_basque_trigger = yes -# NOT = { -# culture = { is_in_list = realm_basque_cultures_list } -# } -# } -# culture = { add_to_list = realm_basque_cultures_list } -# } -# every_relation = { -# type = friend -# limit = { -# favour_the_countryside_basques_counts_as_basque_trigger = yes -# NOT = { -# culture = { is_in_list = realm_basque_cultures_list } -# } -# } -# culture = { add_to_list = realm_basque_cultures_list } -# } -# every_relation = { -# type = lover -# limit = { -# favour_the_countryside_basques_counts_as_basque_trigger = yes -# NOT = { -# culture = { is_in_list = realm_basque_cultures_list } -# } -# } -# culture = { add_to_list = realm_basque_cultures_list } -# } -# ## Next, we process the list. -# if = { -# limit = { -# any_in_list = { -# list = realm_basque_cultures_list -# exists = this -# } -# } -# ordered_in_list = { -# list = realm_basque_cultures_list -# order_by = { -# value = 0 -# save_temporary_scope_as = culture_temp -# # Culture counties are added differently depending on whether they're inside or outside the realm -# every_culture_county = { -# # Every culture county in your realm adds 10. -# if = { -# limit = { -# holder = { -# OR = { -# this = scope:religious_leader -# any_liege_or_above = { this = scope:religious_leader } -# } -# } -# } -# add = 10 -# } -# # Every culture county outside your realm adds 5. -# else = { add = 5 } -# } -# scope:religious_leader = { -# # Vassals add weight depending on their rank. -# every_vassal = { -# if = { -# limit = { culture = scope:culture_temp } -# # Every king-tier vassal adds 50. -# if = { -# limit = { highest_held_title_tier = tier_kingdom } -# add = 50 -# } -# # Every duke-tier vassal adds 25. -# else_if = { -# limit = { highest_held_title_tier = tier_duchy } -# add = 25 -# } -# # Every count-tier vassal adds 10. -# else_if = { -# limit = { highest_held_title_tier = tier_county } -# add = 10 -# } -# # Barons are unimportant. -# } -# } -# # Every close family member adds 15. -# every_close_family_member = { -# limit = { culture = scope:culture_temp } -# add = 15 -# } -# # Every extended family members adds 5. -# every_extended_family_member = { -# limit = { culture = scope:culture_temp } -# add = 5 -# } -# # Every soulmate adds 50. -# every_relation = { -# type = soulmate -# limit = { culture = scope:culture_temp } -# add = 50 -# } -# # Every best friend adds 50. -# every_relation = { -# type = best_friend -# limit = { culture = scope:culture_temp } -# add = 50 -# } -# # Every lover adds 15. -# every_relation = { -# type = lover -# limit = { -# culture = scope:culture_temp -# NOT = { has_relation_soulmate = scope:religious_leader } -# } -# add = 15 -# } -# # Every friend adds 15. -# every_relation = { -# type = friend -# limit = { -# culture = scope:culture_temp -# NOT = { has_relation_best_friend = scope:religious_leader } -# } -# add = 15 -# } -# } -# } -# save_scope_as = chosen_basque_culture -# } -# } -# ## Finally, we try to convert. -# if = { -# limit = { exists = scope:chosen_basque_culture } -# convert_family_culture_and_notify_vassals_effect = { -# CONVERTER = scope:religious_leader -# OLD_CULTURE = scope:religious_leader.culture -# NEW_CULTURE = scope:chosen_basque_culture -# } -# } -# # If this hasn't worked at all, and they've got _any_ counties left, we just switch you to the regular Basque. -# else_if = { -# limit = { -# culture:basque = { -# any_culture_county = { exists = this } -# } -# } -# convert_family_culture_and_notify_vassals_effect = { -# CONVERTER = scope:religious_leader -# OLD_CULTURE = scope:religious_leader.culture -# NEW_CULTURE = culture:basque -# } -# } -# # Otherwise, we presume that the Basque presence in the region is extinct or negligible (at least on the macro level), so we leave your culture alone. -# } -# # Assign a new nickname, if appropriate. -# if = { -# limit = { -# OR = { -# has_any_nickname = no -# has_bad_nickname = yes -# } -# } -# # If you're not already a pagan, guess what folks call you? -# if = { -# limit = { -# NOT = { -# faith = { has_doctrine = pagan_hostility_doctrine } -# } -# } -# give_nickname = nick_the_pagan -# } -# # Otherwise, you're probably an invading Viking and you deserve to get memed. -# else = { give_nickname = nick_the_mountain_king } -# } -# # Switch to the new faith. -# add_character_flag = { -# flag = delay_player_faith_conversion_notification_event -# days = 1 -# } -# # Configure Basque paganism's variable set-up. -# faith:basque_pagan = { -# # Remove the restrictions on converting to Basque paganism. -# remove_variable = block_conversion_till_decision_taken -# # And, since you're inherently creating a new priestly structure -# ## This is mostly done here for immersive reasons; we don't want to imply that Basque paganism already had a distinct organised religious hierarchy in 867 by just applying this on game start, even though you'll always have to have it to access the faith. -# set_variable = { name = has_been_reformed } -# remove_doctrine = unreformed_faith_doctrine -# } -# # Finally, convert. -# ## We do this here so that it's reformed by the time you switch (giving you a better chance with vassal conversion rates). -# set_character_faith_with_conversion = faith:basque_pagan -# } -#} -# -#favour_the_countryside_basques_decision_fundamentalist_path_scripted_effect = { -# faith:basque_pagan = { -# # First, we remove Christian Syncretism & replace it with Warmonger. -# remove_doctrine = tenet_christian_syncretism -# add_doctrine = tenet_warmonger -# # Then, we switch on over from Pluralist to Fundamentalist. -# ## We disguise some of these changes for neatness, as there's a lot to process. -# hidden_effect = { remove_doctrine = doctrine_pluralism_pluralistic } -# add_doctrine = doctrine_pluralism_fundamentalist -# # No HoF becomes a spiritual HoF, so that you can make use of your Warmonger GHWs. -# hidden_effect = { remove_doctrine = doctrine_no_head } -# add_doctrine = doctrine_spiritual_head -# # Plus, set the faith's fervour to a middling/low level, since you've messed with it. -# change_fervor = { -# value = -50 -# desc = fervour_loss_temporal_meddling -# } -# } -# # Create the new HoF. -# hidden_effect = { -# scope:religious_leader = { -# set_up_dynamic_spiritual_hof_title_effect = { CREATOR = scope:religious_leader } -# } -# } -# custom_tooltip = favour_the_countryside_basques_decision.tt.spiritual_hof_acquired -# # We get a small modifier for clergy approval, since they're a bit peeved at the tenet-messing. -# add_character_modifier = fp2_friend_of_the_old_ways_modifier -#} -# -#favour_the_countryside_basques_decision_righteous_path_scripted_effect = { -# faith:basque_pagan = { -# # First, we remove Christian Syncretism & replace it with Sanctity of Nature. -# remove_doctrine = tenet_christian_syncretism -# add_doctrine = tenet_sanctity_of_nature -# # Then, we switch on over from Pluralist to Righteous. -# ## We disguise some of these changes for neatness, as there's a lot to process. -# hidden_effect = { remove_doctrine = doctrine_pluralism_pluralistic } -# add_doctrine = doctrine_pluralism_righteous -# # No HoF becomes you as the temporal HoF, as you're focusing more on the non-Christian parts of the faith. -# hidden_effect = { -# remove_doctrine = doctrine_no_head -# remove_doctrine = doctrine_theocracy_temporal -# remove_doctrine = doctrine_clerical_succession_spiritual_appointment -# } -# add_doctrine = doctrine_temporal_head -# add_doctrine = doctrine_theocracy_lay_clergy -# add_doctrine = doctrine_clerical_succession_temporal_fixed_appointment -# # Plus, set the faith's fervour to a middling/low level, since you've messed with it. -# change_fervor = { -# value = -50 -# desc = fervour_loss_temporal_meddling -# } -# } -# # Create the new HoF. -# hidden_effect = { -# scope:religious_leader = { -# set_up_dynamic_temporal_hof_title_effect = { NEW_HOLDER = scope:religious_leader } -# } -# } -# custom_tooltip = favour_the_countryside_basques_decision.tt.temporal_hof_acquired -# # We get a small modifier for clergy approval, since they're a bit peeved at the tenet-messing. -# add_character_modifier = fp2_friend_of_the_old_ways_modifier -#} -# -#favour_the_countryside_basques_decision_pluralist_path_scripted_effect = { -# faith:basque_pagan = { -# # First, we mostly only need to remove Christian Syncretism & replace it with Islamic Syncretism. -# remove_doctrine = tenet_christian_syncretism -# add_doctrine = tenet_islamic_syncretism -# # Then set the faith's fervour to a middling/low level, since you've messed with it. -# change_fervor = { -# value = -50 -# desc = fervour_loss_temporal_meddling -# } -# } -# # Bonus opinion with every neighbouring Islamic ruler & their vassals, who appreciate the direction you're going in. -# ## Compile a list. -# top_liege = { -# if = { -# limit = { religion = religion:islam_religion } -# add_to_list = pleased_rulers -# } -# every_vassal_or_below = { -# limit = { religion = religion:islam_religion } -# add_to_list = pleased_rulers -# } -# } -# every_neighboring_and_across_water_top_liege_realm_owner = { -# if = { -# limit = { religion = religion:islam_religion } -# add_to_list = pleased_rulers -# } -# every_vassal_or_below = { -# limit = { religion = religion:islam_religion } -# add_to_list = pleased_rulers -# } -# } -# ## And apply some opinions. -# every_in_list = { -# list = pleased_rulers -# custom = favour_the_countryside_basques_decision.tt.all_neighbouring_islamic_rulers -# add_opinion = { -# target = scope:religious_leader -# modifier = pleased_opinion -# opinion = 30 -# } -# } -# # We get a small modifier for clergy approval, since they're a bit peeved at the tenet-messing. -# add_character_modifier = fp2_friend_of_the_old_ways_modifier -#} -# -#favour_the_countryside_basques_decision_default_path_scripted_effect = { -# faith:basque_pagan = { -# # Here, we're not fiddling with the faith's traditions at all, so we get a chonky fervour bonus for the sudden limelight. -# change_fervor = { -# value = 100 -# desc = fervour_gain_unexpected_resurgence -# } -# } -# # Plus a massive chunk of piety experience... -# add_piety_experience = 2000 -# # ... and a more powerful clergy-approval modifier. -# add_character_modifier = fp2_champion_of_the_old_ways_modifier -#} -# -#create_kingdom_of_saxony_effect = { -# if = { -# limit = { -# NOR = { -# root = $CHARACTER$ -# exists = scope:new_saxon_king -# } -# } -# # Grant every held title in Saxony to the new holder -# root = { -# every_held_title = { -# limit = { -# OR = { -# title:k_saxony = { is_de_jure_liege_or_above_target = prev } -# title:k_sorbia = { is_de_jure_liege_or_above_target = prev } -# } -# NOT = { -# holder = { capital_county = prev } -# } -# } -# create_title_and_vassal_change = { -# type = granted -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# change_title_holder = { -# holder = $CHARACTER$ -# change = scope:title_change -# } -# resolve_title_and_vassal_change = scope:title_change -# } -# } -# } -# if = { -# limit = { exists = title:k_sorbia.holder } -# destroy_title = title:k_sorbia -# } -# title:k_sorbia = { -# every_in_de_jure_hierarchy = { -# limit = { tier = tier_duchy } -# set_de_jure_liege_title = title:k_saxony -# } -# } -# title:k_saxony = { set_coa = k_saxon_electorate } -# title:k_saxony = { set_de_jure_liege_title = title:e_hre } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# if = { -# limit = { -# has_title = title:e_hre -# } -# hidden_effect = { -# title:k_saxony = { -# change_title_holder = { -# holder = $CHARACTER$ -# change = scope:title_change -# } -# } -# } -# } -# else = { -# title:k_saxony = { -# change_title_holder = { -# holder = $CHARACTER$ -# change = scope:title_change -# } -# } -# } -# every_vassal = { -# limit = { -# primary_title = { -# OR = { -# title:k_saxony = { is_de_jure_liege_or_above_target = prev } -# title:k_sorbia = { is_de_jure_liege_or_above_target = prev } -# } -# } -# NOT = { this = $CHARACTER$ } -# NOT = { any_liege_or_above = { this = $CHARACTER$ } } -# } -# change_liege = { -# liege = $CHARACTER$ -# change = scope:title_change -# } -# } -# hidden_effect = { -# if = { -# limit = { -# NOR = { -# $CHARACTER$ = root -# $CHARACTER$ = { is_vassal_or_below_of = root } -# } -# } -# $CHARACTER$ = { -# change_liege = { -# liege = root -# change = scope:title_change -# } -# } -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# hidden_effect = { -# $CHARACTER$ = { save_scope_as = new_saxon_king } -# every_player = { -# limit = { -# this != prev -# or = { -# is_vassal_or_below_of = title:e_hre.holder -# AND = { -# exists = title:e_west_slavia -# is_vassal_or_below_of = title:e_west_slavia.holder -# } -# title:e_hre = { is_neighbor_to_realm = prev } -# primary_title = { -# title:e_west_slavia = { is_de_jure_liege_or_above_target = prev } -# } -# } -# } -# trigger_event = middle_europe_decisions.0018 -# } -# } -#} -# -#restore_old_vasconia_decision_scripted_effect = { -# save_scope_as = founder -# # Give Navarra if not held -# if = { -# limit = { -# NOT = { has_title = title:k_navarra } -# } -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# title:k_navarra = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# } -# title:k_navarra = { set_title_name = k_vasconia } -# hidden_effect = { -# # Transfer de jure -# every_in_list = { -# list = vasconia_duchies -# limit = { -# save_temporary_scope_as = duchy_temp -# root = { completely_controls = scope:duchy_temp } -# NOT = { de_jure_liege = title:k_navarra } -# } -# add_to_list = vasconia_transfers -# set_de_jure_liege_title = title:k_navarra -# } -# # Destroy held superseded kingdoms (no de jure land left) -# every_in_list = { -# list = vasconia_kingdoms -# limit = { -# holder = root -# any_direct_de_jure_vassal_title = { count < 1 } -# } -# add_to_list = superseded_kingdoms -# save_scope_as = superseded_kingdom -# root = { destroy_title = scope:superseded_kingdom } -# } -# } -#} -# -#restore_old_vasconia_decision_tooltip_scripted_effect = { -# custom_tooltip = restore_old_vasconia_decision_vasconia_past_tt -# show_as_tooltip = { -# every_in_list = { -# list = vasconia_transfers -# set_de_jure_liege_title = title:k_navarra -# } -# every_in_list = { -# list = superseded_kingdoms -# save_scope_as = superseded_kingdom -# root = { destroy_title = scope:superseded_kingdom } -# } -# } -#} -# -#create_beth_nahrain_scripted_effect = { -# #Create Beth Nahrain -# hidden_effect = { -# every_held_title = { -# limit = { -# tier = tier_empire -# } -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# } -# set_de_jure_liege_title = title:e_beth_nahrain -# } -# } -# } -#} -# -#promote_culture_beth_nahrain_scripted_effect = { -# every_sub_realm_county = { -# custom = promote_culture_beth_nahrain_modifier_custom_desc -# limit = { -# NOT = { -# culture = { has_cultural_pillar = heritage_syriac } -# } -# title_province = { geographical_region = custom_beth_nahrain } -# } -# add_county_modifier = { -# modifier = promote_culture_beth_nahrain_modifier -# years = 50 -# } -# } -# if = { -# limit = { -# faith = faith:nestorian -# } -# faith:nestorian = { -# change_fervor = { -# value = 100 -# desc = middle_east_major_decisions.1020_fervor -# } -# } -# } -# else_if = { -# limit = { -# NOT = { -# exists = scope:suppress_tooltips -# } -# } -# custom_tooltip = middle_east_major_decisions.1020.lack_nestorian -# } -#} -# -#learning_beth_nahrain_scripted_effect = { -# house ?= { -# add_house_modifier = { -# modifier = learning_beth_nahrain_house_modifier -# years = 100 -# } -# } -# add_piety_experience = monumental_piety_value -#} -# -#martial_beth_nahrain_scripted_effect = { -# house ?= { -# add_house_modifier = { -# modifier = martial_beth_nahrain_house_modifier -# years = 100 -# } -# } -# add_prestige_experience = monumental_prestige_value -#} -# -#nestorian_faith_beth_nahrain_scripted_effect = { -# add_trait = crusader_king -# add_piety_experience = monumental_piety_value -#} -# -#no_faith_beth_nahrain_scripted_effect = { -# faith:nestorian = { -# change_fervor = { -# value = 100 -# desc = middle_east_major_decisions.1020_fervor -# } -# } -# set_character_faith_with_conversion = faith:nestorian -# add_piety = monumental_piety_gain -#} -# -#found_empire_of_hindustan_scripted_effect = { -# save_scope_as = founder -# -# create_title_and_vassal_change = { -# type = created -# save_scope_as = title_change -# add_claim_on_loss = no -# } -# if = { -# limit = { -# completely_controls = title:k_punjab #This will always be true but it keeps the decision text easier to read before you fulfill the criteria -# NOT = { has_title = title:k_punjab } -# } -# title:k_punjab = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# } -# if = { -# limit = { -# completely_controls = title:k_delhi #This will always be true but it keeps the decision text easier to read before you fulfill the criteria -# NOT = { has_title = title:k_delhi } -# } -# title:k_delhi = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# } -# if = { -# limit = { -# OR = { -# NOT = { title:d_kuru.holder = root } -# AND = { -# exists = title:d_kuru.holder -# title:d_kuru.holder = { -# is_ai = yes -# } -# } -# } -# } -# title:d_kuru = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# } -# if = { -# limit = { -# NOT = { title:c_delhi.holder = root } -# } -# title:c_delhi = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# } -# title:e_hindustan = { -# change_title_holder = { -# holder = root -# change = scope:title_change -# } -# } -# resolve_title_and_vassal_change = scope:title_change -# set_primary_title_to = title:e_hindustan -# -# hidden_effect = { -# title:k_delhi = { -# set_de_jure_liege_title = title:e_hindustan -# } -# title:k_punjab = { -# set_de_jure_liege_title = title:e_hindustan -# } -# every_held_title = { -# limit = { -# tier = tier_kingdom -# OR = { -# de_jure_liege = title:e_bengal -# de_jure_liege = title:e_deccan -# de_jure_liege = title:e_rajastan -# } -# } -# set_de_jure_liege_title = title:e_hindustan -# } -# #Areas that have had more muslim influence wants to avoid border gore and gets added even if not held - unless controlled by an independent Emperor of Rajastan: -# if = { -# limit = { -# NOT = { -# title:k_sindh.holder.liege = { -# has_title = title:e_rajastan -# } -# } -# } -# title:k_sindh = { -# set_de_jure_liege_title = title:e_hindustan -# } -# } -# if = { -# limit = { -# NOT = { -# title:k_kashmir.holder.liege = { -# has_title = title:e_rajastan -# } -# } -# } -# title:k_kashmir = { -# set_de_jure_liege_title = title:e_hindustan -# } -# } -# add_character_flag = e_hindustan #For title flavorization -# } -# #If the new Emperor of Hindustan holds any of the Indian Empires these are destroyed and their kingdoms added to Hindustan too -# #This is not inside the hidden block to not hide that the empires are destroyed. -# if = { -# limit = { -# has_title = title:e_bengal -# } -# hidden_effect = { -# title:e_bengal = { -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# } -# set_de_jure_liege_title = title:e_hindustan -# } -# } -# } -# destroy_title = title:e_bengal -# } -# if = { -# limit = { -# has_title = title:e_deccan -# } -# hidden_effect = { -# title:e_deccan = { -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# } -# set_de_jure_liege_title = title:e_hindustan -# } -# } -# } -# destroy_title = title:e_deccan -# } -# if = { -# limit = { -# has_title = title:e_rajastan -# } -# hidden_effect = { -# title:e_rajastan = { -# every_in_de_jure_hierarchy = { -# limit = { -# tier = tier_kingdom -# } -# set_de_jure_liege_title = title:e_hindustan -# } -# } -# } -# destroy_title = title:e_rajastan -# } -# custom_tooltip = found_empire_of_hindustan_decision_effects_de_jure_tt -# hidden_effect = { -# if = { # Let's see if you have ultimo and save that if so -# limit = { -# has_realm_law = single_heir_succession_law_youngest -# } -# save_scope_as = set_ultimo_temp_scope -# } -# } -# if = { -# limit = { has_dlc_feature = admin_gov } -# convert_to_administrative_from_feudalism_effect = { GOVERNMENT_TO_ADOPT = flag:administrative } -# } -# hidden_effect = { -# if = { # If you had ultimo, you get to keep it. Otherwise, you get primo for free. -# limit = { -# exists = scope:set_ultimo_temp_scope -# } -# add_realm_law = single_heir_succession_law_youngest -# } -# else = { -# add_realm_law = single_heir_succession_law -# } -# } -# add_legitimacy_effect = { LEGITIMACY = massive_legitimacy_gain } -# dynasty ?= { add_dynasty_prestige = massive_dynasty_prestige_value } -#} -# -# - -restore_swedish_empire_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - give_nickname = nick_the_lion_of_the_north - save_scope_as = scoped_ruler - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:e_sweden = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - hidden_effect = { - copy_title_history = title:k_sweden - } - } - resolve_title_and_vassal_change = scope:change - hidden_effect = { - set_primary_title_to = title:e_sweden - if = { - limit = { - title:k_sapmi = { is_titular = no } - has_title = title:k_sapmi - } - title:k_sapmi = { set_de_jure_liege_title = title:e_sweden } - set_flag = flag_swedish_sapmi - } - else = { - if = { - limit = { - title:k_sapmi = { is_titular = no } - } - title:k_sapmi = { - every_in_de_jure_hierarchy = { - limit = { - tier = tier_duchy - root = { completely_controls = prev } - OR = { - this = title:d_vasterbottena - this = title:d_norrbottena - } - } - set_de_jure_liege_title = title:k_sweden - } - every_in_de_jure_hierarchy = { - limit = { - tier = tier_duchy - root = { completely_controls = prev } - OR = { - this = title:d_giemajohka - this = title:d_gulodat - } - } - set_de_jure_liege_title = title:k_finland - } -# set_de_jure_liege_title = title:e_zapadnorussia - } - } - } - title:k_finland = { set_de_jure_liege_title = title:e_sweden } - title:k_esthonia = { set_de_jure_liege_title = title:e_sweden } - title:k_sweden = { set_de_jure_liege_title = title:e_sweden } - if = { - limit = { - exists = title:k_gotaland - } - destroy_title = title:k_gotaland - } - if = { - limit = { title:k_gotaland ?= { is_titular = no } } - title:k_gotaland = { - every_in_de_jure_hierarchy = { - limit = { tier = tier_duchy } - set_de_jure_liege_title = title:k_sweden - } - } - } - if = { - limit = { - title:k_norway = { is_titular = no } - OR = { - has_title = title:k_norway - completely_controls = title:k_norway - } - } - title:k_norway = { set_de_jure_liege_title = title:e_sweden } - } - if = { - limit = { - completely_controls = title:d_finnmarku - NOT = { has_title = title:k_sapmi } - } - if = { - limit = { - OR = { - has_title = title:k_norway - completely_controls = title:k_norway - } - } - title:d_finnmarku = { set_de_jure_liege_title = title:k_norway } - } - else = { - title:d_finnmarku = { set_de_jure_liege_title = title:k_finland } - } - } - if = { - limit = { - completely_controls = title:d_guoldat - NOT = { has_title = title:k_sapmi } - } - if = { - limit = { - OR = { - has_title = title:k_norway - completely_controls = title:k_norway - } - } - title:d_guoldat = { set_de_jure_liege_title = title:k_norway } - } - else_if = { - limit = { - OR = { - has_title = title:k_karelia - completely_controls = title:k_karelia - } - } - title:d_guoldat = { set_de_jure_liege_title = title:k_karelia } - } - else = { - title:d_guoldat = { set_de_jure_liege_title = title:k_finland } - } - } - if = { - limit = { - title:k_latvia = { is_titular = no } - OR = { - has_title = title:k_latvia - completely_controls = title:k_latvia - } - } - title:k_latvia = { set_de_jure_liege_title = title:e_sweden } - } - if = { - limit = { - title:k_pribaltia = { is_titular = no } - OR = { - has_title = title:k_pribaltia - completely_controls = title:k_pribaltia - } - } - title:k_pribaltia = { set_de_jure_liege_title = title:e_sweden } - } - if = { - limit = { - title:k_lithuania = { is_titular = no } - OR = { - has_title = title:k_lithuania - completely_controls = title:k_lithuania - } - } - title:k_lithuania = { set_de_jure_liege_title = title:e_sweden } - } - if = { - limit = { - title:k_schleswig_holstein = { is_titular = no } - OR = { - has_title = title:k_schleswig_holstein - completely_controls = title:k_schleswig_holstein - } - } - title:k_schleswig_holstein = { set_de_jure_liege_title = title:e_sweden } - } - if = { - limit = { - title:k_karelia = { is_titular = no } - OR = { - has_title = title:k_karelia - completely_controls = title:k_karelia - } - } - title:k_karelia = { set_de_jure_liege_title = title:e_sweden } - } - else = { - title:k_karelia = { - every_in_de_jure_hierarchy = { - limit = { - tier = tier_duchy - root = { completely_controls = prev } - } - set_de_jure_liege_title = title:k_finland - } -# set_de_jure_liege_title = title:e_zapadnorussia - } - } - if = { - limit = { - title:k_poland = { is_titular = no } - OR = { - has_title = title:k_poland - completely_controls = title:k_poland - } - } - title:k_poland = { set_de_jure_liege_title = title:e_sweden } - } - if = { - limit = { - title:k_brandenburg = { is_titular = no } - OR = { - has_title = title:k_brandenburg - completely_controls = title:k_brandenburg - } - } - title:k_brandenburg = { set_de_jure_liege_title = title:e_sweden } - } -# if = { -# limit = { -# title:k_petrograd = { is_titular = no } -# OR = { -# has_title = title:k_petrograd -# completely_controls = title:k_petrograd -# } -# } -# title:k_petrograd = { set_de_jure_liege_title = title:e_sweden } -# } - if = { - limit = { - title:k_iceland = { is_titular = no } - OR = { - has_title = title:k_iceland - completely_controls = title:k_iceland - } - } - title:k_iceland = { set_de_jure_liege_title = title:e_sweden } - } - title:e_scandinavia = { - set_title_name = k_denmark - set_color_from_title = title:k_denmark - set_coa = k_denmark - } - } -} - -form_bulgarian_empire_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - give_nickname = nick_the_great - save_scope_as = scoped_ruler - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:e_bulgaria = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - hidden_effect = { - copy_title_history = title:k_bulgaria - } - } - resolve_title_and_vassal_change = scope:change - hidden_effect = { - set_primary_title_to = title:e_bulgaria - title:k_bulgaria = { set_de_jure_liege_title = title:e_bulgaria } - title:k_macedonia = { set_de_jure_liege_title = title:e_bulgaria } - title:k_thrace = { set_de_jure_liege_title = title:e_bulgaria } - if = { - limit = { - title:k_dacia = { is_titular = no } - OR = { - has_title = title:k_dacia - completely_controls = title:k_dacia - } - } - title:k_dacia = { set_de_jure_liege_title = title:e_bulgaria } - } - if = { - limit = { - title:k_transylvania = { is_titular = no } - OR = { - has_title = title:k_transylvania - completely_controls = title:k_transylvania - } - } - title:k_transylvania = { set_de_jure_liege_title = title:e_bulgaria } - } - if = { - limit = { - title:k_serbia = { is_titular = no } - OR = { - has_title = title:k_serbia - completely_controls = title:k_serbia - } - } - title:k_serbia = { set_de_jure_liege_title = title:e_bulgaria } - } - if = { - limit = { - title:k_epirus = { is_titular = no } - OR = { - has_title = title:k_epirus - completely_controls = title:k_epirus - } - } - title:k_epirus = { set_de_jure_liege_title = title:e_bulgaria } - } - if = { - limit = { - title:k_montenegro = { is_titular = no } - OR = { - has_title = title:k_montenegro - completely_controls = title:k_montenegro - } - } - title:k_montenegro = { set_de_jure_liege_title = title:e_bulgaria } - } - } -} - -restore_ottoman_empire_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - give_nickname = nick_NEOW_fatih - save_scope_as = scoped_ruler - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:e_sublime_state = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - hidden_effect = { - copy_title_history = title:e_turkey - } - } - resolve_title_and_vassal_change = scope:change - hidden_effect = { - set_primary_title_to = title:e_bulgaria - title:k_bulgaria = { set_de_jure_liege_title = title:e_sublime_state } - title:k_macedonia = { set_de_jure_liege_title = title:e_sublime_state } - title:k_thrace = { set_de_jure_liege_title = title:e_sublime_state } - title:k_hellas = { set_de_jure_liege_title = title:e_sublime_state } - title:k_krete = { set_de_jure_liege_title = title:e_sublime_state } - title:k_mikrasia = { set_de_jure_liege_title = title:e_sublime_state } - title:k_cyprus = { set_de_jure_liege_title = title:e_sublime_state } - title:k_epirus = { set_de_jure_liege_title = title:e_sublime_state } - title:k_nikaea = { set_de_jure_liege_title = title:e_sublime_state } - title:k_anatolia = { set_de_jure_liege_title = title:e_sublime_state } - title:k_pontus = { set_de_jure_liege_title = title:e_sublime_state } - title:k_armenitolia = { set_de_jure_liege_title = title:e_sublime_state } - title:k_cilicia = { set_de_jure_liege_title = title:e_sublime_state } - if = { - limit = { - exists = title:e_turkey - } - destroy_title = title:e_turkey - } - if = { - limit = { - exists = title:e_greece - } - destroy_title = title:e_greece - } - } -} - -form_hetmanshchina_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - save_scope_as = scoped_ruler - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:e_hetmanshchina = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - hidden_effect = { - set_primary_title_to = title:e_hetmanshchina - if = { - limit = { - title:k_ruthenia = { is_titular = no } - has_title = title:k_ruthenia - } - title:k_ruthenia = { set_de_jure_liege_title = title:e_hetmanshchina } - set_flag = flag_cossack_ukraine - } - else = { - if = { - limit = { - title:k_ruthenia = { is_titular = no } - } - title:k_ruthenia = { - every_in_de_jure_hierarchy = { - limit = { - tier = tier_duchy - root = { completely_controls = prev } - OR = { - this = title:d_donbas - this = title:d_zaporizhzhia - this = title:d_kherson - this = title:d_dnipro - this = title:d_kharkiv - } - } - set_de_jure_liege_title = title:k_kuban - } - } - } - } - title:d_donbas = { set_de_jure_liege_title = title:k_kuban } - title:d_zaporizhzhia = { set_de_jure_liege_title = title:k_kuban } - title:d_kherson = { set_de_jure_liege_title = title:k_kuban } - title:d_dnipro = { set_de_jure_liege_title = title:k_kuban } - title:d_kharkiv = { set_de_jure_liege_title = title:k_kuban } - title:k_kuban = { set_de_jure_liege_title = title:e_hetmanshchina } - title:k_caucasus = { set_de_jure_liege_title = title:e_hetmanshchina } - title:k_crimea = { set_de_jure_liege_title = title:e_hetmanshchina } - } -} - -expand_alps_decision_effect = { - add_prestige = massive_prestige_gain - hidden_effect = { - title:k_austria = { set_de_jure_liege_title = title:e_alps } - title:k_swabia = { set_de_jure_liege_title = title:e_alps } - title:k_bavaria = { set_de_jure_liege_title = title:e_alps } - title:k_italy = { set_de_jure_liege_title = title:e_alps } - title:k_venice = { set_de_jure_liege_title = title:e_alps } - title:k_slovenia = { set_de_jure_liege_title = title:e_alps } - } -} - -form_quinto_imperio_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - give_nickname = nick_o_desejado - add_trait = savior - save_scope_as = scoped_ruler - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:e_sebastianist_hof = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - hidden_effect = { - set_primary_title_to = title:e_sebastianist_hof - title:k_spanish_galicia = { set_de_jure_liege_title = title:e_sebastianist_hof } - title:k_portugal = { set_de_jure_liege_title = title:e_sebastianist_hof } - title:k_andalusia = { set_de_jure_liege_title = title:e_sebastianist_hof } - title:k_castille_leon = { set_de_jure_liege_title = title:e_sebastianist_hof } - title:k_aragon = { set_de_jure_liege_title = title:e_sebastianist_hof } - title:k_navarra = { set_de_jure_liege_title = title:e_sebastianist_hof } - if = { - limit = { - exists = title:e_iberia - } - destroy_title = title:e_iberia - } - if = { - limit = { - title:k_sardinia_and_corsica = { is_titular = no } - OR = { - has_title = title:k_sardinia_and_corsica - completely_controls = title:k_sardinia_and_corsica - } - } - title:k_sardinia_and_corsica = { set_de_jure_liege_title = title:e_sebastianist_hof } - } - } -} - - restore_rhine_border_novelist_france_decision_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - hidden_effect = { - title:k_belgium = { set_de_jure_liege_title = title:e_france } - title:k_lotharingia = { set_de_jure_liege_title = title:e_france } - title:d_palatinate = { set_de_jure_liege_title = title:k_lotharingia} - title:d_alsace = { set_de_jure_liege_title = title:k_lotharingia } - } -} - -restore_alpine_border_novelist_france_decision_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - hidden_effect = { - title:k_rhodania = { set_de_jure_liege_title = title:e_france } - title:d_upper_burgundy = { set_de_jure_liege_title = title:k_france } - title:d_savoie = { set_de_jure_liege_title = title:k_rhodania } - } -} - -restore_numenor_decision_effect = { - save_scope_as = scoped_ruler - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:h_numenor = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - - every_held_title = { #Should shift all dejure of all Empires owned at the time. - title_tier = empire - set_de_jure_liege_title = title:h_numenor - } - every_empire = { - limit = { - NOT = { exists = hegemony } - any_de_jure_county = { - percent >= 0.6 - holder = { - OR = { - this = root - any_liege_or_above = { this = root } - } - } - } - } - set_de_jure_liege_title = title:h_numenor - } -} - -restore_byzantium_decision_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - save_scope_as = scoped_ruler - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - title:e_NEOW_byzantium = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - hidden_effect = { - set_primary_title_to = title:e_NEOW_byzantium - title:k_thrace = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_macedonia = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_hellas= { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_bulgaria = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_epirus = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_cyprus = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_krete = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_nikaea = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_anatolia = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_pontus = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_armenitolia = { set_de_jure_liege_title = title:e_NEOW_byzantium } - title:k_cilicia = { set_de_jure_liege_title = title:e_NEOW_byzantium } - if = { - limit = { - exists = title:e_greece - } - destroy_title = title:e_greece - } - if = { - limit = { - exists = title:e_turkey - } - destroy_title = title:e_turkey - } - if = { - limit = { - title:k_serbia = { is_titular = no } - OR = { - has_title = title:k_serbia - completely_controls = title:k_serbia - } - } - title:k_serbia = { set_de_jure_liege_title = title:e_NEOW_byzantium } - } - if = { - limit = { - title:k_montenegro = { is_titular = no } - OR = { - has_title = title:k_montenegro - completely_controls = title:k_montenegro - } - } - title:k_montenegro = { set_de_jure_liege_title = title:e_NEOW_byzantium } - } - } -} -albanian_two_decision_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - - save_scope_as = scoped_ruler - - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - title:k_two_albania = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - - resolve_title_and_vassal_change = scope:change - - hidden_effect = { - set_primary_title_to = title:k_two_albania - - title:d_napoli = { set_de_jure_liege_title = title:k_two_albania } - title:d_abruzzo = { set_de_jure_liege_title = title:k_two_albania } - title:d_apulia = { set_de_jure_liege_title = title:k_two_albania } - title:d_lucania = { set_de_jure_liege_title = title:k_two_albania } - title:d_calabria = { set_de_jure_liege_title = title:k_two_albania } - title:d_kosovo = { set_de_jure_liege_title = title:k_two_albania } - title:d_kastrioti = { set_de_jure_liege_title = title:k_two_albania } - title:d_dyrrachion = { set_de_jure_liege_title = title:k_two_albania } - title:d_gjirokaster = { set_de_jure_liege_title = title:k_two_albania } - title:k_two_albania = { set_de_jure_liege_title = title:e_italy } - - if = { - limit = { - exists = title:k_epirus - } - destroy_title = title:k_epirus - } - - if = { - limit = { - exists = title:k_sicily - } - destroy_title = title:k_sicily - } - - if = { - limit = { - title:d_palermo = { is_titular = no } - OR = { - has_title = title:d_palermo - completely_controls = title:d_palermo - } - } - title:d_palermo = { set_de_jure_liege_title = title:k_two_albania } - } - - if = { - limit = { - title:d_siracusa = { is_titular = no } - OR = { - has_title = title:d_siracusa - completely_controls = title:d_siracusa - } - } - title:d_siracusa = { set_de_jure_liege_title = title:k_two_albania } - } - - if = { - limit = { - title:d_athens = { is_titular = no } - OR = { - has_title = title:d_athens - completely_controls = title:d_athens - } - } - title:d_athens = { set_de_jure_liege_title = title:k_two_albania } - } - - if = { - limit = { - title:d_epirus = { is_titular = no } - OR = { - has_title = title:d_epirus - completely_controls = title:d_epirus - } - } - title:d_epirus = { set_de_jure_liege_title = title:k_two_albania } - } - - if = { - limit = { - title:d_peloponnese = { is_titular = no } - OR = { - has_title = title:d_peloponnese - completely_controls = title:d_peloponnese - } - } - title:d_peloponnese = { set_de_jure_liege_title = title:k_two_albania } - } - - if = { - limit = { - title:d_cephalonia = { is_titular = no } - OR = { - has_title = title:d_cephalonia - completely_controls = title:d_cephalonia - } - } - title:d_cephalonia = { set_de_jure_liege_title = title:k_two_albania } - } - } -} -declare_doggerlaw_effect = { - add_prestige = massive_prestige_gain - - save_scope_as = scoped_ruler - - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - title:k_doggerlaw = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - - resolve_title_and_vassal_change = scope:change - - hidden_effect = { - set_primary_title_to = title:k_doggerlaw - - title:d_york = { set_de_jure_liege_title = title:k_doggerlaw } - title:d_northumberland = { set_de_jure_liege_title = title:k_doggerlaw } - title:d_lothian = { set_de_jure_liege_title = title:k_doggerlaw } - - if = { - limit = { - title:k_northumberland = { is_titular = no } - OR = { - has_title = title:k_northumberland - completely_controls = title:k_northumberland - } - } - destroy_title = title:k_northumberland - } - - if = { - limit = { - title:d_strathclyde = { is_titular = no } - OR = { - has_title = title:d_strathclyde - completely_controls = title:d_strathclyde - } - } - title:d_strathclyde = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_galloway = { is_titular = no } - OR = { - has_title = title:d_galloway - completely_controls = title:d_galloway - } - } - title:d_galloway = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_cumbria = { is_titular = no } - OR = { - has_title = title:d_cumbria - completely_controls = title:d_cumbria - } - } - title:d_cumbria = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_lincoln = { is_titular = no } - OR = { - has_title = title:d_lincoln - completely_controls = title:d_lincoln - } - } - title:d_lincoln = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_nottingham = { is_titular = no } - OR = { - has_title = title:d_nottingham - completely_controls = title:d_nottingham - } - } - title:d_nottingham = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_lancaster = { is_titular = no } - OR = { - has_title = title:d_lancaster - completely_controls = title:d_lancaster - } - } - title:d_lancaster = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_leicester = { is_titular = no } - OR = { - has_title = title:d_leicester - completely_controls = title:d_leicester - } - } - title:d_leicester = { set_de_jure_liege_title = title:k_doggerlaw } - } - if = { - limit = { - title:d_norfolk = { is_titular = no } - OR = { - has_title = title:d_norfolk - completely_controls = title:d_norfolk - } - } - title:d_norfolk = { set_de_jure_liege_title = title:k_doggerlaw } - } - } -} - -restore_great_moravia_effect = { - add_prestige = massive_prestige_gain - - save_scope_as = scoped_ruler - - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - title:k_great_moravia = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - - resolve_title_and_vassal_change = scope:change - - hidden_effect = { - set_primary_title_to = title:k_great_moravia - - title:d_moravia = { set_de_jure_liege_title = title:k_great_moravia } - title:d_nyitra = { set_de_jure_liege_title = title:k_great_moravia } - title:d_banska_bystrica = { set_de_jure_liege_title = title:k_great_moravia } - title:d_trencin = { set_de_jure_liege_title = title:k_great_moravia } - title:d_tatra = { set_de_jure_liege_title = title:k_great_moravia } - - if = { - limit = { - title:k_hungary = { is_titular = no } - OR = { - has_title = title:k_hungary - completely_controls = title:k_hungary - } - } - destroy_title = title:k_hungary - } - - if = { - limit = { - title:k_bohemia = { is_titular = no } - OR = { - has_title = title:k_bohemia - completely_controls = title:k_bohemia - } - } - destroy_title = title:k_bohemia - } - - if = { - limit = { - title:k_galicia-volhynia = { is_titular = no } - OR = { - has_title = title:k_galicia-volhynia - completely_controls = title:k_galicia-volhynia - } - } - destroy_title = title:k_galicia-volhynia - } - - - - if = { - limit = { - title:d_gyor = { is_titular = no } - OR = { - has_title = title:d_gyor - completely_controls = title:d_gyor - } - } - title:d_gyor = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_visegrad = { is_titular = no } - OR = { - has_title = title:d_visegrad - completely_controls = title:d_visegrad - } - } - title:d_visegrad = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_somogy = { is_titular = no } - OR = { - has_title = title:d_somogy - completely_controls = title:d_somogy - } - } - title:d_somogy = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_szekesfehervar = { is_titular = no } - OR = { - has_title = title:d_szekesfehervar - completely_controls = title:d_szekesfehervar - } - } - title:d_szekesfehervar = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_bacs = { is_titular = no } - OR = { - has_title = title:d_bacs - completely_controls = title:d_bacs - } - } - title:d_bacs = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_tiszantul = { is_titular = no } - OR = { - has_title = title:d_tiszantul - completely_controls = title:d_tiszantul - } - } - title:d_tiszantul = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_ungvar = { is_titular = no } - OR = { - has_title = title:d_ungvar - completely_controls = title:d_ungvar - } - } - title:d_ungvar = { set_de_jure_liege_title = title:k_great_moravia } - } - if = { - limit = { - title:d_transcarpathia = { is_titular = no } - OR = { - has_title = title:d_transcarpathia - completely_controls = title:d_transcarpathia - } - } - title:d_transcarpathia = { set_de_jure_liege_title = title:k_great_moravia } - } - } -} - -form_carpathia_effect = { - add_prestige = massive_prestige_gain - - save_scope_as = scoped_ruler - - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - title:e_carpathia = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - - resolve_title_and_vassal_change = scope:change - - hidden_effect = { - set_primary_title_to = title:e_carpathia - - title:k_hungary = { set_de_jure_liege_title = title:e_carpathia } - title:k_slovakia = { set_de_jure_liege_title = title:e_carpathia } - title:k_galicia-volhynia = { set_de_jure_liege_title = title:e_carpathia } - title:k_transylvania = { set_de_jure_liege_title = title:e_carpathia } - - if = { - limit = { - title:k_dacia = { is_titular = no } - OR = { - has_title = title:k_dacia - completely_controls = title:k_dacia - } - } - title:k_dacia = { set_de_jure_liege_title = title:e_carpathia } - } - if = { - limit = { - title:k_moldavia = { is_titular = no } - OR = { - has_title = title:k_moldavia - completely_controls = title:k_moldavia - } - } - title:k_moldavia = { set_de_jure_liege_title = title:e_carpathia } - } - } -} -form_ossiland_decision_effect = { - add_prestige = massive_prestige_gain - - save_scope_as = scoped_ruler - - give_nickname = nick_the_ossi - - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - title:k_ossiland = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - - resolve_title_and_vassal_change = scope:change - - hidden_effect = { - trigger_event = NEOW_decision.0004 - - set_primary_title_to = title:k_ossiland - - title:d_nordmark = { set_de_jure_liege_title = title:k_ossiland } - title:d_vorpommern = { set_de_jure_liege_title = title:k_ossiland } - title:d_ostmark = { set_de_jure_liege_title = title:k_ossiland } - title:d_anhalt = { set_de_jure_liege_title = title:k_ossiland } - title:d_lower_lusatia = { set_de_jure_liege_title = title:k_ossiland } - title:d_upper_lusatia = { set_de_jure_liege_title = title:k_ossiland } - title:d_meissen = { set_de_jure_liege_title = title:k_ossiland } - title:d_thuringia = { set_de_jure_liege_title = title:k_ossiland } - title:k_ossiland = { set_de_jure_liege_title = title:e_germany } - - if = { - limit = { - title:k_brandenburg = { is_titular = no } - OR = { - has_title = title:k_brandenburg - } - } - destroy_title = title:k_brandenburg - } - - if = { - limit = { - title:k_sorbia = { is_titular = no } - OR = { - has_title = title:k_sorbia - } - } - destroy_title = title:k_sorbia - } - } -} -troy_decision_effect = { - add_prestige = massive_prestige_gain - add_piety = massive_piety_gain - - save_scope_as = scoped_ruler - - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - - title:k_troy = { - change_title_holder = { - holder = scope:scoped_ruler - change = scope:change - } - } - - resolve_title_and_vassal_change = scope:change - - hidden_effect = { - title:d_optimatoi = { - set_de_jure_liege_title = title:k_troy - } - title:d_opsikion = { - set_de_jure_liege_title = title:k_troy - } - title:d_thrace = { - set_de_jure_liege_title = title:k_troy - - - title:k_troy = { - set_de_jure_liege_title = title:e_turkey - } - - if = { - limit = { - highest_held_title_tier <= tier_kingdom - } - set_primary_title_to = title:k_troy - } - } -} \ No newline at end of file diff --git a/common/scripted_effects/00_nickname_effects.txt b/common/scripted_effects/00_nickname_effects.txt index f20f6a19c..606367266 100644 --- a/common/scripted_effects/00_nickname_effects.txt +++ b/common/scripted_effects/00_nickname_effects.txt @@ -105,7 +105,7 @@ assign_random_nickname_effect = { NOT = { any_realm_county = { culture = scope:nickname_root_scope.culture - } + } } NOT = { primary_title ?= { @@ -123,7 +123,7 @@ assign_random_nickname_effect = { culture = { cultural_acceptance = { target = scope:nickname_root_scope.culture value >= 40 } } - } + } } factor = 2 } @@ -526,7 +526,7 @@ assign_random_nickname_effect = { 100 = { trigger = { has_trait = witch - NOT = { faith = { has_doctrine = doctrine_witchcraft_accepted } } + NOT = { rite = { rite_has_parameter = witchcraft_accepted } } NOT = { exists = scope:had_nick_the_witch } } modifier = { @@ -659,7 +659,7 @@ assign_random_nickname_effect = { has_trait = gluttonous } has_personality_introverted_trigger = no - faith = faith:^ + faith = faith:norse_pagan NOT = { exists = scope:had_nick_foul_fart } } modifier = { @@ -1401,7 +1401,7 @@ assign_random_nickname_effect = { has_trait = intellect_good has_trait = shrewd has_trait = theologian - has_trait = scholar + has_trait = erudite learning >= 16 } has_personality_introverted_trigger = yes @@ -1571,7 +1571,7 @@ assign_random_nickname_effect = { top_liege != this NOR = { religion = liege.religion - faith = { has_doctrine = doctrine_pluralism_pluralistic } + rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } } NOT = { exists = scope:had_nick_the_heathen } } @@ -1761,7 +1761,7 @@ assign_random_nickname_effect = { 100 = { trigger = { is_male = yes - faith = { has_doctrine = doctrine_theocracy_temporal } + rite = { rite_has_doctrine = doctrine_theocracy_temporal } has_personality_levelheaded_trigger = yes has_personality_introverted_trigger = yes has_personality_submissive_trigger = yes @@ -2920,11 +2920,11 @@ assign_random_nickname_effect = { learning >= 16 OR = { has_trait = lifestyle_mystic - has_trait = scholar + has_trait = erudite has_trait = theologian } - NOR = { - exists = scope:had_nick_the_bearded + NOR = { + exists = scope:had_nick_the_bearded has_trait = beardless_eunuch } } @@ -2993,7 +2993,7 @@ assign_random_nickname_effect = { 100 = { trigger = { is_female = yes - faith = { has_doctrine = doctrine_theocracy_temporal } + rite = { rite_has_doctrine = doctrine_theocracy_temporal } has_personality_levelheaded_trigger = yes has_personality_introverted_trigger = yes has_personality_submissive_trigger = yes @@ -4153,15 +4153,15 @@ assign_random_nickname_effect = { learning <= 6 } AND = { - government_allows = administrative + government_has_mechanic = administrative governor_efficiency <= 0.7 } prestige_level <= 2 - } + } NOT = { exists = scope:had_nick_the_incompetent } } modifier = { - government_allows = administrative + government_has_mechanic = administrative governor_efficiency <= 0.6 factor = 2 } @@ -4327,7 +4327,7 @@ set_random_negative_nickname_effect = { NOT = { any_realm_county = { culture = scope:nick_recipient.culture - } + } } NOT = { primary_title ?= { @@ -4343,7 +4343,7 @@ set_random_negative_nickname_effect = { culture = { cultural_acceptance = { target = scope:nick_recipient.culture value >= 40 } } - } + } } factor = 2 } @@ -4544,7 +4544,7 @@ set_random_negative_nickname_effect = { 100 = { trigger = { has_trait = witch - NOT = { faith = { has_doctrine = doctrine_witchcraft_accepted } } + NOT = { rite = { rite_has_parameter = witchcraft_accepted } } } modifier = { piety_level <= 1 @@ -4579,7 +4579,7 @@ set_random_negative_nickname_effect = { 100 = { trigger = { has_trait = drunkard - faith.religion = religion:folk_germanic_religion + faith = faith:norse_pagan } modifier = { prestige_level <= 1 @@ -5072,7 +5072,7 @@ set_random_negative_nickname_effect = { top_liege != this NOR = { religion = liege.religion - faith = { has_doctrine = doctrine_pluralism_pluralistic } + rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } } } set_nickname_effect = { @@ -6338,13 +6338,13 @@ set_random_negative_nickname_effect = { learning <= 6 } AND = { - government_allows = administrative + government_has_mechanic = administrative governor_efficiency <= 0.7 } - } + } } modifier = { - government_allows = administrative + government_has_mechanic = administrative governor_efficiency <= 0.6 factor = 2 } @@ -6397,6 +6397,31 @@ set_random_negative_nickname_effect = { NICKNAME = nick_the_miser } } + 100 = { + trigger = { + religion = { is_in_family = rf_abrahamic } + piety_level >= 4 + num_sinful_traits <= 0 + num_virtuous_traits >= 1 + NOT = { exists = scope:had_nick_the_angelic } + OR = { + has_trait = theologian + has_trait = lifestyle_mystic + has_trait = zealous + has_trait = reclusive + } + has_trait = lifestyle_mystic + spiritual_fulfillment >= spiritual_fulfillment_2 + } + modifier = { + piety_level >= 5 + factor = 2 + } + give_nickname = nick_the_angelic + # Flag this as having been spat out already, in case we're applying several nicknames in quick succession. + flag_random_nickname_as_taken_in_batch_effect = { NICK = nick_the_angelic } + trigger_event = lifestyle_nicknames.1000 + } #Fallback 1 = { trigger = { diff --git a/common/scripted_effects/06_dlc_ce1_legend_effects.txt b/common/scripted_effects/06_dlc_ce1_legend_effects.txt index 1ccadbb63..b6a7682a6 100644 --- a/common/scripted_effects/06_dlc_ce1_legend_effects.txt +++ b/common/scripted_effects/06_dlc_ce1_legend_effects.txt @@ -30,8 +30,8 @@ grab_appropriate_chronicler_effect = { has_cultural_tradition = tradition_chanson_de_geste } } - faith = { - trait_is_virtue = lifestyle_poet + rite = { + trait_is_virtue_rite = lifestyle_poet } } any_court_position_holder = { @@ -918,6 +918,7 @@ change_legend_quality_effect = { add = $VALUE$ } } + custom_tooltip = maximum_legend_quality_discount_reach_tt set_variable = { name = legend_quality_progress value = 100 @@ -932,6 +933,7 @@ change_legend_quality_effect = { add = $VALUE$ } } + custom_tooltip = minimum_legend_quality_discount_reach_tt set_variable = { name = legend_quality_progress value = 0 @@ -1085,14 +1087,14 @@ legend_ending_rewards_mythical_heroic_effect = { legend_ending_rewards_mythical_holy_effect = { add_legitimacy = massive_legitimacy_gain - # Chance to become a Saint + # Chance to become a Herald if = { limit = { dynasty ?= { ce1_heroic_track_perks >= 3 } } - add_trait = saint + add_trait = herald if = { limit = { NOT = { has_global_variable = num_of_saints_var } } set_global_variable = { @@ -1649,7 +1651,7 @@ get_appropriate_exotic_location = { religion = religion:christianity_religion NOT = { any_character_to_title_neighboring_and_across_water_county = { - holder = { faith = faith:coptic } + holder = { faith = faith:miaphysitism } } } NOT = { # Prester John isn't exciting if Egypt is Christian @@ -1683,14 +1685,14 @@ get_appropriate_exotic_location = { OR = { geographical_region = world_india geographical_region = world_tibet - geographical_region = world_burma + geographical_region = world_asia_southeast_mainland geographical_region = world_asia_china } } } culture = { culture_overlaps_geographical_region = world_india } culture = { culture_overlaps_geographical_region = world_tibet } - culture = { culture_overlaps_geographical_region = world_burma } + culture = { culture_overlaps_geographical_region = world_asia_southeast_mainland } culture = { culture_overlaps_geographical_region = world_asia_china } } } @@ -1873,7 +1875,25 @@ generate_religion_descent_effect = { $RELIGION$ = religion:theomach_religion } generate_godly_descent_seed_support_effect = { - FAITH = theomach + FAITH = finno_ugric + GOD = $GOD$ + } + } + else_if = { + limit = { + $RELIGION$ = religion:germanic_religion + } + generate_godly_descent_seed_support_effect = { + FAITH = germanic + GOD = $GOD$ + } + } + else_if = { + limit = { + $RELIGION$ = religion:hellenism_religion + } + generate_godly_descent_seed_support_effect = { + FAITH = hellenism GOD = $GOD$ } } @@ -2350,12 +2370,12 @@ give_legendary_building_location_standard_effect = { has_trait_xp = { trait = lifestyle_hunter track = hunter - value >= 62 + value >= 50 } has_trait_xp = { trait = lifestyle_hunter track = falconer - value >= 62 + value >= 50 } culture ?= { has_cultural_parameter = always_unlock_legendary_hunting_lodge @@ -2453,12 +2473,15 @@ legend_seed_great_deed_dynasty_effect = { legend_seed_great_deed_region_effect = { if = { limit = { has_dlc_feature = legends } + $REGION$ = { + save_scope_as = legend_region + } create_legend_seed = { type = heroic quality = famed chronicle = great_deed_region properties = { - legend_region = $REGION$ + legend_region = scope:legend_region founder = root } } @@ -2978,7 +3001,6 @@ create_swan_knight_legend_seed_effect = { location = { OR = { geographical_region = world_india - geographical_region = world_burma geographical_region = ghw_region_caucasus geographical_region = world_asia_china geographical_region = world_asia_japan diff --git a/common/scripted_effects/07_dlc_ep3_scripted_effects.txt b/common/scripted_effects/07_dlc_ep3_scripted_effects.txt index 9a9f9f9ad..4e827cb57 100644 --- a/common/scripted_effects/07_dlc_ep3_scripted_effects.txt +++ b/common/scripted_effects/07_dlc_ep3_scripted_effects.txt @@ -44,6 +44,124 @@ create_landless_adventurer_title_effect = { $FLAVOR_CHAR$ = { save_scope_as = adventurer_flavor_char } hidden_effect = { random_list = { + #Acclaimed knights become laamps interaction + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_mercenary_accolade_name + } + create_adventurer_title = { + name = accolade_mercenary_accolade_name + holder = scope:new_landless_adventurer + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_mercenary_kings_men_name + } + create_adventurer_title = { + name = accolade_mercenary_kings_men_name + holder = scope:new_landless_adventurer + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_mercenary_knightly_company_name + } + create_adventurer_title = { + name = accolade_mercenary_knightly_company_name + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_honor_band_name + } + create_adventurer_title = { + name = accolade_honor_band_name + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_rulers_swords_name + } + create_adventurer_title = { + name = accolade_rulers_swords_name + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_culture_riders_name + } + create_adventurer_title = { + name = accolade_culture_riders_name + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_free_knights_name + } + create_adventurer_title = { + name = accolade_free_knights_name + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = accolade_culture_company_name + } + create_adventurer_title = { + name = accolade_culture_company_name + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } + 10000 = { + trigger = { + scope:acclaimed_mercenary ?= scope:new_landless_adventurer + has_character_flag = new_laamp_title_name_entered_text + } + create_adventurer_title = { + name = new_laamp_title_name_entered_text + holder = scope:new_landless_adventurer + save_scope_as = new_title + } + } + #Confederation event laamps + 1000 = { + trigger = { + scope:warrior_youth ?= scope:new_landless_adventurer + } + create_adventurer_title = { + name = adventurer_name_free_warriors + holder = scope:new_landless_adventurer + article = DEFAULT_TITLE_NAME_ARTICLE + save_scope_as = new_title + } + } 1000 = { trigger = { scope:warrior_youth ?= scope:new_landless_adventurer @@ -57,7 +175,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_001 holder = scope:new_landless_adventurer @@ -65,7 +183,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { trigger = { exists = scope:new_landless_adventurer_house } @@ -76,7 +194,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_003 holder = scope:new_landless_adventurer @@ -84,7 +202,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_004 holder = scope:new_landless_adventurer @@ -92,7 +210,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { trigger = { NOT = { scope:new_landless_adventurer.culture = culture:kurdish @@ -105,7 +223,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_006 holder = scope:new_landless_adventurer @@ -113,7 +231,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_007 holder = scope:new_landless_adventurer @@ -121,7 +239,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { trigger = { exists = scope:new_landless_adventurer_house } @@ -131,7 +249,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_009 holder = scope:new_landless_adventurer @@ -139,7 +257,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { exists = scope:new_landless_adventurer_location } @@ -150,7 +268,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { exists = scope:new_landless_adventurer_location } @@ -161,7 +279,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { exists = scope:new_landless_adventurer_location } @@ -172,7 +290,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal > 0 } @@ -183,7 +301,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal > 0 } @@ -194,7 +312,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal > 0 } @@ -205,7 +323,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { OR = { has_martial_lifestyle_trait_trigger = yes @@ -224,7 +342,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { OR = { has_martial_lifestyle_trait_trigger = yes @@ -243,7 +361,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value scope:new_landless_adventurer.ai_boldness >= 0 @@ -260,7 +378,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value scope:new_landless_adventurer.ai_greed >= 0 @@ -277,7 +395,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value scope:new_landless_adventurer.ai_compassion >= 0 @@ -294,7 +412,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { exists = scope:new_landless_adventurer_location.county } @@ -308,7 +426,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { create_adventurer_title = { name = adventurer_name_022 holder = scope:new_landless_adventurer @@ -316,7 +434,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { trigger = { exists = scope:new_landless_adventurer_house } @@ -327,7 +445,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { trigger = { scope:new_landless_adventurer.ai_zeal > medium_negative_ai_value scope:new_landless_adventurer.ai_rationality >= 0 @@ -345,7 +463,7 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 7 = { + 3 = { trigger = { scope:new_landless_adventurer.ai_zeal < low_negative_ai_value scope:new_landless_adventurer.ai_compassion < medium_negative_ai_value @@ -357,14 +475,14 @@ create_landless_adventurer_title_effect = { save_scope_as = new_title } } - 10 = { + 5 = { create_adventurer_title = { name = adventurer_name_0026 holder = scope:new_landless_adventurer save_scope_as = new_title } } - 5 = { + 1 = { trigger = { exists = scope:new_landless_adventurer.culture OR = { @@ -459,6 +577,7 @@ create_landless_adventurer_title_effect = { flag:runaway_forbidden = { custom_tooltip = nearby_landless_adventurer_created_message_runaway_forbidden_tt } flag:wanderer = { custom_tooltip = nearby_landless_adventurer_created_message_wanderer_tt } flag:eradicate = { custom_tooltip = nearby_landless_adventurer_created_message_eradicate_tt } + flag:acclaimed_mercenary = { custom_tooltip = nearby_landless_adventurer_created_message_acclaimed_mercenary_tt } fallback = { custom_tooltip = nearby_landless_adventurer_created_message_fallback_tt } } } @@ -547,7 +666,10 @@ create_landless_adventurer_title_effect = { # Give us a couple of starting chars if we're almost completely bereft. if = { limit = { - any_courtier = { count <= 2 } + any_courtier = { + is_adult = yes + count <= 2 + } } trigger_event = { id = ep3_laamps.1001 @@ -565,694 +687,6 @@ create_landless_adventurer_title_effect = { set_variable = flavourise_camp_purpose_wanderers } -create_landless_minority_title_effect = { - save_scope_as = new_landless_minority - if = { - limit = { - NOT = { exists = dynasty } - } - create_dynasty = { - spread_to_descendants = yes - } - } - if = { - limit = { - exists = house - } - house = { save_scope_as = new_landless_minority_house } - } - if = { - limit = { - exists = location - } - location = { save_scope_as = new_landless_minority_location } - } - save_scope_value_as = { - name = minority_creation_reason - value = $REASON$ - } - $FLAVOR_CHAR$ = { save_scope_as = minority_flavor_char } - hidden_effect = { - - create_adventurer_title = { - name = minority_name - holder = scope:new_landless_minority - article = DEFAULT_TITLE_NAME_ARTICLE - government = landless_minority_government - save_scope_as = new_title - } - scope:new_title ?= { - create_landless_minority_title_history_effect = yes - set_variable = { - name = minority_creation_reason - value = scope:minority_creation_reason - } - set_variable = { - name = minority_flavor_char - value = scope:minority_flavor_char - } - } - - scope:new_title = { save_scope_as = new_landless_minority_title } - scope:new_landless_minority = { - if = { - limit = { - NOT = { has_government = landless_minority_government } - } - change_government = landless_minority_government - } - if = { - limit = { - NOT = { has_realm_law = confederate_partition_succession_law } - } - add_realm_law = confederate_partition_succession_law - } - if = { - limit = { - has_realm_law = crown_authority_0 - } - remove_realm_law = crown_authority_0 - } - domicile = { change_provisions = starting_provisions_value } - } - every_player = { - limit = { - NOR = { - root ?= this - this = scope:new_landless_minority - } - OR = { - # Either they're important to us. - is_close_or_extended_family_of = scope:new_landless_minority - is_consort_of = scope:new_landless_minority - has_important_relationship_with_character_trigger = { CHARACTER = scope:new_landless_minority } - # Or they're just close enough. - AND = { - capital_province = { "squared_distance(scope:new_landless_minority.location)" <= squared_distance_medium } - OR = { - top_liege = root.top_liege - any_neighboring_and_across_water_top_liege_realm_owner = { this = root.top_liege } - } - } - } - } - send_interface_message = { - type = msg_landless_minority_nearby - title = nearby_landless_minority_created_message_title - left_icon = scope:new_landless_minority - right_icon = scope:minority_flavor_char - switch = { - trigger = scope:minority_creation_reason - flag:conquest = { custom_tooltip = nearby_landless_minority_created_message_conquest_tt } - flag:conquest_claim = { custom_tooltip = nearby_landless_minority_created_message_conquest_tt } - flag:deposition = { custom_tooltip = nearby_landless_minority_created_message_deposition_tt } - flag:succession = { custom_tooltip = nearby_landless_minority_created_message_succession_tt } - flag:exile = { custom_tooltip = nearby_landless_minority_created_message_exile_tt } - flag:voluntary = { custom_tooltip = nearby_landless_minority_created_message_voluntary_tt } - flag:revocation = { custom_tooltip = nearby_landless_minority_created_message_revocation_tt } - flag:runaway_allowed = { custom_tooltip = nearby_landless_minority_created_message_runaway_allowed_tt } - flag:runaway_forbidden = { custom_tooltip = nearby_landless_minority_created_message_runaway_forbidden_tt } - flag:wanderer = { custom_tooltip = nearby_landless_minority_created_message_wanderer_tt } - flag:eradicate = { custom_tooltip = nearby_landless_minority_created_message_eradicate_tt } - fallback = { custom_tooltip = nearby_landless_minority_created_message_fallback_tt } - } - } - } - } - custom_tooltip = laamp_become_minority_tt - hidden_effect = { - if = { - limit = { - scope:new_landless_minority = { - is_ai = no - } - NOT = { exists = scope:expelled } - } - populate_location_with_contracts_effect = { - AREA_CHAR = scope:new_landless_minority - AMOUNT = 3 - } - } - scope:new_landless_minority = { - every_courtier = { - limit = { - NOR = { - is_close_or_extended_family_of = scope:new_landless_minority - has_relation_lover = scope:new_landless_minority - has_relation_friend = scope:new_landless_minority - is_consort_of = scope:new_landless_minority - } - } - move_to_pool = yes - } - # Give us a couple of starting chars if we're almost completely bereft. - if = { - limit = { - is_ai = no - any_courtier = { count <= 2 } - } - trigger_event = { - id = ep3_laamps.1001 - weeks = { 2 6 } - } - } - else = { - create_character = { - template = pool_repopulate_diplomacy - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = diplomacy_1 - diplomacy = { - min_template_high_skill - max_template_high_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_diplomacy - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = diplomacy_2 - diplomacy = { - min_template_high_skill - max_template_high_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_martial - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = martial_1 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_high_skill - max_template_high_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_martial - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = martial_2 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_high_skill - max_template_high_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_stewardship - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = stewardship_1 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_high_skill - max_template_high_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_stewardship - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = stewardship_2 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_high_skill - max_template_high_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_intrigue - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = intrigue_1 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_high_skill - max_template_high_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_intrigue - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = intrigue_2 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_high_skill - max_template_high_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_learning - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = learning_1 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_high_skill - max_template_high_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_learning - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = learning_2 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_high_skill - max_template_high_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_prowess - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = prowess_1 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_high_skill - max_template_high_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_prowess - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = prowess_2 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_high_skill - max_template_high_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_local_flavor - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = women_1 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_local_flavor - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = women_2 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - create_character = { - template = pool_repopulate_local_flavor - dynasty = none - culture = scope:new_landless_minority.culture - faith = scope:new_landless_minority.faith - location = root.location - save_scope_as = women_3 - diplomacy = { - min_template_average_skill - max_template_average_skill - } - martial = { - min_template_average_skill - max_template_average_skill - } - stewardship = { - min_template_average_skill - max_template_average_skill - } - intrigue = { - min_template_average_skill - max_template_average_skill - } - learning = { - min_template_average_skill - max_template_average_skill - } - prowess = { - min_template_average_skill - max_template_average_skill - } - after_creation = { add_to_list = spawned_chars_list } - } - add_courtier = scope:women_1 - add_courtier = scope:women_2 - add_courtier = scope:women_3 - add_courtier = scope:martial_1 - add_courtier = scope:martial_2 - add_courtier = scope:diplomacy_1 - add_courtier = scope:diplomacy_2 - add_courtier = scope:stewardship_1 - add_courtier = scope:stewardship_2 - add_courtier = scope:learning_1 - add_courtier = scope:learning_2 - add_courtier = scope:intrigue_1 - add_courtier = scope:intrigue_2 - add_courtier = scope:prowess_1 - add_courtier = scope:prowess_2 - } - } - trigger_event = { id = misc.0001 days = 1 } - local_arbitration_boon_change_purpose_effect = yes - } - add_to_global_variable_list = { - name = laamps_tally - target = scope:new_landless_minority.primary_title - } - set_variable = flavourise_camp_purpose_wanderers -} - -destroy_landless_title_no_dlc_effect = { - if = { - limit = { - NOT = { has_dlc_feature = roads_to_power } - game_start_date = $DATE$ - } - holder ?= { - # Clears liquid treasury whenever balance > 0 - empty_treasury_when_abandoning_landed_life_effect = yes - destroy_title = prev - } - } -} - set_landless_government_effect = { if = { limit = { @@ -1373,15 +807,10 @@ destroy_laamp_effect = { # Ironically, we only want to use this effect if you're _not_ admin — it'll reset you nicely to the best government for you, but if you're admin, you should stay admin. if = { limit = { - NOR = { - government_has_flag = government_is_administrative - government_has_flag = government_is_nomadic - government_has_flag = government_is_steppe_admin - government_has_flag = government_is_wanua - government_has_flag = government_is_mandala - government_has_flag = government_is_celestial - government_has_flag = government_is_meritocratic - government_has_flag = government_is_japan_feudal + OR = { + government_has_flag = government_is_clan + government_has_flag = government_is_tribal_excluding_wanua + government_has_flag = government_is_feudal } } admin_government_reset_effect = yes #this only contains Clan, Tribal, Nomadic and Feudal @@ -1480,9 +909,17 @@ ep3_become_landed_save_liege_effect = { } scope:ruler = { save_scope_as = new_liege } } + scope:new_liege.government_type ?= { + save_scope_as = old_government + } } ep3_become_landed_transfer_effect = { + ordered_in_list = { + list = $TITLE_LIST$ + order_by = tier + save_scope_as = new_primary_title + } hidden_effect = { # Liquidate camp $TITLE_RECEIVER$ = { laamp_clear_domicile_buildings_liquidator_effect = yes } @@ -1504,7 +941,7 @@ ep3_become_landed_transfer_effect = { } set_variable = { # Used to prevent invalid NF creation name = laamp_invasion_flag - value = scope:target + value = scope:new_primary_title days = 1 } } @@ -1513,10 +950,10 @@ ep3_become_landed_transfer_effect = { add_claim_on_loss = yes save_scope_as = title_change } - scope:target.holder ?= { save_scope_as = old_holder } + scope:new_primary_title.holder ?= { save_scope_as = old_holder } if = { limit = { NOT = { exists = scope:old_holder } } - scope:target = { + scope:new_primary_title = { ordered_de_jure_county = { limit = { holder.top_liege = scope:defender.top_liege } order_by = development_level @@ -1529,71 +966,8 @@ ep3_become_landed_transfer_effect = { limit = { NOT = { exists = scope:government_giver } } scope:old_holder = { save_scope_as = government_giver } } - scope:government_giver ?= { - switch = { - trigger = government_has_flag - government_is_administrative = { - save_scope_value_as = { name = old_government value = flag:admin } - } - government_is_feudal = { - save_scope_value_as = { name = old_government value = flag:feudal } - } - government_is_clan = { - save_scope_value_as = { name = old_government value = flag:clan } - } - government_is_tribal = { - save_scope_value_as = { name = old_government value = flag:tribal } - } - government_is_republic = { - if = { - limit = { - scope:government_giver ?= { ep3_is_clan_inclined_trigger = yes } - } - save_scope_value_as = { name = old_government value = flag:clan } - } - else = { - save_scope_value_as = { name = old_government value = flag:feudal } - } - } - government_is_theocracy = { - if = { - limit = { - scope:government_giver ?= { ep3_is_clan_inclined_trigger = yes } - } - save_scope_value_as = { name = old_government value = flag:clan } - } - else = { - save_scope_value_as = { name = old_government value = flag:feudal } - } - } - government_is_wanua = { - save_scope_value_as = { name = old_government value = flag:wanua } - } - government_is_nomadic = { - save_scope_value_as = { name = old_government value = flag:nomad } - } - government_is_herder = { - save_scope_value_as = { name = old_government value = flag:nomad } - } - government_is_celestial = { - save_scope_value_as = { name = old_government value = flag:celestial } - } - government_is_steppe_admin = { - save_scope_value_as = { name = old_government value = flag:steppe_admin } - } - government_is_meritocratic = { - save_scope_value_as = { name = old_government value = flag:meritocratic } - } - government_is_japan_administrative = { - save_scope_value_as = { name = old_government value = flag:japan_administrative } - } - government_is_japan_feudal = { - save_scope_value_as = { name = old_government value = flag:japan_feudal } - } - government_is_mandala = { - save_scope_value_as = { name = old_government value = flag:mandala } - } - } + scope:government_giver.government_type ?= { + save_scope_as = old_government } if = { limit = { @@ -1612,18 +986,13 @@ ep3_become_landed_transfer_effect = { } scope:new_primary_title ?= { ordered_de_jure_county = { - limit = { holder = scope:defender } - alternative_limit = { holder.top_liege = scope:defender.top_liege } + limit = { holder = scope:old_holder } + alternative_limit = { holder.top_liege = scope:old_holder.top_liege } order_by = development_level save_scope_as = new_capital } } } - ordered_in_list = { - list = $TITLE_LIST$ - order_by = tier - save_scope_as = new_primary_title - } $TITLE_RECEIVER$ = { if = { limit = { @@ -1643,24 +1012,29 @@ ep3_become_landed_transfer_effect = { } } } - scope:new_primary_title ?= { - every_de_jure_county = { - limit = { - NOT = { is_in_list = $TITLE_LIST$ } - trigger_if = { - limit = { exists = scope:defender } - holder.top_liege ?= scope:defender.top_liege + if = { + limit = { + NOT = { scope:ascended_throne_value = flag:purchased } + } + scope:new_primary_title ?= { + every_de_jure_county = { + limit = { + NOT = { is_in_list = $TITLE_LIST$ } + trigger_if = { + limit = { exists = scope:defender } + holder.top_liege ?= scope:defender.top_liege + } + trigger_if = { + limit = { exists = scope:new_liege } + holder.top_liege ?= scope:new_liege.top_liege + } } - trigger_if = { - limit = { exists = scope:new_liege } - holder.top_liege ?= scope:new_liege.top_liege + change_title_holder_include_vassals = { + holder = $TITLE_RECEIVER$ + change = scope:title_change + take_baronies = no } } - change_title_holder_include_vassals = { - holder = $TITLE_RECEIVER$ - change = scope:title_change - take_baronies = no - } } } every_in_list = { @@ -1692,7 +1066,7 @@ ep3_become_landed_transfer_effect = { } } if = { - limit = { has_character_flag = special_laamp_char } + limit = { $TITLE_RECEIVER$ = { has_character_flag = special_laamp_char } } resolve_title_and_vassal_change = scope:title_change # Then we resolve vassalage separately, so that we can lock in tiers. create_title_and_vassal_change = { @@ -1721,334 +1095,182 @@ ep3_become_landed_transfer_effect = { } else_if = { limit = { top_liege != this } - becomes_independent = { change = scope:title_change } + $TITLE_RECEIVER$ = { becomes_independent = { change = scope:title_change } } } resolve_title_and_vassal_change = scope:title_change - # Because target may be either a title or a character, we check if a scope value has been set up in advance if this is being called from the Seize Realm scheme specifically if = { - limit = { exists = scope:old_government_type } - scope:old_government_type = { save_scope_as = old_government } + limit = { + $REASON$ = flag:purchased + any_in_list = { + list = purchase_land_vassals_taken + always = yes + } + } + create_title_and_vassal_change = { + type = $TYPE$ + add_claim_on_loss = yes + save_scope_as = purchase_land_vassal_change + } + every_in_list = { + list = purchase_land_vassals_taken + change_liege = { + liege = $TITLE_RECEIVER$ + change = scope:purchase_land_vassal_change + } + } + resolve_title_and_vassal_change = scope:purchase_land_vassal_change } # Set government type - if = { - limit = { exists = scope:old_government } - # We don't expect to actually trigger most of the below, as most are not valid targets to begin with, but all are included for completeness and mod support - switch = { - trigger = scope:old_government - flag:feudal = { - change_government = feudal_government - } - flag:republic = { - change_government = republic_government - } - flag:theocracy = { - change_government = theocracy_government - } - flag:clan = { - change_government = clan_government - } - flag:tribal = { - change_government = tribal_government - } - flag:wanua = { - change_government = wanua_government - } - flag:holy_order = { - change_government = holy_order_government - } - flag:administrative = { - change_government = administrative_government - } - flag:nomad = { - #Did you demand a herder's pastureland? - if = { - limit = { - scope:new_capital.title_province = { - has_holding = yes - NOT = { has_holding_type = nomad_holding } - } - } - scope:new_capital.title_province = { set_holding_type = nomad_holding } - } - change_government = nomad_government - } - flag:herder = { - change_government = herder_government - } - flag:celestial = { - change_government = celestial_government - } - flag:mandala = { - if = { - limit = { - faith ?= { has_doctrine = doctrine_polytheist } - } - change_government = mandala_government - #Sort out the House shenanigans + $TITLE_RECEIVER$ = { + if = { + limit = { exists = scope:old_government } + # We don't expect to actually trigger most of the below, as most are not valid targets to begin with, but all are included for completeness and mod support + switch = { + trigger = scope:old_government + government_type:nomad_government = { + #Did you demand a herder's pastureland? if = { - limit = { is_house_head = no } - house = { - if = { - limit = { - house_head = { - is_landed = no - is_courtier_of = root + limit = { + scope:new_capital.title_province = { + has_holding = yes + NOT = { has_holding_type = nomad_holding } + } + } + scope:new_capital.title_province = { set_holding_type = nomad_holding } + } + change_government = nomad_government + } + government_type:mandala_government = { + if = { + limit = { + faith = { has_doctrine = doctrine_polytheist } + } + change_government = mandala_government + #Sort out the House shenanigans + if = { + limit = { is_house_head = no } + house = { + if = { + limit = { + house_head = { + is_landed = no + is_courtier_of = root + } } + set_house_head = root } - set_house_head = root + } + } + else = { + house ?= { + set_house_aspiration = { type = no_aspect } } } } else = { - house ?= { - set_house_aspiration = { type = no_aspect } - } + assign_feudal_governments_effect = yes } } - else = { + government_type:japan_administrative_government = { if = { - limit = { ep3_is_clan_inclined_trigger = yes } - change_government = clan_government + limit = { + scope:new_liege ?= { has_government = japan_administrative_government } + } + change_government = japan_administrative_government } else = { change_government = feudal_government } } - } - flag:steppe_admin = { - change_government = steppe_admin_government - } - flag:meritocratic = { - change_government = meritocratic_government - } - flag:japan_feudal = { - change_government = japan_feudal_government - } - flag:japan_administrative = { - if = { - limit = { - scope:new_liege ?= { has_government = japan_administrative_government } - } - change_government = japan_administrative_government + fallback = { + change_government = scope:old_government } - else = { change_government = feudal_government } } } - } - # Otherwise we proceed as normal - else = { - $TITLE_RECEIVER$ = { + # Otherwise we proceed as normal + else = { # Change our government according to the government of our liege. - ## Nomad. + assign_new_government_effect = yes + # Ennobled adventurer penalties if = { - limit = { - OR = { - government_has_flag = government_is_nomadic - scope:new_liege ?= { government_has_flag = government_is_nomadic } - scope:old_government ?= flag:nomad - scope:new_capital.title_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - } - } - hidden_effect = { - every_held_title = { - limit = { - tier = tier_county - title_province = { has_holding_type = herder_holding } - } - title_province = { set_holding_type = nomad_holding } - } - } - change_government = nomad_government - } - ## Soryo. - else_if = { - limit = { - OR = { - scope:new_liege ?= { government_has_flag = government_is_japan_feudal } - scope:old_government ?= flag:japan_feudal - } - } - change_government = japan_feudal_government - } - ## Administrative. - else_if = { - limit = { - OR = { - scope:old_government ?= flag:admin - scope:old_government ?= flag:celestial - scope:old_government ?= flag:steppe_admin - scope:old_government ?= flag:meritocratic - scope:old_government ?= flag:japan_administrative - scope:new_liege ?= { government_allows = administrative } - } - } - change_to_administrative_effect = yes - } - ## Clan. - else_if = { - limit = { - OR = { - scope:new_liege ?= { government_has_flag = government_is_clan } - scope:old_government ?= flag:clan - AND = { - ep3_is_clan_inclined_trigger = yes - top_liege = this - } - } - } - change_government = clan_government - } - ## Republic. - else_if = { - limit = { - scope:new_liege ?= { government_has_flag = government_is_republic } - } + limit = { $ENNOBLED_ADVENTURER$ = flag:yes } if = { limit = { - scope:new_liege ?= { ep3_is_clan_inclined_trigger = yes } - } - change_government = clan_government - } - else = { change_government = feudal_government } - } - ## Tribal. - else_if = { - limit = { - OR = { - scope:new_liege ?= { government_has_flag = government_is_tribal } - scope:old_government ?= flag:tribal - } - } - change_government = tribal_government - } - ## Wanua. - else_if = { - limit = { - OR = { - scope:new_liege ?= { government_has_flag = government_is_wanua } - scope:old_government ?= flag:wanua - } - } - change_government = wanua_government - } - ## Mandala. - else_if = { - limit = { - OR = { - scope:new_liege ?= { government_has_flag = government_is_mandala } - #scope:old_government ?= flag:mandala - scope:target.holder = { government_has_flag = government_is_mandala } - } - faith ?= { has_doctrine = doctrine_polytheist } - } - change_government = mandala_government - #Sort out the House shenanigans - hidden_effect = { - if = { - limit = { is_house_head = no } - house = { - if = { - limit = { - house_head = { - is_landed = no - is_courtier_of = $TITLE_RECEIVER$ - } + calc_true_if = { + amount = 3 + prestige_level <= 3 + scope:new_capital.culture ?= { + NOR = { + $TITLE_RECEIVER$.culture ?= this + $TITLE_RECEIVER$.primary_spouse.culture ?= this + $TITLE_RECEIVER$.primary_heir.culture ?= this } - set_house_head = $TITLE_RECEIVER$ } + scope:new_capital.faith != faith } } - else = { - house ?= { - set_house_aspiration = { type = no_aspect } - } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_3 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_3 + years = 30 } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules } - } - ## Else feudal. - else = { - change_government = feudal_government - } - } - # Ennobled adventurer penalties - if = { - limit = { $ENNOBLED_ADVENTURER$ = flag:yes } - if = { - limit = { - calc_true_if = { - amount = 3 - prestige_level <= 3 - scope:new_capital.culture ?= { - NOR = { - $TITLE_RECEIVER$.culture ?= this - $TITLE_RECEIVER$.primary_spouse.culture ?= this - $TITLE_RECEIVER$.primary_heir.culture ?= this + else_if = { + limit = { + calc_true_if = { + amount = 2 + prestige_level <= 3 + scope:new_capital.culture ?= { + NOR = { + $TITLE_RECEIVER$.culture ?= this + $TITLE_RECEIVER$.primary_spouse.culture ?= this + $TITLE_RECEIVER$.primary_heir.culture ?= this + } } + scope:new_capital.faith != faith } - scope:new_capital.faith != faith } + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_2 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_2 + years = 20 + } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules } - custom_tooltip = ep3_ennobled_adventurer_modifier_reason_3 - add_character_modifier = { - modifier = ep3_ennobled_adventurer_modifier_3 - years = 30 - } - custom_tooltip = ep3_ennobled_adventurer_modifier_rules - } - else_if = { - limit = { - calc_true_if = { - amount = 2 - prestige_level <= 3 - scope:new_capital.culture ?= { - NOR = { - $TITLE_RECEIVER$.culture ?= this - $TITLE_RECEIVER$.primary_spouse.culture ?= this - $TITLE_RECEIVER$.primary_heir.culture ?= this + else_if = { + limit = { + calc_true_if = { + amount = 1 + prestige_level <= 3 + scope:new_capital.culture ?= { + NOR = { + $TITLE_RECEIVER$.culture ?= this + $TITLE_RECEIVER$.primary_spouse.culture ?= this + $TITLE_RECEIVER$.primary_heir.culture ?= this + } } + scope:new_capital.faith != faith } - scope:new_capital.faith != faith } - } - custom_tooltip = ep3_ennobled_adventurer_modifier_reason_2 - add_character_modifier = { - modifier = ep3_ennobled_adventurer_modifier_2 - years = 20 - } - custom_tooltip = ep3_ennobled_adventurer_modifier_rules - } - else_if = { - limit = { - calc_true_if = { - amount = 1 - prestige_level <= 3 - scope:new_capital.culture ?= { - NOR = { - $TITLE_RECEIVER$.culture ?= this - $TITLE_RECEIVER$.primary_spouse.culture ?= this - $TITLE_RECEIVER$.primary_heir.culture ?= this - } - } - scope:new_capital.faith != faith + custom_tooltip = ep3_ennobled_adventurer_modifier_reason_1 + add_character_modifier = { + modifier = ep3_ennobled_adventurer_modifier_1 + years = 10 } + custom_tooltip = ep3_ennobled_adventurer_modifier_rules } - custom_tooltip = ep3_ennobled_adventurer_modifier_reason_1 - add_character_modifier = { - modifier = ep3_ennobled_adventurer_modifier_1 - years = 10 - } - custom_tooltip = ep3_ennobled_adventurer_modifier_rules } } } destroy_laamp_effect = { ADVENTURER = $TITLE_RECEIVER$ } - # Setup NF if valid - if = { - limit = { government_allows = noble_families } - give_new_noble_family_title_effect = yes + $TITLE_RECEIVER$ = { + # Setup NF if valid + if = { + limit = { + government_has_mechanic = administrative + government_allows = noble_families + } + give_new_noble_family_title_effect = yes + } } } @@ -2139,12 +1361,11 @@ purchase_land_interaction_effect = { TITLE_LIST = purchased_titles } # Purchase land specific + # actual give recipient the gold scope:actor = { - show_as_tooltip = { - pay_short_term_gold = { - gold = scope:purchase_land_cost - target = scope:recipient - } + pay_short_term_gold = { + gold = scope:purchase_land_cost + target = scope:recipient } } # Resolve title, liege, government changes @@ -2157,7 +1378,7 @@ purchase_land_interaction_effect = { } # Extra purchase land specific scope:actor = { - stress_impact = { + stress_and_fulfillment_impact = { greedy = minor_stress_impact_gain lazy = minor_stress_impact_loss } @@ -2186,7 +1407,7 @@ purchase_land_interaction_effect = { limit = { scope:recipient = { government_has_flag = government_is_mandala } #... we're lenient - faith ?= { has_doctrine = doctrine_polytheist } + faith = { has_doctrine = doctrine_polytheist } } #Sort out the House shenanigans hidden_effect = { @@ -2217,7 +1438,7 @@ purchase_land_interaction_effect = { } } } - +# not used. note check consistency with purchase_land_interaction etc to make sure actor do lose gold ONCE purchase_land_interaction_shortened_effect = { scope:actor = { if = { @@ -2236,7 +1457,7 @@ purchase_land_interaction_shortened_effect = { } } scope:actor = { - stress_impact = { + stress_and_fulfillment_impact = { humble = minor_stress_impact_gain lazy = minor_stress_impact_loss } @@ -2411,13 +1632,18 @@ procure_estate_interaction_effect = { # Note our courtiers so that they don't escape. every_courtier = { add_to_list = courtiers_list } # Change liege - destroy_laamp_effect = { ADVENTURER = scope:actor } - hidden_effect = { - scope:recipient.top_liege = { - add_courtier = scope:actor - return_to_court = yes + save_scope_as = keep_title + every_held_title = { + limit = { + has_variable = adventurer_creation_reason } + add_to_list = titles_list } + set_variable = { + name = laamp_transition + days = 1 # removing it in this effect will still fire game over + } + destroy_laamp_effect = { ADVENTURER = scope:actor } create_noble_family_effect = { GOVERNMENT_GIVER = scope:recipient } hidden_effect = { # Return any escaped courtiers. @@ -2466,6 +1692,10 @@ procure_estate_interaction_effect = { modifier = ep3_administrative_outsider_modifier years = 15 } + every_in_list = { + list = titles_list + prev = { destroy_title = prev } + } } scope:recipient.top_liege = { if = { @@ -2564,8 +1794,28 @@ negotiate_settlement_interaction_effect = { } # Effects on land giver scope:actor = { - add_legitimacy = scope:negotiate_settlement_legitimacy_cost - stress_impact = { + if = { + limit = { + NOT = { exists = scope:negotiate_settlement_legitimacy_cost } + } + save_scope_value_as = { + name = negotiate_settlement_legitimacy_cost + value = { + value = 0 + every_in_list = { + list = offered_titles + if = { + limit = { tier = tier_county } + add = -25 + } + else = { add = -50 } + } + multiply = scope:actor.highest_held_title_tier + } + } + } + add_legitimacy_effect = { LEGITIMACY = scope:negotiate_settlement_legitimacy_cost } + stress_and_fulfillment_impact = { greedy = minor_stress_impact_gain vengeful = minor_stress_impact_gain } @@ -2686,7 +1936,7 @@ ep3_laamp_supporter_invalidated_effect = { send_interface_message = { type = event_landless_adventurer_neutral title = ep3_laamp_sponsor_invalidated_title - left_icon = scope:attacker + left_icon = scope:adventurer right_icon = scope:war_target remove_variable = adventurer_invasion_supportee remove_variable = adventurer_invasion_target @@ -2695,7 +1945,7 @@ ep3_laamp_supporter_invalidated_effect = { limit = { exists = var:adventurer_invasion_join_war } set_variable = { name = adventurer_invasion_join_war - value = scope:actor + value = scope:adventurer years = 5 } } @@ -2703,7 +1953,7 @@ ep3_laamp_supporter_invalidated_effect = { limit = { exists = var:adventurer_invasion_request_soldiers } set_variable = { name = adventurer_invasion_request_soldiers - value = scope:actor + value = scope:adventurer years = 5 } } @@ -3074,7 +2324,7 @@ adventurer_realm_destabilisation_list_effect = { } trigger_if = { limit = { - government_allows = administrative + government_has_mechanic = administrative } scope:title = { OR = { @@ -3098,7 +2348,7 @@ adventurer_realm_destabilisation_list_effect = { abs = yes divide = 5 } - culture ?= { + culture = { this != scope:adventurer.culture cultural_acceptance = { target = scope:adventurer.culture @@ -3118,14 +2368,14 @@ adventurer_realm_destabilisation_list_effect = { max = 25 } ai_zeal > low_positive_zeal - faith ?= { + faith = { this != scope:adventurer.faith "faith_hostility_level(scope:adventurer.faith)" > 0 } } modifier = { # Theocatic Vassals of different faith more likely factor = 2 - has_government = theocracy_government + government_has_flag = government_is_theocracy faith != scope:adventurer.faith } ### DISTANCE @@ -3632,6 +2882,8 @@ points_of_interest_tracker_effect = { OR = { # Building flags has_any_point_of_interest_flag = yes + # Holy sites with an enshrined artifact but no religious POI building + has_travel_point_of_interest = poi_standalone_holy_site # Capitals AND = { province_owner.top_liege.capital_province ?= this @@ -3852,13 +3104,13 @@ bandit_king_maa_spawn_effect = { } spawn_army = { men_at_arms = { - type = maa_thieves + type = maa_marauders stacks = var:maa_number } inheritable = no uses_supply = yes location = scope:bandit_king.location - name = ep3_bandits_army + name = ep3_poachers_army } } 1 = { @@ -4015,141 +3267,190 @@ create_noble_family_effect = { debug_log = create_noble_family_title save_scope_as = new_noble_family_holder $GOVERNMENT_GIVER$ = { save_scope_as = government_giver } - hidden_effect = { # NF can only be held by house heads - if = { # Start by checking that we are not the house head already - limit = { - exists = house.house_head - NOT = { house.house_head = scope:new_noble_family_holder } - } - if = { # If not, let's see if it would be reasonable to become house head... - limit = { - house.house_head ?= { - is_ai = yes # Don't steal house head from a player - OR = { - # Within same realm but less important - AND = { - top_liege = scope:new_noble_family_holder.top_liege - OR = { - is_ruler = no - highest_held_title_tier < scope:new_noble_family_holder.highest_held_title_tier - } - } - # Wanderer - NOT = { exists = liege } - } - } - } - house = { set_house_head = scope:new_noble_family_holder } - } - else = { # ... Otherwise, we create a cadet branch - create_cadet_branch = {} - } - } - } - scope:government_giver = { + if = { + limit = { scope:government_giver ?= { government_allows = noble_families } } if = { limit = { - scope:new_noble_family_holder = { - NOT = { - any_held_title = { is_noble_family_title = yes } + is_ruler = no + } + if = { + limit = { + scope:government_giver = { is_ruler = yes } + } + scope:government_giver = { + if = { + limit = { + highest_held_title_tier <= tier_duchy + } + top_liege = { + save_scope_as = liege + } + } + else = { + save_scope_as = liege } } } - switch = { - trigger = has_government - japan_administrative_government = { # Japan has count level NFs + else = { + liege_or_court_owner ?= { + save_scope_as = liege + } + } + } + hidden_effect = { # NF can only be held by house heads + if = { # Start by checking that we are not the house head already + limit = { + exists = house.house_head + NOT = { house.house_head = scope:new_noble_family_holder } + } + if = { # If not, let's see if it would be reasonable to become house head... + limit = { + house.house_head ?= { + is_ai = yes # Don't steal house head from a player + OR = { + # Within same realm but less important + AND = { + top_liege = scope:new_noble_family_holder.top_liege + OR = { + is_ruler = no + highest_held_title_tier < scope:new_noble_family_holder.highest_held_title_tier + } + } + # Wanderer + NOT = { exists = liege } + } + } + } + house = { set_house_head = scope:new_noble_family_holder } + } + else = { # ... Otherwise, we create a cadet branch + create_cadet_house_with_name_effect = yes + } + } + } + scope:government_giver = { + if = { + limit = { scope:new_noble_family_holder = { - give_noble_family_title = { - name = noble_family_name - tier = county - article = DEFAULT_TITLE_NAME_ARTICLE - government = japan_administrative_government - save_scope_as = new_title + NOT = { + any_held_title = { is_noble_family_title = yes } } } } - japan_feudal_government = { # Japan has count level NFs - scope:new_noble_family_holder = { - give_noble_family_title = { - name = noble_family_name - tier = county - article = DEFAULT_TITLE_NAME_ARTICLE - government = japan_feudal_government - save_scope_as = new_title + switch = { + trigger = has_government + japan_administrative_government = { # Japan has count level NFs + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = japan_administrative_government + save_scope_as = new_title + } } } - } - celestial_government = { # China has different government - scope:new_noble_family_holder = { - give_noble_family_title = { - name = noble_family_name - tier = county - article = DEFAULT_TITLE_NAME_ARTICLE - government = celestial_government - save_scope_as = new_title - } - trigger_event = { - id = tgp_china_career.0001 - days = { 2 5 } + japan_feudal_government = { # Japan has count level NFs + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = japan_feudal_government + save_scope_as = new_title + } } } - } - meritocratic_government = { # Meritocratic has different government - scope:new_noble_family_holder = { - give_noble_family_title = { - name = noble_family_name - tier = county - article = DEFAULT_TITLE_NAME_ARTICLE - government = meritocratic_government - save_scope_as = new_title + celestial_government = { # China has different government + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = celestial_government + save_scope_as = new_title + } + trigger_event = { + id = tgp_china_career.0001 + days = { 2 5 } + } } } - } - steppe_admin_government = { # Steppe Admin has different government - scope:new_noble_family_holder = { - give_noble_family_title = { - name = noble_family_name - tier = county - article = DEFAULT_TITLE_NAME_ARTICLE - government = steppe_admin_government - save_scope_as = new_title + meritocratic_government = { # Meritocratic has different government + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = meritocratic_government + save_scope_as = new_title + } } } - } - fallback = { - scope:new_noble_family_holder = { - give_noble_family_title = { - name = noble_family_name - tier = duchy - article = DEFAULT_TITLE_NAME_ARTICLE - government = administrative_government - save_scope_as = new_title + steppe_admin_government = { # Steppe Admin has different government + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = county + article = DEFAULT_TITLE_NAME_ARTICLE + government = steppe_admin_government + save_scope_as = new_title + } + } + } + fallback = { + scope:new_noble_family_holder = { + give_noble_family_title = { + name = noble_family_name + tier = duchy + article = DEFAULT_TITLE_NAME_ARTICLE + government = administrative_government + save_scope_as = new_title + } } } } } - } - scope:new_title.holder ?= { - save_scope_as = noble_family_head - scope:new_title = { set_coa = scope:noble_family_head.house } - } - custom_description = { text = create_noble_family_tt } + scope:new_title.holder ?= { + save_scope_as = noble_family_head + scope:new_title = { set_coa = scope:noble_family_head.house } + if = { + limit = { + is_landed = no + exists = scope:liege + scope:liege.highest_held_title_tier > highest_held_title_tier + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + } + change_liege = { + liege = scope:liege + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + } + custom_description = { text = create_noble_family_tt } - #Notifications - every_player = { - limit = { - top_liege = scope:new_noble_family_holder.top_liege - this != scope:new_noble_family_holder - # China has hundreds of Noble Families, it gets spammy - NOT = { government_allows = merit } - } - trigger_event = { - id = ep3_emperor_yearly.2410 - days = 1 + #Notifications + every_player = { + limit = { + top_liege = scope:new_noble_family_holder.top_liege + this != scope:new_noble_family_holder + # China has hundreds of Noble Families, it gets spammy + NOT = { government_allows = merit } + } + trigger_event = { + id = ep3_emperor_yearly.2410 + days = 1 + } } } } - + else = { + debug_log = "try create NF title but goverment does not allow" + } debug_log_scopes = yes } @@ -4613,6 +3914,7 @@ admin_change_government_effect = { if = { limit = { is_landed = no + NOT = { top_liege = { government_allows = noble_families } } any_held_title = { is_noble_family_title = yes } @@ -4640,7 +3942,7 @@ admin_change_government_effect = { liege = { government_has_flag = government_is_clan } AND = { liege = { government_has_flag = government_is_tribal } - religion = religion:islam_religion + ep3_is_clan_inclined_trigger = yes } } } @@ -4653,8 +3955,8 @@ admin_change_government_effect = { OR = { liege = { government_has_flag = government_is_japan_feudal } AND = { - liege = { government_has_flag = government_is_japan_feudal } - NOT = { religion = religion:islam_religion } + liege = { government_has_flag = government_is_tribal } + ep3_is_clan_inclined_trigger = no } } } @@ -4668,7 +3970,7 @@ admin_change_government_effect = { liege = { government_has_flag = government_is_feudal } AND = { liege = { government_has_flag = government_is_tribal } - NOT = { religion = religion:islam_religion } + ep3_is_clan_inclined_trigger = no } } } @@ -4678,7 +3980,7 @@ admin_change_government_effect = { else_if = { limit = { top_liege = this - faith ?= { religion_tag = islam_religion } + ep3_is_clan_inclined_trigger = yes } change_government = clan_government } @@ -4688,6 +3990,7 @@ admin_change_government_effect = { # Finally, let's double-check and see if there are any remaining family titles we should destroy if = { limit = { + NOT = { government_allows = noble_families } any_held_title = { is_noble_family_title = yes } @@ -4711,7 +4014,7 @@ ep3_dynasty_legacy_add_legitimacy_effect = { if = { limit = { scope:host = { - government_allows = administrative + government_has_mechanic = administrative OR = { dynasty = { has_dynasty_perk = ep3_administrative_legacy_3 } top_participant_group:dynastic_cycle ?= { @@ -4766,7 +4069,7 @@ ep3_dynasty_legacy_add_legitimacy_effect = { } if = { limit = { - primary_title.tier = tier_empire + primary_title.tier >= tier_empire } send_interface_toast = { type = event_toast_effect_good @@ -4799,75 +4102,75 @@ ep3_dynasty_legacy_add_legitimacy_effect = { # Byzantium ################################################## -remove_a_criminal_trait_in_faith_effect = { +remove_a_criminal_trait_in_rite_effect = { $CHARACTER$ = { if = { limit = { has_trait = adulterer - trait_is_criminal_in_faith_trigger = { TRAIT = trait:adulterer FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:adulterer RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = adulterer } else_if = { limit = { has_trait = fornicator - trait_is_criminal_in_faith_trigger = { TRAIT = trait:fornicator FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:fornicator RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = fornicator } else_if = { limit = { has_trait = sodomite - trait_is_criminal_in_faith_trigger = { TRAIT = trait:sodomite FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:sodomite RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = sodomite } else_if = { limit = { has_trait = deviant - trait_is_criminal_in_faith_trigger = { TRAIT = trait:deviant FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:deviant RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = deviant } else_if = { limit = { has_trait = kinslayer_3 - trait_is_criminal_in_faith_trigger = { TRAIT = trait:kinslayer_3 FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:kinslayer_3 RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = kinslayer_3 } else_if = { limit = { has_trait = kinslayer_2 - trait_is_criminal_in_faith_trigger = { TRAIT = trait:kinslayer_2 FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:kinslayer_2 RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = kinslayer_2 } else_if = { limit = { has_trait = kinslayer_1 - trait_is_criminal_in_faith_trigger = { TRAIT = trait:kinslayer_1 FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:kinslayer_1 RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = kinslayer_1 } else_if = { limit = { has_trait = witch - trait_is_criminal_in_faith_trigger = { TRAIT = trait:witch FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:witch RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = witch } else_if = { limit = { has_trait = cannibal - trait_is_criminal_in_faith_trigger = { TRAIT = trait:cannibal FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:cannibal RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = cannibal } else_if = { limit = { has_trait = incestuous - trait_is_criminal_in_faith_trigger = { TRAIT = trait:incestuous FAITH = $FAITH$ GENDER_CHARACTER = $CHARACTER$ } + trait_is_criminal_in_rite_trigger = { TRAIT = trait:incestuous RITE = $RITE$ GENDER_CHARACTER = $CHARACTER$ } } remove_trait = incestuous } @@ -6184,7 +5487,7 @@ disburse_chariot_race_activity_host_rewards = { add_legitimacy = miniscule_legitimacy_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = major_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6201,7 +5504,7 @@ disburse_chariot_race_activity_host_rewards = { add_legitimacy = 5 if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = medium_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6231,7 +5534,7 @@ disburse_chariot_race_activity_host_rewards = { add_legitimacy = minor_legitimacy_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = massive_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6252,7 +5555,7 @@ disburse_chariot_race_activity_host_rewards = { add_legitimacy = 10 if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = major_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6288,7 +5591,7 @@ disburse_chariot_race_activity_host_rewards = { add_legitimacy = medium_legitimacy_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = monumental_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6308,7 +5611,7 @@ disburse_chariot_race_activity_host_rewards = { add_legitimacy = miniscule_legitimacy_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = miniscule_stress_loss athletic = massive_stress_loss gregarious = miniscule_stress_loss @@ -6329,6 +5632,7 @@ disburse_chariot_race_activity_host_rewards = { } } } + pam_vows_of_poverty_host_completion_piety_effect = yes } disburse_chariot_race_activity_spectator_rewards = { @@ -6364,7 +5668,7 @@ disburse_chariot_race_activity_spectator_rewards = { change_influence = monumental_influence_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = monumental_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6381,7 +5685,7 @@ disburse_chariot_race_activity_spectator_rewards = { change_influence = massive_influence_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = massive_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6398,7 +5702,7 @@ disburse_chariot_race_activity_spectator_rewards = { change_influence = major_influence_gain if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = massive_stress_loss athletic = miniscule_stress_loss gregarious = miniscule_stress_loss @@ -6407,7 +5711,7 @@ disburse_chariot_race_activity_spectator_rewards = { } else_if = { limit = { has_activity_intent = reduce_stress_intent } - stress_impact = { + stress_and_fulfillment_impact = { base = miniscule_stress_loss athletic = major_stress_loss gregarious = miniscule_stress_loss @@ -7821,7 +7125,7 @@ ep3_child_castration_effect = { if = { limit = { scope:actor = { - is_landed_or_landless_administrative = yes + government_has_mechanic = administrative } } custom_tooltip = castration_governor_efficiency @@ -7898,7 +7202,7 @@ ep3_youth_castration_effect = { if = { limit = { scope:actor = { - is_landed_or_landless_administrative = yes + government_has_mechanic = administrative } } custom_tooltip = castration_governor_efficiency @@ -7964,7 +7268,7 @@ ep3_youth_castration_effect = { } ep3_greek_fire_success_effect = { - scope:invading_commander = { + scope:invading_commander ?= { add_character_modifier = { modifier = ravaged_by_greek_fire_modifier years = 1 @@ -7974,7 +7278,7 @@ ep3_greek_fire_success_effect = { scope:army = { deplete_army_by_percentage = 0.9 } - scope:invading_commander = { + scope:invader ?= { custom_tooltip = two_knights_killed_tooltip hidden_effect = { scope:knight_1 ?= { @@ -8003,11 +7307,10 @@ ep3_greek_fire_success_effect = { } } } - } ep3_greek_fire_fail_effect = { - scope:invading_commander = { + scope:invading_commander ?= { add_character_modifier = { modifier = assaulted_by_greek_fire_modifier years = 1 @@ -8023,7 +7326,7 @@ ep3_greek_fire_fail_effect = { scope:army = { deplete_army_by_percentage = 0.4 } - scope:invading_commander = { + scope:invader ?= { custom_tooltip = two_knights_wounded_tooltip hidden_effect = { scope:knight_2 ?= { @@ -8037,7 +7340,7 @@ ep3_greek_fire_fail_effect = { } ep3_greek_fire_crit_fail_effect = { - scope:invading_commander = { + scope:invading_commander ?= { add_character_modifier = { modifier = assaulted_by_greek_fire_modifier years = 1 @@ -8046,7 +7349,7 @@ ep3_greek_fire_crit_fail_effect = { scope:army = { deplete_army_by_percentage = 0.1 } - scope:invading_commander = { + scope:invader ?= { custom_tooltip = two_knights_wounded_tooltip hidden_effect = { scope:knight_1 ?= { @@ -8086,115 +7389,119 @@ save_traveler_culture_effect = { OR = { AND = { culture_overlaps_geographical_region = world_europe - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_europe } + scope:traveler_culture = { culture_overlaps_geographical_region = world_europe } } AND = { culture_overlaps_geographical_region = world_asia_minor - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_europe } + scope:traveler_culture = { culture_overlaps_geographical_region = world_europe } } AND = { culture_overlaps_geographical_region = world_europe - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_minor } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_minor } } AND = { culture_overlaps_geographical_region = world_asia_minor - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_minor } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_minor } } AND = { culture_overlaps_geographical_region = world_asia_minor - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_middle_east } + scope:traveler_culture = { culture_overlaps_geographical_region = world_middle_east } } AND = { culture_overlaps_geographical_region = world_middle_east - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_minor } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_minor } } AND = { culture_overlaps_geographical_region = world_middle_east - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_middle_east } + scope:traveler_culture = { culture_overlaps_geographical_region = world_middle_east } } AND = { culture_overlaps_geographical_region = world_africa - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_africa } + scope:traveler_culture = { culture_overlaps_geographical_region = world_africa } } AND = { culture_overlaps_geographical_region = world_steppe - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_steppe } + scope:traveler_culture = { culture_overlaps_geographical_region = world_steppe } } AND = { culture_overlaps_geographical_region = world_tibet - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_tibet } + scope:traveler_culture = { culture_overlaps_geographical_region = world_tibet } } AND = { culture_overlaps_geographical_region = world_tibet - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_india} + scope:traveler_culture = { culture_overlaps_geographical_region = world_india} } AND = { culture_overlaps_geographical_region = world_india - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_tibet } + scope:traveler_culture = { culture_overlaps_geographical_region = world_tibet } } AND = { culture_overlaps_geographical_region = world_india - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_india } + scope:traveler_culture = { culture_overlaps_geographical_region = world_india } } AND = { - culture_overlaps_geographical_region = world_burma - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_india } + culture_overlaps_geographical_region = world_asia_southeast + scope:traveler_culture = { culture_overlaps_geographical_region = world_india } } AND = { culture_overlaps_geographical_region = world_india - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_burma } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_southeast } } AND = { culture_overlaps_geographical_region = world_tibet - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_burma } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_southeast } } AND = { - culture_overlaps_geographical_region = world_burma - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_tibet } + culture_overlaps_geographical_region = world_asia_southeast + scope:traveler_culture = { culture_overlaps_geographical_region = world_tibet } } AND = { culture_overlaps_geographical_region = world_tibet - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_china } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } + } + AND = { + culture_overlaps_geographical_region = world_asia_southeast + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } } AND = { culture_overlaps_geographical_region = world_asia_china - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_china } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } } AND = { culture_overlaps_geographical_region = world_asia_china - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_southeast } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_southeast } } AND = { culture_overlaps_geographical_region = world_asia_china - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_korea } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_korea } } AND = { culture_overlaps_geographical_region = world_asia_china - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_japan } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_japan } } AND = { culture_overlaps_geographical_region = world_asia_korea - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_china } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } } AND = { culture_overlaps_geographical_region = world_asia_korea - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_japan } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_japan } } AND = { culture_overlaps_geographical_region = world_asia_korea - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_korea } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_korea } } AND = { culture_overlaps_geographical_region = world_asia_japan - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_japan } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_japan } } AND = { culture_overlaps_geographical_region = world_asia_japan - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_china } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_china } } AND = { culture_overlaps_geographical_region = world_asia_japan - scope:traveler_culture ?= { culture_overlaps_geographical_region = world_asia_korea } + scope:traveler_culture = { culture_overlaps_geographical_region = world_asia_korea } } } cultural_acceptance = { @@ -8361,6 +7668,7 @@ ep3_story_cycle_admin_eunuch_matching_modifier_effect = { } ep3_story_cycle_admin_eunuch_downgrade_modifier_effect = { + top_liege = { save_scope_as = top_liege } save_scope_value_as = { name = modifier_type value = flag:$TYPE$ @@ -8372,7 +7680,7 @@ ep3_story_cycle_admin_eunuch_downgrade_modifier_effect = { limit = { scope:modifier_type = flag:eunuch } progress_towards_rival_effect = { REASON = rival_admin_eunuch - CHARACTER = top_liege + CHARACTER = scope:top_liege OPINION = default_rival_opinion } } @@ -8525,7 +7833,7 @@ ep3_pick_random_maa_regiment_effect = { # TRIBAL 1 = { trigger = { - culture ?= { has_innovation = innovation_elephantry } + culture = { has_innovation = innovation_elephantry } } save_scope_value_as = { name = maa_to_create @@ -8534,7 +7842,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_war_camels } + culture = { has_innovation = innovation_war_camels } } save_scope_value_as = { name = maa_to_create @@ -8543,7 +7851,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_arched_saddle } + culture = { has_innovation = innovation_arched_saddle } } save_scope_value_as = { name = maa_to_create @@ -8552,13 +7860,9 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { + culture = { has_innovation = innovation_catapult - NOR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = no } scope:include_siege_maa = yes } @@ -8569,13 +7873,9 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { + culture = { has_innovation = innovation_catapult - OR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = yes } scope:include_siege_maa = yes } @@ -8587,7 +7887,7 @@ ep3_pick_random_maa_regiment_effect = { # EARLY 1 = { trigger = { - culture ?= { has_innovation = innovation_quilted_armor } + culture = { has_innovation = innovation_quilted_armor } } save_scope_value_as = { name = maa_to_create @@ -8596,13 +7896,9 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { + culture = { has_innovation = innovation_mangonel - NOR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = no } scope:include_siege_maa = yes } @@ -8613,13 +7909,9 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { + culture = { has_innovation = innovation_mangonel - OR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = yes } scope:include_siege_maa = yes } @@ -8631,13 +7923,9 @@ ep3_pick_random_maa_regiment_effect = { # HIGH 1 = { trigger = { - culture ?= { + culture = { has_innovation = innovation_trebuchet - NOR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = no } scope:include_siege_maa = yes } @@ -8648,13 +7936,9 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { + culture = { has_innovation = innovation_trebuchet - OR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = yes } scope:include_siege_maa = yes } @@ -8665,7 +7949,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_advanced_bowmaking } + culture = { has_innovation = innovation_advanced_bowmaking } } save_scope_value_as = { name = maa_to_create @@ -8675,13 +7959,9 @@ ep3_pick_random_maa_regiment_effect = { # LATE 1 = { trigger = { - culture ?= { + culture = { has_cultural_parameter = unlock_late_medieval_gunpowder_units - NOR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = no } scope:include_siege_maa = yes } @@ -8692,13 +7972,9 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { + culture = { has_cultural_parameter = unlock_late_medieval_gunpowder_units - OR = { - has_cultural_pillar = heritage_chinese - has_cultural_pillar = heritage_korean - has_cultural_pillar = heritage_japonic - } + culture_uses_eastern_siege_weapons_trigger = yes } scope:include_siege_maa = yes } @@ -8710,7 +7986,7 @@ ep3_pick_random_maa_regiment_effect = { # CULTURAL INNOVATIONS 1 = { trigger = { - culture ?= { has_innovation = innovation_bamboo_bows } + culture = { has_innovation = innovation_bamboo_bows } } save_scope_value_as = { name = maa_to_create @@ -8719,7 +7995,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_zweihanders } + culture = { has_innovation = innovation_zweihanders } } save_scope_value_as = { name = maa_to_create @@ -8728,7 +8004,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_adaptive_militia } + culture = { has_innovation = innovation_adaptive_militia } } save_scope_value_as = { name = maa_to_create @@ -8737,7 +8013,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_valets } + culture = { has_innovation = innovation_valets } } save_scope_value_as = { name = maa_to_create @@ -8746,7 +8022,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_rocket_cart } + culture = { has_innovation = innovation_rocket_cart } } save_scope_value_as = { name = maa_to_create @@ -8755,7 +8031,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_pike_columns } + culture = { has_innovation = innovation_pike_columns } } save_scope_value_as = { name = maa_to_create @@ -8764,7 +8040,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_legionnaires } + culture = { has_innovation = innovation_legionnaires } } save_scope_value_as = { name = maa_to_create @@ -8773,7 +8049,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_desert_tactics } + culture = { has_innovation = innovation_desert_tactics } } save_scope_value_as = { name = maa_to_create @@ -8782,7 +8058,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_caballeros } + culture = { has_innovation = innovation_caballeros } } save_scope_value_as = { name = maa_to_create @@ -8791,7 +8067,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_hobbies } + culture = { has_innovation = innovation_hobbies } } save_scope_value_as = { name = maa_to_create @@ -8800,7 +8076,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_rectilinear_schiltron } + culture = { has_innovation = innovation_rectilinear_schiltron } } save_scope_value_as = { name = maa_to_create @@ -8809,7 +8085,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_sahel_horsemen } + culture = { has_innovation = innovation_sahel_horsemen } } save_scope_value_as = { name = maa_to_create @@ -8818,7 +8094,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_sarawit } + culture = { has_innovation = innovation_sarawit } } save_scope_value_as = { name = maa_to_create @@ -8827,7 +8103,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_repeating_crossbow } + culture = { has_innovation = innovation_repeating_crossbow } } save_scope_value_as = { name = maa_to_create @@ -8836,7 +8112,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_pole_vault } + culture = { has_innovation = innovation_pole_vault } } save_scope_value_as = { name = maa_to_create @@ -8845,7 +8121,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_huscarls } + culture = { has_cultural_parameter = unlock_maa_huscarls } } save_scope_value_as = { name = maa_to_create @@ -8854,7 +8130,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_longbowmen } + culture = { has_cultural_parameter = unlock_maa_longbowmen } } save_scope_value_as = { name = maa_to_create @@ -8863,7 +8139,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_monaspa } + culture = { has_cultural_parameter = unlock_maa_monaspa } } save_scope_value_as = { name = maa_to_create @@ -8872,7 +8148,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_cataphract } + culture = { has_cultural_parameter = unlock_maa_cataphract } } save_scope_value_as = { name = maa_to_create @@ -8881,7 +8157,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_metsanvartija } + culture = { has_cultural_parameter = unlock_maa_metsanvartija } } save_scope_value_as = { name = maa_to_create @@ -8890,7 +8166,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_maturkan_warriors } + culture = { has_cultural_parameter = unlock_maa_maturkan_warriors } } save_scope_value_as = { name = maa_to_create @@ -8900,7 +8176,7 @@ ep3_pick_random_maa_regiment_effect = { 1 = { trigger = { OR = { - culture ?= { has_cultural_parameter = unlock_maa_horse_archers } + culture = { has_cultural_parameter = unlock_maa_horse_archers } mpo_can_recruit_nomad_maa_trigger = yes } } @@ -8911,7 +8187,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_ayyar } + culture = { has_cultural_parameter = unlock_maa_ayyar } } save_scope_value_as = { name = maa_to_create @@ -8920,7 +8196,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_mubarizun } + culture = { has_cultural_parameter = unlock_maa_mubarizun } } save_scope_value_as = { name = maa_to_create @@ -8929,7 +8205,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_mulaththamun } + culture = { has_cultural_parameter = unlock_maa_mulaththamun } } save_scope_value_as = { name = maa_to_create @@ -8938,7 +8214,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_archers_of_the_nile } + culture = { has_cultural_parameter = unlock_maa_archers_of_the_nile } } save_scope_value_as = { name = maa_to_create @@ -8947,7 +8223,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_druzhina } + culture = { has_cultural_parameter = unlock_maa_druzhina } } save_scope_value_as = { name = maa_to_create @@ -8956,7 +8232,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_hussar } + culture = { has_cultural_parameter = unlock_maa_hussar } } save_scope_value_as = { name = maa_to_create @@ -8965,7 +8241,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_horn_warrior } + culture = { has_cultural_parameter = unlock_maa_horn_warrior } } save_scope_value_as = { name = maa_to_create @@ -8974,7 +8250,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_bush_hunter } + culture = { has_cultural_parameter = unlock_maa_bush_hunter } } save_scope_value_as = { name = maa_to_create @@ -8983,7 +8259,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_shomer } + culture = { has_cultural_parameter = unlock_maa_shomer } } save_scope_value_as = { name = maa_to_create @@ -8992,7 +8268,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_garudas } + culture = { has_cultural_parameter = unlock_maa_garudas } } save_scope_value_as = { name = maa_to_create @@ -9001,7 +8277,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_khandayat } + culture = { has_cultural_parameter = unlock_maa_khandayat } } save_scope_value_as = { name = maa_to_create @@ -9010,7 +8286,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_mountaineer } + culture = { has_cultural_parameter = unlock_maa_mountaineer } } save_scope_value_as = { name = maa_to_create @@ -9019,7 +8295,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_guinea_warrior } + culture = { has_cultural_parameter = unlock_maa_guinea_warrior } } save_scope_value_as = { name = maa_to_create @@ -9028,7 +8304,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_abudrar } + culture = { has_cultural_parameter = unlock_maa_abudrar } } save_scope_value_as = { name = maa_to_create @@ -9037,7 +8313,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_zbrojnosh } + culture = { has_cultural_parameter = unlock_maa_zbrojnosh } } save_scope_value_as = { name = maa_to_create @@ -9046,7 +8322,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_palace_guards } + culture = { has_cultural_parameter = unlock_maa_palace_guards } } save_scope_value_as = { name = maa_to_create @@ -9066,7 +8342,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_tarkhan } + culture = { has_cultural_parameter = unlock_maa_tarkhan } } save_scope_value_as = { name = maa_to_create @@ -9075,7 +8351,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_zupin_warrior } + culture = { has_cultural_parameter = unlock_maa_zupin_warrior } } save_scope_value_as = { name = maa_to_create @@ -9084,7 +8360,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_tawashi } + culture = { has_cultural_parameter = unlock_maa_tawashi } } save_scope_value_as = { name = maa_to_create @@ -9244,7 +8520,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_vigmen } + culture = { has_cultural_parameter = unlock_maa_vigmen } } save_scope_value_as = { name = maa_to_create @@ -9253,7 +8529,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_bondi } + culture = { has_cultural_parameter = unlock_maa_bondi } } save_scope_value_as = { name = maa_to_create @@ -9262,7 +8538,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_varangian_veterans } + culture = { has_cultural_parameter = unlock_maa_varangian_veterans } } save_scope_value_as = { name = maa_to_create @@ -9271,7 +8547,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_ayrudzi } + culture = { has_cultural_parameter = unlock_maa_ayrudzi } } save_scope_value_as = { name = maa_to_create @@ -9289,7 +8565,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_conrois } + culture = { has_cultural_parameter = unlock_maa_conrois } } save_scope_value_as = { name = maa_to_create @@ -9298,7 +8574,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_akritai } + culture = { has_cultural_parameter = unlock_maa_akritai } } save_scope_value_as = { name = maa_to_create @@ -9307,7 +8583,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_ballistrai } + culture = { has_cultural_parameter = unlock_maa_ballistrai } } save_scope_value_as = { name = maa_to_create @@ -9316,7 +8592,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_skoutatoi } + culture = { has_cultural_parameter = unlock_maa_skoutatoi } } save_scope_value_as = { name = maa_to_create @@ -9325,7 +8601,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_warrior_monk_units } + culture = { has_cultural_parameter = unlock_warrior_monk_units } } save_scope_value_as = { name = maa_to_create @@ -9334,7 +8610,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_emishi_horse_archers_units } + culture = { has_cultural_parameter = unlock_emishi_horse_archers_units } } save_scope_value_as = { name = maa_to_create @@ -9343,7 +8619,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_mounted_samurai_units } + culture = { has_cultural_parameter = unlock_mounted_samurai_units } } save_scope_value_as = { name = maa_to_create @@ -9352,7 +8628,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_pesilat } + culture = { has_cultural_parameter = unlock_maa_pesilat } } save_scope_value_as = { name = maa_to_create @@ -9361,7 +8637,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_gakgung_archers } + culture = { has_cultural_parameter = unlock_maa_gakgung_archers } } save_scope_value_as = { name = maa_to_create @@ -9370,7 +8646,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_infantry_samurai_units } + culture = { has_cultural_parameter = unlock_infantry_samurai_units } } save_scope_value_as = { name = maa_to_create @@ -9379,7 +8655,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_zhanmadao } + culture = { has_cultural_parameter = unlock_zhanmadao } } save_scope_value_as = { name = maa_to_create @@ -9388,7 +8664,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_burenjia } + culture = { has_cultural_parameter = unlock_burenjia } } save_scope_value_as = { name = maa_to_create @@ -9397,7 +8673,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_innovation = innovation_tiefutu } + culture = { has_innovation = innovation_tiefutu } } save_scope_value_as = { name = maa_to_create @@ -9406,7 +8682,7 @@ ep3_pick_random_maa_regiment_effect = { } 1 = { trigger = { - culture ?= { has_cultural_parameter = unlock_maa_black_armor_cavalry } + culture = { has_cultural_parameter = unlock_maa_black_armor_cavalry } } save_scope_value_as = { name = maa_to_create @@ -10054,8 +9330,8 @@ ep3_missionary_effect = { limit = { OR = { $LOCATION$.religion = $PREACHER$.religion - $LOCATION$.faith ?= { has_doctrine_parameter = unreformed } -# character:41702 ?= $PREACHER$ + $LOCATION$.faith = { has_doctrine_parameter = unreformed } + character:41702 ?= $PREACHER$ } } $LOCATION$ = { @@ -10065,24 +9341,24 @@ ep3_missionary_effect = { # Preacher is Gnostic, convert the locals to a regionally appropriate form of Gnosticism else_if = { limit = { - $PREACHER$.faith ?= { + $PREACHER$ = { OR = { - has_doctrine = tenet_gnosticism - has_doctrine = special_doctrine_is_gnostic_faith + rite = { rite_has_tenet = tenet_gnosticism } + faith = { has_doctrine = special_doctrine_is_gnostic_faith } } } $LOCATION$.religion = { - any_faith ?= { - has_doctrine = tenet_gnosticism + any_faith = { + main_rite = { rite_has_tenet = tenet_gnosticism } } } } $LOCATION$ = { religion = { - random_faith ?= { + random_faith = { limit = { OR = { - has_doctrine = tenet_gnosticism + main_rite = { rite_has_tenet = tenet_gnosticism } has_doctrine = special_doctrine_is_gnostic_faith } } @@ -10440,6 +9716,29 @@ hasan_sabbah_ignite_decision_effect = { target = root.location.county.holder.top_liege target_title = root.location.county.holder.top_liege.primary_title } + if = { + limit = { + has_character_flag = founded_assassins_already + } + faith = { + every_faith_holy_order = { + limit = { + leader = { + is_allied_to = root + } + } + leader = { + save_scope_as = holy_order_leader + } + } + } + every_character_war = { + limit = { + using_cb = ep3_hasan_assassin_war + } + add_attacker = scope:holy_order_leader + } + } } hasan_sabbah_end_war = { # Offer Hasan the opportunity to become landed @@ -10572,7 +9871,7 @@ hasan_sabbah_end_war = { $SELJUK$ = { if = { limit = { - government_has_flag = government_is_administrative + government_has_mechanic = administrative } admin_government_reset_effect = yes } @@ -10600,7 +9899,10 @@ hasan_sabbah_end_war = { reinforce_soldiers_regiment_effect = { save_scope_as = laamp_temp # For the value. - save_temporary_scope_as = actor + if = { + limit = { NOT = { exists = scope:actor } } + save_temporary_scope_as = actor + } custom_tooltip = { text = reinforce_soldiers_effect_tt every_maa_regiment = { @@ -10613,6 +9915,7 @@ reinforce_soldiers_regiment_effect = { refill_maa_with_provisions_effect = { save_scope_as = laamp_temp while = { + count = 100 # Hard bound; the limit below is what normally ends the loop limit = { scope:actor.domicile.provisions > 0 any_maa_regiment = { @@ -10646,6 +9949,7 @@ refill_maa_with_provisions_effect = { refill_maa_with_gold_effect = { save_scope_as = laamp_temp while = { + count = 100 # Hard bound; the limit below is what normally ends the loop limit = { scope:actor.gold > 0 any_maa_regiment = { @@ -10710,26 +10014,11 @@ admin_government_reset_effect = { } } } - change_government = tribal_government + assign_tribal_governments_effect = yes } - ### CLAN - are you a Muslim or from a Clan culture? - else_if = { - limit = { - OR = { - faith ?= { religion_tag = islam_religion } - culture ?= { - OR = { - has_cultural_pillar = heritage_arabic - has_cultural_pillar = heritage_iranian - has_cultural_pillar = heritage_turkic - } - } - } - } - change_government = clan_government + else = { + assign_feudal_governments_effect = yes } - ### FEUDAL - fallback playable case - else = { change_government = feudal_government } } } @@ -10740,6 +10029,7 @@ create_basic_peasant_effect = { dynasty = none culture = root.location.culture faith = root.location.faith + rite = root.location.rite gender_female_chance = 50 after_creation = { set_to_lowborn = yes @@ -10752,7 +10042,7 @@ fire_governor_long_war_response_events = { if = { limit = { scope:defender = { - government_has_flag = government_is_administrative + government_has_mechanic = administrative top_liege = this any_vassal = { is_governor = yes @@ -10878,7 +10168,7 @@ fire_governor_long_war_response_events = { if = { limit = { scope:attacker = { - government_has_flag = government_is_administrative + government_has_mechanic = administrative top_liege = this any_vassal = { is_governor = yes @@ -11065,13 +10355,13 @@ ep3_admin_war_aftermath_effect = { limit = { any_war_participant = { is_landed = yes - government_has_flag = government_is_administrative + government_has_mechanic = administrative } } every_war_participant = { limit = { is_landed = yes - government_has_flag = government_is_administrative + government_has_mechanic = administrative } primary_title = { set_variable = { @@ -11087,13 +10377,13 @@ ep3_admin_war_aftermath_effect = { state_faith_conversion_add_piety_effect = { if = { limit = { - scope:actor = { + scope:puppet_or_actor = { top_liege = { government_allows = state_faith } - faith = top_liege.primary_title.state_faith + rite = top_liege.primary_title.state_rite } scope:recipient.top_liege = { government_allows = state_faith } } - scope:actor = { + scope:puppet_or_actor = { add_piety = medium_piety_gain } } @@ -11102,10 +10392,10 @@ state_faith_conversion_add_piety_effect = { state_faith_refuse_conversion_add_piety_effect = { if = { limit = { - scope:actor.top_liege = { government_allows = state_faith } + scope:puppet_or_actor.top_liege = { government_allows = state_faith } scope:recipient = { top_liege = { government_allows = state_faith } - faith = top_liege.primary_title.state_faith + rite = top_liege.primary_title.state_rite } } scope:recipient = { add_piety = medium_piety_gain } @@ -11505,9 +10795,9 @@ noble_family_adoption_effect = { house.house_head = { #We do this first, otherwise house head will already mean someone else. if = { limit = { - $ADOPTER$.culture ?= { has_cultural_parameter = wider_adoption } + $ADOPTER$.culture = { has_cultural_parameter = wider_adoption } $ADOPTEE$ = { - culture ?= { has_cultural_parameter = wider_adoption } + culture = { has_cultural_parameter = wider_adoption } NOT = { any_parent = { is_alive = yes @@ -11563,7 +10853,7 @@ noble_family_adoption_effect = { custom = every_zealot_house_member_tt limit = { ai_zeal >= medium_positive_ai_value - faith ?= { faith_hostility_level = { target = $ADOPTEE$.faith value >= faith_astray_level } } + faith = { faith_hostility_level = { target = $ADOPTEE$.faith value >= faith_astray_level } } NOT = { this = $ADOPTER$ } } add_opinion = { @@ -11579,12 +10869,12 @@ noble_family_adoption_effect = { is_close_family_of = $ADOPTER$ NAND = { ai_zeal >= medium_positive_ai_value - faith ?= { faith_hostility_level = { target = $ADOPTEE$.faith value >= faith_astray_level } } + faith = { faith_hostility_level = { target = $ADOPTEE$.faith value >= faith_astray_level } } } NAND = { - $ADOPTER$.culture ?= { has_cultural_parameter = wider_adoption } + $ADOPTER$.culture = { has_cultural_parameter = wider_adoption } $ADOPTEE$ = { - culture ?= { has_cultural_parameter = wider_adoption } + culture = { has_cultural_parameter = wider_adoption } NOT = { any_parent = { is_alive = yes @@ -11675,6 +10965,7 @@ create_artifact_court_icon_large_effect = { # Get the character the artifact is being made for. $OWNER$ = { save_scope_as = owner } $PAINTER$ = { save_scope_as = painter } + save_adventurer_location_effect = yes hidden_effect_new_object = { # Get artifact quality, wealth, and materials @@ -11758,6 +11049,7 @@ create_artifact_court_icon_small_effect = { # Get the character the artifact is being made for. $OWNER$ = { save_scope_as = owner } $PAINTER$ = { save_scope_as = painter } + save_adventurer_location_effect = yes hidden_effect_new_object = { # Get artifact quality, wealth, and materials @@ -11841,6 +11133,7 @@ create_artifact_trinket_icon_effect = { # Get the character the artifact is being made for. $OWNER$ = { save_scope_as = owner } $PAINTER$ = { save_scope_as = painter } + save_adventurer_location_effect = yes hidden_effect_new_object = { # Get artifact quality, wealth, and materials @@ -12065,6 +11358,7 @@ war_task_contracts_completion_effect = { } if = { limit = { + exists = scope:winner task_contract_taker = scope:winner } complete_task_contract = success_standard @@ -12111,6 +11405,10 @@ laamp_as_mercenary_payout_effect = { } else = { save_scope_as = laamp_temp + save_scope_value_as = { + name = war_contribution_value + value = "scope:war.war_contribution(scope:laamp_temp)" + } var:joined_as_mercenary = { save_scope_as = employer } if = { limit = { exists = var:aggregate_war_contribution_value } @@ -12354,6 +11652,7 @@ camp_party_completed_log_entry_effect = { } } } + pam_vows_of_poverty_host_completion_piety_effect = yes } disburse_camp_party_reward_effect = { @@ -12727,6 +12026,45 @@ disburse_camp_party_reward_effect = { } } } + 1 = { + trigger = { + has_domicile_building_or_higher = mess_tent_01 + NOT = { has_domicile_building = mess_tent_06 } + } + switch = { + trigger = has_domicile_building + mess_tent_01 = { + save_scope_value_as = { + name = domicile_building + value = flag:mess_tent_01 + } + } + mess_tent_02 = { + save_scope_value_as = { + name = domicile_building + value = flag:mess_tent_02 + } + } + mess_tent_03 = { + save_scope_value_as = { + name = domicile_building + value = flag:mess_tent_03 + } + } + mess_tent_04 = { + save_scope_value_as = { + name = domicile_building + value = flag:mess_tent_04 + } + } + mess_tent_05 = { + save_scope_value_as = { + name = domicile_building + value = flag:mess_tent_05 + } + } + } + } } } } @@ -12767,6 +12105,11 @@ disburse_camp_party_reward_effect = { flag:camp_perimeter_03 = { add_domicile_building = camp_perimeter_04 } flag:camp_perimeter_04 = { add_domicile_building = camp_perimeter_05 } flag:camp_perimeter_05 = { add_domicile_building = camp_perimeter_06 } + flag:mess_tent_01 = { add_domicile_building = mess_tent_02 } + flag:mess_tent_02 = { add_domicile_building = mess_tent_03 } + flag:mess_tent_03 = { add_domicile_building = mess_tent_04 } + flag:mess_tent_04 = { add_domicile_building = mess_tent_05 } + flag:mess_tent_05 = { add_domicile_building = mess_tent_06 } } } @@ -12961,17 +12304,20 @@ ep3_the_fens_list_effect = { #Used for setting up the Harrying of the North widget for events #Requires use of ep3_harrying_widget_clear_effect in the 'after' as well ep3_harrying_widget_setup_effect = { - global_var:harrying_of_the_north = { save_scope_as = story } ## First, identify our widget character. save_scope_as = scope_character ## Then transfer over some suitable variables for the UI. - set_variable = { - name = pacification_gui - value = scope:story.var:pacification - } - set_variable = { - name = resistance_gui - value = scope:story.var:resistance + if = { + limit = { exists = global_var:harrying_of_the_north } + global_var:harrying_of_the_north = { save_scope_as = story } + set_variable = { + name = pacification_gui + value = scope:story.var:pacification + } + set_variable = { + name = resistance_gui + value = scope:story.var:resistance + } } } @@ -13013,15 +12359,14 @@ ep3_increase_pacification_effect = { if = { limit = { - exists = character:90028 - character:90028 ?= { + character:90028 = { is_alive = yes NOT = { has_character_flag = hereward_settled_flag } } } - character:90028 ?= { + character:90028 = { send_interface_message = { type = msg_pacification_rise title = harrying.notification_pacification_rise @@ -13032,7 +12377,6 @@ ep3_increase_pacification_effect = { if = { limit = { - exists = scope:story.var:ruler_england scope:story.var:ruler_england = { any_vassal = { culture = culture:anglo_saxon @@ -13092,14 +12436,14 @@ ep3_increase_pacification_large_effect = { if = { limit = { - character:90028 ?= { + character:90028 = { is_alive = yes NOT = { has_character_flag = hereward_settled_flag } } } - character:90028 ?= { + character:90028 = { send_interface_message = { type = msg_pacification_rise title = harrying.notification_pacification_rise @@ -13169,14 +12513,14 @@ ep3_increase_resistance_effect = { if = { limit = { - character:90028 ?= { + character:90028 = { is_alive = yes NOT = { has_character_flag = hereward_settled_flag } } } - character:90028 ?= { + character:90028 = { send_interface_message = { type = msg_resistance_rise title = harrying.notification_resistance_rise @@ -13246,14 +12590,14 @@ ep3_increase_resistance_large_effect = { if = { limit = { - character:90028 ?= { + character:90028 = { is_alive = yes NOT = { has_character_flag = hereward_settled_flag } } } - character:90028 ?= { + character:90028 = { send_interface_message = { type = msg_resistance_rise title = harrying.notification_resistance_rise @@ -13325,14 +12669,14 @@ ep3_decrease_pacification_effect = { if = { limit = { - character:90028 ?= { + character:90028 = { is_alive = yes NOT = { has_character_flag = hereward_settled_flag } } } - character:90028 ?= { + character:90028 = { send_interface_message = { type = msg_pacification_falls title = harrying.notification_pacification_fall @@ -13369,7 +12713,7 @@ ep3_decrease_pacification_effect = { ep3_decrease_resistance_effect = { save_scope_as = origin_char if = { - limit = { scope:story.var:pacification != 0 } + limit = { scope:story.var:resistance != 0 } scope:story = { change_variable = { name = resistance @@ -13405,14 +12749,14 @@ ep3_decrease_resistance_effect = { if = { limit = { - character:90028 ?= { + character:90028 = { is_alive = yes NOT = { has_character_flag = hereward_settled_flag } } } - character:90028 ?= { + character:90028 = { send_interface_message = { type = msg_resistance_falls title = harrying.notification_resistance_fall @@ -13787,7 +13131,7 @@ assign_favourite_child_effect = { exists = scope:current_favorite } remove_relation_favorite_child = scope:current_favorite - scope:current_favorite ?= { + scope:current_favorite = { add_opinion = { target = $ACTOR$ modifier = no_more_favorite_opinion diff --git a/common/scripted_effects/NEOW_major_decisions_scripted_effects.txt b/common/scripted_effects/NEOW_major_decisions_scripted_effects.txt new file mode 100644 index 000000000..89d28c790 --- /dev/null +++ b/common/scripted_effects/NEOW_major_decisions_scripted_effects.txt @@ -0,0 +1,1149 @@ +restore_swedish_empire_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + give_nickname = nick_the_lion_of_the_north + save_scope_as = scoped_ruler + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:e_sweden = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + hidden_effect = { + copy_title_history = title:k_sweden + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + set_primary_title_to = title:e_sweden + if = { + limit = { + title:k_sapmi = { is_titular = no } + has_title = title:k_sapmi + } + title:k_sapmi = { set_de_jure_liege_title = title:e_sweden } + set_flag = flag_swedish_sapmi + } + else = { + if = { + limit = { + title:k_sapmi = { is_titular = no } + } + title:k_sapmi = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_duchy + root = { completely_controls = prev } + OR = { + this = title:d_vasterbottena + this = title:d_norrbottena + } + } + set_de_jure_liege_title = title:k_sweden + } + every_in_de_jure_hierarchy = { + limit = { + tier = tier_duchy + root = { completely_controls = prev } + OR = { + this = title:d_giemajohka + this = title:d_gulodat + } + } + set_de_jure_liege_title = title:k_finland + } +# set_de_jure_liege_title = title:e_zapadnorussia + } + } + } + title:k_finland = { set_de_jure_liege_title = title:e_sweden } + title:k_esthonia = { set_de_jure_liege_title = title:e_sweden } + title:k_sweden = { set_de_jure_liege_title = title:e_sweden } + if = { + limit = { + exists = title:k_gotaland + } + destroy_title = title:k_gotaland + } + if = { + limit = { title:k_gotaland ?= { is_titular = no } } + title:k_gotaland = { + every_in_de_jure_hierarchy = { + limit = { tier = tier_duchy } + set_de_jure_liege_title = title:k_sweden + } + } + } + if = { + limit = { + title:k_norway = { is_titular = no } + OR = { + has_title = title:k_norway + completely_controls = title:k_norway + } + } + title:k_norway = { set_de_jure_liege_title = title:e_sweden } + } + if = { + limit = { + completely_controls = title:d_finnmarku + NOT = { has_title = title:k_sapmi } + } + if = { + limit = { + OR = { + has_title = title:k_norway + completely_controls = title:k_norway + } + } + title:d_finnmarku = { set_de_jure_liege_title = title:k_norway } + } + else = { + title:d_finnmarku = { set_de_jure_liege_title = title:k_finland } + } + } + if = { + limit = { + completely_controls = title:d_guoldat + NOT = { has_title = title:k_sapmi } + } + if = { + limit = { + OR = { + has_title = title:k_norway + completely_controls = title:k_norway + } + } + title:d_guoldat = { set_de_jure_liege_title = title:k_norway } + } + else_if = { + limit = { + OR = { + has_title = title:k_karelia + completely_controls = title:k_karelia + } + } + title:d_guoldat = { set_de_jure_liege_title = title:k_karelia } + } + else = { + title:d_guoldat = { set_de_jure_liege_title = title:k_finland } + } + } + if = { + limit = { + title:k_latvia = { is_titular = no } + OR = { + has_title = title:k_latvia + completely_controls = title:k_latvia + } + } + title:k_latvia = { set_de_jure_liege_title = title:e_sweden } + } + if = { + limit = { + title:k_pribaltia = { is_titular = no } + OR = { + has_title = title:k_pribaltia + completely_controls = title:k_pribaltia + } + } + title:k_pribaltia = { set_de_jure_liege_title = title:e_sweden } + } + if = { + limit = { + title:k_lithuania = { is_titular = no } + OR = { + has_title = title:k_lithuania + completely_controls = title:k_lithuania + } + } + title:k_lithuania = { set_de_jure_liege_title = title:e_sweden } + } + if = { + limit = { + title:k_schleswig_holstein = { is_titular = no } + OR = { + has_title = title:k_schleswig_holstein + completely_controls = title:k_schleswig_holstein + } + } + title:k_schleswig_holstein = { set_de_jure_liege_title = title:e_sweden } + } + if = { + limit = { + title:k_karelia = { is_titular = no } + OR = { + has_title = title:k_karelia + completely_controls = title:k_karelia + } + } + title:k_karelia = { set_de_jure_liege_title = title:e_sweden } + } + else = { + title:k_karelia = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_duchy + root = { completely_controls = prev } + } + set_de_jure_liege_title = title:k_finland + } +# set_de_jure_liege_title = title:e_zapadnorussia + } + } + if = { + limit = { + title:k_poland = { is_titular = no } + OR = { + has_title = title:k_poland + completely_controls = title:k_poland + } + } + title:k_poland = { set_de_jure_liege_title = title:e_sweden } + } + if = { + limit = { + title:k_brandenburg = { is_titular = no } + OR = { + has_title = title:k_brandenburg + completely_controls = title:k_brandenburg + } + } + title:k_brandenburg = { set_de_jure_liege_title = title:e_sweden } + } +# if = { +# limit = { +# title:k_petrograd = { is_titular = no } +# OR = { +# has_title = title:k_petrograd +# completely_controls = title:k_petrograd +# } +# } +# title:k_petrograd = { set_de_jure_liege_title = title:e_sweden } +# } + if = { + limit = { + title:k_iceland = { is_titular = no } + OR = { + has_title = title:k_iceland + completely_controls = title:k_iceland + } + } + title:k_iceland = { set_de_jure_liege_title = title:e_sweden } + } + title:e_scandinavia = { + set_title_name = k_denmark + set_color_from_title = title:k_denmark + set_coa = k_denmark + } + } +} + +form_bulgarian_empire_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + give_nickname = nick_the_great + save_scope_as = scoped_ruler + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:e_bulgaria = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + hidden_effect = { + copy_title_history = title:k_bulgaria + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + set_primary_title_to = title:e_bulgaria + title:k_bulgaria = { set_de_jure_liege_title = title:e_bulgaria } + title:k_macedonia = { set_de_jure_liege_title = title:e_bulgaria } + title:k_thrace = { set_de_jure_liege_title = title:e_bulgaria } + if = { + limit = { + title:k_dacia = { is_titular = no } + OR = { + has_title = title:k_dacia + completely_controls = title:k_dacia + } + } + title:k_dacia = { set_de_jure_liege_title = title:e_bulgaria } + } + if = { + limit = { + title:k_transylvania = { is_titular = no } + OR = { + has_title = title:k_transylvania + completely_controls = title:k_transylvania + } + } + title:k_transylvania = { set_de_jure_liege_title = title:e_bulgaria } + } + if = { + limit = { + title:k_serbia = { is_titular = no } + OR = { + has_title = title:k_serbia + completely_controls = title:k_serbia + } + } + title:k_serbia = { set_de_jure_liege_title = title:e_bulgaria } + } + if = { + limit = { + title:k_epirus = { is_titular = no } + OR = { + has_title = title:k_epirus + completely_controls = title:k_epirus + } + } + title:k_epirus = { set_de_jure_liege_title = title:e_bulgaria } + } + if = { + limit = { + title:k_montenegro = { is_titular = no } + OR = { + has_title = title:k_montenegro + completely_controls = title:k_montenegro + } + } + title:k_montenegro = { set_de_jure_liege_title = title:e_bulgaria } + } + } +} + +restore_ottoman_empire_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + give_nickname = nick_NEOW_fatih + save_scope_as = scoped_ruler + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:e_sublime_state = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + hidden_effect = { + copy_title_history = title:e_turkey + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + set_primary_title_to = title:e_bulgaria + title:k_bulgaria = { set_de_jure_liege_title = title:e_sublime_state } + title:k_macedonia = { set_de_jure_liege_title = title:e_sublime_state } + title:k_thrace = { set_de_jure_liege_title = title:e_sublime_state } + title:k_hellas = { set_de_jure_liege_title = title:e_sublime_state } + title:k_krete = { set_de_jure_liege_title = title:e_sublime_state } + title:k_mikrasia = { set_de_jure_liege_title = title:e_sublime_state } + title:k_cyprus = { set_de_jure_liege_title = title:e_sublime_state } + title:k_epirus = { set_de_jure_liege_title = title:e_sublime_state } + title:k_nikaea = { set_de_jure_liege_title = title:e_sublime_state } + title:k_anatolia = { set_de_jure_liege_title = title:e_sublime_state } + title:k_pontus = { set_de_jure_liege_title = title:e_sublime_state } + title:k_armenitolia = { set_de_jure_liege_title = title:e_sublime_state } + title:k_cilicia = { set_de_jure_liege_title = title:e_sublime_state } + if = { + limit = { + exists = title:e_turkey + } + destroy_title = title:e_turkey + } + if = { + limit = { + exists = title:e_greece + } + destroy_title = title:e_greece + } + } +} + +form_hetmanshchina_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + save_scope_as = scoped_ruler + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:e_hetmanshchina = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + set_primary_title_to = title:e_hetmanshchina + if = { + limit = { + title:k_ruthenia = { is_titular = no } + has_title = title:k_ruthenia + } + title:k_ruthenia = { set_de_jure_liege_title = title:e_hetmanshchina } + set_flag = flag_cossack_ukraine + } + else = { + if = { + limit = { + title:k_ruthenia = { is_titular = no } + } + title:k_ruthenia = { + every_in_de_jure_hierarchy = { + limit = { + tier = tier_duchy + root = { completely_controls = prev } + OR = { + this = title:d_donbas + this = title:d_zaporizhzhia + this = title:d_kherson + this = title:d_dnipro + this = title:d_kharkiv + } + } + set_de_jure_liege_title = title:k_kuban + } + } + } + } + title:d_donbas = { set_de_jure_liege_title = title:k_kuban } + title:d_zaporizhzhia = { set_de_jure_liege_title = title:k_kuban } + title:d_kherson = { set_de_jure_liege_title = title:k_kuban } + title:d_dnipro = { set_de_jure_liege_title = title:k_kuban } + title:d_kharkiv = { set_de_jure_liege_title = title:k_kuban } + title:k_kuban = { set_de_jure_liege_title = title:e_hetmanshchina } + title:k_caucasus = { set_de_jure_liege_title = title:e_hetmanshchina } + title:k_crimea = { set_de_jure_liege_title = title:e_hetmanshchina } + } +} + +expand_alps_decision_effect = { + add_prestige = massive_prestige_gain + hidden_effect = { + title:k_austria = { set_de_jure_liege_title = title:e_alps } + title:k_swabia = { set_de_jure_liege_title = title:e_alps } + title:k_bavaria = { set_de_jure_liege_title = title:e_alps } + title:k_italy = { set_de_jure_liege_title = title:e_alps } + title:k_venice = { set_de_jure_liege_title = title:e_alps } + title:k_slovenia = { set_de_jure_liege_title = title:e_alps } + } +} + +form_quinto_imperio_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + give_nickname = nick_o_desejado + add_trait = savior + save_scope_as = scoped_ruler + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:e_sebastianist_hof = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + set_primary_title_to = title:e_sebastianist_hof + title:k_spanish_galicia = { set_de_jure_liege_title = title:e_sebastianist_hof } + title:k_portugal = { set_de_jure_liege_title = title:e_sebastianist_hof } + title:k_andalusia = { set_de_jure_liege_title = title:e_sebastianist_hof } + title:k_castille_leon = { set_de_jure_liege_title = title:e_sebastianist_hof } + title:k_aragon = { set_de_jure_liege_title = title:e_sebastianist_hof } + title:k_navarra = { set_de_jure_liege_title = title:e_sebastianist_hof } + if = { + limit = { + exists = title:e_iberia + } + destroy_title = title:e_iberia + } + if = { + limit = { + title:k_sardinia_and_corsica = { is_titular = no } + OR = { + has_title = title:k_sardinia_and_corsica + completely_controls = title:k_sardinia_and_corsica + } + } + title:k_sardinia_and_corsica = { set_de_jure_liege_title = title:e_sebastianist_hof } + } + } +} + + restore_rhine_border_novelist_france_decision_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + hidden_effect = { + title:k_belgium = { set_de_jure_liege_title = title:e_france } + title:k_lotharingia = { set_de_jure_liege_title = title:e_france } + title:d_palatinate = { set_de_jure_liege_title = title:k_lotharingia} + title:d_alsace = { set_de_jure_liege_title = title:k_lotharingia } + } +} + +restore_alpine_border_novelist_france_decision_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + hidden_effect = { + title:k_rhodania = { set_de_jure_liege_title = title:e_france } + title:d_upper_burgundy = { set_de_jure_liege_title = title:k_france } + title:d_savoie = { set_de_jure_liege_title = title:k_rhodania } + } +} + +restore_numenor_decision_effect = { + save_scope_as = scoped_ruler + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:h_numenor = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + + every_held_title = { #Should shift all dejure of all Empires owned at the time. + title_tier = empire + set_de_jure_liege_title = title:h_numenor + } + every_empire = { + limit = { + NOT = { exists = hegemony } + any_de_jure_county = { + percent >= 0.6 + holder = { + OR = { + this = root + any_liege_or_above = { this = root } + } + } + } + } + set_de_jure_liege_title = title:h_numenor + } +} + +restore_byzantium_decision_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + save_scope_as = scoped_ruler + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + title:e_NEOW_byzantium = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + hidden_effect = { + set_primary_title_to = title:e_NEOW_byzantium + title:k_thrace = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_macedonia = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_hellas= { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_bulgaria = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_epirus = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_cyprus = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_krete = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_nikaea = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_anatolia = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_pontus = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_armenitolia = { set_de_jure_liege_title = title:e_NEOW_byzantium } + title:k_cilicia = { set_de_jure_liege_title = title:e_NEOW_byzantium } + if = { + limit = { + exists = title:e_greece + } + destroy_title = title:e_greece + } + if = { + limit = { + exists = title:e_turkey + } + destroy_title = title:e_turkey + } + if = { + limit = { + title:k_serbia = { is_titular = no } + OR = { + has_title = title:k_serbia + completely_controls = title:k_serbia + } + } + title:k_serbia = { set_de_jure_liege_title = title:e_NEOW_byzantium } + } + if = { + limit = { + title:k_montenegro = { is_titular = no } + OR = { + has_title = title:k_montenegro + completely_controls = title:k_montenegro + } + } + title:k_montenegro = { set_de_jure_liege_title = title:e_NEOW_byzantium } + } + } +} +albanian_two_decision_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + + save_scope_as = scoped_ruler + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + + title:k_two_albania = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + hidden_effect = { + set_primary_title_to = title:k_two_albania + + title:d_napoli = { set_de_jure_liege_title = title:k_two_albania } + title:d_abruzzo = { set_de_jure_liege_title = title:k_two_albania } + title:d_apulia = { set_de_jure_liege_title = title:k_two_albania } + title:d_lucania = { set_de_jure_liege_title = title:k_two_albania } + title:d_calabria = { set_de_jure_liege_title = title:k_two_albania } + title:d_kosovo = { set_de_jure_liege_title = title:k_two_albania } + title:d_kastrioti = { set_de_jure_liege_title = title:k_two_albania } + title:d_dyrrachion = { set_de_jure_liege_title = title:k_two_albania } + title:d_gjirokaster = { set_de_jure_liege_title = title:k_two_albania } + title:k_two_albania = { set_de_jure_liege_title = title:e_italy } + + if = { + limit = { + exists = title:k_epirus + } + destroy_title = title:k_epirus + } + + if = { + limit = { + exists = title:k_sicily + } + destroy_title = title:k_sicily + } + + if = { + limit = { + title:d_palermo = { is_titular = no } + OR = { + has_title = title:d_palermo + completely_controls = title:d_palermo + } + } + title:d_palermo = { set_de_jure_liege_title = title:k_two_albania } + } + + if = { + limit = { + title:d_siracusa = { is_titular = no } + OR = { + has_title = title:d_siracusa + completely_controls = title:d_siracusa + } + } + title:d_siracusa = { set_de_jure_liege_title = title:k_two_albania } + } + + if = { + limit = { + title:d_athens = { is_titular = no } + OR = { + has_title = title:d_athens + completely_controls = title:d_athens + } + } + title:d_athens = { set_de_jure_liege_title = title:k_two_albania } + } + + if = { + limit = { + title:d_epirus = { is_titular = no } + OR = { + has_title = title:d_epirus + completely_controls = title:d_epirus + } + } + title:d_epirus = { set_de_jure_liege_title = title:k_two_albania } + } + + if = { + limit = { + title:d_peloponnese = { is_titular = no } + OR = { + has_title = title:d_peloponnese + completely_controls = title:d_peloponnese + } + } + title:d_peloponnese = { set_de_jure_liege_title = title:k_two_albania } + } + + if = { + limit = { + title:d_cephalonia = { is_titular = no } + OR = { + has_title = title:d_cephalonia + completely_controls = title:d_cephalonia + } + } + title:d_cephalonia = { set_de_jure_liege_title = title:k_two_albania } + } + } +} +declare_doggerlaw_effect = { + add_prestige = massive_prestige_gain + + save_scope_as = scoped_ruler + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + + title:k_doggerlaw = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + hidden_effect = { + set_primary_title_to = title:k_doggerlaw + + title:d_york = { set_de_jure_liege_title = title:k_doggerlaw } + title:d_northumberland = { set_de_jure_liege_title = title:k_doggerlaw } + title:d_lothian = { set_de_jure_liege_title = title:k_doggerlaw } + + if = { + limit = { + title:k_northumberland = { is_titular = no } + OR = { + has_title = title:k_northumberland + completely_controls = title:k_northumberland + } + } + destroy_title = title:k_northumberland + } + + if = { + limit = { + title:d_strathclyde = { is_titular = no } + OR = { + has_title = title:d_strathclyde + completely_controls = title:d_strathclyde + } + } + title:d_strathclyde = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_galloway = { is_titular = no } + OR = { + has_title = title:d_galloway + completely_controls = title:d_galloway + } + } + title:d_galloway = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_cumbria = { is_titular = no } + OR = { + has_title = title:d_cumbria + completely_controls = title:d_cumbria + } + } + title:d_cumbria = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_lincoln = { is_titular = no } + OR = { + has_title = title:d_lincoln + completely_controls = title:d_lincoln + } + } + title:d_lincoln = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_nottingham = { is_titular = no } + OR = { + has_title = title:d_nottingham + completely_controls = title:d_nottingham + } + } + title:d_nottingham = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_lancaster = { is_titular = no } + OR = { + has_title = title:d_lancaster + completely_controls = title:d_lancaster + } + } + title:d_lancaster = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_leicester = { is_titular = no } + OR = { + has_title = title:d_leicester + completely_controls = title:d_leicester + } + } + title:d_leicester = { set_de_jure_liege_title = title:k_doggerlaw } + } + if = { + limit = { + title:d_norfolk = { is_titular = no } + OR = { + has_title = title:d_norfolk + completely_controls = title:d_norfolk + } + } + title:d_norfolk = { set_de_jure_liege_title = title:k_doggerlaw } + } + } +} + +restore_great_moravia_effect = { + add_prestige = massive_prestige_gain + + save_scope_as = scoped_ruler + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + + title:k_great_moravia = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + hidden_effect = { + set_primary_title_to = title:k_great_moravia + + title:d_moravia = { set_de_jure_liege_title = title:k_great_moravia } + title:d_nyitra = { set_de_jure_liege_title = title:k_great_moravia } + title:d_banska_bystrica = { set_de_jure_liege_title = title:k_great_moravia } + title:d_trencin = { set_de_jure_liege_title = title:k_great_moravia } + title:d_tatra = { set_de_jure_liege_title = title:k_great_moravia } + + if = { + limit = { + title:k_hungary = { is_titular = no } + OR = { + has_title = title:k_hungary + completely_controls = title:k_hungary + } + } + destroy_title = title:k_hungary + } + + if = { + limit = { + title:k_bohemia = { is_titular = no } + OR = { + has_title = title:k_bohemia + completely_controls = title:k_bohemia + } + } + destroy_title = title:k_bohemia + } + + if = { + limit = { + title:k_galicia-volhynia = { is_titular = no } + OR = { + has_title = title:k_galicia-volhynia + completely_controls = title:k_galicia-volhynia + } + } + destroy_title = title:k_galicia-volhynia + } + + + + if = { + limit = { + title:d_gyor = { is_titular = no } + OR = { + has_title = title:d_gyor + completely_controls = title:d_gyor + } + } + title:d_gyor = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_visegrad = { is_titular = no } + OR = { + has_title = title:d_visegrad + completely_controls = title:d_visegrad + } + } + title:d_visegrad = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_somogy = { is_titular = no } + OR = { + has_title = title:d_somogy + completely_controls = title:d_somogy + } + } + title:d_somogy = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_szekesfehervar = { is_titular = no } + OR = { + has_title = title:d_szekesfehervar + completely_controls = title:d_szekesfehervar + } + } + title:d_szekesfehervar = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_bacs = { is_titular = no } + OR = { + has_title = title:d_bacs + completely_controls = title:d_bacs + } + } + title:d_bacs = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_tiszantul = { is_titular = no } + OR = { + has_title = title:d_tiszantul + completely_controls = title:d_tiszantul + } + } + title:d_tiszantul = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_ungvar = { is_titular = no } + OR = { + has_title = title:d_ungvar + completely_controls = title:d_ungvar + } + } + title:d_ungvar = { set_de_jure_liege_title = title:k_great_moravia } + } + if = { + limit = { + title:d_transcarpathia = { is_titular = no } + OR = { + has_title = title:d_transcarpathia + completely_controls = title:d_transcarpathia + } + } + title:d_transcarpathia = { set_de_jure_liege_title = title:k_great_moravia } + } + } +} + +form_carpathia_effect = { + add_prestige = massive_prestige_gain + + save_scope_as = scoped_ruler + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + + title:e_carpathia = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + hidden_effect = { + set_primary_title_to = title:e_carpathia + + title:k_hungary = { set_de_jure_liege_title = title:e_carpathia } + title:k_slovakia = { set_de_jure_liege_title = title:e_carpathia } + title:k_galicia-volhynia = { set_de_jure_liege_title = title:e_carpathia } + title:k_transylvania = { set_de_jure_liege_title = title:e_carpathia } + + if = { + limit = { + title:k_dacia = { is_titular = no } + OR = { + has_title = title:k_dacia + completely_controls = title:k_dacia + } + } + title:k_dacia = { set_de_jure_liege_title = title:e_carpathia } + } + if = { + limit = { + title:k_moldavia = { is_titular = no } + OR = { + has_title = title:k_moldavia + completely_controls = title:k_moldavia + } + } + title:k_moldavia = { set_de_jure_liege_title = title:e_carpathia } + } + } +} +form_ossiland_decision_effect = { + add_prestige = massive_prestige_gain + + save_scope_as = scoped_ruler + + give_nickname = nick_the_ossi + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + + title:k_ossiland = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + hidden_effect = { + trigger_event = NEOW_decision.0004 + + set_primary_title_to = title:k_ossiland + + title:d_nordmark = { set_de_jure_liege_title = title:k_ossiland } + title:d_vorpommern = { set_de_jure_liege_title = title:k_ossiland } + title:d_ostmark = { set_de_jure_liege_title = title:k_ossiland } + title:d_anhalt = { set_de_jure_liege_title = title:k_ossiland } + title:d_lower_lusatia = { set_de_jure_liege_title = title:k_ossiland } + title:d_upper_lusatia = { set_de_jure_liege_title = title:k_ossiland } + title:d_meissen = { set_de_jure_liege_title = title:k_ossiland } + title:d_thuringia = { set_de_jure_liege_title = title:k_ossiland } + title:k_ossiland = { set_de_jure_liege_title = title:e_germany } + + if = { + limit = { + title:k_brandenburg = { is_titular = no } + OR = { + has_title = title:k_brandenburg + } + } + destroy_title = title:k_brandenburg + } + + if = { + limit = { + title:k_sorbia = { is_titular = no } + OR = { + has_title = title:k_sorbia + } + } + destroy_title = title:k_sorbia + } + } +} +troy_decision_effect = { + add_prestige = massive_prestige_gain + add_piety = massive_piety_gain + + save_scope_as = scoped_ruler + + create_title_and_vassal_change = { + type = created + save_scope_as = change + add_claim_on_loss = no + } + + title:k_troy = { + change_title_holder = { + holder = scope:scoped_ruler + change = scope:change + } + } + + resolve_title_and_vassal_change = scope:change + + hidden_effect = { + title:d_optimatoi = { + set_de_jure_liege_title = title:k_troy + } + title:d_opsikion = { + set_de_jure_liege_title = title:k_troy + } + title:d_thrace = { + set_de_jure_liege_title = title:k_troy + + + title:k_troy = { + set_de_jure_liege_title = title:e_turkey + } + + if = { + limit = { + highest_held_title_tier <= tier_kingdom + } + set_primary_title_to = title:k_troy + } + } +} \ No newline at end of file diff --git a/common/scripted_effects/pam_effects.txt b/common/scripted_effects/pam_effects.txt deleted file mode 100644 index 14a8ef256..000000000 --- a/common/scripted_effects/pam_effects.txt +++ /dev/null @@ -1,14582 +0,0 @@ -#create_appropriate_relic_artifact_effect -#create_artifact_pedestal_bible_effect -#create_artifact_pedestal_thurible_effect -#create_artifact_pedestal_situla_effect -#create_artifact_pedestal_crozier_effect -#create_christian_religious_artifact_effect -#pam_miles_christi_white_peace_effect -#pam_miles_christi_fulfillment_from_combat_effect -#pam_miles_christi_holy_weapon_victory_effect -#pam_miles_christi_holy_weapon_gain_victory_effect -#pam_miles_christi_holy_weapon_blessing_effect -#pam_tenet_scholasticism_university_bonus_effect -#pam_tenet_scholasticism_yearly_effect -#pam_tenet_scholasticism_studium_effect -#pam_harmonious_society_five_bonds_effect -#pam_harmonious_society_apply_five_bonds_effect -#pam_tenet_purgatory_sin_penalty_effect -#pam_tenet_apostolic_succession_episcopate_effect -#pam_tenet_divine_liturgy_choirs_effect -#pam_tenet_divine_liturgy_officiant_effect -#pam_pentarchy_circuit_entourage_effect -#pam_pentarchy_pilgrim_circuit_effect -#add_scholar_trait_or_xp_effect -#pam_remove_forbidden_personal_tenet_secret_if_invalid_effect -#pam_faith_cleanup_forbidden_personal_tenet_secrets_effect -#pam_faith_grant_forbidden_personal_tenet_secrets_effect -#on_personal_tenet_gain_secret_gain_effect -#pam_ai_personal_tenet_pulse_effect -#conversion_tenet_acts_of_the_apostles_legitimacy_effect -#ora_et_labora_gardener_gain_effect -#hedonistic_reveler_gain_effect -#hedonistic_obesity_modifier_sync_effect -#hedonistic_feast_gout_risk_effect -#pam_tenet_mountain_worship_rough_terrain_expert_gain_effect -#pam_tenet_mountain_worship_hike_spiritual_fulfillment_effect -#asceticism_inappetetic_gain_effect -#literalism_scholar_gain_effect -#scholasticism_scholar_gain_effect -#pam_levy_the_tithes_decision_effects -#unrelenting_faith_blademaster_gain_effect -#pam_kingdom_of_heaven_declaration_effect -#pam_create_theocratic_dynasty_extra_effects -#pam_the_christian_church_clergy_embezzled_treasury_catalyst_effect -#pam_the_christian_church_non_christian_kingdom_in_europe_catalyst_effect -#pam_the_christian_church_county_converted_to_faith_catalyst_effect -#pam_the_christian_church_county_conversion_catalysts_effect -#pam_the_christian_church_excommunication_war_catalyst_effect -#pam_the_christian_church_humiliation_war_catalyst_effect -#pam_the_christian_church_clergy_has_child_catalyst_effect -#pam_determine_ghw_target_character_from_kingdom_effect -#pam_use_bull_selected_ghw_target_effect -#pam_start_bull_great_holy_war_effect -#pam_bull_notify_faith_rulers_effect -#pam_declare_rite_heresy_effect -#pam_secure_pilgrim_routes_effect -#request_white_peace_interaction_effect -#request_victory_interaction_effect -#request_enforce_succession_interaction_effect -#pam_enforce_title_succession_effect -#pam_increase_papabile_score_effect -#pam_on_conversion_effect -#pam_cardinal_vacancy_on_death_effect -#pam_evangelize_personal_tenet_effect -#pam_evangelize_personal_tenet_decline_effect - -create_appropriate_relic_artifact_effect = { - hidden_effect_new_object = { - if = { - limit = { religion = religion:christianity_religion } - create_artifact_pedestal_reliquary_christian_effect = { OWNER = $OWNER$ } - } - else_if = { - limit = { religion = religion:islam_religion } - create_artifact_pedestal_reliquary_islam_effect = { OWNER = $OWNER$ } - } - else_if = { - limit = { religion = religion:buddhism_religion } - create_artifact_pedestal_reliquary_buddhism_effect = { OWNER = $OWNER$ } - } - else_if = { - limit = { religion = religion:judaism_religion } - create_artifact_pedestal_reliquary_judaism_effect = { OWNER = $OWNER$ } - } - else = { - create_artifact_sculpture_religious_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - scope:newly_created_artifact = { - set_variable = relic # Adds the Relic flag - } - if = { # Makes a regular character artifact if you don't have a Royal Court - limit = { - has_royal_court = no - } - scope:newly_created_artifact = { - reforge_artifact = { type = miscellaneous } - } - } - } -} - -create_artifact_pedestal_bible_effect = { - $OWNER$ = { save_scope_as = owner } - $CREATOR$ = { save_scope_as = creator } - - get_artifact_quality_effect = yes - get_artifact_wealth_effect = yes - - scope:owner = { - create_artifact = { - name = artifact_pedestal_bible_name - creator = scope:creator - description = artifact_pedestal_bible_description - visuals = pam_bible - type = pedestal - template = cross_template - modifier = artifact_placeholder_modifier - save_scope_as = newly_created_artifact - wealth = scope:wealth - quality = scope:quality - } - } - - scope:newly_created_artifact = { - add_scaled_artifact_modifier_devotion_effect = yes - add_scaled_artifact_modifier_grandeur_small_effect = yes - if = { - limit = { - OR = { - rarity = famed - rarity = illustrious - } - } - add_scaled_artifact_modifier_piety_effect = yes - } - remove_artifact_modifier = artifact_placeholder_modifier - } -} - -create_artifact_pedestal_thurible_effect = { - $OWNER$ = { save_scope_as = owner } - $CREATOR$ = { save_scope_as = creator } - - get_artifact_quality_effect = yes - get_artifact_wealth_effect = yes - - scope:owner = { - create_artifact = { - name = artifact_pedestal_thurible_name - creator = scope:creator - description = artifact_pedestal_thurible_description - visuals = pam_thurible - type = pedestal - template = cross_template - modifier = artifact_placeholder_modifier - save_scope_as = newly_created_artifact - wealth = scope:wealth - quality = scope:quality - } - } - - scope:newly_created_artifact = { - add_scaled_artifact_modifier_devotion_effect = yes - add_scaled_artifact_modifier_grandeur_small_effect = yes - if = { - limit = { - OR = { - rarity = famed - rarity = illustrious - } - } - add_scaled_artifact_modifier_piety_effect = yes - } - remove_artifact_modifier = artifact_placeholder_modifier - } -} - -create_artifact_pedestal_situla_effect = { - $OWNER$ = { save_scope_as = owner } - $CREATOR$ = { save_scope_as = creator } - - get_artifact_quality_effect = yes - get_artifact_wealth_effect = yes - - scope:owner = { - create_artifact = { - name = artifact_pedestal_situla_name - creator = scope:creator - description = artifact_pedestal_situla_description - visuals = pam_situla - type = pedestal - template = cross_template - modifier = artifact_placeholder_modifier - save_scope_as = newly_created_artifact - wealth = scope:wealth - quality = scope:quality - } - } - - scope:newly_created_artifact = { - add_scaled_artifact_modifier_devotion_effect = yes - add_scaled_artifact_modifier_grandeur_small_effect = yes - if = { - limit = { - OR = { - rarity = famed - rarity = illustrious - } - } - add_scaled_artifact_modifier_piety_effect = yes - } - remove_artifact_modifier = artifact_placeholder_modifier - } -} - -create_artifact_pedestal_crozier_effect = { - $OWNER$ = { save_scope_as = owner } - $CREATOR$ = { save_scope_as = creator } - - get_artifact_quality_effect = yes - get_artifact_wealth_effect = yes - - scope:owner = { - create_artifact = { - name = artifact_pedestal_crozier_name - creator = scope:creator - description = artifact_pedestal_crozier_description - visuals = pam_crozier - type = pedestal - template = cross_template - modifier = artifact_placeholder_modifier - save_scope_as = newly_created_artifact - wealth = scope:wealth - quality = scope:quality - } - } - - scope:newly_created_artifact = { - add_scaled_artifact_modifier_devotion_effect = yes - add_scaled_artifact_modifier_grandeur_small_effect = yes - if = { - limit = { - OR = { - rarity = famed - rarity = illustrious - } - } - add_scaled_artifact_modifier_piety_effect = yes - } - remove_artifact_modifier = artifact_placeholder_modifier - } -} - -create_christian_religious_artifact_effect = { - hidden_effect_new_object = { - random_list = { - 1 = { - create_artifact_pedestal_cross_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - 1 = { - trigger = { - rite = { - NOT = { rite_has_tenet = tenet_aniconism } - } - } - create_artifact_pedestal_crucifix_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - 1 = { - create_artifact_sculpture_religious_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - 1 = { - create_artifact_pedestal_bible_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - 1 = { - create_artifact_pedestal_thurible_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - 1 = { - create_artifact_pedestal_situla_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - 1 = { - create_artifact_pedestal_crozier_effect = { OWNER = $OWNER$ CREATOR = $CREATOR$ } - } - } - if = { # Makes a regular character artifact if you don't have a Royal Court - limit = { - has_royal_court = no - } - scope:newly_created_artifact = { reforge_artifact = { type = miscellaneous } } - } - } -} - -# Called from wars on_white_peace -pam_miles_christi_white_peace_effect = { - scope:defender = { - if = { - limit = { - rite = { rite_has_parameter = tenet_miles_christi_white_peace_defender_bonus } - scope:attacker = { - faith = scope:defender.faith - } - } - add_piety = { - value = medium_piety_gain - multiply = scope:attacker.primary_title.tier - multiply = scope:defender.primary_title.tier - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - add_legitimacy = { - value = medium_legitimacy_gain - multiply = scope:attacker.primary_title.tier - multiply = scope:defender.primary_title.tier - } - } - } -} -# Both on_combat_end_loser and on_combat_end_winner fire this -pam_miles_christi_fulfillment_from_combat_effect = { - if = { - limit = { - rite = { rite_has_parameter = tenet_miles_christi_combat_fulfillment } - } - send_interface_toast = { - title = successful_battles_and_sieges_give_sp_toast - left_icon = root - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - } -} - -# Called from on_combat_end_winner in the scope of the winning combat side. -pam_miles_christi_holy_weapon_victory_effect = { - if = { - limit = { - exists = enemy_side.side_primary_participant - } - enemy_side.side_primary_participant = { - save_temporary_scope_as = pam_holy_weapon_enemy - } - every_side_commander = { - limit = { - rite = { rite_has_parameter = tenet_miles_christi_holy_weapon_blessing } - NOT = { faith.religion = scope:pam_holy_weapon_enemy.faith.religion } - } - every_character_artifact = { - limit = { pam_holy_weapon_trigger = yes } - pam_miles_christi_holy_weapon_gain_victory_effect = yes - } - } - } -} - -# Artifact scope. Tallies one holy victory and steps up the blessing when a threshold is crossed. -pam_miles_christi_holy_weapon_gain_victory_effect = { - if = { - limit = { NOT = { has_variable = pam_holy_weapon_victories_var } } - set_variable = { - name = pam_holy_weapon_victories_var - value = 1 - } - } - else = { - change_variable = { - name = pam_holy_weapon_victories_var - add = 1 - } - } - - if = { - limit = { - NOT = { has_variable = pam_holy_weapon_blessing_var } - var:pam_holy_weapon_victories_var >= 5 - } - set_variable = { - name = pam_holy_weapon_blessing_var - value = 1 - } - pam_miles_christi_holy_weapon_blessing_effect = { MODIFIER = pam_holy_weapon_1_artifact_modifier } - } - else_if = { - limit = { - has_variable = pam_holy_weapon_blessing_var - var:pam_holy_weapon_blessing_var = 1 - var:pam_holy_weapon_victories_var >= 15 - } - change_variable = { - name = pam_holy_weapon_blessing_var - add = 1 - } - pam_miles_christi_holy_weapon_blessing_effect = { MODIFIER = pam_holy_weapon_2_artifact_modifier } - } - else_if = { - limit = { - has_variable = pam_holy_weapon_blessing_var - var:pam_holy_weapon_blessing_var = 2 - var:pam_holy_weapon_victories_var >= 30 - } - change_variable = { - name = pam_holy_weapon_blessing_var - add = 1 - } - pam_miles_christi_holy_weapon_blessing_effect = { MODIFIER = pam_holy_weapon_3_artifact_modifier } - } - else_if = { - limit = { - has_variable = pam_holy_weapon_blessing_var - var:pam_holy_weapon_blessing_var = 3 - var:pam_holy_weapon_victories_var >= 50 - } - change_variable = { - name = pam_holy_weapon_blessing_var - add = 1 - } - pam_miles_christi_holy_weapon_blessing_effect = { MODIFIER = pam_holy_weapon_4_artifact_modifier } - } -} - -# Artifact scope -# MODIFIER = the artifact modifier for the tier being reached -pam_miles_christi_holy_weapon_blessing_effect = { - save_temporary_scope_as = pam_holy_weapon - add_artifact_modifier = $MODIFIER$ - artifact_owner ?= { - send_interface_toast = { - type = event_toast_effect_good - title = pam_holy_weapon_blessing_toast - desc = pam_holy_weapon_blessing_toast_desc - left_icon = this - right_icon = scope:pam_holy_weapon - show_as_tooltip = { - scope:pam_holy_weapon = { - add_artifact_modifier = $MODIFIER$ - } - } - } - } -} - -pam_pursuit_of_power_war_victory_fulfillment_effect = { - scope:winner = { - if = { - limit = { - has_personal_tenet_flag = tenet_pursuit_of_power_war_victory_fulfillment - scope:war.casus_belli = { - any_target_title = { is_landless_type_title = no } - } - } - send_interface_toast = { - title = pam_pursuit_of_power_war_victory_toast - left_icon = root - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } - } - } -} - -# Only rewards paying for someone else's freedom in gold; self-ransoms and favour settlements do not count. -pam_philanthropia_ransom_payer_effect = { - scope:payer = { - if = { - limit = { - has_personal_tenet_flag = tenet_philanthropia_ransom_captives - this != scope:prisoner - pam_philanthropia_ransom_gold_value > 0 - } - send_interface_toast = { - title = pam_philanthropia_ransom_toast - left_icon = scope:prisoner - add_piety = pam_philanthropia_ransom_piety_value - change_spiritual_fulfillment = pam_philanthropia_ransom_fulfillment_value - } - } - } -} - -# Rewards releasing or exiling a prisoner outright; anything extracted from them first makes it a bargain. -tenet_benevolent_governance_clemency_effect = { - scope:puppet_or_actor = { - if = { - limit = { - has_personal_tenet_flag = tenet_benevolent_governance_clemency_fulfillment - OR = { - tenet_benevolent_governance_unconditional_release_trigger = yes - AND = { - scope:banish = yes - has_execute_reason = scope:recipient - } - } - } - if = { - limit = { is_ai = no } - send_interface_toast = { - type = event_generic_good - title = benevolent_governance_clemency_fulfillment_toast - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - change_spiritual_fulfillment = tenet_benevolent_governance_clemency_fulfillment_value - } - } - else = { - change_spiritual_fulfillment = tenet_benevolent_governance_clemency_fulfillment_value - } - } - } -} - -pam_be_fruitful_fruitful_upbringing_effect = { - if = { - limit = { - exists = scope:father - OR = { - scope:mother ?= { has_personal_tenet_flag = tenet_be_fruitful_and_multiply_fruitful_upbringing } - scope:father ?= { has_personal_tenet_flag = tenet_be_fruitful_and_multiply_fruitful_upbringing } - } - } - scope:child = { - if = { - limit = { - scope:mother ?= { has_relation_soulmate = scope:father } - } - add_character_modifier = { - modifier = tenet_be_fruitful_and_multiply_fruitful_upbringing_devoted - years = 16 - } - } - else_if = { - limit = { - scope:mother ?= { - OR = { - has_relation_lover = scope:father - has_relation_best_friend = scope:father - } - } - } - add_character_modifier = { - modifier = tenet_be_fruitful_and_multiply_fruitful_upbringing_close - years = 16 - } - } - else_if = { - limit = { - scope:mother ?= { - OR = { - has_relation_friend = scope:father - opinion = { - target = scope:father - value >= medium_positive_opinion - } - } - } - } - add_character_modifier = { - modifier = tenet_be_fruitful_and_multiply_fruitful_upbringing_fond - years = 16 - } - } - } - } -} - -# PAM Scholasticism tenet effect -pam_tenet_scholasticism_university_bonus_effect = { - if = { - limit = { - rite = { rite_has_parameter = tenet_scholasticism_university_bonus } - } - add_character_modifier = { - modifier = tenet_scholasticism_modifier - years = 20 - } - } -} - -pam_pentarchy_circuit_entourage_effect = { - if = { - limit = { exists = involved_activity } - save_temporary_scope_as = pam_pentarchy_circuit_pilgrim - involved_activity = { - every_attending_character = { - limit = { this != scope:pam_pentarchy_circuit_pilgrim } - custom = pam_pentarchy_circuit_entourage_tt - hidden_effect = { - local_court_type_skill_point_effect = { - PROVINCE = scope:pam_pentarchy_circuit_pilgrim.location - } - } - } - } - } -} - -# Pentarchy tenet is already checked when pilgrimage_additional_reward_effect fires this -pam_pentarchy_pilgrim_circuit_effect = { - save_temporary_scope_as = pam_pentarchy_pilgrim - if = { - limit = { - NOT = { has_character_flag = pam_pentarchy_circuit_completed } - exists = scope:pam_pentarchy_pilgrim.location.barony - faith = { - any_holy_site_barony = { this = scope:pam_pentarchy_pilgrim.location.barony } - } - } - scope:pam_pentarchy_pilgrim.location.barony = { - save_temporary_scope_as = pam_pentarchy_see - } - if = { - limit = { - OR = { - NOT = { has_variable_list = pam_pentarchy_sees_visited } - NOT = { - is_target_in_variable_list = { - name = pam_pentarchy_sees_visited - target = scope:pam_pentarchy_see - } - } - } - } - add_to_variable_list = { - name = pam_pentarchy_sees_visited - target = scope:pam_pentarchy_see - } - - # Recount vs current holy sites so a conversion since visiting self-corrects - set_variable = { - name = pam_pentarchy_sees_total - value = 0 - } - set_variable = { - name = pam_pentarchy_sees_count - value = 0 - } - faith = { - every_holy_site = { - limit = { exists = holy_site_barony } - holy_site_barony = { save_temporary_scope_as = pam_pentarchy_counted_see } - scope:pam_pentarchy_pilgrim = { - change_variable = { - name = pam_pentarchy_sees_total - add = 1 - } - if = { - limit = { - is_target_in_variable_list = { - name = pam_pentarchy_sees_visited - target = scope:pam_pentarchy_counted_see - } - } - change_variable = { - name = pam_pentarchy_sees_count - add = 1 - } - } - } - } - } - - if = { - limit = { - # The log entry's description is drawn before the counters above are set - has_variable = pam_pentarchy_sees_total - var:pam_pentarchy_sees_total > 0 - var:pam_pentarchy_sees_count >= var:pam_pentarchy_sees_total - } - add_character_flag = pam_pentarchy_circuit_completed - send_interface_toast = { - type = event_toast_text_and_effect_good - title = pam_pentarchy_circuit_completed_toast - desc = pam_pentarchy_circuit_completed_toast_desc - left_icon = scope:pam_pentarchy_pilgrim - add_character_modifier = { - modifier = pam_pilgrim_of_every_holy_site_modifier - } - add_piety = massive_piety_gain - change_spiritual_fulfillment = major_spiritual_fulfillment_value - if = { - limit = { has_personal_tenet_flag = tenet_pentarchy_pilgrim_circuit_companions } - pam_pentarchy_circuit_entourage_effect = yes - } - } - } - else = { - send_interface_message = { - type = event_generic_good_with_text - title = pam_pentarchy_see_visited_message - desc = pam_pentarchy_see_visited_message_desc - left_icon = scope:pam_pentarchy_pilgrim - add_piety = medium_piety_gain - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - if = { - limit = { has_personal_tenet_flag = tenet_pentarchy_pilgrim_circuit_companions } - pam_pentarchy_circuit_entourage_effect = yes - } - } - } - } - } -} - -pam_tenet_scholasticism_yearly_effect = { - random = { - chance = { - value = 5 - if = { - limit = { - is_ai = no - } - add = 5 - } - if = { - limit = { - learning >= 30 - } - add = 2 - } - if = { - limit = { - learning >= 40 - } - add = 3 - } - if = { - limit = { - piety_level >= 4 - } - add = 2 - } - if = { - limit = { - piety_level >= 5 - } - add = 3 - } - if = { - limit = { - num_of_known_languages >= 3 - } - add = 2 - } - if = { - limit = { - num_of_known_languages >= 5 - } - add = 3 - } - } - send_interface_toast = { - type = event_toast_effect_good - title = pam_tenet_scholasticism_toast_title - left_icon = root - add_character_modifier = { - modifier = tenet_scholasticism_modifier - years = 20 - } - } - } -} - -pam_tenet_scholasticism_studium_effect = { - save_scope_as = studium_master - current_travel_plan ?= { - random_entourage_character = { - limit = { - NOT = { this = scope:studium_master } - is_physically_able_ai_adult = yes - ep1_is_valid_character_for_inspiration_trigger = yes - } - random = { - chance = pam_scholasticism_studium_inspiration_chance_value - create_inspiration = book_inspiration - save_scope_as = pam_studium_scholar - scope:studium_master = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_tenet_scholasticism_studium_toast_title - desc = pam_tenet_scholasticism_studium_toast_desc - left_icon = scope:pam_studium_scholar - } - } - } - } - } -} -add_scholar_trait_or_xp_effect = { - if = { - limit = { - NOT = { has_trait = lifestyle_scholar } - } - add_trait = lifestyle_scholar - } - else = { - add_trait_xp = { - trait = lifestyle_scholar - value = $VALUE$ - } - } -} - -save_most_suitable_monastic_leader_effect = { - #Patronized by puppet_or_actor - random_faith_holy_order = { - limit = { - take_the_vows_valid_monastic_order_trigger = { CHARACTER = scope:puppet_or_actor } - holy_order_patron = scope:puppet_or_actor - } - leader = { - save_scope_as = archabbot - } - } - #leases from puppet_or_actor - if = { - limit = { - NOT = { - exists = scope:archabbot - } - } - random_faith_holy_order = { - limit = { - take_the_vows_valid_monastic_order_trigger = { CHARACTER = scope:puppet_or_actor } - any_leased_title = { - county.holder ?= scope:puppet_or_actor - } - } - leader = { - save_scope_as = archabbot - } - } - } - #patronized by puppet_or_actor's superior - if = { - limit = { - NOT = { - exists = scope:archabbot - } - } - random_faith_holy_order = { - limit = { - take_the_vows_valid_monastic_order_trigger = { CHARACTER = scope:puppet_or_actor } - holy_order_patron = { - is_liege_or_above_of = scope:puppet_or_actor - } - } - leader = { - save_scope_as = archabbot - } - } - } - #in same realm as puppet_or_actor - if = { - limit = { - NOT = { - exists = scope:archabbot - } - } - random_faith_holy_order = { - limit = { - take_the_vows_valid_monastic_order_trigger = { CHARACTER = scope:puppet_or_actor } - any_leased_title = { - county.holder.top_liege ?= scope:puppet_or_actor.top_liege - } - } - leader = { - save_scope_as = archabbot - } - } - } - #in diplo range of puppet_or_actor - if = { - limit = { - NOT = { - exists = scope:archabbot - } - } - random_faith_holy_order = { - limit = { - take_the_vows_valid_monastic_order_trigger = { CHARACTER = scope:puppet_or_actor } - leader = { - in_diplomatic_range = scope:puppet_or_actor - } - } - leader = { - save_scope_as = archabbot - } - } - } - #any order - if = { - limit = { - NOT = { - exists = scope:archabbot - } - } - random_faith_holy_order = { - limit = { - take_the_vows_valid_monastic_order_trigger = { CHARACTER = scope:puppet_or_actor } - } - leader = { - save_scope_as = archabbot - } - } - } -} - -# Saeculum Obscurum ends - time to get divorced -pam_the_christian_church_saeculum_obscurum_end_clergy_divorce_effect = { - every_situation_participant = { - limit = { - is_clergy = yes - rite = { rite_has_doctrine = doctrine_clerical_marriage_disallowed } - } - hidden_effect = { - if = { - limit = { - is_married = yes - is_ai = yes - } - every_spouse = { - limit = { is_ai = yes } - save_temporary_scope_as = saeculum_clergy_divorcee - less_verbose_divorce_effect = { - DIVORCER = prev - DIVORCEE = scope:saeculum_clergy_divorcee - } - } - } - if = { - limit = { exists = betrothed } - break_betrothal = betrothed - } - } - } -} - -#The Christian Church phase start effect - -# Phase on_start runs with situation as root; every_player does not iterate players from that context. Iterate situation participants instead (cf. the_great_steppe phase on_start). -the_christian_church_fire_event_for_participant_players_effect = { - if = { - limit = { - NOT = { has_global_variable = pam_skip_tcc_phase_start_event } - } - every_player = { - limit = { - # Saeculum Obscurum on_start fires the schism start event - trigger_if = { - limit = { - situation:the_christian_church ?= { situation_current_phase = saeculum_obscurum } - } - situation:the_christian_church ?= { - NOT = { has_variable = pam_great_schism_status } - } - } - OR = { - government_has_flag = government_is_theocracy - years_from_game_start >= 1 - } - any_character_situation = { - this = situation:the_christian_church - } - } - trigger_event = $EVENT$ - } - } -} - -#The Christian Church situation effects -the_christian_church_fire_correct_phase_start_event_for_player_effect = { - if = { - limit = { - is_ai = no - is_player_tutorial_character = no - NOT = { has_global_variable = pam_skip_tcc_phase_start_event } - OR = { - government_has_flag = government_is_theocracy - years_from_game_start >= 1 - } - } - save_scope_as = situation_participant - situation:the_christian_church = { - switch = { - trigger = situation_current_phase - fragile_unity = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0051 - } - } - saeculum_obscurum = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0052 - } - } - conversion_phase = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0053 - } - } - reform_phase = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0054 - } - } - investiture_crisis = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0055 - } - } - crusade_phase = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0056 - } - } - concord = { - scope:situation_participant = { - trigger_event = pam_the_christian_church.0057 - } - } - } - } - } -} - -pam_remove_forbidden_personal_tenet_secret_if_invalid_effect = { - if = { - limit = { - any_secret = { type = secret_forbidden_personal_tenet } - NOT = { pam_has_forbidden_personal_tenet_trigger = yes } - } - every_secret = { - type = secret_forbidden_personal_tenet - remove_secret = yes - } - } -} - -# Faith scope -pam_faith_cleanup_forbidden_personal_tenet_secrets_effect = { - hidden_effect = { - every_faith_character = { - pam_remove_forbidden_personal_tenet_secret_if_invalid_effect = yes - } - } -} - -# Faith scope. TENET is the tenet just prohibited -pam_faith_grant_forbidden_personal_tenet_secrets_effect = { - hidden_effect = { - every_faith_character = { - limit = { - has_personal_tenet = $TENET$ - NOT = { any_secret = { type = secret_forbidden_personal_tenet } } - } - on_personal_tenet_gain_secret_gain_effect = yes - } - } -} - -on_personal_tenet_gain_secret_gain_effect = { - # AI on_personal_tenet_gain is delayed, so the prohibited tenet may already be gone - if = { - limit = { pam_has_forbidden_personal_tenet_trigger = yes } - send_interface_toast = { - title = on_personal_tenet_gain_secret_gain_effect_tt - left_icon = root - add_secret = { - type = secret_forbidden_personal_tenet - target = this - } - if = { - limit = { exists = var:tenet_evangelized_by } - var:tenet_evangelized_by = { save_temporary_scope_as = tenet_evangelizer } - every_secret = { - type = secret_forbidden_personal_tenet - reveal_to = scope:tenet_evangelizer - } - remove_variable = tenet_evangelized_by - } - } - } -} - -# Called from five_year_playable_pulse. Root is the character. -pam_ai_personal_tenet_pulse_effect = { - if = { - limit = { - is_physically_able_ai = yes - } - - # Phase 0: cardinals may hold beliefs their rite prohibits, so a new pontiff can arrive carrying one - # Ahead of Phase 1 so the freed slot refills this pulse; on_personal_tenet_loss clears the secret - if = { - limit = { - pam_holds_college_elected_church_seat_trigger = yes - pam_has_forbidden_personal_tenet_trigger = yes - } - faith.main_rite = { save_temporary_scope_as = pam_pontiff_rite } - while = { - count = 8 - limit = { pam_has_forbidden_personal_tenet_trigger = yes } - random_personal_tenet = { - limit = { - scope:pam_pontiff_rite = { - has_tenet_status = { - tenet = prev - status = prohibited - } - } - } - root = { remove_personal_tenet = prev } - } - } - } - - # Phase 1: fill every empty personal tenet slot. No chance gate - empty slots are wasted SF and immersion. - # 8 = safety upper bound on slot cap (base 1 + up to ~5 from piety levels, with headroom). - while = { - count = 8 - limit = { - free_personal_tenet_slots > 0 - any_desired_tenet = { - only_positive = yes - threshold = 1 - selection_count = 97 - save_temporary_scope_as = pam_personal_tenet_candidate - NOT = { - root = { - any_personal_tenet = { - this = scope:pam_personal_tenet_candidate - } - } - } - OR = { - NOT = { - root.faith.main_rite = { - has_tenet_status = { - tenet = scope:pam_personal_tenet_candidate - status = prohibited - } - } - } - root = { pam_ai_can_consider_forbidden_personal_tenet_trigger = yes } - } - } - } - - random_desired_tenet = { - only_positive = yes - threshold = 1 - selection_count = 97 - limit = { - save_temporary_scope_as = pam_personal_tenet_candidate - NOT = { - root = { - any_personal_tenet = { - this = scope:pam_personal_tenet_candidate - } - } - } - OR = { - NOT = { - root.faith.main_rite = { - has_tenet_status = { - tenet = scope:pam_personal_tenet_candidate - status = prohibited - } - } - } - root = { pam_ai_can_consider_forbidden_personal_tenet_trigger = yes } - } - } - root = { set_personal_tenet = prev } - } - } - - # Phase 2: chance-gated swap, only when there are no free slots left to fill. - if = { - limit = { - free_personal_tenet_slots <= 0 - any_desired_tenet = { - only_positive = yes - threshold = 1 - selection_count = 97 - save_temporary_scope_as = pam_personal_tenet_candidate - NOT = { - root = { - any_personal_tenet = { - this = scope:pam_personal_tenet_candidate - } - } - } - OR = { - NOT = { - root.faith.main_rite = { - has_tenet_status = { - tenet = scope:pam_personal_tenet_candidate - status = prohibited - } - } - } - root = { pam_ai_can_consider_forbidden_personal_tenet_trigger = yes } - } - } - } - - random = { - chance = 30 - modifier = { - add = 15 - has_trait = zealous - } - modifier = { - add = -15 - has_trait = cynical - } - modifier = { - add = { - value = ai_zeal - divide = 5 - } - } - modifier = { - add = { - value = ai_boldness - divide = 5 - } - } - - # Pick the new tenet - Random of any positive-SF known tenet, not strictly the best. - random_desired_tenet = { - only_positive = yes - threshold = 1 - selection_count = 97 - limit = { - save_temporary_scope_as = pam_personal_tenet_candidate - NOT = { - root = { - any_personal_tenet = { - this = scope:pam_personal_tenet_candidate - } - } - } - OR = { - NOT = { - root.faith.main_rite = { - has_tenet_status = { - tenet = scope:pam_personal_tenet_candidate - status = prohibited - } - } - } - root = { pam_ai_can_consider_forbidden_personal_tenet_trigger = yes } - } - } - root = { force_set_personal_tenet = prev } - } - } - } - } -} - -conversion_tenet_acts_of_the_apostles_effect = { - scope:puppet_or_actor = { - if = { - limit = { # Legitimacy if core to the faith - rite = { - rite_has_parameter = tenet_acts_of_apostles_legitimacy_from_converts - } - is_valid_for_legitimacy_change = yes - } - send_interface_toast = { - title = conversion_tenet_acts_of_the_apostles_effect_legitimacy_tt - left_icon = scope:puppet_or_actor - add_legitimacy = minor_legitimacy_gain - } - } - if = { - limit = { # SP if personal tenet - converting the mighty pays more - has_personal_tenet_flag = tenet_acts_of_apostles_fulfillment_from_converts - scope:recipient ?= { is_landed = yes } - } - send_interface_toast = { - title = conversion_tenet_acts_of_the_apostles_effect_sp_tt - left_icon = scope:puppet_or_actor - change_spiritual_fulfillment = major_spiritual_fulfillment_value - } - } - else_if = { - limit = { - has_personal_tenet_flag = tenet_acts_of_apostles_fulfillment_from_converts - } - send_interface_toast = { - title = conversion_tenet_acts_of_the_apostles_effect_sp_tt - left_icon = scope:puppet_or_actor - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - } - if = { - limit = { # Piety if core to the faith, scaled steeply by the convert's rank - rite = { rite_has_parameter = tenet_acts_of_apostles_piety_from_converts } - scope:recipient ?= { highest_held_title_tier >= tier_barony } - } - send_interface_toast = { - title = conversion_tenet_acts_of_the_apostles_effect_piety_tt - left_icon = scope:puppet_or_actor - add_piety = pam_acts_conversion_piety_value - } - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:puppet_or_actor = { - rite = { rite_has_parameter = tenet_acts_of_apostles_legitimacy_from_converts } - is_valid_for_legitimacy_change = yes - } - } - scope:actor = { - send_interface_toast = { - title = conversion_tenet_acts_of_the_apostles_effect_legitimacy_tt_puppeteer - left_icon = scope:puppet_or_actor - } - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:puppet_or_actor = { has_personal_tenet_flag = tenet_acts_of_apostles_fulfillment_from_converts } - } - scope:actor = { - send_interface_toast = { - title = conversion_tenet_acts_of_the_apostles_effect_sp_tt_puppeteer - left_icon = scope:puppet_or_actor - } - } - } -} - -pam_tax_nonbelievers_conversion_concession_effect = { - if = { - limit = { - scope:tax_nonbelievers_conversion_concession = yes - } - scope:puppet_or_actor = { - pay_short_term_gold = { - target = scope:recipient - gold = medium_gold_value - } - send_interface_toast = { - type = event_toast_effect_good - title = pam_tax_nonbelievers_conversion_concession_toast - left_icon = scope:recipient - right_icon = scope:puppet_or_actor - } - } - } -} - -conversion_tenet_mendicant_preachers_effect = { - scope:puppet_or_actor = { - if = { - limit = { - has_personal_tenet_flag = tenet_mendicant_preachers_conversion_fulfillment - } - send_interface_toast = { - title = conversion_tenet_mendicant_preachers_effect_sp_tt - left_icon = scope:puppet_or_actor - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:puppet_or_actor = { has_personal_tenet_flag = tenet_mendicant_preachers_conversion_fulfillment } - } - scope:actor = { - send_interface_toast = { - title = conversion_tenet_mendicant_preachers_effect_sp_tt_puppeteer - left_icon = scope:puppet_or_actor - } - } - } -} - -pam_tax_nonbelievers_conversion_fulfillment_effect = { - if = { - limit = { - has_personal_tenet_flag = tax_nonbelievers_fulfillment_from_conversion - } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } -} - -ora_et_labora_gardener_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_ora_et_labora_gardener_trait - NOT = { has_trait = lifestyle_gardener } - } - add_trait = lifestyle_gardener - } -} - -pam_tenet_takamin_hunter_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_takamin_hunter_trait - NOT = { has_trait = lifestyle_hunter } - } - add_trait = lifestyle_hunter - } -} - -pam_tenet_religious_law_scholar_gain_effect = { - if = { - limit = { - scope:tenet = tenet:tenet_religious_legal_pronouncements - has_personal_tenet_flag = tenet_religious_law_scholar_trait - } - if = { - limit = { - NOT = { has_trait = lifestyle_scholar } - } - add_stress = medium_stress_gain - add_trait = lifestyle_scholar - } - } -} - -pam_tenet_filial_piety_education_completion_reward_effect = { - if = { - limit = { - NOT = { has_character_flag = pam_filial_piety_education_rewarded } - exists = scope:educator - scope:educator = { - is_parent_of = root - has_personal_tenet_flag = tenet_filial_piety_education_completion_reward - } - } - add_character_flag = pam_filial_piety_education_rewarded - scope:educator = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_filial_piety_education_completion_parent_toast - left_icon = scope:educator - right_icon = root - add_piety = major_piety_value - change_spiritual_fulfillment = major_spiritual_fulfillment_value - } - } - send_interface_toast = { - type = event_toast_effect_good - title = pam_filial_piety_education_completion_child_toast - left_icon = root - right_icon = scope:educator - add_piety = major_piety_value - if = { - limit = { is_playable_character = yes } - change_spiritual_fulfillment = major_spiritual_fulfillment_value - } - } - } -} - -# An activity already under way was planned without the vow, so its reward is forfeit -pam_vows_of_poverty_block_ongoing_activity_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_vows_of_poverty_humble_host - exists = involved_activity - involved_activity.activity_host = root - } - involved_activity = { - set_variable = pam_vows_of_poverty_completion_piety_paid - } - } -} - -pam_vows_of_poverty_host_completion_piety_effect = { - if = { - limit = { - this = scope:host - scope:host = { - has_personal_tenet_flag = tenet_vows_of_poverty_humble_host - } - scope:activity = { - NOT = { has_variable = pam_vows_of_poverty_completion_piety_paid } - } - } - scope:activity = { - set_variable = pam_vows_of_poverty_completion_piety_paid - scope:host = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_vows_of_poverty_activity_completion_piety_toast - left_icon = scope:host - add_piety = pam_vows_of_poverty_host_piety_value - } - } - } - } -} - -hedonistic_reveler_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_hedonistic_reveler_trait - NOT = { has_trait = lifestyle_reveler } - } - add_trait = lifestyle_reveler - } -} - -pam_tenet_mountain_worship_rough_terrain_expert_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_mountain_worship_rough_terrain_expert_trait - NOT = { has_trait = rough_terrain_expert } - } - add_trait = rough_terrain_expert - } -} - -pam_tenet_mountain_worship_hike_spiritual_fulfillment_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_mountain_worship_hike - location = { - OR = { - terrain = mountains - terrain = desert_mountains - } - } - } - custom_tooltip = pam_tenet_mountain_worship_hike_spiritual_fulfillment_tt - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } -} - -hedonistic_obesity_modifier_sync_effect = { - if = { - limit = { - current_weight >= overweight_value - has_personal_tenet_flag = tenet_hedonistic_obesity_fulfillment - } - if = { - limit = { - NOT = { has_character_modifier = tenet_hedonistic_obese_modifier } - } - add_character_modifier = { - modifier = tenet_hedonistic_obese_modifier - } - } - } - else_if = { - limit = { - has_character_modifier = tenet_hedonistic_obese_modifier - } - remove_character_modifier = tenet_hedonistic_obese_modifier - } -} - -hedonistic_feast_gout_risk_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_hedonistic_feast_gout_risk - current_weight >= overweight_value - can_contract_disease_trigger = { DISEASE = gout_ridden } - } - random_list = { - 75 = {} - 25 = { - send_interface_toast = { - type = event_toast_effect_bad - title = hedonistic_feast_gout_risk_toast - left_icon = root - show_as_tooltip = { add_trait_force_tooltip = gout_ridden } - hidden_effect = { - contract_disease_effect = { DISEASE = gout_ridden TREATMENT_EVENT = no } - } - } - } - } - } -} - -asceticism_inappetetic_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_asceticism_inappetetic_trait - NOT = { has_trait = inappetetic } - } - add_trait = inappetetic - } -} - -# Traits granted by a personal tenet are permanent -mortification_holy_scars_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_mortification_holy_scars - NOT = { has_trait = scarred } - } - add_trait = scarred - } -} - -# Revel in Pain belongs to Exaltation of Pain -pam_mortify_flesh_scourge_effect = { - if = { - limit = { has_personal_tenet_flag = tenet_mortification_revel_bonus } - send_interface_toast = { - type = event_generic_good - title = pam_mortification_revel_toast - left_icon = root - if = { # If you don't have the trait, it's guaranteed - limit = { - NOT = { has_trait = flagellant } - } - add_trait = flagellant - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } - } - - if = { - limit = { has_personal_tenet_flag = tenet_mortification_holy_scars } - send_interface_toast = { - type = event_generic_good - title = pam_mortification_holy_scars_toast - left_icon = root - add_trait = scarred - add_trait_xp = { - trait = scarred - value = { integer_range = { min = 10 max = 25 } } - } - } - } -} - -# Wounds cannot kill here: the player chose this from a decision. -pam_mortify_flesh_offering_effect = { - add_piety = massive_piety_value - change_spiritual_fulfillment = major_spiritual_fulfillment_value - stress_and_fulfillment_impact = { - flagellant = medium_stress_impact_loss - zealous = minor_stress_impact_loss - craven = medium_stress_impact_gain - content = medium_stress_impact_gain - } - increase_wounds_no_death_effect = { REASON = treatment } -} - -literalism_scholar_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_literalism_scholar_trait - NOT = { has_trait = lifestyle_scholar } - } - add_trait = lifestyle_scholar - } -} - -scholasticism_scholar_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_scholasticism_scholar_trait - NOT = { has_trait = lifestyle_scholar } - } - add_trait = lifestyle_scholar - } - else_if = { - limit = { - has_personal_tenet_flag = tenet_scholasticism_scholar_trait - } - add_trait_xp = { - trait = lifestyle_scholar - value = pam_scholasticism_scholar_xp_value - } - } -} - -unrelenting_faith_blademaster_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_unrelenting_faith_blademaster_trait - NOT = { has_trait = lifestyle_blademaster } - } - add_trait = lifestyle_blademaster - } -} - -astrology_mystic_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_astrology_mystic_trait - NOT = { has_trait = lifestyle_mystic } - } - add_trait = lifestyle_mystic - } -} - -anachoresis_mystic_gain_effect = { - if = { - limit = { - scope:tenet = tenet:tenet_anachoresis - has_personal_tenet_flag = tenet_anachoresis_mystic_trait - NOT = { has_trait = lifestyle_mystic } - } - add_trait = lifestyle_mystic - } -} - -pure_land_aggressive_attacker_gain_effect = { - if = { - limit = { - scope:tenet = tenet:tenet_pure_land - has_personal_tenet_flag = tenet_pure_land_aggressive_attacker_trait - NOT = { has_trait = aggressive_attacker } - } - add_trait = aggressive_attacker - } -} - -pure_land_prestige_level_loss_effect = { - if = { - limit = { - scope:tenet = tenet:tenet_pure_land - has_personal_tenet_flag = tenet_pure_land_prestige_level_loss - } - add_prestige_level = -1 - } -} - -# Miles Christi personal tenet: the soldier of Christ takes up the mantle of a Holy Warrior -miles_christi_holy_warrior_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_miles_christi_holy_warrior_trait - NOT = { has_trait = holy_warrior } - } - add_trait = holy_warrior - } -} - -# PAM - Reincarnation: claim a forebear's personality trait. -# Opposing traits are replaced first; otherwise the least-fulfilling personality trait is replaced. -pam_claim_remembered_personality_trait_effect = { - if = { - limit = { - $TRAIT$ = { - any_opposite_trait = { - root = { has_trait = prev } - } - } - } - $TRAIT$ = { - every_opposite_trait = { - limit = { - root = { has_trait = prev } - } - root = { remove_trait = prev } - } - } - } - else_if = { - limit = { number_of_personality_traits >= 1 } - ordered_character_trait = { - limit = { has_trait_category = personality } - order_by = pam_recall_worst_personality_order_value - save_scope_as = pam_recall_replaced_personality - } - remove_trait = scope:pam_recall_replaced_personality - } - add_trait = $TRAIT$ - change_spiritual_fulfillment = medium_spiritual_fulfillment_value -} - -pam_great_project_contribution_catalyst_effect = { - if = { - limit = { - this != scope:owner - this != scope:founder - scope:owner ?= { - any_character_situation = { - situation_type = the_christian_church - } - } - OR = { - scope:great_project.great_project_type = great_project_type:pam_cathedral_01 - scope:great_project.great_project_type = great_project_type:pam_cathedral_02 - scope:great_project.great_project_type = great_project_type:pam_cathedral_03 - scope:great_project.great_project_type = great_project_type:pam_mass_rite_conversion - } - } - random_character_situation = { - limit = { situation_type = the_christian_church } - switch = { - trigger = scope:great_project.great_project_type - great_project_type:pam_cathedral_01 = { - if = { - limit = { situation_top_has_catalyst = catalyst_great_project_cathedral_contribution } - trigger_situation_catalyst = catalyst_great_project_cathedral_contribution - } - } - great_project_type:pam_cathedral_02 = { - if = { - limit = { situation_top_has_catalyst = catalyst_great_project_cathedral_contribution } - trigger_situation_catalyst = catalyst_great_project_cathedral_contribution - } - } - great_project_type:pam_cathedral_03 = { - if = { - limit = { situation_top_has_catalyst = catalyst_great_project_cathedral_contribution } - trigger_situation_catalyst = catalyst_great_project_cathedral_contribution - } - } - great_project_type:pam_mass_rite_conversion = { - if = { - limit = { situation_top_has_catalyst = catalyst_great_project_mass_rite_conversion_contribution } - trigger_situation_catalyst = catalyst_great_project_mass_rite_conversion_contribution - } - } - } - } - } -} - -pam_levy_the_tithes_decision_effects = { - every_vassal = { - limit = { - OR = { - government_has_flag = government_is_theocracy - government_has_flag = government_is_ecclesiastical - } - } - custom = every_theocratic_vassal_tt - pay_short_term_gold = { - target = root - gold = minor_gold_value - } - } - if = { - limit = { exists = cp:councillor_court_chaplain } - cp:councillor_court_chaplain = { - progress_towards_rival_effect = { - CHARACTER = root - REASON = rival_levied_tithes - OPINION = default_rival_opinion - } - } - } -} - -#The flag is set in give_cardinal_order_interaction this provides the appropriate event option to accept or deny, along with communicating to players (via toast) who rule the county(s) affected by the below modifiers that a change has taken place -pam_choose_cardinal_order_switch_scripted_effect = { - switch = { - trigger = yes - scope:cardinal_improve_development ?= { - capital_county.clerical_region_title = { - every_county_in_clerical_region = { - custom = cardinal_order_improve_development - limit = { - faith = scope:recipient.faith - } - add_county_modifier = { - modifier = pam_cardinal_order_improve_development_modifier - years = 10 - } - holder = { - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - } - } - - scope:cardinal_convert_faith ?= { - capital_county ?= { - clerical_region_title ?= { - every_county_in_clerical_region = { - custom = cardinal_order_convert_faith - limit = { - pam_cardinal_order_convert_faith_in_region_county_trigger = { CARDINAL = scope:recipient } - } - add_county_modifier = { - modifier = pam_cardinal_order_convert_faith_modifier - years = 10 - } - holder = { - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - if = { - limit = { - any_county_in_clerical_region = { - any_neighboring_county = { - pam_cardinal_order_convert_faith_neighboring_county_trigger = { CARDINAL = scope:recipient } - } - } - } - custom_tooltip = { - text = cardinal_order_convert_faith_neighboring - every_county_in_clerical_region = { - every_neighboring_county = { - limit = { - pam_cardinal_order_convert_faith_neighboring_county_trigger = { CARDINAL = scope:recipient } - NOT = { has_county_modifier = pam_cardinal_order_convert_faith_modifier } - } - add_county_modifier = { - modifier = pam_cardinal_order_convert_faith_modifier - years = 10 - } - holder = { - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - } - } - } - } - } - } - - scope:cardinal_increase_control ?= { - capital_county.clerical_region_title = { - every_county_in_clerical_region = { - custom = cardinal_order_increase_control - limit = { - holder.top_liege.faith = scope:recipient.faith - } - add_county_modifier = { - modifier = pam_cardinal_order_increase_control_modifier - years = 10 - } - holder = { - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - } - } - - scope:cardinal_accelerate_cultural_fascination ?= { - scope:puppet_or_actor.culture.culture_head = { - custom_tooltip = cardinal_order_accelerate_cultural_fascination - add_character_modifier = { - modifier = pam_cardinal_order_accelerate_cultural_fascination_modifier - years = 10 - } - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - - scope:cardinal_improve_epidemic_resistance ?= { - capital_county.clerical_region_title = { - every_county_in_clerical_region = { - custom = cardinal_order_improve_epidemic_resistance - limit = { - NOT = { - has_county_modifier = pam_cardinal_order_improve_epidemic_resistance_modifier - } - faith = scope:recipient.faith - } - add_county_modifier = { - modifier = pam_cardinal_order_improve_epidemic_resistance_modifier - years = 10 - } - holder = { - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - } - } - - scope:cardinal_improve_legitimacy ?= { - capital_county.clerical_region_title = { - every_county_in_clerical_region = { - custom = cardinal_order_improve_legitimacy - limit = { - holder.top_liege = { - has_legitimacy = yes - NOT = { - has_character_modifier = pam_cardinal_order_improve_legitimacy_modifier - } - faith = scope:recipient.faith - } - } - holder.top_liege = { - add_character_modifier = { - modifier = pam_cardinal_order_improve_legitimacy_modifier - years = 10 - } - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - } - } - - scope:cardinal_undermine_legitimacy ?= { - capital_county.clerical_region_title = { - every_county_in_clerical_region = { - custom = cardinal_order_undermine_legitimacy - limit = { - holder.top_liege = { - has_legitimacy = yes - NOT = { - has_character_modifier = pam_cardinal_order_undermine_legitimacy_modifier - } - faith = scope:recipient.faith - } - } - holder.top_liege = { - add_character_modifier = { - modifier = pam_cardinal_order_undermine_legitimacy_modifier - years = 10 - } - if = { - limit = { - is_ai = no - } - add_to_list = county_holders - } - } - } - } - } - } -} - -pam_cardinal_order_accept_notify_players_effect = { - $HOF$ = { - if = { - limit = { is_ai = no } - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = give_cardinal_order_interaction_toast - left_icon = $HOF$ - right_icon = scope:recipient - scope:recipient = { - show_as_tooltip = { - pam_choose_cardinal_order_switch_scripted_effect = yes - } - } - } - } - } - } - if = { - limit = { - scope:actor != $HOF$ - scope:actor = { is_ai = no } - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = give_cardinal_order_interaction_toast - left_icon = $HOF$ - right_icon = scope:recipient - scope:recipient = { - show_as_tooltip = { - pam_choose_cardinal_order_switch_scripted_effect = yes - } - } - } - } - } - every_in_list = { - list = county_holders - limit = { - NOT = { this = $HOF$ } - NOT = { this = scope:actor } - } - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = give_cardinal_order_interaction_toast - left_icon = $HOF$ - right_icon = scope:recipient - scope:recipient = { - show_as_tooltip = { - pam_choose_cardinal_order_switch_scripted_effect = yes - } - } - } - } - } -} - -pam_cardinal_order_decline_effect = { - $CARDINAL$ = { - add_prestige = medium_prestige_gain - add_piety = medium_piety_loss - if = { - limit = { - $HOF$ = { is_alive = yes } - can_set_relation_rival_trigger = { CHARACTER = $HOF$ } - } - progress_towards_rival_effect = { - REASON = rival_ignored_orders - CHARACTER = $HOF$ - OPINION = default_rival_opinion - } - } - else_if = { - limit = { - $HOF$ = { is_alive = yes } - } - add_opinion = { - target = $HOF$ - modifier = disrespect_opinion - opinion = -60 - } - } - } -} - -# Shared handler for the offer_pilgrimage send option: ACTOR promises the pilgrimage, CLERIC is rewarded -pam_offer_pilgrimage_effect = { - if = { - limit = { - scope:offer_pilgrimage ?= yes - } - $ACTOR$ = { - add_character_modifier = { - modifier = promised_pilgrimage_to_clergy_modifier - years = 10 - } - custom_tooltip = actor_promised_pilgrimage_tt - } - $CLERIC$ = { - add_piety_experience = { - value = minor_piety_gain - add = { - value = $ACTOR$.highest_held_title_tier - subtract = 1.5 - multiply = 20 - } - } - } - } -} - -request_legitimacy_interaction_effect = { - add_legitimacy = { - value = medium_legitimacy_gain - multiply = 1.5 - if = { - limit = { - scope:monastic_support = yes - } - scope:puppet_or_actor = { - every_patroned_holy_order = { - limit = { - leader = { - government_has_flag = government_is_monastic_holy_order - } - } - add = minor_legitimacy_gain - } - } - } - if = { - limit = { - scope:puppet_or_actor ?= { - has_personal_tenet_flag = tenet_apostolic_succession_papal_legitimacy - faith.religious_head ?= scope:recipient - } - } - add = medium_legitimacy_gain - } - max = massive_legitimacy_gain - } - if = { - limit = { - rite = { - has_tenet_status = { - tenet = tenet_simony - status = prohibited - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - } - if = { - limit = { - any_vassal = { - NOT = { - faith = scope:puppet_or_actor.faith - } - } - } - every_vassal = { - custom = custom.every_astray_faith_vassal - limit = { - NOT = { - faith = scope:puppet_or_actor.faith - } - faith = { - faith_hostility_level = { - target = scope:puppet_or_actor.faith - value >= faith_astray_level - } - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = heathen_mandate_opinion - opinion = -20 - } - } - } - if = { - limit = { - any_held_title = { - tier = tier_county - NOT = { - faith = scope:puppet_or_actor.faith - } - faith = { - faith_hostility_level = { - target = scope:puppet_or_actor.faith - value >= faith_astray_level - } - } - } - } - every_held_title = { - custom = custom.every_astray_faith_domain_county - limit = { - tier = tier_county - NOT = { - faith = scope:puppet_or_actor.faith - } - faith = { - faith_hostility_level = { - target = scope:puppet_or_actor.faith - value >= faith_astray_level - } - } - } - add_county_modifier = { - modifier = heathen_mandate_modifier - years = 5 - } - } - } - if = { - limit = { - scope:monastic_support = yes - } - every_patroned_holy_order = { - limit = { - leader = { - government_has_flag = government_is_monastic_holy_order - } - } - scope:puppet_or_actor = { - pay_short_term_gold = { - target = prev.leader - gold = minor_gold_value - } - } - } - } - if = { - limit = { - scope:tithe = yes - } - every_held_title = { - limit = { - tier = tier_county - NOT = { - any_county_province = { - is_occupied = yes - } - } - development_level >= 1 - } - add_to_list = tithed_counties - } - scope:recipient = { - add_gold = { - value = 0 - every_in_list = { - list = tithed_counties - add = scope:recipient.miniscule_gold_value - add = { - value = development_level - } - } - max = monumental_gold_value - } - } - every_in_list = { - list = tithed_counties - custom = custom.every_domain_county_1_plus_development - if = { - limit = { - scope:recipient.culture = { - has_cultural_era_or_later = culture_era_late_medieval - } - } - change_development_progress = massive_development_progress_loss - } - else_if = { - limit = { - scope:recipient.culture = { - has_cultural_era_or_later = culture_era_high_medieval - } - } - change_development_progress = major_development_progress_loss - } - else = { - change_development_progress = medium_development_progress_loss - } - } - #Secretly take gold from wealthy-ass barons - hidden_effect = { - every_in_list = { - list = tithed_counties - every_county_province = { - limit = { - barony.holder ?= { - highest_held_title_tier = tier_barony - is_ai = yes - gold > medium_gold_value - } - } - barony.holder ?= { - remove_short_term_gold = medium_gold_value - } - } - } - } - if = { - limit = { - any_vassal = { - has_vassal_stance = barons_and_minor_landholders - } - } - every_vassal = { - custom = custom.every_barons_and_minor_landholders_vassal - limit = { - has_vassal_stance = barons_and_minor_landholders - } - add_opinion = { - modifier = tithed_opinion - target = scope:puppet_or_actor - opinion = -25 - } - } - custom_tooltip = tithe_takes_baron_gold_tt - } - } - if = { - limit = { - scope:donate_faith = yes - } - pay_short_term_gold = { - target = scope:recipient - gold = scope:puppet_or_actor.major_gold_value - } - } - if = { - limit = { - scope:use_hook = yes - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - if = { - limit = { - scope:offer_hook = yes - } - scope:recipient = { - add_hook = { - type = favor_hook - target = scope:puppet_or_actor - } - } - } - if = { - limit = { - is_ai = yes - } - add_opinion = { - target = scope:recipient - modifier = grateful_opinion - opinion = 30 - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - #The cleric should lose spiritual fulfillment if they agree to supporting a wicked king or a tyrant - if = { - limit = { - OR = { - character_considered_wicked_trigger = { RITE = scope:recipient.rite } - scope:recipient = { - has_relation_rival = scope:puppet_or_actor - } - tyranny > medium_tyranny - has_trait = excommunicated - } - } - scope:recipient = { - # We never take more piety than the cleric has, or the Church goes into debt - add_piety = { - value = major_piety_value - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - max = piety - min = 0 - multiply = -1 - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - if = { - limit = { - scope:puppet_or_actor = { has_trait = excommunicated } - } - custom_tooltip = sp_ful_loss_due_to_excommunicated - } - else_if = { - limit = { - has_relation_rival = scope:puppet_or_actor - } - custom_tooltip = sp_ful_loss_due_to_rival - } - else_if = { - limit = { - scope:puppet_or_actor = { tyranny > medium_tyranny } - } - custom_tooltip = sp_ful_loss_due_to_tyranny - } - else_if = { - custom_tooltip = sp_ful_loss_due_to_wicked - } - } - } - else_if = { - limit = { - OR = { - character_considered_morally_dubious_trigger = { RITE = scope:recipient.rite } - tyranny >= low_tyranny - } - } - scope:recipient = { - add_piety = { - value = minor_piety_value - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - max = piety - min = 0 - multiply = -1 - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - if = { - limit = { - scope:puppet_or_actor = { tyranny >= low_tyranny } - } - custom_tooltip = sp_ful_loss_due_to_tyranny - } - else = { - custom_tooltip = sp_ful_loss_due_to_immoral - } - } - } - else = { - scope:recipient = { - add_piety = { - value = miniscule_piety_value - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - max = piety - min = 0 - multiply = -1 - } - } - } - # Catalysts - if = { - limit = { - scope:puppet_or_actor.religion = religion:christianity_religion - situation:the_christian_church ?= { situation_top_has_catalyst = catalyst_the_christian_church_requested_legitimacy } - } - situation:the_christian_church = { trigger_situation_catalyst = catalyst_the_christian_church_requested_legitimacy } - } -} -#Add variable that makes title grant recipient (who is claimant) satisfied with claim-granting for a bit -claimant_jealousy_immunity_effect = { - custom_tooltip = satisfied_claim_granting_tt - if = { - limit = { - scope:highest_claim.tier = tier_hegemony - } - add_to_variable_list = { - name = hegemony_grant - target = scope:puppet_or_actor - years = 3 - } - } - else_if = { - limit = { - scope:highest_claim.tier = tier_empire - } - add_to_variable_list = { - name = empire_grant - target = scope:puppet_or_actor - years = 3 - } - } - else_if = { - limit = { - scope:highest_claim.tier = tier_kingdom - } - add_to_variable_list = { - name = kingdom_grant - target = scope:puppet_or_actor - years = 3 - } - } - else_if = { - limit = { - scope:highest_claim.tier = tier_duchy - } - add_to_variable_list = { - name = duchy_grant - target = scope:puppet_or_actor - years = 3 - } - } - else_if = { - limit = { - scope:highest_claim.tier = tier_county - } - add_to_variable_list = { - name = county_grant - target = scope:puppet_or_actor - years = 3 - } - } -} -claimant_rivalry_mercy_effect = { - custom_tooltip = strong_claim_given_away_rivalry_tt - if = { - limit = { - scope:highest_denied_claim = { - tier >= tier_hegemony - } - } - add_to_variable_list = { - name = denied_hegemony - target = scope:puppet_or_actor - days = 31 - } - } - else_if = { - limit = { - scope:highest_denied_claim = { - tier >= tier_empire - } - } - add_to_variable_list = { - name = denied_empire - target = scope:puppet_or_actor - days = 31 - } - } - else_if = { - limit = { - scope:highest_denied_claim = { - tier >= tier_kingdom - } - } - add_to_variable_list = { - name = denied_kingdom - target = scope:puppet_or_actor - days = 31 - } - } - else_if = { - limit = { - scope:highest_denied_claim = { - tier >= tier_duchy - } - } - add_to_variable_list = { - name = denied_duchy - target = scope:puppet_or_actor - days = 31 - } - } - else_if = { - limit = { - scope:highest_denied_claim = { - tier >= tier_county - } - } - add_to_variable_list = { - name = denied_county - target = scope:puppet_or_actor - days = 31 - } - } - trigger_event = { - id = pam_interactions_events.0040 - days = 30 - } -} -#Opinion loss with underlings who think they should get the title you're granting -title_granting_controversy_effect = { - #populate vassal list - every_vassal_or_below = { - limit = { - NOR = { - this = scope:recipient - this = $TITLE$.holder - is_in_list = eligible_vassals - } - highest_held_title_tier > tier_barony - #Vassal granting should only annoy people who could actually receive vassal - trigger_if = { - limit = { - exists = scope:secondary_actor - } - highest_held_title_tier > $TITLE$.tier - } - #Children can't hold titles in admin govs - trigger_if = { - limit = { - government_has_mechanic = administrative - } - is_adult = yes - #Admin de jure/neighboring thing is a pain in the butt but should be acknowledged - trigger_if = { - limit = { - is_ruler = yes - } - any_held_title = { - OR = { - # The target title is part of your de jure structure - is_de_jure_liege_or_above_target = $TITLE$ - target_is_de_jure_liege_or_above = $TITLE$ - } - } - } - } - scope:puppet_or_actor = { - is_character_interaction_valid = { - recipient = prev - interaction = $INTERACTION$ - } - } - #Shouldn't lose opinion when giving title to their child or parent - NOR = { - AND = { - is_child_of = scope:recipient - is_heir_of = scope:recipient - } - AND = { - is_parent_of = scope:recipient - exists = scope:recipient.house - house ?= scope:recipient.house - } - } - } - add_to_list = eligible_vassals - } - #Also show effect on courtier claimants you actually care about (IE your family members) - $TITLE$ = { - every_claimant = { - limit = { - NOT = { this = scope:recipient } - NOT = { - is_in_list = eligible_vassals - } - #Vassal granting should only annoy people who could actually receive vassal - trigger_if = { - limit = { - exists = scope:secondary_actor - } - highest_held_title_tier > $TITLE$.tier - } - trigger_if = { - limit = { - is_ruler = no - } - OR = { - rite = { - rite_has_parameter = gender_equal_law - } - AND = { - is_male = yes - rite = { - rite_has_parameter = male_dominated_law - } - } - AND = { - is_female = yes - rite = { - rite_has_parameter = female_dominated_law - } - } - } - } - in_diplomatic_range = scope:puppet_or_actor - NOT = { has_strong_implicit_claim_on = $TITLE$ } - any_claim = { - pressed = yes - this = $TITLE$ - } - any_liege_or_above = { - this = scope:puppet_or_actor - } - OR = { - any_close_family_member = { - this = scope:puppet_or_actor - } - AND = { - exists = scope:puppet_or_actor.house - house ?= scope:puppet_or_actor.house - } - any_spouse = { - this = scope:puppet_or_actor - } - has_any_good_relationship_with_character_trigger = { CHARACTER = scope:puppet_or_actor } - } - #Children can't hold titles in admin govs - trigger_if = { - limit = { - government_has_mechanic = administrative - } - is_adult = yes - #Admin de jure/neighboring thing is a pain in the butt but should be acknowledged - trigger_if = { - limit = { - is_ruler = yes - } - any_held_title = { - OR = { - # The target title is part of your de jure structure - is_de_jure_liege_or_above_target = $TITLE$ - target_is_de_jure_liege_or_above = $TITLE$ - } - } - } - } - scope:puppet_or_actor = { - is_character_interaction_valid = { - recipient = prev - interaction = $INTERACTION$ - } - } - #Shouldn't lose opinion when giving title to their child or parent - NOR = { - AND = { - is_child_of = scope:recipient - is_heir_of = scope:recipient - } - AND = { - is_parent_of = scope:recipient - exists = scope:recipient.house - house ?= scope:recipient.house - } - } - } - add_to_list = eligible_vassals - } - } - - #Higher repercussions for higher tier - #Higher repercussions for pressed claims than unpressed - if = { - limit = { - $TITLE$ = { - tier >= tier_kingdom - } - } - every_in_list = { - list = eligible_vassals - limit = { - NOT = { has_strong_implicit_claim_on = $TITLE$ } - has_claim_on = $TITLE$ - #Wasn't granted a claim of same tier or better in recent memory - NOR = { - any_in_list = { - variable = hegemony_grant - this = scope:puppet_or_actor - } - AND = { - $TITLE$.tier <= tier_empire - any_in_list = { - variable = empire_grant - this = scope:puppet_or_actor - } - } - AND = { - $TITLE$.tier <= tier_kingdom - any_in_list = { - variable = kingdom_grant - this = scope:puppet_or_actor - } - } - AND = { - $TITLE$.tier <= tier_duchy - any_in_list = { - variable = duchy_grant - this = scope:puppet_or_actor - } - } - AND = { - $TITLE$.tier <= tier_county - any_in_list = { - variable = county_grant - this = scope:puppet_or_actor - } - } - } - } - #pressed claim - if = { - limit = { - has_strong_claim_on = $TITLE$ - } - add_to_list = strong_claimants - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_my_pressed_claim_opinion - opinion = -50 - } - } - #unpressed claim - else = { - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_my_unpressed_claim_opinion - opinion = -30 - } - } - } - #Upset they didn't get de jure vassal title - every_in_list = { - list = eligible_vassals - limit = { - any_held_title = { - any_in_de_jure_hierarchy = { - this = $TITLE$ - } - } - } - #Less opinion loss if you're giving it to one of their vassals - if = { - limit = { - OR = { - exists = scope:secondary_actor - any_vassal_or_below = { - this = scope:recipient - } - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_vassal_title_opinion - opinion = -25 - } - } - else = { - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_vassal_title_opinion - opinion = -40 - } - } - } - #De Jure vassals upset they didn't get the title - every_in_list = { - list = eligible_vassals - limit = { - any_held_title = { - tier >= $TITLE$.tier_minus_1 - any_this_title_or_de_jure_above = { - this = $TITLE$ - } - } - } - #Less opinion loss if you're giving it to their liege or above - if = { - limit = { - any_liege_or_above = { - this = scope:recipient - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_liege_title_opinion - opinion = -20 - } - } - else = { - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_liege_title_opinion - opinion = -30 - } - } - } - } - else_if = { - limit = { - #Either title is a duchy or we're doing vassal transfer, not title granting - OR = { - $TITLE$ = { - tier >= tier_duchy - } - exists = scope:secondary_actor - } - } - every_in_list = { - list = eligible_vassals - limit = { - NOT = { has_strong_implicit_claim_on = $TITLE$ } - any_claim = { - this = $TITLE$ - pressed = yes - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_my_pressed_claim_opinion - opinion = -40 - } - } - every_in_list = { - list = eligible_vassals - limit = { - NOT = { has_strong_implicit_claim_on = $TITLE$ } - any_claim = { - this = $TITLE$ - pressed = no - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_my_unpressed_claim_opinion - opinion = -20 - } - } - #Upset they didn't get de jure vassal title - every_in_list = { - list = eligible_vassals - limit = { - any_held_title = { - any_in_de_jure_hierarchy = { - this = $TITLE$ - } - } - } - #Less opinion loss if you're giving it to one of their vassals or it's a vassal transfer - if = { - limit = { - OR = { - exists = scope:secondary_actor - any_vassal_or_below = { - this = scope:recipient - } - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_vassal_title_opinion - opinion = -20 - } - } - else = { - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_vassal_title_opinion - opinion = -30 - } - } - } - #De Jure vassals upset they didn't get the title - every_in_list = { - list = eligible_vassals - limit = { - any_held_title = { - tier >= $TITLE$.tier_minus_1 - any_this_title_or_de_jure_above = { - this = $TITLE$ - } - } - } - #Less opinion loss if you're giving it to their liege or above - if = { - limit = { - any_liege_or_above = { - this = scope:recipient - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_liege_title_opinion - opinion = -15 - } - } - else = { - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_liege_title_opinion - opinion = -20 - } - } - } - } - #Don't want to impose much mental load on giving away counties - #PLUS you can give them away with the "give to random noble" button without repercussions - #So we'll only do de jure lieges getting mad you are purposefully favoring another lord or courtier over them - else_if = { - limit = { - $TITLE$ = { tier >= tier_county } - } - #Upset they didn't get de jure vassal title - every_in_list = { - list = eligible_vassals - limit = { - any_held_title = { - any_in_de_jure_hierarchy = { - this = $TITLE$ - } - } - NOT = { - any_vassal_or_below = { - this = scope:recipient - } - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = gave_away_de_jure_vassal_title_opinion - opinion = -15 - } - } - } -} -strengthen_claim_interaction_effect = { - scope:puppet_or_actor = { add_pressed_claim = scope:target } - scope:recipient = { save_scope_as = cleric } - scope:target.holder ?= { save_scope_as = owner } - #Let's figure out how morally wrong the cleric feels this is - #Either your shittiness or target's coolness has given the clergyman pause - if = { - limit = { - clerical_hesitation_claim_interaction_value >= 9 - } - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = major_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = major_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 6 - } - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = medium_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = medium_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 3 - } - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = minor_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = minor_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < 3 - clerical_hesitation_claim_interaction_value >= -2 - } - scope:recipient = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < -2 - } - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -5 - } - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -8 - } - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else = { - scope:recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = major_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - scope:target.holder ?= { - add_opinion = { - target = scope:puppet_or_actor - modifier = church_claim_modifier - opinion = -40 - } - if = { - limit = { - scope:recipient = { - is_ai = yes - } - } - hidden_effect = { - add_opinion = { - target = scope:recipient - modifier = church_claim_modifier - opinion = -30 - } - } - } - else = { - add_opinion = { - target = scope:recipient - modifier = church_claim_modifier - opinion = -30 - } - } - } - #Opinion loss with title's de jure liege - why you trying to steal this when it should be under me? - scope:target = { - every_this_title_or_de_jure_above = { - limit = { - exists = holder - NOR = { - this = scope:target - holder = { - OR = { - this = scope:puppet_or_actor - this = scope:recipient - this = scope:target.holder - #actor's liege being mad at them for contesting other vassals is kinda wrong - is_liege_or_above_of = scope:puppet_or_actor - } - } - } - } - if = { - limit = { - any_direct_de_jure_vassal_title = { - this = scope:target - } - } - holder = { add_to_list = de_jure_direct_lieges } - } - else = { - holder = { add_to_list = de_jure_higher_lieges } - } - } - every_in_list = { - list = de_jure_direct_lieges - #More loss for direct liege - add_opinion = { - target = scope:puppet_or_actor - modifier = pressed_church_claim_de_jure_liege_modifier - opinion = -25 - } - if = { - limit = { - scope:recipient = { - is_ai = yes - } - } - hidden_effect = { - add_opinion = { - target = scope:recipient - modifier = pressed_church_claim_de_jure_liege_modifier - opinion = -10 - } - } - } - else = { - add_opinion = { - target = scope:recipient - modifier = pressed_church_claim_de_jure_liege_modifier - opinion = -10 - } - } - } - every_in_list = { - list = de_jure_higher_lieges - limit = { - NOT = { is_in_list = de_jure_direct_lieges } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = pressed_church_claim_de_jure_liege_modifier - opinion = -15 - } - if = { - limit = { - scope:recipient = { - is_ai = yes - } - } - hidden_effect = { - add_opinion = { - target = scope:recipient - modifier = pressed_church_claim_de_jure_liege_modifier - opinion = -5 - } - } - } - else = { - add_opinion = { - target = scope:recipient - modifier = pressed_church_claim_de_jure_liege_modifier - opinion = -5 - } - } - } - } - if = { - limit = { - is_ai = yes - } - add_opinion = { - target = scope:recipient - modifier = pressed_my_claim - opinion = { - value = 10 - if = { - limit = { - highest_held_title_tier < scope:target.tier - } - multiply = 4 - } - else_if = { - limit = { - highest_held_title_tier = scope:target.tier - } - multiply = 3 - } - else_if = { - limit = { - highest_held_title_tier_minus_one = scope:target.tier - } - multiply = 2 - } - else_if = { - limit = { - highest_held_title_tier_minus_two = scope:target.tier - } - multiply = 1.5 - } - } - } - } - if = { - limit = { - scope:donate_faith = yes - } - pay_short_term_gold = { - target = scope:recipient - gold = scope:puppet_or_actor.medium_gold_value - } - } - if = { - limit = { - scope:use_hook = yes - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - if = { - limit = { - scope:offer_hook = yes - } - scope:recipient = { - add_hook = { - type = favor_hook - target = scope:puppet_or_actor - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - if = { - limit = { - scope:threaten_priest = yes - } - if = { - limit = { - scope:secondary_recipient = { - this = scope:puppet_or_actor.faith.religious_head - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - add_piety_experience = massive_piety_loss - custom_tooltip = hof_increase_piety_sp_fulfillment_loss_tt - } - else = { - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - add_piety_experience = major_piety_loss - } - scope:secondary_recipient = { - add_opinion = { - modifier = threatened_church_opinion - target = scope:puppet_or_actor - opinion = -50 - } - } - } - # Catalysts - if = { - limit = { # If you are strenghtening a claim against a Christian ruler - scope:puppet_or_actor.religion = religion:christianity_religion - scope:target.holder.religion ?= religion:christianity_religion - situation:the_christian_church ?= { situation_top_has_catalyst = catalyst_the_christian_church_strenghtened_claim } - } - situation:the_christian_church = { trigger_situation_catalyst = catalyst_the_christian_church_strenghtened_claim } - } -} - -sell_claim_interaction_effect = { - scope:recipient = { add_unpressed_claim = scope:target } - # cost = { piety } is only charged to scope:actor, so a puppeteer's cleric pays here instead - if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - add_piety = { - value = { - add = pam_sell_claim_piety_cost_value - max = piety - multiply = -1 - } - } - } - } - if = { - limit = { scope:sell_claim_gold_and_hook = yes } - send_interface_toast = { - title = sell_claim_interaction_effect_tt - left_icon = scope:target - right_icon = scope:recipient - scope:recipient = { - pay_short_term_gold = { - target = scope:puppet_or_actor - gold = minor_gold_value - } - } - } - scope:puppet_or_actor = { # Generates its own toast - if = { - limit = { has_hook = scope:recipient } - custom_tooltip = already_has_hook_on_recipient - } - add_hook = { - type = favor_hook - target = scope:recipient - } - } - } - else = { - scope:puppet_or_actor = { - send_interface_toast = { - title = sell_claim_interaction_effect_tt - left_icon = scope:target - right_icon = scope:recipient - scope:recipient = { - pay_short_term_gold = { - target = scope:puppet_or_actor - gold = pam_sell_claim_gold_cost_value - } - } - } - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:actor != scope:recipient - } - scope:actor = { - send_interface_toast = { - title = sell_claim_interaction_effect_tt_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - } - } - } - if = { - limit = { - scope:puppet_or_actor = { has_pam_dlc_trigger = yes } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_sold_claim - } - scope:puppet_or_actor = { - any_character_situation = { - this = situation:the_christian_church - } - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_sold_claim - } - } -} - -gift_claim_interaction_effect = { - send_interface_toast = { - type = event_toast_effect_neutral - title = gift_claim_interaction_effect_tt - left_icon = scope:target - right_icon = scope:recipient - remove_claim = scope:target - scope:recipient = { - add_unpressed_claim = scope:target - } - } - if = { - limit = { - scope:actor != scope:puppet_or_actor - scope:actor != scope:recipient - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = gift_claim_interaction_effect_tt_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - } - } - } -} - -ecclesiastic_grant_claim_interaction_effect = { - add_pressed_claim = scope:target - scope:secondary_recipient = { save_scope_as = cleric } - scope:recipient = { save_scope_as = owner } - #Either your shittiness or target's coolness has given the clergyman pause - if = { - limit = { - clerical_hesitation_claim_interaction_value >= 9 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = major_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = major_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 6 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = medium_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = medium_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 3 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = minor_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = minor_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < 3 - clerical_hesitation_claim_interaction_value >= -2 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < -2 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -5 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -8 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else = { - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:puppet_or_actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = major_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - scope:recipient ?= { - add_opinion = { - target = scope:puppet_or_actor - modifier = claimed_my_title_opinion - opinion = -60 - } - progress_towards_rival_effect = { - CHARACTER = scope:puppet_or_actor - OPINION = 0 - REASON = rival_claimed_my_title - } - hidden_effect = { - add_opinion = { - target = scope:secondary_recipient - modifier = claimed_my_title_opinion - opinion = -35 - } - } - } - #Opinion loss with title's de jure liege - why you trying to steal this when it should be under me? - scope:target = { - every_this_title_or_de_jure_above = { - limit = { - exists = holder - NOR = { - this = scope:target - holder = { - OR = { - this = scope:puppet_or_actor - this = scope:recipient - this = scope:target.holder - #actor's liege being mad at them for contesting other vassals is kinda wrong - is_liege_or_above_of = scope:puppet_or_actor - } - } - } - } - if = { - limit = { - any_direct_de_jure_vassal_title = { - this = scope:target - } - } - holder = { add_to_list = de_jure_direct_lieges } - } - else = { - holder = { add_to_list = de_jure_higher_lieges } - } - } - every_in_list = { - list = de_jure_direct_lieges - #More loss for direct liege - add_opinion = { - target = scope:puppet_or_actor - modifier = church_claim_de_jure_liege_modifier - opinion = -25 - } - if = { - limit = { - scope:secondary_recipient = { is_ai = yes } - } - hidden_effect = { - add_opinion = { - target = scope:secondary_recipient - modifier = church_claim_de_jure_liege_modifier - opinion = -10 - } - } - } - else = { - add_opinion = { - target = scope:secondary_recipient - modifier = church_claim_de_jure_liege_modifier - opinion = -10 - } - } - } - every_in_list = { - list = de_jure_higher_lieges - limit = { - NOT = { is_in_list = de_jure_direct_lieges } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = church_claim_de_jure_liege_modifier - opinion = -15 - } - if = { - limit = { - scope:secondary_recipient = { is_ai = yes } - } - hidden_effect = { - add_opinion = { - target = scope:secondary_recipient - modifier = church_claim_de_jure_liege_modifier - opinion = -5 - } - } - } - else = { - add_opinion = { - target = scope:secondary_recipient - modifier = church_claim_de_jure_liege_modifier - opinion = -5 - } - } - } - } - if = { - limit = { - is_ai = yes - } - add_opinion = { - target = scope:secondary_recipient - modifier = granted_claim_opinion - opinion = { - value = 10 - if = { - limit = { - highest_held_title_tier < scope:target.tier - } - multiply = 5 - } - else_if = { - limit = { - highest_held_title_tier = scope:target.tier - } - multiply = 4 - } - else_if = { - limit = { - highest_held_title_tier_minus_one = scope:target.tier - } - multiply = 3 - } - else_if = { - limit = { - highest_held_title_tier_minus_two = scope:target.tier - } - multiply = 2 - } - } - } - } - if = { - limit = { - scope:donate_faith = yes - } - pay_short_term_gold = { - target = scope:secondary_recipient - gold = scope:puppet_or_actor.medium_gold_value - } - } - if = { - limit = { - scope:use_hook = yes - has_usable_hook = scope:secondary_recipient - } - use_hook = scope:secondary_recipient - } - if = { - limit = { - scope:offer_hook = yes - } - scope:secondary_recipient = { - add_hook = { - type = favor_hook - target = scope:puppet_or_actor - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:secondary_recipient - } - if = { - limit = { - scope:threaten_priest = yes - } - if = { - limit = { - scope:secondary_recipient = { - this = scope:puppet_or_actor.faith.religious_head - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - add_piety_experience = massive_piety_loss - custom_tooltip = hof_increase_piety_sp_fulfillment_loss_secondary_tt - } - else = { - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - add_piety_experience = major_piety_loss - } - scope:secondary_recipient = { - add_opinion = { - modifier = threatened_church_opinion - target = scope:puppet_or_actor - opinion = -50 - } - } - } - # Catalysts - if = { - limit = { - scope:puppet_or_actor.religion = religion:christianity_religion - scope:recipient.religion = religion:christianity_religion - situation:the_christian_church ?= { situation_top_has_catalyst = catalyst_the_christian_church_ecclesiastical_grant_claim } - } - if = { - limit = { scope:threaten_priest = yes } - situation:the_christian_church = { trigger_situation_catalyst = catalyst_the_christian_church_threatened_ecclesiastical_grant_claim } - } - else = { - situation:the_christian_church = { trigger_situation_catalyst = catalyst_the_christian_church_ecclesiastical_grant_claim } - } - } -} - -# Called from on_personal_tenet_gain and on_piety_level_gain -reincarnation_piety_courage_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_reincarnation_piety_level_courage - piety_level >= high_piety_level - } - if = { - limit = { has_trait = craven } - send_interface_toast = { - type = event_toast_effect_good - title = pam_reincarnation_courage_toast - left_icon = root - remove_trait = craven - } - } - else_if = { - limit = { NOT = { has_trait = brave } } - send_interface_toast = { - type = event_toast_effect_good - title = pam_reincarnation_courage_toast - left_icon = root - add_trait = brave - } - } - } -} - -exaltation_of_pain_flagellant_gain_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_exaltation_of_pain_flagellant_trait - NOT = { has_trait = flagellant } - } - add_trait = flagellant - } -} - -pam_kingdom_of_heaven_declaration_effect = { - save_scope_as = kingdom_of_heaven_founder - get_title = title:h_kingdom_of_heaven - set_primary_title_to = title:h_kingdom_of_heaven - set_realm_capital = title:c_jerusalem - hidden_effect = { - domicile ?= { move_domicile = root.capital_province } - } - dynasty ?= { - add_dynasty_prestige = 10000 - add_dynasty_modifier = pam_founded_kingdom_of_heaven_modifier - } - if = { - limit = { NOT = { exists = dynasty } } - add_character_modifier = pam_founded_kingdom_of_heaven_modifier - } - custom_tooltip = { - text = pam_kingdom_of_heaven_decision_subjugation_effect_tt - set_variable = koh_subjugation_cb_allowed - } - set_global_variable = { - name = created_kingdom_of_heaven - value = yes - } - root.faith = { - every_faith_ruler = { - limit = { - this != root - is_independent_ruler = yes - is_available_quick = { - landed = yes - ai = yes - advanced_ruler = yes - } - is_playable_character = yes - highest_held_title_tier >= tier_county - highest_held_title_tier < tier_hegemony - NOR = { - has_relation_rival = root - is_at_war_with = root - government_has_flag = cannot_be_vassal_or_liege - } - } - random = { - chance = { - value = 20 - if = { - limit = { piety_level >= 1 } - add = 5 - } - if = { - limit = { piety_level >= 2 } - add = 8 - } - if = { - limit = { piety_level >= 3 } - add = 10 - } - if = { - limit = { piety_level >= 4 } - add = 15 - } - if = { - limit = { - opinion = { - target = root - value >= 30 - } - } - add = 10 - } - if = { - limit = { - opinion = { - target = root - value >= 60 - } - } - add = 15 - } - if = { - limit = { - exists = rite - scope:kingdom_of_heaven_founder = { exists = rite } - rite = scope:kingdom_of_heaven_founder.rite - } - add = 40 - } - } - add_to_list = new_vassals - hidden_effect = { - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = koh_fealty_change - add_claim_on_loss = no - } - change_liege = { - liege = root - change = scope:koh_fealty_change - } - resolve_title_and_vassal_change = scope:koh_fealty_change - } - if = { - limit = { highest_held_title_tier >= tier_kingdom } - show_as_tooltip = { - change_liege = { - liege = root - change = scope:koh_fealty_change - } - } - } - } - } - } - custom_tooltip = kingdom_of_heaven_lower_vassals_gained_tt - custom_tooltip = { - text = kingdom_of_heaven_lower_de_jure_gained_tt - every_empire = { - limit = { - is_landless_type_title = no - trigger_if = { - limit = { exists = holder.top_liege } - holder.top_liege = root - } - # really not landless - any_in_de_jure_hierarchy = { - tier = tier_kingdom - is_landless_type_title = no - any_in_de_jure_hierarchy = { - tier = tier_duchy - is_landless_type_title = no - } - } - save_temporary_scope_as = empire_temp - OR = { - holder ?= scope:kingdom_of_heaven_founder - scope:kingdom_of_heaven_founder = { completely_controls = scope:empire_temp } - } - } - set_de_jure_liege_title = title:h_kingdom_of_heaven - } - } -} - -pam_create_theocratic_dynasty_extra_effects = { - if = { # HoF doesn't like this - limit = { - exists = faith.religious_head - root != faith.religious_head - faith = { has_doctrine = doctrine_clerical_marriage_disallowed } - } - faith.religious_head = { - add_opinion = { - target = root - modifier = impious_opinion - opinion = -40 - } - } - add_piety = major_piety_loss - situation:the_christian_church ?= { - if = { - limit = { - situation_top_has_catalyst = catalyst_the_christian_church_established_theocratic_dynasty - } - trigger_situation_catalyst = catalyst_the_christian_church_established_theocratic_dynasty - } - } - } -} - -pam_boost_clerical_appointment_score_effect = { - $CHARACTER$.superior.primary_title ?= { - change_appointment_investment = { - target = $CHARACTER$ - value = $VALUE$ - } - } -} - -# Successful Siphon Treasury -pam_the_christian_church_clergy_embezzled_treasury_catalyst_effect = { - if = { - limit = { - is_clergy = yes - any_character_situation = { - situation_type = the_christian_church - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_embezzled_treasury - } - } - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_clergy_embezzled_treasury - character = root - } - } - } -} - -# Withdraw Funds from Treasury decision -pam_the_christian_church_clergy_withdrew_funds_from_treasury_catalyst_effect = { - if = { - limit = { - is_clergy = yes - any_character_situation = { - situation_type = the_christian_church - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_withdrew_funds_from_treasury - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_withdrew_funds_from_treasury - } - } -} - -# Needs POPE (appointer), CARDINAL (new cardinal) and OTHERWISE (non-nepotistic catalyst), any scope -# Both branches guard their catalyst, so a phase listing neither books nothing -pam_the_christian_church_appointed_cardinal_catalyst_effect = { - situation:the_christian_church ?= { - if = { - limit = { - $CARDINAL$ = { pam_cardinal_is_nepotistic_appointment_trigger = { POPE = $POPE$ } } - } - if = { - limit = { - situation_top_has_catalyst = catalyst_the_christian_church_appointed_nepotistic_cardinal - } - trigger_situation_catalyst = catalyst_the_christian_church_appointed_nepotistic_cardinal - } - } - else = { - if = { - limit = { - situation_top_has_catalyst = $OTHERWISE$ - } - trigger_situation_catalyst = $OTHERWISE$ - } - } - } -} - -# A non-Catholic ruler holds the de jure capital county of k_papal_state -pam_the_christian_church_catholic_hof_weak_papal_state_control_catalyst_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - pam_catholic_hof_weak_papal_state_control_trigger = yes - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_catholic_hof_weak_papal_state_control - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_catholic_hof_weak_papal_state_control - } - } -} - -@pam_papal_dynasty_capture_reigns = 3 -pam_the_christian_church_papal_dynasty_capture_catalyst_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - current_date_is_start_date_trigger = no - religion = religion:christianity_religion - } - if = { - limit = { exists = dynasty } - dynasty = { save_scope_as = pam_new_papal_dynasty } - } - situation:the_christian_church ?= { - if = { - limit = { - exists = scope:pam_new_papal_dynasty - has_variable = pam_papal_dynasty - var:pam_papal_dynasty = scope:pam_new_papal_dynasty - } - change_variable = { - name = pam_papal_dynasty_reigns - add = 1 - } - } - else_if = { - limit = { exists = scope:pam_new_papal_dynasty } - set_variable = { - name = pam_papal_dynasty - value = scope:pam_new_papal_dynasty - } - set_variable = { - name = pam_papal_dynasty_reigns - value = 1 - } - remove_variable = pam_papal_dynasty_capture_catalyst_fired - } - else = { - remove_variable = pam_papal_dynasty - remove_variable = pam_papal_dynasty_reigns - remove_variable = pam_papal_dynasty_capture_catalyst_fired - } - if = { - limit = { - has_variable = pam_papal_dynasty_reigns - var:pam_papal_dynasty_reigns >= @pam_papal_dynasty_capture_reigns - NOT = { has_variable = pam_papal_dynasty_capture_catalyst_fired } - situation_top_has_catalyst = catalyst_the_christian_church_papal_dynasty_capture - } - set_variable = pam_papal_dynasty_capture_catalyst_fired - trigger_situation_catalyst = catalyst_the_christian_church_papal_dynasty_capture - } - } - } -} - -# A different Christian faith becomes Main Power -pam_the_christian_church_main_power_faith_changed_catalyst_effect = { - situation:the_christian_church ?= { - if = { - limit = { - has_variable = pam_main_power_faith_changed_catalyst_faith - NOT = { var:tcc_main_power_faith = var:pam_main_power_faith_changed_catalyst_faith } - } - remove_variable = pam_the_christian_church_main_power_faith_changed_catalyst_fired - remove_variable = pam_main_power_faith_changed_catalyst_faith - } - if = { - limit = { - exists = scope:tcc_old_main_power_faith - has_variable = tcc_main_power_faith - var:tcc_main_power_faith != scope:tcc_old_main_power_faith - NOT = { has_variable = pam_the_christian_church_main_power_faith_changed_catalyst_fired } - situation_top_has_catalyst = catalyst_the_christian_church_main_power_faith_changed - } - set_variable = pam_the_christian_church_main_power_faith_changed_catalyst_fired - set_variable = { - name = pam_main_power_faith_changed_catalyst_faith - value = var:tcc_main_power_faith - } - trigger_situation_catalyst = catalyst_the_christian_church_main_power_faith_changed - } - } -} - -# Byzantine emperor is not Christian -pam_the_christian_church_byzantine_emperor_non_christian_catalyst_effect = { - situation:the_christian_church ?= { - if = { - limit = { - pam_byzantine_emperor_non_christian_trigger = no - } - remove_variable = pam_byzantine_emperor_non_christian_catalyst_fired - } - else_if = { - limit = { - pam_byzantine_emperor_non_christian_trigger = yes - NOT = { has_variable = pam_byzantine_emperor_non_christian_catalyst_fired } - situation_top_has_catalyst = catalyst_byzantine_emperor_non_christian - } - set_variable = pam_byzantine_emperor_non_christian_catalyst_fired - trigger_situation_catalyst = catalyst_byzantine_emperor_non_christian - } - } -} - -# Non Christian presence in Europe -pam_the_christian_church_non_christian_kingdom_in_europe_catalyst_effect = { - if = { - limit = { - pam_non_christian_kingdom_holder_in_europe_trigger = yes - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_non_christian_kingdom_in_europe - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_non_christian_kingdom_in_europe - } - random_ruler = { - limit = { pam_non_christian_kingdom_holder_in_europe_trigger = yes } - set_variable = pam_non_christian_kingdom_holder_in_europe_trigger_var - } - } -} - -# County conversion Catalysts -pam_the_christian_church_county_conversion_catalysts_effect = { - if = { # PAM - Catalysts if non-Christian county is converted to Christianity - limit = { - faith != scope:old_faith - scope:old_faith = { - religion != religion:christianity_religion - } - faith.religion = religion:christianity_religion - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_county_converted_to_faith - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_county_converted_to_faith - } - } - if = { # PAM - Catalyst when Christian county is converted away from Christianity - limit = { - faith != scope:old_faith - scope:old_faith = { - religion = religion:christianity_religion - } - faith.religion != religion:christianity_religion - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_county_converted_from_faith - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_county_converted_from_faith - } - } - if = { # PAM - Jerusalem county is no longer Christian - limit = { - this = title:c_jerusalem - scope:old_faith = { - religion = religion:christianity_religion - } - faith.religion != religion:christianity_religion - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_lose_jerusalem - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_lose_jerusalem - } - } - if = { # PAM - Other Christian holy site county is no longer Christian - limit = { - NOT = { this = title:c_jerusalem } - scope:old_faith = { - religion = religion:christianity_religion - } - faith.religion != religion:christianity_religion - any_county_province = { - barony = { is_holy_site_of = scope:old_faith } - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_lose_holy_site - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_lose_holy_site - } - } -} - -# Clergy member exposed as adhering to a prohibited personal tenet -pam_the_christian_church_clergy_exposed_forbidden_personal_tenet_catalyst_effect = { - if = { - limit = { - is_clergy = yes - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_exposed_forbidden_personal_tenet - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_exposed_forbidden_personal_tenet - } - } -} - -# Secular ruler exposed as adhering to a prohibited personal tenet -pam_the_christian_church_exposed_forbidden_personal_tenet_catalyst_effect = { - if = { - limit = { - is_clergy = no - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_exposed_forbidden_personal_tenet - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_exposed_forbidden_personal_tenet - } - } -} - -# Christian ruler wins a Great Holy War -pam_the_christian_church_great_holy_war_won_catalyst_effect = { - if = { - limit = { - scope:attacker = { - has_pam_dlc_trigger = yes - religion = religion:christianity_religion - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_great_holy_war_won - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_great_holy_war_won - } - } -} - -# Christian ruler loses a Great Holy War -pam_the_christian_church_great_holy_war_lost_catalyst_effect = { - if = { - limit = { - scope:attacker = { - has_pam_dlc_trigger = yes - religion = religion:christianity_religion - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_great_holy_war_lost - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_great_holy_war_lost - } - } -} - -# Christian prelate hires a Military Order (on_holy_order_hired) -pam_the_christian_church_clergy_hired_holy_order_catalyst_effect = { - if = { - limit = { - scope:actor = { - has_pam_dlc_trigger = yes - is_clergy = yes - religion = religion:christianity_religion - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_hired_holy_order - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_hired_holy_order - } - } -} - -# Christian prelate hires mercenaries while at war with a non-Christian (on_mercenary_company_hired) -pam_the_christian_church_clergy_hired_mercenaries_catalyst_effect = { - if = { - limit = { - scope:employer = { - has_pam_dlc_trigger = yes - is_clergy = yes - religion = religion:christianity_religion - any_primary_war_enemy = { - religion != religion:christianity_religion - } - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_hired_mercenaries - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_hired_mercenaries - } - } -} - -pam_the_christian_church_clergy_gained_landed_title_catalyst_effect = { - if = { - limit = { - has_global_variable = game_has_started # Don't fire for the clerical title holders placed during setup - has_pam_dlc_trigger = yes - is_clergy = yes - religion = religion:christianity_religion - scope:title = { - tier >= tier_county - has_clerical_region = no - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_gained_landed_title - } - } - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_clergy_gained_landed_title - character = root - } - } - } -} - -# Excommunication war declared between two Christian rulers (excommunication_war on_declaration) -pam_the_christian_church_excommunication_war_catalyst_effect = { - if = { - limit = { - scope:attacker = { has_pam_dlc_trigger = yes } - scope:attacker = { religion = religion:christianity_religion } - scope:defender = { religion = religion:christianity_religion } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_excommunication_war_declared - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_excommunication_war_declared - } - } -} - -# Humiliation war declared against a Christian ecclesiastical ruler -pam_the_christian_church_humiliation_war_catalyst_effect = { - if = { - limit = { - scope:attacker = { has_pam_dlc_trigger = yes } - scope:defender = { - religion = religion:christianity_religion - government_has_flag = government_is_theocracy # Accounts for Ecclesiastical - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_humiliation_war_declared - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_humiliation_war_declared - } - } -} - -# Clergy has a child -pam_the_christian_church_clergy_has_child_catalyst_effect = { - $CHARACTER$ = { - if = { - limit = { - has_pam_dlc_trigger = yes - is_clergy = yes - rite = { rite_has_doctrine = doctrine_clerical_marriage_disallowed } - any_character_situation = { - situation_type = the_christian_church - situation_top_has_catalyst = catalyst_clergy_has_child - } - } - if = { - limit = { - any_held_title = { is_head_of_faith = yes } - } - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_the_christian_church_head_of_faith_has_child - character = $CHARACTER$ - } - } - } - else = { - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_clergy_has_child - character = $CHARACTER$ - } - } - } - } - } -} - -pam_buy_ecclesiastical_title_interaction_effect = { - scope:actor = { - if = { - limit = { government_has_flag = government_is_theocracy } - save_scope_as = new_holder - } - else = { - scope:secondary_recipient = { save_scope_as = new_holder } - } - } - scope:actor = { - pay_short_term_gold = { - target = scope:recipient - gold = pam_buy_ecclesiastical_title_gold_cost_value - } - } - create_title_and_vassal_change = { - type = granted - save_scope_as = change - } - scope:target = { - change_title_holder_include_vassals = { - holder = scope:new_holder - change = scope:change - government_base = scope:recipient - } - } - resolve_title_and_vassal_change = scope:change - scope:new_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_ecclesiastical } - } - change_government = ecclesiastical_government - } - } - if = { - limit = { - scope:actor = { has_pam_dlc_trigger = yes } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_simony - } - scope:actor = { - any_character_situation = { - this = situation:the_christian_church - } - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_simony - } - } -} - -ecclesiastic_transfer_land_interaction_immediate_effect = { - scope:secondary_recipient = { save_scope_as = cleric } - scope:recipient = { save_scope_as = owner } - #Either your shittiness or target's coolness has given the clergyman pause - if = { - limit = { - clerical_hesitation_claim_interaction_value >= 9 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = major_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = major_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 6 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = medium_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = medium_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 3 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = minor_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = minor_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_high_player_tt - } - else = { - custom_tooltip = clerical_hesitation_high_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < 3 - clerical_hesitation_claim_interaction_value >= -2 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < -2 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -5 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -8 - } - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - else = { - scope:secondary_recipient = { - if = { - limit = { - is_ai = yes - piety <= 0 - } - show_as_tooltip = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - } - else = { - add_piety = { - value = miniscule_piety_loss - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - change_spiritual_fulfillment = major_spiritual_fulfillment_value - if = { - limit = { - root ?= scope:cleric - } - custom_tooltip = clerical_hesitation_low_player_tt - } - else = { - custom_tooltip = clerical_hesitation_low_tt - } - } - } - #Opinion effects - scope:target.holder ?= { - #Hide this info from the cleric secondary_recipient - if = { - limit = { - root ?= scope:secondary_recipient - } - hidden_effect = { - add_opinion = { - target = scope:actor - modifier = demanded_my_title_opinion - opinion = -50 - } - } - } - else = { - add_opinion = { - target = scope:actor - modifier = demanded_my_title_opinion - opinion = -50 - } - } - if = { - limit = { - scope:secondary_recipient = { - is_ai = yes - } - } - hidden_effect = { - add_opinion = { - target = scope:secondary_recipient - modifier = demanded_my_title_opinion - opinion = -30 - } - } - } - } - if = { - limit = { - scope:recipient = { - NOT = { - this = scope:target.holder - } - } - } - scope:recipient ?= { - #Hide this info from the cleric secondary_recipient - if = { - limit = { - root ?= scope:secondary_recipient - } - hidden_effect = { - add_opinion = { - target = scope:actor - modifier = demanded_my_title_opinion - opinion = -25 - } - } - } - else = { - add_opinion = { - target = scope:actor - modifier = demanded_my_title_opinion - opinion = -25 - } - } - - - if = { - limit = { - scope:secondary_recipient = { - is_ai = yes - } - } - hidden_effect = { - add_opinion = { - target = scope:secondary_recipient - modifier = demanded_my_title_opinion - opinion = -20 - } - } - } - } - } - if = { - limit = { - is_ai = yes - } - add_opinion = { - target = scope:secondary_recipient - modifier = clerical_transfer_title_opinion - opinion = { - value = 10 - if = { - limit = { - highest_held_title_tier < scope:target.tier - } - multiply = 8 - } - else_if = { - limit = { - highest_held_title_tier = scope:target.tier - } - multiply = 5 - } - else_if = { - limit = { - highest_held_title_tier_minus_one = scope:target.tier - } - multiply = 3 - } - else_if = { - limit = { - highest_held_title_tier_minus_two = scope:target.tier - } - multiply = 2 - } - } - } - } - #Send toast to actor to confirm that interaction option costs have been applied - if = { - limit = { - OR = { - scope:promise_church_succession = yes - scope:donate_faith = yes - AND = { - scope:use_hook = yes - has_usable_hook = scope:secondary_recipient - } - scope:offer_pilgrimage = yes - scope:threaten_priest = yes - } - } - trigger_event = pam_interactions_events.0038 - #You promised the church could inherit this title if it is ever without heirs - if = { - limit = { - scope:promise_church_succession = yes - } - scope:actor = { - set_fallback_succession_title = scope:secondary_recipient.primary_title - } - scope:actor = { - custom_tooltip = church_fallback_succession_promise_tt - } - } - if = { - limit = { - scope:donate_faith = yes - } - pay_short_term_gold = { - target = scope:secondary_recipient - gold = scope:actor.medium_gold_value - } - } - if = { - limit = { - scope:use_hook = yes - has_usable_hook = scope:secondary_recipient - } - use_hook = scope:secondary_recipient - } - if = { - limit = { - scope:offer_hook = yes - } - scope:secondary_recipient = { - add_hook = { - type = strong_obligation_hook - target = scope:actor - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:actor - CLERIC = scope:secondary_recipient - } - if = { - limit = { - scope:threaten_priest = yes - } - if = { - limit = { - scope:secondary_recipient = { - this = scope:actor.faith.religious_head - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - add_piety_experience = massive_piety_loss - custom_tooltip = hof_increase_piety_sp_fulfillment_loss_secondary_tt - } - else = { - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - add_piety_experience = major_piety_loss - } - scope:secondary_recipient = { - add_opinion = { - modifier = threatened_church_opinion - target = scope:actor - opinion = -50 - } - } - } - } - #Catalyst towards saeculum_obscurum - if = { - limit = { - #Only fire catalyst if clergyman is choosing a more immoral holder (has decently high hesitation) - clerical_hesitation_claim_interaction_value >= -2 - any_character_situation = { - this = situation:the_christian_church - } - situation:the_christian_church = { - OR = { - situation_top_has_catalyst = catalyst_ecclesiastical_transfer_land_interaction - situation_top_has_catalyst = catalyst_ecclesiastical_transfer_land_interaction_major - } - } - } - situation:the_christian_church = { - if = { - limit = { - scope:target.tier >= tier_kingdom - } - trigger_situation_catalyst = catalyst_ecclesiastical_transfer_land_interaction_major - } - else = { - trigger_situation_catalyst = catalyst_ecclesiastical_transfer_land_interaction - } - } - - } -} - -ecclesiastic_transfer_land_interaction_transfer_effect = { - #Transfer vassal - #Need to inform player of why they were just transferred - #Players are only valid if it is their primary title being transfered - if = { - limit = { - scope:target.holder ?= { - NOT = { - this = scope:recipient - } - is_ai = no - } - } - #transfer vassal - if = { - limit = { - scope:target.holder = { is_governor_or_admin_count = no } - } - scope:target.holder = { - add_to_list = already_transfered - every_vassal_or_below = { - limit = { - highest_held_title_tier >= tier_county - } - add_to_list = already_transfered - } - } - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = no - } - scope:target.holder = { - change_liege = { - liege = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - - scope:target.holder = { - #Notification event they're being transferred - trigger_event = pam_interactions_events.0037 - } - } - #Admin - needs title revoked - else = { - every_held_title = { - limit = { - any_this_title_or_de_jure_above = { - this = scope:target - } - } - add_to_list = admin_target_transfer - } - hidden_effect = { - create_title_and_vassal_change = { - type = revoked - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = admin_target_transfer - change_title_holder = { - holder = scope:recipient - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - scope:target.holder = { - #Notification event to dispossessed admin - trigger_event = pam_interactions_events.0039 - } - } - } - #Transfer vassal if it is primary title of its holder - else_if = { - limit = { - scope:target.holder.primary_title ?= scope:target - scope:target.holder = { - highest_held_title_tier = scope:target.tier - is_governor_or_admin_count = no - } - OR = { - #already low enough tier to transfer - scope:target.holder.highest_held_title_tier < scope:actor.highest_held_title_tier - #Will be low enough tier to transfer - scope:target.holder = { - NOT = { - any_held_title = { - NOT = { - this = scope:target - } - tier = scope:target.tier - } - } - } - } - } - scope:target.holder = { save_scope_as = old_holder } - #Need to transfer vassals if getting taken down a tier - if = { - limit = { - #Will be low enough tier to transfer - scope:target.holder = { - NOT = { - any_held_title = { - NOT = { - this = scope:target - } - tier >= scope:target.tier - } - } - } - } - scope:old_holder = { - every_vassal = { - limit = { - highest_held_title_tier >= tier_county - primary_title = { - any_this_title_or_de_jure_above = { - this = scope:target - } - } - highest_held_title_tier >= scope:target.tier_minus_one - is_governor_or_admin_count = no - } - add_to_list = transfer_vassals - } - } - } - #Transferring title still if needed to vassalize recipient - if = { - limit = { - scope:target.tier >= scope:actor.highest_held_title_tier - } - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = yes - } - scope:target = { - change_title_holder = { - holder = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - scope:old_holder = { - add_to_list = already_transfered - every_vassal_or_below = { - limit = { - - } - add_to_list = already_transfered - } - } - custom_tooltip = clergy_transfer_vassal_tt - hidden_effect = { - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = no - } - scope:old_holder = { - change_liege = { - liege = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - } - #transfer the title without the holder - else = { - scope:target ?= { - add_to_list = titles_to_grant - } - } - scope:target ?= { - #Revoke titles from admins in the transfer zone - every_in_de_jure_hierarchy = { - limit = { - tier >= tier_county - holder ?= { - is_vassal_or_below_of = scope:recipient - is_governor_or_admin_count = yes - } - NOT = { is_in_list = titles_to_grant } - } - add_to_list = admin_title_losses - } - hidden_effect = { - create_title_and_vassal_change = { - type = revoked - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = admin_title_losses - change_title_holder = { - holder = scope:recipient - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - - #Transfer vassals - every_in_de_jure_hierarchy = { - limit = { - exists = holder - holder = { - is_governor_or_admin_count = no - } - } - #Transfer vassals/sub-vassals of recipient that belong under target title - #At this point, target holder may be transfered and thus their vassals would not be included in this - if = { - limit = { - holder = { - highest_held_title_tier >= tier_county - any_liege_or_above = { - this = scope:recipient - } - primary_title = { - any_this_title_or_de_jure_above = { - this = scope:target - } - } - #Liege is also being transferred - NOT = { - any_liege_or_above = { - NOT = { - this = scope:target.holder - } - primary_title = { - any_this_title_or_de_jure_above = { - this = scope:target - } - } - } - } - NOR = { - is_in_list = transfer_vassals - is_in_list = already_transfered - } - highest_held_title_tier < scope:actor.highest_held_title_tier - } - } - holder = { add_to_list = transfer_vassals } - } - } - } - #transfer title(s) - if = { - limit = { - any_in_list = { - list = titles_to_grant - count >= 1 - } - } - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = titles_to_grant - limit = { - tier >= tier_county - } - change_title_holder = { - holder = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - #transfer vassals - if = { - limit = { - any_in_list = { - list = transfer_vassals - count >= 1 - any_held_title = { - is_landless_type_title = no - NOT = { - is_in_list = titles_to_grant - } - } - } - } - if = { - limit = { - any_in_list = { - list = transfer_vassals - this = scope:target.holder - } - } - custom_tooltip = clergy_transfer_vassal_tt - } - hidden_effect = { - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = transfer_vassals - change_liege = { - liege = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - } - #Make sure recipient isn't sneakily holding onto titles beneath the target title - if = { - limit = { - scope:recipient = { - NOT = { - is_vassal_of = scope:actor - } - } - } - scope:recipient = { - every_held_title = { - limit = { - tier >= tier_county - any_this_title_or_de_jure_above = { - this = scope:target - } - } - add_to_list = recipient_mop_up - } - } - hidden_effect = { - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = yes - } - every_in_list = { - list = recipient_mop_up - limit = { - tier >= tier_county - } - change_title_holder = { - holder = scope:actor - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - } - if = { - limit = { - scope:target.tier >= highest_held_title_tier_minus_one - } - create_character_memory = { - type = negotiated_for_land_memory - participants = { - recipient = scope:recipient - } - } - scope:new_memory = { - set_variable = { - name = target_title - value = scope:target - } - } - } - if = { - limit = { - scope:target.tier >= scope:recipient.highest_held_title_tier_minus_one - } - scope:recipient = { - create_character_memory = { - type = gave_away_land_memory - participants = { - actor = scope:actor - } - } - scope:new_memory = { - set_variable = { - name = target_title - value = scope:target - } - } - } - } -} - -pam_negotiate_land_possible_refusal_notificaton_effect = { - if = { - limit = { - scope:target.tier >= scope:recipient.highest_held_title_tier_minus_one - scope:recipient = { - has_legitimacy = no - } - } - scope:recipient = { custom_tooltip = refuse_ecclesiastic_land_transfer_penalty_no_legit_tt } - } - else_if = { - limit = { - scope:recipient = { - has_legitimacy = no - } - } - scope:recipient = { custom_tooltip = refuse_ecclesiastic_land_transfer_penalty_minor_no_legit_tt } - } - else_if = { - limit = { - scope:target.tier >= scope:recipient.highest_held_title_tier_minus_one - } - scope:recipient = { custom_tooltip = refuse_ecclesiastic_land_transfer_penalty_tt } - } - else = { - scope:recipient = { custom_tooltip = refuse_ecclesiastic_land_transfer_penalty_minor_tt } - } -} -clergy_land_refusal_legitimacy_piety_effect = { - if = { - limit = { - scope:target.tier >= scope:recipient.highest_held_title_tier_minus_one - } - scope:recipient = { - add_piety = clergy_land_refusal_large_piety_value - if = { - limit = { - has_legitimacy = yes - } - add_legitimacy = clergy_land_refusal_large_legitimacy_value - } - else = { - add_prestige = clergy_land_refusal_large_prestige_value - } - } - } - else = { - scope:recipient = { - add_piety = clergy_land_refusal_small_piety_value - if = { - limit = { - has_legitimacy = yes - } - add_legitimacy = clergy_land_refusal_small_legitimacy_value - } - else = { - add_prestige = clergy_land_refusal_small_prestige_value - } - } - } -} - -pam_available_negotiation_methods_tooltip_effect = { - #show tooltips - if = { - limit = { - pam_forced_negotiate_land_success_trigger = yes - } - #Do not show AI behaviour tooltips if this is recipient viewing - if = { - limit = { - NOT = { exists = scope:recipient_event } - } - custom_tooltip = pam_clergy_land_forced_success_tt - custom_tooltip = pam_negotiate_land_force_by_tt - } - #FORCED FIRST - if = { - limit = { - pam_negotiate_land_forced_hook_trigger = yes - } - custom_tooltip = pam_forced_negotiate_land_hook_tt - } - if = { - limit = { - pam_negotiate_land_forced_relation_trigger = yes - } - custom_tooltip = pam_forced_negotiate_land_relation_tt - } - if = { - limit = { - pam_negotiate_land_forced_piety_level_trigger = yes - } - if = { - limit = { - scope:recipient.piety_level = 0 - } - custom_tooltip = pam_forced_negotiate_land_piety_level_1_tt - } - else = { - custom_tooltip = pam_forced_negotiate_land_piety_level_2_tt - } - } - if = { - limit = { - pam_negotiate_land_forced_legitimacy_level_trigger = yes - } - if = { - limit = { - scope:recipient.legitimacy_level = 0 - } - custom_tooltip = pam_forced_negotiate_land_legitimacy_level_1_tt - } - else = { - custom_tooltip = pam_forced_negotiate_land_legitimacy_level_2_tt - } - } - if = { - limit = { - pam_negotiate_land_forced_gold_trigger = yes - } - show_as_tooltip = { - if = { - limit = { - has_treasury = yes - } - pay_short_term_treasury = { - target = scope:recipient - gold = scope:recipient.pam_transfer_land_gold_value - } - } - else = { - pay_short_term_gold = { - target = scope:recipient - gold = scope:recipient.pam_transfer_land_gold_value - } - } - } - } - } - else = { - #Do not show AI behaviour tooltips if this is recipient viewing - if = { - limit = { - NOT = { exists = scope:recipient_event } - } - custom_tooltip = pam_clergy_land_possible_success_tt - } - } - - if = { - limit = { - pam_possible_negotiate_land_success_trigger = yes - } - #Do not show AI behaviour tooltips if this is recipient viewing - if = { - limit = { - NOT = { exists = scope:recipient_event } - } - custom_tooltip = pam_negotiate_land_possible_by_tt - } - #POSSIBLE NEXT - if = { - limit = { - pam_negotiate_land_possible_hook_trigger = yes - pam_negotiate_land_forced_hook_trigger = no - } - custom_tooltip = pam_possible_negotiate_land_hook_tt - } - if = { - limit = { - pam_negotiate_land_possible_relation_trigger = yes - pam_negotiate_land_forced_relation_trigger = no - } - custom_tooltip = pam_possible_negotiate_land_relation_tt - } - if = { - limit = { - pam_negotiate_land_possible_piety_level_trigger = yes - pam_negotiate_land_forced_piety_level_trigger = no - } - custom_tooltip = pam_possible_negotiate_land_piety_level_tt - } - if = { - limit = { - pam_negotiate_land_possible_legitimacy_level_trigger = yes - pam_negotiate_land_forced_legitimacy_level_trigger = no - } - custom_tooltip = pam_possible_negotiate_land_legitimacy_level_tt - } - if = { - limit = { - pam_negotiate_land_possible_gold_trigger = yes - pam_negotiate_land_forced_gold_trigger = no - } - show_as_tooltip = { - pam_negotiate_land_gold_effect = yes - } - } - } -} -pam_negotiate_land_hook_effect = { - use_hook = scope:recipient -} -pam_negotiate_land_relation_accept_effect = { - if = { - limit = { - has_relation_best_friend = scope:recipient - } - remove_relation_best_friend = scope:recipient - } - else_if = { - limit = { - has_relation_friend = scope:recipient - } - remove_relation_friend = scope:recipient - } - if = { - limit = { - has_relation_soulmate = scope:recipient - } - remove_relation_soulmate = scope:recipient - } - if = { - limit = { - has_relation_lover = scope:recipient - } - remove_relation_lover = scope:recipient - } - if = { - limit = { - has_relation_crush = scope:recipient - } - remove_relation_crush = scope:recipient - } - if = { - limit = { - has_relation_student = scope:recipient - } - remove_relation_student = scope:recipient - } - if = { - limit = { - has_relation_mentor = scope:recipient - } - remove_relation_mentor = scope:recipient - } - if = { - limit = { - has_relation_guardian = scope:recipient - } - remove_relation_guardian = scope:recipient - } - if = { - limit = { - has_relation_ward = scope:recipient - } - remove_relation_ward = scope:recipient - } - if = { - limit = { - has_relation_potential_friend = scope:recipient - } - remove_relation_potential_friend = scope:recipient - } - if = { - limit = { - has_relation_potential_lover = scope:recipient - } - remove_relation_potential_lover = scope:recipient - } - if = { - limit = { - has_relation_blood_brother = scope:recipient - } - remove_relation_blood_brother = scope:recipient - } - if = { - limit = { - has_relation_disciple = scope:recipient - } - remove_relation_disciple = scope:recipient - } - if = { - limit = { - has_relation_elder = scope:recipient - } - remove_relation_elder = scope:recipient - } -} -pam_negotiate_land_relation_effect = { - pam_negotiate_land_relation_accept_effect = yes - if = { - limit = { - exists = scope:forceable_relation - } - custom_tooltip = recipient_becomes_potential_rival_tt - hidden_effect = { - set_relation_potential_rival = { - target = scope:recipient - reason = rival_quarreled_over_land - } - } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - scope:recipient = { - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - } - } - else = { - custom_tooltip = recipient_becomes_rival_tt - hidden_effect = { - set_relation_rival = { - target = scope:recipient - reason = rival_quarreled_over_land - } - } - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - scope:recipient = { - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - } - } -} -pam_negotiate_land_piety_effect = { - if = { - limit = { - pam_negotiate_land_forced_piety_level_trigger = yes - } - if = { - limit = { - scope:recipient.piety_level = 0 - } - add_piety_experience = major_piety_loss - scope:recipient = { add_piety_experience = massive_piety_loss } - } - else = { - add_piety_experience = massive_piety_loss - scope:recipient = { add_piety_level = -1 } - } - } - else = { - add_piety_level = -1 - scope:recipient = { add_piety_level = -2 } - } -} -pam_negotiate_land_legitimacy_effect = { - if = { - limit = { - pam_negotiate_land_forced_legitimacy_level_trigger = yes - } - if = { - limit = { - scope:recipient.legitimacy_level = 0 - } - add_legitimacy = medium_legitimacy_loss - scope:recipient = { add_legitimacy = major_legitimacy_loss } - } - else = { - add_legitimacy = major_legitimacy_loss - scope:recipient = { add_legitimacy_level = -1 } - } - } - else = { - add_legitimacy_level = -1 - scope:recipient = { add_legitimacy_level = -2 } - } -} -pam_negotiate_land_gold_effect = { - if = { - limit = { - has_treasury = yes - } - pay_short_term_treasury = { - target = scope:recipient - gold = scope:recipient.pam_transfer_land_gold_value - } - } - else = { - pay_short_term_gold = { - target = scope:recipient - gold = scope:recipient.pam_transfer_land_gold_value - } - } -} -pam_negotiate_land_tracking_variable_effect = { - scope:recipient = { - if = { - limit = { - has_variable = clergy_land_granted - var:clergy_land_granted <= scope:target.tier - } - remove_variable = clergy_land_granted - custom_tooltip = clergy_land_request_reduction_tt - set_variable = { - name = clergy_land_granted - value = scope:target.tier - years = 5 - } - } - else_if = { - limit = { - NOT = { - has_variable = clergy_land_granted - } - } - custom_tooltip = clergy_land_request_reduction_tt - set_variable = { - name = clergy_land_granted - value = scope:target.tier - years = 5 - } - } - } -} - -###################### -### RITE DIVERGENCE DRIFT -###################### - - -@hor_drift_forward_cap = 40 -@hor_drift_backward_floor = 5 - -@hor_drift_step_high = 20 -@hor_drift_step_normal = 10 -@hor_drift_step_low = 5 - -@hor_drift_step_high_neg = -20 -@hor_drift_step_normal_neg = -10 -@hor_drift_step_low_neg = -5 - -@hor_drift_low_fervor = 40 -@hor_drift_high_fervor = 70 - -rite_yearly_hor_divergence_drift_effect = { - if = { - limit = { - this != faith.main_rite - # We leave rites that are already heretical alone, since heresy already covers that range - "divergence(faith.main_rite)" < faith.heresy_threshold - head_of_rite ?= { - is_available_ai_adult = yes - NOT = { has_character_flag = hor_already_drifted_rite_flag } - } - } - random = { - chance = { - value = 4 - # Low fervor: lots of room for reinterpretation - if = { - limit = { faith.fervor <= @hor_drift_low_fervor } - add = 6 - } - # Stable faith: rare drift - if = { - limit = { faith.fervor >= @hor_drift_high_fervor } - add = -2 - } - # Unfulfilled HoR's do changes more often - if = { - limit = { - head_of_rite ?= { - spiritual_fulfillment <= 0 - } - } - add = 4 - } - if = { - limit = { head_of_rite ?= { has_trait = heresiarch } } - add = 25 - } - min = 1 - } - - rite_yearly_hor_divergence_drift_apply_effect = yes - } - } -} - -rite_yearly_hor_divergence_drift_apply_effect = { - save_scope_as = diverged_rite - head_of_rite = { save_scope_as = diverged_hor } - - # Snapshot the rite's current tenets and (HoR-known) doctrines so we can identify what change_rite_divergence swapped in. - every_rite_tenet = { - add_to_list = drift_tenets_before - } - scope:diverged_hor = { - every_character_doctrine = { - rite_filter = scope:diverged_rite - add_to_list = drift_doctrines_before - } - } - - random_list = { - 100 = { - trigger = { - "divergence(faith.main_rite)" <= 40 - } - modifier = { - factor = 0.5 - "divergence(faith.main_rite)" >= 30 - } - modifier = { - # Low fervor faiths drift outward more readily. - factor = 1.5 - faith.fervor <= @hor_drift_low_fervor - } - modifier = { - factor = 0.6 - faith.fervor >= @hor_drift_high_fervor - } - - save_scope_value_as = { name = diverged_change value = 1 } - rite_yearly_hor_divergence_drift_forward_pick_effect = yes - } - 100 = { - trigger = { - "divergence(faith.main_rite)" >= 10 - faith.rite_growth_rites_needed <= 0 - trigger_if = { - limit = { - exists = faith.religious_head - } - scope:diverged_hor = { - OR = { - opinion = { - target = scope:diverged_rite.faith.religious_head - value >= 50 - } - has_dread_level_towards = { - target = scope:diverged_rite.faith.religious_head - level >= 1 - } - } - } - } - trigger_else = { - always = yes - } - } - modifier = { - # Mirror the forward throttle: when divergence is small there's less room to walk it back. - factor = 0.5 - "divergence(faith.main_rite)" < 20 - } - modifier = { - factor = 1.3 - faith.fervor >= @hor_drift_high_fervor - } - modifier = { - # Consolidation belongs to high-fervor faiths; sub-70 fervor is the divergence regime. - factor = 0.2 - faith.fervor < @hor_drift_high_fervor - } - modifier = { - # Without a HoF to anchor consolidation, backward drift is much rarer. - factor = 0.2 - NOT = { exists = faith.religious_head } - } - save_scope_value_as = { name = diverged_change value = -1 } - rite_yearly_hor_divergence_drift_backward_pick_effect = yes - } - } -} - -rite_yearly_hor_divergence_drift_forward_pick_effect = { - random_list = { - 1 = { - # Only allow a +20 jump if we're far below the cap. - trigger = { - "divergence(faith.main_rite)" <= 20 - } - modifier = { - factor = 0.4 - "divergence(faith.main_rite)" >= 15 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_high } - change_rite_divergence = { - value = @hor_drift_step_high - override_tenets_first = no - } - } - 1 = { - trigger = { - "divergence(faith.main_rite)" <= 20 - } - modifier = { - factor = 0.4 - "divergence(faith.main_rite)" >= 15 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_high } - change_rite_divergence = { - value = @hor_drift_step_high - override_tenets_first = yes - } - } - 3 = { - trigger = { - "divergence(faith.main_rite)" <= 30 - } - modifier = { - factor = 0.5 - "divergence(faith.main_rite)" >= 25 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_normal } - change_rite_divergence = { - value = @hor_drift_step_normal - override_tenets_first = no - } - } - 3 = { - trigger = { - "divergence(faith.main_rite)" <= 30 - } - modifier = { - factor = 0.5 - "divergence(faith.main_rite)" >= 25 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_normal } - change_rite_divergence = { - value = @hor_drift_step_normal - override_tenets_first = yes - } - } - 8 = { - trigger = { - "divergence(faith.main_rite)" <= 40 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_low } - change_rite_divergence = { - value = @hor_drift_step_low - override_tenets_first = no - } - } - 8 = { - trigger = { - "divergence(faith.main_rite)" <= 40 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_low } - change_rite_divergence = { - value = @hor_drift_step_low - override_tenets_first = yes - } - } - } - rite_yearly_hor_divergence_drift_commit_effect = yes -} - -rite_yearly_hor_divergence_drift_backward_pick_effect = { - random_list = { - 1 = { - trigger = { - "divergence(faith.main_rite)" >= 25 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_high_neg } - change_rite_divergence = { - value = @hor_drift_step_high_neg - override_tenets_first = no - } - } - 1 = { - trigger = { - "divergence(faith.main_rite)" >= 25 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_high_neg } - change_rite_divergence = { - value = @hor_drift_step_high_neg - override_tenets_first = yes - } - } - 3 = { - trigger = { - "divergence(faith.main_rite)" >= 15 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_normal_neg } - change_rite_divergence = { - value = @hor_drift_step_normal_neg - override_tenets_first = no - } - } - 3 = { - trigger = { - "divergence(faith.main_rite)" >= 15 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_normal_neg } - change_rite_divergence = { - value = @hor_drift_step_normal_neg - override_tenets_first = yes - } - } - 8 = { - trigger = { - "divergence(faith.main_rite)" >= 10 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_low_neg } - change_rite_divergence = { - value = @hor_drift_step_low_neg - override_tenets_first = no - } - } - 8 = { - trigger = { - "divergence(faith.main_rite)" >= 10 - } - save_scope_value_as = { name = diverged_change value = @hor_drift_step_low_neg } - change_rite_divergence = { - value = @hor_drift_step_low_neg - override_tenets_first = yes - } - } - } - rite_yearly_hor_divergence_drift_commit_effect = yes -} - -rite_yearly_hor_divergence_drift_commit_effect = { - random_rite_tenet = { - limit = { - NOT = { is_in_list = drift_tenets_before } - } - save_scope_as = diverged_added_tenet - } - scope:diverged_hor = { - random_character_doctrine = { - rite_filter = scope:diverged_rite - limit = { - NOT = { is_in_list = drift_doctrines_before } - } - save_scope_as = diverged_added_doctrine - } - } - - if = { - limit = { - OR = { - exists = scope:diverged_added_tenet - exists = scope:diverged_added_doctrine - } - } - scope:diverged_hor = { - add_character_flag = hor_already_drifted_rite_flag - } - if = { - limit = { scope:diverged_change <= -1 } - scope:diverged_rite.faith = { - change_fervor = { - value = notable_fervor_value - desc = fervor_gain_pam_rite_consolidated - } - } - } - else_if = { - limit = { scope:diverged_change >= 1 } - scope:diverged_rite.faith = { - change_fervor = { - value = significant_fervor_loss - desc = fervor_loss_pam_rite_diverged - } - } - } - rite_yearly_hor_divergence_drift_notify_effect = yes - } -} - -# Notify every ruler of the rite + the religious head, via letter event. -rite_yearly_hor_divergence_drift_notify_effect = { - faith = { - every_faith_ruler = { - limit = { - rite = scope:diverged_rite - this != scope:diverged_hor - } - trigger_event = pam_tenet_events.0004 - } - } - # Religious head (if any) gets the letter too, even if they aren't iterated above. - faith.religious_head ?= { - if = { - limit = { - NOT = { rite = scope:diverged_rite } - this != scope:diverged_hor - } - trigger_event = pam_tenet_events.0004 - } - } -} - -pam_declare_rite_heresy_effect = { - custom_tooltip = { - text = pam_declare_rite_heresy_effect_tt - detach_rite_to_new_faith = { - target = scope:heresy_rite - } - } - # Heresy rite types ship convert = no so they cannot be joined before the bull; branding has to flip it or nothing can convert in. - scope:heresy_rite = { - set_can_convert_to_rite = yes - } - faith = { - change_fervor = { - value = notable_fervor_value - desc = fervor_gain_pam_rite_declared_heresy - } - set_variable = { - name = rite_growth_recent_heresy - value = yes - days = rite_growth_heresy_cooldown_days - } - } - # The declaring faith repudiates the now-heretical rite, so its core tenets lose standing there. - if = { - limit = { faith = { has_tenet_popularity_trigger = yes } } - faith = { save_scope_as = heresy_declaring_faith } - scope:heresy_rite = { - every_rite_tenet = { - status = core - save_scope_as = heresy_rite_tenet - scope:heresy_declaring_faith = { - change_tenet_popularity = { - target = scope:heresy_rite_tenet - change = major_tenet_popularity_loss - } - } - } - } - } - if = { - limit = { - exists = scope:heresy_rite - NOT = { scope:heresy_rite.faith = faith } - } - scope:heresy_rite.faith = { - every_faith_character = { - limit = { - is_ruler = yes - this != scope:bull_issuer - } - trigger_event = { id = pam_decision_events.0013 days = 1 } - } - } - } -} - -#This is only for use in pam_cathedral_01, pam_cathedral_02, and pam_cathedral_03 -pam_cathedral_art_contribution_subject_event_effect = { - save_scope_as = contributor - scope:contributor = { - trigger_event = { - id = $EVENT$ - days = { 5 20 } - } - } -} - -#This is only for use in pam_cathedral_01, pam_cathedral_02, and pam_cathedral_03 -cathedral_great_project_funded_started_event_sender_effect = { - scope:founder = { - trigger_event = pam_great_projects_events.0005 - } - scope:owner = { - if = { - limit = { - this != scope:founder - } - trigger_event = pam_great_projects_events.0005 - } - } - every_contribution = { - limit = { - contribution_is_funded = yes - } - contributor ?= { - if = { - limit = { - this != scope:owner - this != scope:founder - } - save_scope_as = contributor - trigger_event = pam_great_projects_events.0005 - } - } - } -} - -cathedral_great_project_completed_event_sender_effect = { - scope:founder = { - trigger_event = pam_great_projects_events.0020 - } - scope:owner = { - if = { - limit = { - this != scope:founder - } - trigger_event = pam_great_projects_events.0020 - } - } - scope:founder_heir ?= { - if = { - limit = { - is_alive = yes - this != scope:founder - this != scope:owner - } - trigger_event = pam_great_projects_events.0020 - } - } - every_contribution = { - limit = { - contribution_is_funded = yes - } - contributor ?= { - if = { - limit = { - this != scope:owner - this != scope:founder - NOT = { this ?= scope:founder_heir } - } - save_scope_as = contributor - trigger_event = pam_great_projects_events.0020 - } - } - } -} - -# Create a New Ecclesiastical Title as HoF - on_accept -pam_create_new_ecclesiastical_title_interaction_effect = { - scope:secondary_recipient = { - save_scope_as = new_ecclesiastical_holder - } - scope:recipient = { - save_scope_as = kingdom_holder - if = { - limit = { - scope:new_ecclesiastical_holder = { - NOT = { - is_courtier_of = scope:kingdom_holder - } - is_ruler = no - } - } - add_courtier = scope:new_ecclesiastical_holder - } - if = { - limit = { - scope:new_ecclesiastical_holder = { - NOT = { is_councillor_of = scope:kingdom_holder } - } - } - assign_councillor_type = { - type = councillor_court_chaplain - remove_existing_councillor = yes - target = scope:new_ecclesiastical_holder - } - } - } - scope:target = { - save_scope_as = target_kingdom - } - scope:actor = { - if = { - limit = { - any_character_situation = { - situation_type = the_christian_church - situation_top_has_catalyst = catalyst_the_christian_church_clerical_region_created - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_clerical_region_created - } - } - send_interface_toast = { - type = event_toast_effect_good - title = create_new_ecclesiastical_title_toast - left_icon = scope:actor - right_icon = scope:new_ecclesiastical_holder - custom_tooltip = { - text = create_new_ecclesiastical_title_effect_tt - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - scope:target_kingdom = { - title_capital_county = { - save_scope_as = clerical_region_anchor_county - random_county_province = { - limit = { - is_county_capital = yes - } - save_scope_as = region_capital - create_clerical_region = { - domicile_type = ecclesiastical_domicile - name = NEW_ECCLESIASTICAL_TITLE - save_scope_as = new_title - } - scope:new_title ?= { - set_coa = scope:target_kingdom - set_color_from_title = scope:target_kingdom - set_capital_county = scope:clerical_region_anchor_county - set_landless_title = yes - set_no_automatic_claims = yes - set_definitive_form = yes - change_title_holder = { - holder = scope:new_ecclesiastical_holder - change = scope:change - } - resolve_title_and_vassal_change = scope:change - } - } - } - } - } - } - reverse_add_opinion = { - target = scope:new_ecclesiastical_holder - modifier = grateful_opinion - opinion = 50 - } - } - scope:new_ecclesiastical_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_ecclesiastical } - } - change_government = ecclesiastical_government - } - faith = { - change_fervor = { - value = notable_fervor_gain - desc = fervor_gain_clerical_title_created - } - } - situation:the_christian_church ?= { - add_manual_participant = prev - } - } -} - -# Expects scope:target and scope:pam_new_archbishop, and the caller must save pam_old_archbishop first -pam_grant_ecclesiastical_title_interaction_effect = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_grant_ecclesiastical_title_toast - left_icon = scope:actor - right_icon = scope:pam_new_archbishop - if = { - limit = { exists = scope:pam_old_archbishop } - custom_tooltip = { - text = pam_grant_ecclesiastical_title_deposed_effect_tt - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = no - } - scope:pam_old_archbishop = { - every_held_title = { - limit = { - OR = { - has_clerical_region = yes - is_landless_type_title = no - } - } - change_title_holder_include_vassals = { - holder = scope:pam_new_archbishop - change = scope:change - government_base = scope:pam_old_archbishop - } - } - } - resolve_title_and_vassal_change = scope:change - } - } - else = { - custom_tooltip = { - text = pam_grant_ecclesiastical_title_vacant_effect_tt - create_title_and_vassal_change = { - type = granted - save_scope_as = change - } - scope:target = { - change_title_holder_include_vassals = { - holder = scope:pam_new_archbishop - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - } - add_hook = { - type = granted_clerical_title_hook - target = scope:pam_new_archbishop - } - } - reverse_add_opinion = { - target = scope:pam_new_archbishop - modifier = grateful_opinion - opinion = 50 - } - } - scope:pam_old_archbishop ?= { - add_opinion = { - target = scope:actor - modifier = fp3_resentful_opinion - opinion = -40 - } - } - if = { - limit = { - scope:pam_old_archbishop ?= { rite != scope:actor.rite } - } - scope:actor.faith = { - change_fervor = { - value = significant_fervor_loss - desc = fervor_loss_pam_archbishop_deposed - } - } - } - scope:pam_new_archbishop = { - if = { - limit = { - NOT = { government_has_flag = government_is_ecclesiastical } - } - change_government = ecclesiastical_government - } - situation:the_christian_church ?= { - add_manual_participant = prev - } - } - if = { - limit = { - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_clergy_elevated_to_archbishopric - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_clergy_elevated_to_archbishopric - } - } -} - -# Picks scope:target_character for a GHW after scope:target_kingdom is already set (e.g. bull kingdom selection). -pam_determine_ghw_target_character_from_kingdom_effect = { - scope:target_kingdom = { - random_in_de_jure_hierarchy = { - continue = { tier > tier_county } - limit = { - tier = tier_county - $FAITH$.main_rite = { - is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.rite } - } - holder = { - highest_held_title_tier >= 4 - any_realm_county = { count >= 5 } - } - } - alternative_limit = { - tier = tier_county - $FAITH$.main_rite = { - is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.rite } - } - holder = { - highest_held_title_tier >= 3 - any_realm_county = { count >= 5 } - } - } - alternative_limit = { - tier = tier_county - $FAITH$.main_rite = { - is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.rite } - } - holder = { - highest_held_title_tier >= 2 - any_realm_county = { count >= 5 } - } - } - alternative_limit = { - tier = tier_county - $FAITH$.main_rite = { - is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.rite } - } - } - alternative_limit = { - tier = tier_kingdom - $FAITH$.main_rite = { - is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.rite } - } - } - holder = { - save_scope_as = target_character - } - } - } -} - -pam_use_bull_selected_ghw_target_effect = { - $GHW_SPONSOR$ = { - var:pam_bull_ghw_target_kingdom = { save_scope_as = target_kingdom } - remove_variable = pam_bull_ghw_target_kingdom - } - pam_determine_ghw_target_character_from_kingdom_effect = { FAITH = $FAITH$ } -} - -# Starts an undirected GHW using the kingdom stored on the HoF by pick_crusade_target_decision. -pam_start_bull_great_holy_war_effect = { - $GHW_SPONSOR$ = { - if = { - limit = { has_variable = pam_bull_ghw_target_kingdom } - religion = { set_variable = variable_ghw_unlocked } - $FAITH$ = { trigger_event = great_holy_war.0001 } - } - } -} - -pam_bull_notify_faith_rulers_effect = { - scope:bull_issuer = { - faith = { - every_faith_character = { - limit = { - is_ruler = yes - this != scope:bull_issuer - } - trigger_event = { id = pam_bull_events.0004 days = 1 } - } - } - } -} - -pam_apply_great_schism_creation_effect = { - if = { - limit = { NOT = { has_global_variable = pam_great_schism_happened } } - set_global_variable = { - name = pam_great_schism_happened - value = current_year - } - } - situation:the_christian_church.var:schism_mainline_rite = { save_scope_as = schism_mainline_rite } - if = { - limit = { scope:schism_mainline_rite = rite:roman_rite } - faith:catholic = { save_scope_as = schism_mainline_faith } - faith:orthodox = { save_scope_as = schism_competitor_faith } - } - else = { - faith:orthodox = { save_scope_as = schism_mainline_faith } - faith:catholic = { save_scope_as = schism_competitor_faith } - } - custom_tooltip = { - text = pam_create_great_schism_effect_tt - faith:christian_faith = { - save_scope_as = old_rite - every_faith_rite = { - limit = { rite_has_doctrine = doctrine_no_head } - change_rite_doctrine = doctrine_spiritual_head - } - } - faith:catholic = { - set_religious_head_title = title:k_papal_state - } - faith:orthodox = { - set_religious_head_title = title:k_orthodox - } - rite:roman_rite = { - save_scope_as = roman_rite - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:catholic - main = yes - } - } - rite:insular_celtic = { - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:catholic - main = no - } - } - rite:mozarabic_church = { - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:catholic - main = no - } - } - rite:ambrosian_rite = { - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:catholic - main = no - } - } - rite:byzantine_rite = { - save_scope_as = byzantine_rite - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:orthodox - main = yes - } - } - rite:georgian_rite = { - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:orthodox - main = no - } - } - rite:slavic_rite = { - set_can_convert_to_rite = yes - set_parent_faith = { - target = faith:orthodox - main = no - } - } - rite:carolingian_christianity = { - set_can_convert_to_rite = no - set_rite_enabled = no - set_parent_faith = { - target = faith:catholic - main = no - } - } - rite:beneventan_rite = { - set_can_convert_to_rite = no - set_rite_enabled = no - set_parent_faith = { - target = faith:catholic - main = no - } - } - struggle:iberian_struggle ?= { - set_faith_as_involved = rite:mozarabic_church.faith - set_faith_as_uninvolved = faith:christian_faith - } - } - show_as_tooltip = { - faith:catholic = { set_religious_head_title = title:k_papal_state } - } - hidden_effect = { - situation:the_christian_church ?= { - every_situation_participant = { - limit = { - OR = { - var:pam_schism_stance ?= flag:mainline - var:pam_schism_stance ?= flag:competitor - } - OR = { - faith = faith:christian_faith - faith = scope:schism_mainline_faith - faith = scope:schism_competitor_faith - } - NOR = { - any_held_title = { is_head_of_faith = yes } - primary_title ?= { is_holy_order = yes } - } - } - if = { - limit = { - var:pam_schism_stance ?= flag:mainline - NOT = { faith = scope:schism_mainline_faith } - } - set_character_faith = scope:schism_mainline_faith - } - else_if = { - limit = { - var:pam_schism_stance ?= flag:competitor - NOT = { faith = scope:schism_competitor_faith } - } - set_character_faith = scope:schism_competitor_faith - } - } - } - faith:christian_faith = { - every_clerical_elector_title = { - add_to_list = pam_schism_cardinalates - } - } - every_in_list = { - list = pam_schism_cardinalates - save_temporary_scope_as = pam_schism_cardinalate - if = { - limit = { - holder ?= { - OR = { - faith = faith:catholic - AND = { - faith = faith:christian_faith - OR = { - rite = rite:roman_rite - rite = rite:insular_celtic - rite = rite:mozarabic_church - rite = rite:ambrosian_rite - } - } - } - } - } - holder = { - if = { - limit = { NOT = { faith = faith:catholic } } - set_character_faith = faith:catholic - } - } - add_clerical_elector = faith:catholic - } - else_if = { - limit = { exists = holder } - holder = { - pam_destroy_cardinal_title_effect = { CARDINALATE = scope:pam_schism_cardinalate } - } - } - } - faith:christian_faith = { remove_doctrine = special_doctrine_has_clerical_electors } - # Catholicism starts with a College so AI clergy do not spam the Pope to fill vacancies - faith:catholic = { pam_seed_cardinals_effect = yes } - if = { - limit = { exists = situation:the_christian_church } - the_christian_church_set_main_power_faith_effect = yes - the_christian_church_recalculate_participant_groups_effect = yes - } - } -} - -# Rite followers move with their rites -pam_unite_miaphysite_churches_effect = { - save_scope_as = unifier - if = { - limit = { faith = faith:miaphysitism } - custom_tooltip = { - text = pam_unite_miaphysite_churches_effect_tt - faith = { save_scope_as = uniting_faith } - faith:armenian_apostolic = { - save_scope_as = absorbed_faith - remove_religious_head_title = yes - every_faith_rite = { - limit = { faith != scope:uniting_faith } - set_parent_faith = { - target = faith:miaphysitism - main = no - include_derived = no - } - } - } - } - } - else = { - custom_tooltip = { - text = pam_unite_miaphysite_churches_effect_tt - faith = { save_scope_as = uniting_faith } - faith:miaphysitism = { - save_scope_as = absorbed_faith - remove_religious_head_title = yes - every_faith_rite = { - limit = { faith != scope:uniting_faith } - set_parent_faith = { - target = faith:armenian_apostolic - main = no - include_derived = no - } - } - } - } - } - faith = { - change_fervor = { - value = medium_fervor_gain - desc = fervor_gain_mended_schism - } - } - hidden_effect = { - every_player = { - limit = { - this != root - faith = scope:uniting_faith - } - send_interface_message = { - type = event_generic_good_with_text - title = pam_unite_miaphysite_churches_message - desc = pam_unite_miaphysite_churches_message_desc - left_icon = scope:unifier - } - } - } - set_nickname_effect = { NICKNAME = nick_the_ecumenist } -} - -pam_great_schismat_effect = { - give_nickname = nick_the_schismat - dynasty ?= { - add_dynasty_modifier = { modifier = pam_caused_great_schism_dynasty_modifier } - } - if = { - limit = { NOT = { exists = dynasty } } - add_character_modifier = pam_caused_great_schism_character_modifier - } - # 0061 already announces the Schism - set_global_variable = { - name = pam_skip_tcc_phase_start_event - days = 30 - } - situation:the_christian_church = { - change_top_phase = { phase = concord } - } - save_scope_as = schismat -} - -pam_create_great_schism_effect = { - set_global_variable = { - name = pam_skip_tcc_phase_start_event - days = 30 - } - pam_apply_great_schism_creation_effect = yes - set_global_variable = pam_great_schism_decision_taken - faith:catholic = { save_scope_as = schism_western_faith } - faith:orthodox = { save_scope_as = schism_eastern_faith } - if = { - limit = { NOT = { exists = scope:schismat } } - situation:the_christian_church = { - change_top_phase = { phase = reform_phase } - } - } - situation:the_christian_church ?= { - every_situation_participant = { - limit = { - is_ruler = yes - faith.religion = religion:christianity_religion - } - trigger_event = pam_the_christian_church.0061 - } - } -} - -pam_prevent_great_schism_effect = { - custom_tooltip = pam_prevent_great_schism_aftermath_tt - give_nickname = nick_the_concordant - dynasty ?= { - add_dynasty_modifier = { modifier = pam_prevented_great_schism_dynasty_modifier } - } - if = { - limit = { NOT = { exists = dynasty } } - add_character_modifier = pam_prevented_great_schism_character_modifier - } - # 0062 already announces the Schism - set_global_variable = { - name = pam_skip_tcc_phase_start_event - days = 30 - } - situation:the_christian_church = { - change_top_phase = { phase = concord } - } -} - -# Run from either Mend the Great Schism decision, which pass the modifier pair matching their route. -# MODIFIER - dynasty modifier for the mender's dynasty. -# CHARACTER_MODIFIER - equivalent for a lowborn mender, who has no dynasty to mark. -pam_mend_great_schism_reward_effect = { - dynasty ?= { - add_dynasty_prestige = 10000 - add_dynasty_modifier = { modifier = $MODIFIER$ } - } - if = { - limit = { NOT = { exists = dynasty } } - add_character_modifier = $CHARACTER_MODIFIER$ - } - add_piety = monumental_piety_gain - add_prestige = monumental_prestige_gain - set_nickname_effect = { NICKNAME = nick_the_reconciler } -} - -# Character scope, saved so the decision tooltip, 0062 option, and seating all name the same see -# Falls back to Rome so an unheld Constantinople does not leave the faith headless -pam_save_schism_head_of_faith_effect = { - if = { - limit = { - rite = rite:byzantine_rite - exists = title:d_et_constantinople.holder - } - title:d_et_constantinople = { save_scope_as = new_head_of_faith_title } - } - else_if = { - limit = { - rite = rite:byzantine_rite - exists = title:k_orthodox.holder - } - title:k_orthodox = { save_scope_as = new_head_of_faith_title } - } - else_if = { - limit = { exists = title:k_papal_state.holder } - title:k_papal_state = { save_scope_as = new_head_of_faith_title } - } - scope:new_head_of_faith_title.holder ?= { save_scope_as = new_head_of_faith } -} - -# Needs pam_save_schism_head_of_faith_effect -pam_schism_seat_head_of_faith_effect = { - if = { - limit = { exists = scope:new_head_of_faith_title } - custom_tooltip = { - text = pam_schism_seat_head_of_faith_tt - faith:christian_faith = { - if = { - limit = { NOT = { has_doctrine = doctrine_spiritual_head } } - change_doctrine = doctrine_spiritual_head - } - set_religious_head_title = scope:new_head_of_faith_title - # Carolingian Christianity has doctrine_no_head; leave it behind once the faith has a head - hidden_effect = { - every_faith_rite = { - if = { - limit = { rite_has_doctrine = doctrine_no_head } - change_rite_doctrine = doctrine_spiritual_head - } - force_refresh_head_of_rite = yes - } - } - } - } - } -} - -# The seat kept vacant. Chalcedonianism is already headless and keeps doctrine_spiritual_head, so -# there is nothing to change - doctrine_no_head would bar Establish a Head of Faith for good. -pam_schism_leave_faith_headless_effect = { - custom_tooltip = pam_schism_leave_faith_headless_tt -} - -# Apply an ancestral Khachkar in the chosen county (for decision confirmation event). -pam_apply_ancestral_khachkar_effects = { - $LOCATION$ = { - save_scope_as = khachkar_location - set_variable = { - name = pam_khachkar_ancestor - value = $ANCESTOR$ - } - set_variable = { - name = pam_khachkar_commissioner - value = root - } - add_county_modifier = { - modifier = pam_khachkar_ancestral_county - desc = pam_khachkar_ancestral_county_custom_desc - } - } - add_prestige = medium_prestige_value - add_piety = medium_piety_value - add_legitimacy = 100 - remove_variable = pam_khachkar_ancestral_ancestor -} - -# Remember a same-faith expansion outside the see's home kingdom so later petitions are harder to accept -pam_mark_recent_same_faith_clerical_expansion_effect = { - if = { - limit = { - exists = $TITLE$ - pam_expand_target_is_same_faith_outside_home_kingdom_trigger = { - TITLE = $TITLE$ - ARCHBISHOP = $ARCHBISHOP$ - } - } - $ARCHBISHOP$ = { - hidden_effect = { - add_character_flag = { - flag = pam_recently_expanded_same_faith - years = pam_expand_same_faith_recent_years - } - } - } - } -} - -# Expand an Ecclesiastical Title as HoF - on_accept -pam_expand_ecclesiastical_title_interaction_effect = { - scope:recipient = { - save_scope_as = clerical_region_holder - # We use the picker's region and skip alternative_limit, so we do not land on a non-bordering see - if = { - limit = { - capital_province.county.clerical_region_title ?= { - has_clerical_region = yes - holder ?= scope:clerical_region_holder - } - } - capital_province.county.clerical_region_title = { - save_scope_as = clerical_region_title - } - } - } - scope:target = { - save_scope_as = target_duchy - } - # is_adjacent_to_clerical_region matches the counties expand_clerical_region would take - if = { - limit = { - exists = scope:clerical_region_title - scope:clerical_region_title = { is_adjacent_to_clerical_region = scope:target_duchy } - } - scope:actor = { - if = { - limit = { - any_character_situation = { - situation_type = the_christian_church - situation_top_has_catalyst = catalyst_the_christian_church_clerical_region_expanded - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_clerical_region_expanded - } - } - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_good - title = expand_ecclesiastical_title_toast - left_icon = scope:clerical_region_holder - right_icon = scope:clerical_region_title - custom_tooltip = { - text = expand_ecclesiastical_title_effect_tt - scope:clerical_region_title = { - expand_clerical_region = scope:target_duchy - } - } - } - } - faith = { - change_fervor = { - value = notable_fervor_gain - desc = fervor_gain_clerical_title_expanded - } - } - } - scope:clerical_region_holder = { - if = { - limit = { - NOT = { this = scope:actor } - } - add_opinion = { - target = scope:actor - modifier = grateful_opinion - opinion = 50 - } - } - send_interface_toast = { - type = event_toast_effect_good - title = expand_ecclesiastical_title_toast - left_icon = scope:actor - right_icon = scope:clerical_region_title - custom_tooltip = expand_ecclesiastical_title_effect_tt - } - pam_mark_recent_same_faith_clerical_expansion_effect = { - TITLE = scope:target_duchy - ARCHBISHOP = this - } - } - } -} - -# Split an Ecclesiastical Title as HoF - on_accept -pam_split_ecclesiastical_title_interaction_effect = { - scope:secondary_recipient = { - save_scope_as = new_ecclesiastical_holder - } - scope:secondary_actor = { - save_scope_as = secular_ruler - } - scope:recipient = { - save_scope_as = clerical_region_holder - } - scope:secular_ruler.capital_county.clerical_region_title ?= { - save_scope_as = clerical_region_title - } - # Interaction tooltip reads on_accept before the split - show_as_tooltip = { - pam_split_ecclesiastical_title_outcome_effect = yes - } - hidden_effect = { - scope:secular_ruler = { - capital_province = { save_scope_as = region_capital } - split_clerical_region = { - name = CLERICAL_REGION_PROVINCE_TITLE_NAME - save_scope_as = new_title - } - } - # A failed split leaves scope:new_title unset - if = { - limit = { exists = scope:new_title } - pam_split_ecclesiastical_title_outcome_effect = yes - } - } -} - -# Runs twice, once for the interaction window tooltip and once for real after a successful split -pam_split_ecclesiastical_title_outcome_effect = { - scope:secular_ruler = { - if = { - limit = { - scope:new_ecclesiastical_holder = { - NOT = { - is_courtier_of = scope:secular_ruler - } - is_ruler = no - } - } - add_courtier = scope:new_ecclesiastical_holder - } - if = { - limit = { - scope:new_ecclesiastical_holder = { - NOT = { is_councillor_of = scope:secular_ruler } - } - } - assign_councillor_type = { - type = councillor_court_chaplain - remove_existing_councillor = yes - target = scope:new_ecclesiastical_holder - } - } - } - hidden_effect = { - create_title_and_vassal_change = { - type = created - save_scope_as = change - add_claim_on_loss = no - } - scope:new_title ?= { - set_coa = scope:secular_ruler.primary_title - set_color_from_title = scope:secular_ruler.primary_title - set_capital_county = scope:secular_ruler.capital_county - set_landless_title = yes - set_no_automatic_claims = yes - - change_title_holder = { - holder = scope:new_ecclesiastical_holder - change = scope:change - } - resolve_title_and_vassal_change = scope:change - } - } - scope:actor = { - if = { - limit = { - any_character_situation = { - situation_type = the_christian_church - situation_top_has_catalyst = catalyst_the_christian_church_clerical_region_split - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_clerical_region_split - } - } - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_good - title = split_ecclesiastical_title_toast - left_icon = scope:actor - right_icon = scope:new_ecclesiastical_holder - custom_tooltip = { - text = split_ecclesiastical_title_effect_tt - } - } - } - reverse_add_opinion = { - target = scope:new_ecclesiastical_holder - modifier = grateful_opinion - opinion = 50 - } - reverse_add_opinion = { - target = scope:secondary_actor - modifier = pleased_opinion - opinion = 25 - } - if = { - # On a self-split the HoF reorganises their own region, so there is no aggrieved superior to anger - limit = { scope:recipient != scope:actor } - reverse_add_opinion = { - target = scope:recipient - modifier = angry_opinion - opinion = -50 - } - } - add_hook = { - type = favor_hook - target = scope:new_ecclesiastical_holder - } - } - if = { - # Skip the "your region was split" notification when the HoF split their own region - limit = { scope:recipient != scope:actor } - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_bad - title = split_ecclesiastical_title_toast - left_icon = scope:actor - right_icon = scope:new_ecclesiastical_holder - custom_tooltip = split_ecclesiastical_title_effect_tt - } - } - } - scope:new_ecclesiastical_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_ecclesiastical } - } - change_government = ecclesiastical_government - } - } -} - -# Merge an Ecclesiastical Title as HoF - on_accept -pam_merge_new_ecclesiastical_title_interaction_effect = { - $ABSORBING_TITLE$ ?= { - save_scope_as = absorbing_title - holder ?= { save_scope_as = absorbing_holder } - } - $ABSORBED_TITLE$ = { - save_scope_as = absorbed_title - holder = { - save_scope_as = absorbed_holder - scope:absorbed_holder = { - send_interface_toast = { - type = event_toast_effect_bad - title = request_ecclesiastical_title_merger_absorbed_tt - left_icon = scope:absorbing_holder - right_icon = scope:absorbed_title - if = { - limit = { is_ai = yes } - # Absorbed region holder is angry at the initiator - add_opinion = { - target = $SENDER$ - modifier = angry_opinion - opinion = -75 - } - progress_towards_rival_effect = { - CHARACTER = $SENDER$ - OPINION = 0 - REASON = rival_ecclesiastical_title_merged - } - } - } - } - } - } - # Toast to the initiator - $SENDER$ = { - hidden_effect = { - send_interface_toast = { - type = event_toast_effect_good - title = merge_new_ecclesiastical_title_toast - left_icon = scope:absorbing_holder - right_icon = scope:absorbed_title - # Perform the region merge - custom_tooltip = { - text = merge_new_ecclesiastical_title_effect_tt - scope:absorbing_title = { - grow_clerical_region_from = scope:absorbed_title - set_variable = { - name = merge_clerical_region_cooldown - years = merge_clerical_region_cooldown_years_value - } - } - } - } - } - } - scope:absorbing_holder = { - send_interface_toast = { - type = event_toast_effect_good - title = merge_new_ecclesiastical_title_toast - left_icon = $SENDER$ - right_icon = scope:absorbed_title - custom_tooltip = merge_new_ecclesiastical_title_effect_tt - # The puppet variant sends on its own behalf, so there is no favour owed. - if = { - limit = { NOT = { this = $SENDER$ } } - if = { - limit = { is_ai = yes } - add_opinion = { - target = $SENDER$ - modifier = grateful_opinion - opinion = 50 - } - } - $SENDER$ = { - add_hook = { - type = favor_hook - target = scope:absorbing_holder - } - } - } - } - } -} - -pam_secure_pilgrim_routes_effect = { - faith = { - set_variable = { - name = pam_secured_pilgrim_routes - years = 25 - } - main_rite = { - remove_rite_tenet = scope:removed_tenet - add_rite_tenet = tenet_armed_pilgrimages - } - # The removed tenet loses, and the new core tenet gains popularity. - if = { - limit = { has_tenet_popularity_trigger = yes } - change_tenet_popularity = { - target = scope:removed_tenet - change = major_tenet_popularity_loss - } - change_tenet_popularity = { - target = tenet:tenet_armed_pilgrimages - change = major_tenet_popularity_gain - } - } - } - add_character_modifier = { - modifier = pam_protector_of_pilgrims_modifier - years = 25 - } - custom_tooltip = pam_secure_pilgrim_routes_pilgrim_xp_tt - custom_tooltip = pam_secure_pilgrim_routes_ai_pilgrimage_tt -} - -spiritual_hof_or_realm_priest_superior_recipient_redirect_effect = { - #redirect low tiers targeting HoF to archbishops - if = { - limit = { - highest_held_title_tier < tier_kingdom - faith.religious_head ?= scope:recipient - OR = { - exists = cp:councillor_court_chaplain.superior - AND = { - government_has_flag = government_is_theocracy - exists = superior - } - } - } - #Actor is a priest themselves - if = { - limit = { - AND = { - government_has_flag = government_is_theocracy - exists = superior - } - } - superior = { save_scope_as = recipient } - } - #Actor is secular - else = { - cp:councillor_court_chaplain.superior = { - save_scope_as = recipient - } - } - } - #redirect high tiers targeting archbishops to HoF - else_if = { - limit = { - highest_held_title_tier >= tier_kingdom - OR = { - superior ?= scope:recipient - cp:councillor_court_chaplain.superior ?= scope:recipient - } - faith = { - has_doctrine = doctrine_spiritual_head - religious_head ?= { - NOR = { - this = scope:recipient - this = scope:puppet_or_actor - } - } - } - } - faith.religious_head = { - save_scope_as = recipient - } - } -} -non_pope_lifting_excommunication_penalty_effect = { - if = { - limit = { - scope:puppet_or_actor = { - has_character_flag = pope_excom - } - NOT = { - scope:puppet_or_actor.faith.religious_head ?= scope:recipient - } - } - scope:recipient = { - add_piety = massive_piety_loss - add_piety_level = -2 - } - scope:puppet_or_actor.faith.religious_head = { - add_opinion = { - target = scope:recipient - opinion = -80 - modifier = betrayal_opinion - } - } - } -} - -seek_indulgences_refusal_effect = { - scope:recipient = { - add_prestige = { - value = minor_prestige_value - multiply = { - value = scope:actor.highest_held_title_tier - subtract = 1 - } - } - } - scope:actor = { - clerical_interaction_refusal_minor_effect = yes - if = { - limit = { - scope:recipient = { - is_ai = yes - } - } - if = { - limit = { - scope:actor = { - is_ai = yes - } - } - add_character_modifier = { - modifier = pam_refused_indulgences_modifier_small - years = 5 - desc = refused_indulgences_effect_tt - } - custom_tooltip = refused_indulgences_ai_personality_effect_tt - custom_tooltip = refused_indulgences_ai_war_effect_tt - custom_tooltip = refused_indulgences_ai_amenity_effect_tt - } - else = { - add_character_modifier = { - modifier = pam_refused_indulgences_modifier_small - years = 5 - } - } - change_spiritual_fulfillment = minor_spiritual_fulfillment_loss - } - else = { - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - if = { - limit = { - scope:actor = { - is_ai = yes - } - } - add_character_modifier = { - modifier = pam_refused_indulgences_modifier - years = 5 - desc = refused_indulgences_effect_tt - } - custom_tooltip = refused_indulgences_ai_personality_effect_tt - custom_tooltip = refused_indulgences_ai_war_effect_tt - custom_tooltip = refused_indulgences_ai_amenity_effect_tt - } - else = { - add_character_modifier = { - modifier = pam_refused_indulgences_modifier - years = 5 - } - } - } - } -} -divorce_house_feud_effect = { - house_feud_start_effect = { - # Feuding House Head - ACTOR = scope:divorcer.house.house_head - # Target House Head - TARGET = scope:secondary_recipient.house.house_head - # Feud Reason - REASON = divorce - # House Member attacker if relevant - ATTACKER = scope:divorcer - # House Member victim if relevant - VICTIM = scope:secondary_recipient - } - scope:secondary_recipient = { - add_prestige_level = -1 - } -} -divorce_holy_order_lease_effect = { - scope:barony_to_lease = { lease_out_to_holy_order = scope:lease_order } -} -divorce_get_hook_effect = { - if = { - limit = { - exists = scope:forcing_divorce - } - add_hook = { - type = favor_hook - target = scope:forcing_divorce - } - } - else = { - add_hook = { - type = favor_hook - target = scope:divorcer - } - } - -} -divorce_put_spouse_in_monastery_effect = { - scope:secondary_recipient = { - add_trait = devoted - scope:recipient = { - add_courtier = scope:secondary_recipient - } - } -} - -############################# -# Tenet popularity # -############################# - -# on_personal_tenet_gain fires this, with root as the character and scope:tenet the gained tenet -# Popularity gain is the lowest possible value, scaled by title tier -pam_tenet_popularity_on_personal_tenet_gain_effect = { - save_scope_as = tp_personal_tenet_changer - faith = { - if = { - limit = { has_tenet_popularity_trigger = yes } - change_tenet_popularity = { - target = scope:tenet - change = scope:tp_personal_tenet_changer.pam_personal_tenet_popularity_gain - } - } - } -} - -# on_personal_tenet_loss runs this with root as the character and scope:tenet as the dropped tenet -pam_tenet_popularity_on_personal_tenet_loss_effect = { - save_scope_as = tp_personal_tenet_changer - faith = { - if = { - limit = { has_tenet_popularity_trigger = yes } - change_tenet_popularity = { - target = scope:tenet - change = scope:tp_personal_tenet_changer.pam_personal_tenet_popularity_loss - } - } - } -} - -# The newly elected pope is root -pam_tenet_popularity_on_new_pope_effect = { - if = { - limit = { faith = { has_tenet_popularity_trigger = yes } } - faith = { save_scope_as = tp_new_pope_faith } - every_personal_tenet = { - save_scope_as = tp_new_pope_tenet - scope:tp_new_pope_faith = { - change_tenet_popularity = { - target = scope:tp_new_pope_tenet - change = medium_tenet_popularity_gain - } - } - } - rite = { - every_rite_tenet = { - status = core - save_scope_as = tp_new_pope_tenet - scope:tp_new_pope_faith = { - change_tenet_popularity = { - target = scope:tp_new_pope_tenet - change = medium_tenet_popularity_gain - } - } - } - } - } -} - -pam_set_pope_rite_mainline_effect = { - if = { - limit = { - exists = rite - rite != faith.main_rite - } - rite = { - set_main_rite = yes - } - } -} - -pam_pope_core_tenet_popularity_catalyst_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - exists = scope:tenet_to_add - religion = religion:christianity_religion - exists = situation:the_christian_church - } - if = { - limit = { - "faith.tenet_popularity(scope:tenet_to_add)" >= tenet_popularity_popular_threshold - situation:the_christian_church = { - situation_top_has_catalyst = catalyst_pope_declared_popular_core_tenet - } - } - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_pope_declared_popular_core_tenet - character = root - } - } - } - else_if = { - limit = { - "faith.tenet_popularity(scope:tenet_to_add)" < tenet_popularity_popular_threshold - situation:the_christian_church = { - situation_top_has_catalyst = catalyst_pope_declared_unpopular_core_tenet - } - } - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_pope_declared_unpopular_core_tenet - character = root - } - } - } - } -} - -# Head of Faith enacts a papal bull. Called from the after block of each bull event, where root is the issuer. -pam_the_christian_church_papal_bull_enacted_catalyst_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - religion = religion:christianity_religion - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_papal_bull_enacted - } - } - situation:the_christian_church = { - trigger_situation_catalyst = { - catalyst = catalyst_the_christian_church_papal_bull_enacted - character = root - } - } - } -} - -pam_react_to_new_pope_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - current_date_is_start_date_trigger = no - is_alive = yes - is_ruler = yes - } - save_scope_as = new_pope - faith = { - every_faith_character = { - limit = { - is_ruler = yes - this != scope:new_pope - } - hidden_effect = { remove_character_modifier = pam_denied_new_pope_modifier } - if = { - limit = { has_variable = pam_new_pope_events_as_feed_message } - send_interface_message = { - type = msg_pam_new_pope_elected - title = { - first_valid = { - triggered_desc = { - trigger = { scope:new_pope = { is_female = yes } } - desc = pam_clergy_events.0030.t.female - } - desc = pam_clergy_events.0030.t - } - } - desc = pam_clergy_events.0030.feed - left_icon = scope:new_pope - } - } - else = { - trigger_event = pam_clergy_events.0030 - } - } - } - } -} - -# Root = the kinsman who just took the office. $TITLE$ = the office title, $KIND$ = flag:head_of_faith / flag:antipope / flag:archbishop -pam_family_becomes_prelate_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - current_date_is_start_date_trigger = no - is_alive = yes - religion = religion:christianity_religion - # Every string in 0060 names the dynasty, so a lowborn prelate has no story to tell here - exists = dynasty - } - save_scope_as = new_prelate - $TITLE$ = { save_scope_as = prelate_title } - save_scope_value_as = { - name = prelate_office - value = $KIND$ - } - every_player = { - limit = { - this != scope:new_prelate - OR = { - is_close_or_extended_family_of = scope:new_prelate - house ?= scope:new_prelate.house - } - # Archdioceses change hands far more often than the great offices do - trigger_if = { - limit = { scope:prelate_office = flag:archbishop } - NOT = { has_character_flag = pam_family_prelate_cooldown } - } - } - if = { - limit = { scope:prelate_office = flag:archbishop } - add_character_flag = { - flag = pam_family_prelate_cooldown - years = 10 - } - } - trigger_event = { - id = pam_clergy_events.0060 - days = { 3 5 } - } - } - } -} - -# Root = the new archbishop. $TITLE$ = the clerical region title that changed hands. -pam_react_to_new_archbishop_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - current_date_is_start_date_trigger = no - is_alive = yes - } - save_scope_as = new_archbishop - $TITLE$ = { save_scope_as = archdiocese } - every_player = { - limit = { - this != scope:new_archbishop - is_ruler = yes - # The clerical_region_title is geographic, so a non-Christian holder would be told they answer to it - religion = religion:christianity_religion - capital_county.clerical_region_title ?= scope:archdiocese - } - send_interface_message = { - type = msg_pam_new_archbishop - left_icon = scope:new_archbishop - right_icon = scope:archdiocese - } - } - } -} - -pam_tenet_popularity_on_evangelized_tenet_effect = { - save_temporary_scope_as = pam_evangelizer - faith = { - if = { - limit = { has_tenet_popularity_trigger = yes } - change_tenet_popularity = { - target = $TENET$ - change = { - value = $CHANGE$ - # A Faithful Flock dynasty legacy: evangelizing dynasty members spread their tenets further - if = { - limit = { - scope:pam_evangelizer = { - dynasty ?= { has_dynasty_perk = pam_legacy_3 } - } - } - multiply = 1.5 - } - } - } - } - } -} - -# Root = preacher, $TENET$ = the tenet -# Once per preacher per activity, and we keep the record on the activity so it cannot leak -pam_spread_tenet_flat_popularity_once_effect = { - save_temporary_scope_as = pam_spread_flat_preacher - if = { - limit = { - involved_activity ?= { - NAND = { - has_variable_list = pam_spread_tenet_flat_paid - is_target_in_variable_list = { - name = pam_spread_tenet_flat_paid - target = scope:pam_spread_flat_preacher - } - } - } - } - involved_activity = { - add_to_variable_list = { - name = pam_spread_tenet_flat_paid - target = scope:pam_spread_flat_preacher - } - } - pam_tenet_popularity_on_evangelized_tenet_effect = { - TENET = $TENET$ - CHANGE = medium_tenet_popularity_gain - } - } -} - -# A converting character is root, scope:old_rite the previous rite -pam_tenet_popularity_on_rite_change_effect = { - if = { - limit = { is_landed = yes } - faith = { save_scope_as = tp_new_faith } - rite = { save_scope_as = tp_new_rite } - if = { - limit = { - exists = scope:old_rite - scope:old_rite != scope:tp_new_rite - } - scope:old_rite.faith = { save_scope_as = tp_old_faith } - if = { - limit = { scope:tp_old_faith = { has_tenet_popularity_trigger = yes } } - scope:old_rite = { - every_rite_tenet = { - status = core - save_scope_as = tp_tenet - scope:tp_old_faith = { - change_tenet_popularity = { - target = scope:tp_tenet - change = miniscule_tenet_popularity_loss - } - } - } - } - } - } - if = { - limit = { scope:tp_new_faith = { has_tenet_popularity_trigger = yes } } - scope:tp_new_rite = { - every_rite_tenet = { - status = core - save_scope_as = tp_tenet - scope:tp_new_faith = { - change_tenet_popularity = { - target = scope:tp_tenet - change = miniscule_tenet_popularity_gain - } - } - } - } - } - } -} - -# on_county_faith_change sets root as the county and scope:old_faith as the previous faith -# var:tp_popularity_rite remembers the last credited rite so the old faith can be uncredited -pam_tenet_popularity_on_county_faith_change_effect = { - faith = { save_scope_as = tp_new_faith } - rite = { save_scope_as = tp_new_rite } - if = { - limit = { exists = var:tp_popularity_rite } - var:tp_popularity_rite = { save_scope_as = tp_old_rite } - if = { - limit = { scope:old_faith = { has_tenet_popularity_trigger = yes } } - scope:tp_old_rite = { - every_rite_tenet = { - status = core - save_scope_as = tp_tenet - scope:old_faith = { - change_tenet_popularity = { - target = scope:tp_tenet - change = miniscule_tenet_popularity_loss - } - } - } - } - } - } - if = { - limit = { scope:tp_new_faith = { has_tenet_popularity_trigger = yes } } - scope:tp_new_rite = { - every_rite_tenet = { - status = core - save_scope_as = tp_tenet - scope:tp_new_faith = { - change_tenet_popularity = { - target = scope:tp_tenet - change = miniscule_tenet_popularity_gain - } - } - } - } - } - set_variable = { - name = tp_popularity_rite - value = rite - } -} - -# Study Rite: scope:discovered_tenet learned by root (a character). -pam_study_rite_tenet_popularity_effect = { - if = { - limit = { - exists = scope:discovered_tenet - faith = { has_tenet_popularity_trigger = yes } - } - faith = { - change_tenet_popularity = { - target = scope:discovered_tenet - change = minor_tenet_popularity_gain - } - } - } -} - -# on_rite_created. scope:new_rite must exist; root is founder. -pam_tenet_popularity_on_rite_created_effect = { - if = { - limit = { - scope:new_rite.faith ?= { has_tenet_popularity_trigger = yes } - } - root = { save_scope_as = rite_founder } - scope:new_rite = { - save_scope_as = created_rite - every_rite_tenet = { - status = core - save_scope_as = tenet - scope:created_rite.faith = { - change_tenet_popularity = { - target = scope:tenet - change = scope:created_rite.tenet_popularity_rite_created_gain - } - } - } - } - } -} - -# Bump one tenet across all Christian faiths with map presence. -pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - religion:christianity_religion = { - every_faith = { - limit = { - num_county_followers >= 1 - has_tenet_popularity_trigger = yes - } - change_tenet_popularity = { - target = tenet:$TENET$ - change = $VALUE$ - } - } - } -} - -# Situation phase on_start hooks (The Christian Church). -pam_tenet_popularity_situation_fragile_unity_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_peace_of_god - VALUE = miniscule_tenet_popularity_gain - } -} - -pam_tenet_popularity_situation_saeculum_obscurum_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_simony - VALUE = medium_tenet_popularity_gain - } -} - -pam_tenet_popularity_situation_conversion_phase_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_ora_et_labora - VALUE = medium_tenet_popularity_gain - } -} - -pam_tenet_popularity_situation_reform_phase_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_ora_et_labora - VALUE = medium_tenet_popularity_gain - } - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_simony - VALUE = medium_tenet_popularity_loss - } -} - -pam_tenet_popularity_situation_investiture_crisis_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_apostolic_succession - VALUE = medium_tenet_popularity_loss - } -} - -pam_tenet_popularity_situation_crusade_phase_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_miles_christi - VALUE = medium_tenet_popularity_gain - } - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_armed_pilgrimages - VALUE = medium_tenet_popularity_gain - } -} - -pam_tenet_popularity_situation_concord_start_effect = { - pam_tenet_popularity_christian_faiths_tenet_delta_effect = { - TENET = tenet_love_thy_neighbour - VALUE = medium_tenet_popularity_gain - } -} - -# Without this, clerical courts fill from generic pool templates and feel secular -pam_seed_monk_courtiers_effect = { - if = { - limit = { pam_court_wants_monk_courtiers_trigger = yes } - save_temporary_scope_as = monk_employer - while = { - count = 4 # Hard bound matching the highest quota; the limit below is what actually ends the loop - limit = { - any_courtier = { - count < pam_monk_courtier_target_value - OR = { - has_trait = devoted - has_trait = cleric - } - } - } - random_list = { - 50 = { - create_character = { # No location: create_character rejects location and employer together - employer = scope:monk_employer - template = pam_monk_courtier_template - } - } - 50 = { - create_character = { - employer = scope:monk_employer - template = pam_cleric_courtier_template - } - } - } - } - } -} - -# Game start only, because if the three-year pulse ran this the split would creep toward all courts -pam_seed_nun_courtier_effect = { - if = { - limit = { - pam_court_wants_monk_courtiers_trigger = yes - NOT = { - any_courtier = { - is_female = yes - has_trait = devoted - } - } - } - save_temporary_scope_as = monk_employer - random = { - chance = 50 - create_character = { - employer = scope:monk_employer - template = pam_nun_courtier_template - } - } - } -} - -# Here we run this on the courtier, and it expects scope:pam_clerical_patron -pam_clerical_court_ordain_effect = { - save_scope_as = pam_clerical_ordained - scope:pam_clerical_patron = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_clerical_court_ordain_toast - left_icon = scope:pam_clerical_ordained - scope:pam_clerical_ordained = { - add_trait = cleric - if = { - limit = { learning < scope:pam_clerical_patron.pam_clerical_court_learning_cap_value } - add_learning_skill = pam_clerical_court_learning_gain_value - } - add_opinion = { - target = scope:pam_clerical_patron - modifier = grateful_for_calling_opinion - } - } - add_piety = pam_clerical_court_piety_gain_value - } - } -} - -# scope:pam_clerical_patron is required here, and we run this on the courtier -pam_clerical_court_instruct_effect = { - save_scope_as = pam_clerical_instructed - scope:pam_clerical_patron = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_clerical_court_instruct_toast - left_icon = scope:pam_clerical_instructed - scope:pam_clerical_instructed = { - if = { - limit = { learning < scope:pam_clerical_patron.pam_clerical_court_learning_cap_value } - add_learning_skill = pam_clerical_court_learning_gain_value - } - if = { - limit = { NOT = { has_trait = lifestyle_scholar } } - add_trait = lifestyle_scholar - } - else_if = { - limit = { - has_trait_xp = { trait = lifestyle_scholar value < 100 } - } - add_trait_xp = { - trait = lifestyle_scholar - value = 20 - } - } - else_if = { - limit = { NOT = { has_trait = lifestyle_mystic } } - add_trait = lifestyle_mystic - } - else_if = { - limit = { - has_trait_xp = { trait = lifestyle_mystic value < 100 } - } - add_trait_xp = { - trait = lifestyle_mystic - value = 25 - } - } - } - } - } -} - -# Recruiting rulers run this, and it expects scope:pam_clerical_patron -pam_clerical_court_recruit_effect = { - if = { - limit = { exists = scope:pam_clerical_novice_current } - clear_saved_scope = pam_clerical_novice_current - } - if = { - limit = { - exists = scope:pam_clerical_novice - # Can cease to be in the pool between the event firing and the option executing - scope:pam_clerical_novice = { is_pool_character = yes } - } - scope:pam_clerical_novice = { save_scope_as = pam_clerical_novice_current } - } - else_if = { - limit = { - any_pool_character = { - province = scope:pam_clerical_patron.location - pam_clerical_court_novice_trigger = { RULER = scope:pam_clerical_patron } - faith = scope:pam_clerical_patron.faith - } - } - random_pool_character = { - province = scope:pam_clerical_patron.location - limit = { - pam_clerical_court_novice_trigger = { RULER = scope:pam_clerical_patron } - faith = scope:pam_clerical_patron.faith - } - save_scope_as = pam_clerical_novice_current - } - } - else_if = { - limit = { - any_pool_character = { - province = scope:pam_clerical_patron.location - pam_clerical_court_novice_trigger = { RULER = scope:pam_clerical_patron } - } - } - random_pool_character = { - province = scope:pam_clerical_patron.location - limit = { pam_clerical_court_novice_trigger = { RULER = scope:pam_clerical_patron } } - save_scope_as = pam_clerical_novice_current - } - } - if = { - limit = { exists = scope:pam_clerical_novice_current } - add_courtier = scope:pam_clerical_novice_current - send_interface_toast = { - type = event_toast_effect_good - title = pam_clerical_court_recruit_toast - left_icon = scope:pam_clerical_novice_current - if = { - limit = { - NOT = { scope:pam_clerical_novice_current.faith = scope:pam_clerical_patron.faith } - } - scope:pam_clerical_novice_current = { - set_character_faith = scope:pam_clerical_patron.faith - } - } - if = { - limit = { scope:pam_clerical_novice_current = { NOT = { rite = scope:pam_clerical_patron.rite } } } - scope:pam_clerical_novice_current = { - set_character_rite = scope:pam_clerical_patron.rite - } - } - if = { - limit = { scope:pam_clerical_novice_current = { NOT = { has_trait = cleric } } } - scope:pam_clerical_novice_current = { - add_trait = cleric - } - } - } - } -} - -# At game start we leave prohibited tenets at zero -pam_tenet_popularity_on_game_start_effect = { - if = { - limit = { has_pam_dlc_trigger = yes } - religion:christianity_religion = { - every_faith = { - limit = { num_county_followers >= 1 } - save_scope_as = tp_faith - main_rite = { save_scope_as = tp_rite } - # Any follower works as the host scope for the tenet iterator; rite_filter drives the list. - random_faith_county = { - limit = { exists = holder } - holder = { - pam_tenet_popularity_seed_status_effect = { RITE = scope:tp_rite FAITH = scope:tp_faith STATUS = core VALUE = massive_tenet_popularity_value } - pam_tenet_popularity_seed_status_effect = { RITE = scope:tp_rite FAITH = scope:tp_faith STATUS = permitted VALUE = major_tenet_popularity_value } - pam_tenet_popularity_seed_status_effect = { RITE = scope:tp_rite FAITH = scope:tp_faith STATUS = known VALUE = medium_tenet_popularity_value } - } - } - } - } - } -} - -# $RITE$ is the rite scope, run after a title adopts a new state rite -pam_tenet_popularity_boost_rite_effect = { - $RITE$ = { - if = { - limit = { - has_pam_dlc_trigger = yes - faith.religion = religion:christianity_religion - faith = { num_county_followers >= 1 } - } - save_scope_as = tp_boost_rite - faith = { - save_scope_as = tp_boost_faith - # Any follower works as the host scope for the tenet iterator; rite_filter drives the list. - random_faith_county = { - limit = { exists = holder } - holder = { - pam_tenet_popularity_seed_status_effect = { RITE = scope:tp_boost_rite FAITH = scope:tp_boost_faith STATUS = core VALUE = massive_tenet_popularity_value } - pam_tenet_popularity_seed_status_effect = { RITE = scope:tp_boost_rite FAITH = scope:tp_boost_faith STATUS = permitted VALUE = major_tenet_popularity_value } - pam_tenet_popularity_seed_status_effect = { RITE = scope:tp_boost_rite FAITH = scope:tp_boost_faith STATUS = known VALUE = medium_tenet_popularity_value } - } - } - } - } - } -} - -# Credits every $RITE$ tenet at $STATUS$ with $VALUE$ popularity for $FAITH$ -# Root is only a host for the tenet iterator, and its own knowledge is ignored -pam_tenet_popularity_seed_status_effect = { - if = { - limit = { $FAITH$ = { has_tenet_popularity_trigger = yes } } - every_character_tenet = { - rite_filter = $RITE$ - status = $STATUS$ - save_scope_as = tp_seed_tenet - $FAITH$ = { - change_tenet_popularity = { - target = scope:tp_seed_tenet - change = $VALUE$ - } - } - } - } -} - -pam_save_selected_interaction_tenet_effect = { - # Set the tenet based on selected send_options - switch = { - trigger = yes - scope:tenet_aniconism = { - tenet:tenet_aniconism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_alexandrian_catechism = { - tenet:tenet_alexandrian_catechism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_armed_pilgrimages = { - tenet:tenet_armed_pilgrimages = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_carnal_exaltation = { - tenet:tenet_carnal_exaltation = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_communal_identity = { - tenet:tenet_communal_identity = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_communion = { - tenet:tenet_communion = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_consolamentum = { - tenet:tenet_consolamentum = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_divine_marriage = { - tenet:tenet_divine_marriage = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_gnosticism = { - tenet:tenet_gnosticism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_mendicant_preachers = { - tenet:tenet_mendicant_preachers = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_pacifism = { - tenet:tenet_pacifism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_pentarchy = { - tenet:tenet_pentarchy = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_unrelenting_faith = { - tenet:tenet_unrelenting_faith = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_vows_of_poverty = { - tenet:tenet_vows_of_poverty = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_pastoral_isolation = { - tenet:tenet_pastoral_isolation = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_adaptive = { - tenet:tenet_adaptive = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_esotericism = { - tenet:tenet_esotericism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_legalism = { - tenet:tenet_legalism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_literalism = { - tenet:tenet_literalism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_reincarnation = { - tenet:tenet_reincarnation = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_religious_legal_pronouncements = { - tenet:tenet_religious_legal_pronouncements = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_struggle_submission = { - tenet:tenet_struggle_submission = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_false_conversion_sanction = { - tenet:tenet_false_conversion_sanction = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_tax_nonbelievers = { - tenet:tenet_tax_nonbelievers = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_asceticism = { - tenet:tenet_asceticism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_bhakti = { - tenet:tenet_bhakti = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_dharmic_pacifism = { - tenet:tenet_dharmic_pacifism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_inner_journey = { - tenet:tenet_inner_journey = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_ritual_hospitality = { - tenet:tenet_ritual_hospitality = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_adorcism = { - tenet:tenet_adorcism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_ancestor_worship = { - tenet:tenet_ancestor_worship = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_astrology = { - tenet:tenet_astrology = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_hedonistic = { - tenet:tenet_hedonistic = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_human_sacrifice = { - tenet:tenet_human_sacrifice = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_mystical_birthright = { - tenet:tenet_mystical_birthright = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_ritual_celebrations = { - tenet:tenet_ritual_celebrations = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sacred_childbirth = { - tenet:tenet_sacred_childbirth = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sanctity_of_nature = { - tenet:tenet_sanctity_of_nature = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sun_worship = { - tenet:tenet_sun_worship = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_warmonger = { - tenet:tenet_warmonger = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_gruesome_festivals = { - tenet:tenet_gruesome_festivals = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_cthonic_redoubts = { - tenet:tenet_cthonic_redoubts = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_household_gods = { - tenet:tenet_household_gods = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sinitic_syncretism = { - tenet:tenet_sinitic_syncretism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_eastern_syncretism = { - tenet:tenet_eastern_syncretism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_unreformed_syncretism = { - tenet:tenet_unreformed_syncretism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_christian_syncretism = { - tenet:tenet_christian_syncretism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_islamic_syncretism = { - tenet:tenet_islamic_syncretism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_jewish_syncretism = { - tenet:tenet_jewish_syncretism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_exaltation_of_pain = { - tenet:tenet_exaltation_of_pain = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_natural_primitivism = { - tenet:tenet_natural_primitivism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_pursuit_of_power = { - tenet:tenet_pursuit_of_power = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_ritual_cannibalism = { - tenet:tenet_ritual_cannibalism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sacred_shadows = { - tenet:tenet_sacred_shadows = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_polyamory = { - tenet:tenet_polyamory = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sacrificial_ceremonies = { - tenet:tenet_sacrificial_ceremonies = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_megaliths = { - tenet:tenet_megaliths = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_fp3_fedayeen = { - tenet:tenet_fp3_fedayeen = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_communal_possessions = { - tenet:tenet_communal_possessions = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_pure_land = { - tenet:tenet_pure_land = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_no_mind = { - tenet:tenet_no_mind = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_mountain_worship = { - tenet:tenet_mountain_worship = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_extinction_of_dharma = { - tenet:tenet_extinction_of_dharma = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_cranial_trophies = { - tenet:tenet_cranial_trophies = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_pursuit_of_knowledge = { - tenet:tenet_pursuit_of_knowledge = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_benevolent_governance = { - tenet:tenet_benevolent_governance = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_filial_piety = { - tenet:tenet_filial_piety = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_harmonious_society = { - tenet:tenet_harmonious_society = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_sacred_destruction = { - tenet:tenet_sacred_destruction = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_preservation = { - tenet:tenet_preservation = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_takamin = { - tenet:tenet_takamin = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_peace_of_god = { - tenet:tenet_peace_of_god = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_dulia = { - tenet:tenet_dulia = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_transubstantiation = { - tenet:tenet_transubstantiation = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_ora_et_labora = { - tenet:tenet_ora_et_labora = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_hyperdulia = { - tenet:tenet_hyperdulia = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_simony = { - tenet:tenet_simony = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_monophysitism = { - tenet:tenet_monophysitism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_acts_of_apostles = { - tenet:tenet_acts_of_apostles = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_purgatory = { - tenet:tenet_purgatory = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_be_fruitful_and_multiply = { - tenet:tenet_be_fruitful_and_multiply = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_apostolic_succession = { - tenet:tenet_apostolic_succession = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_confession = { - tenet:tenet_confession = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_original_sin = { - tenet:tenet_original_sin = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_celestial_hierarchy = { - tenet:tenet_celestial_hierarchy = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_miles_christi = { - tenet:tenet_miles_christi = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_philanthropia = { - tenet:tenet_philanthropia = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_scholasticism = { - tenet:tenet_scholasticism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_adoptionism = { - tenet:tenet_adoptionism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_love_thy_neighbour = { - tenet:tenet_love_thy_neighbour = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_divine_liturgy = { - tenet:tenet_divine_liturgy = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_miaphysitism = { - tenet:tenet_miaphysitism = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_hesychasm = { - tenet:tenet_hesychasm = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_anachoresis = { - tenet:tenet_anachoresis = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_mortification_of_the_flesh = { - tenet:tenet_mortification_of_the_flesh = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_holy_myron = { - tenet:tenet_holy_myron = { - save_scope_as = pam_selected_interaction_tenet - } - } - scope:tenet_khachkar = { - tenet:tenet_khachkar = { - save_scope_as = pam_selected_interaction_tenet - } - } - } -} - -# Root is character that will have their personal tenet replaced with TENET -pam_replace_personal_tenet_effect = { - save_temporary_scope_as = tenet_char - if = { - limit = { - free_personal_tenet_slots = 0 - } - random_personal_tenet = { - weight = { - base = 10 - modifier = { - add = pam_tenet_popularity_impact_value - } - } - scope:tenet_char = { - remove_personal_tenet = prev - } - } - } - set_personal_tenet = $TENET$ -} - -pam_notify_holy_war_instigator_effect_win = { - if = { - limit = { - scope:war ?= { - has_variable = holy_instigator - var:holy_instigator = { - is_alive = yes - save_temporary_scope_as = instigator_temp - } - NOT = { - any_war_participant = { - this = scope:instigator_temp - } - } - } - } - every_in_list = { - list = target_titles - save_scope_as = target - } - - scope:war = { - var:holy_instigator = { - save_scope_as = cleric - send_interface_message = { - type = event_generic_good - title = pam_instigated_holy_war_won.t - left_icon = scope:attacker - right_icon = scope:defender - - if = { - limit = { - is_ai = no - } - add_prestige = pam_holy_war_inciter_prestige_value - } - else = { - hidden_effect = { - add_prestige = pam_holy_war_inciter_prestige_value - } - } - - custom_tooltip = pam_instigated_holy_war_won_tt - if = { - limit = { - pam_can_expand_clerical_region_after_war_trigger = { HEATHEN = scope:defender } - } - if = { - limit = { - any_in_list = { - list = target_titles - tier = tier_county - } - } - every_in_list = { - list = target_titles - duchy = { - scope:cleric = { - add_to_variable_list = { - name = clergy_expands - target = prev - } - } - } - } - } - else_if = { - limit = { - any_in_list = { - list = target_titles - tier = tier_duchy - } - } - every_in_list = { - list = target_titles - scope:cleric = { - add_to_variable_list = { - name = clergy_expands - target = prev - } - } - } - } - else = { - every_in_list = { - list = target_titles - every_direct_de_jure_vassal_title = { - limit = { - any_de_jure_county = { - holder = { - target_is_same_character_or_above = scope:defender - } - } - } - scope:cleric = { - add_to_variable_list = { - name = clergy_expands - target = prev - } - } - } - } - } - } - } - } - } - } -} -pam_notify_holy_war_instigator_effect_draw = { - if = { - limit = { - scope:war ?= { - has_variable = holy_instigator - var:holy_instigator = { - is_alive = yes - save_temporary_scope_as = instigator_temp - } - NOT = { - any_war_participant = { - this = scope:instigator_temp - } - } - } - } - every_in_list = { - list = target_titles - save_scope_as = target - } - scope:war = { - var:holy_instigator = { - send_interface_message = { - type = event_generic_bad - title = pam_instigated_holy_war_draw.t - left_icon = scope:attacker - right_icon = scope:defender - custom_tooltip = pam_instigated_holy_war_draw_tt - } - } - } - } -} -pam_notify_holy_war_instigator_effect_loss = { - if = { - limit = { - scope:war ?= { - has_variable = holy_instigator - var:holy_instigator = { - is_alive = yes - save_temporary_scope_as = instigator_temp - } - NOT = { - any_war_participant = { - this = scope:instigator_temp - } - } - } - } - every_in_list = { - list = target_titles - save_scope_as = target - } - scope:war = { - if = { - limit = { - has_variable = holy_joiner - } - var:holy_joiner = { - send_interface_message = { - type = event_generic_bad - title = pam_instigated_holy_war_lost.t - left_icon = scope:attacker - right_icon = scope:defender - - add_prestige_level = -2 - } - } - } - else = { - var:holy_instigator = { - send_interface_message = { - type = event_generic_bad - title = pam_instigated_holy_war_lost.t - left_icon = scope:attacker - right_icon = scope:defender - - custom_tooltip = pam_instigated_holy_war_lost_tt - } - } - } - } - } -} -pam_incite_holy_war_effect = { - scope:puppet_or_actor = { - if = { - limit = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_incite_holy_war_interaction - } - NOR = { - has_trait = forgiving - has_trait = compassionate - } - } - change_spiritual_fulfillment = { - value = miniscule_spiritual_fulfillment_value - multiply = { - value = scope:target.tier - subtract = 1 - } - } - } - } - - scope:secondary_recipient = { - save_scope_as = sponsored_holy_war_attacker - add_piety = { - value = medium_piety_value - multiply = { - value = scope:target.tier - subtract = 1 - } - } - if = { - limit = { - scope:puppet_or_actor = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_incite_holy_war_interaction - } - } - NOR = { - has_trait = forgiving - has_trait = compassionate - } - } - change_spiritual_fulfillment = { - value = minor_spiritual_fulfillment_value - multiply = { - value = scope:target.tier - subtract = 1 - } - } - } - } - scope:recipient = { - save_scope_as = sponsored_holy_war_defender - if = { - limit = { - NOT = { - root ?= scope:secondary_recipient - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = incited_holy_war_opinion - opinion = -50 - } - } - } - if = { - limit = { - root ?= scope:secondary_recipient - } - custom_tooltip = interaction_holy_war_attacker_tt - show_as_tooltip = { - scope:recipient = { - add_opinion = { - modifier = declared_war - target = scope:secondary_recipient - } - } - } - } - else = { - scope:recipient = { - custom_tooltip = interaction_holy_war_attacked_tt - } - } - - scope:sponsored_holy_war_attacker = { - add_character_flag = { - flag = holy_war_incited - days = 10 - } - if = { - limit = { - scope:sponsored_holy_war_target.tier = tier_kingdom - } - hidden_effect = { - start_war = { - casus_belli = major_religious_war - target = scope:sponsored_holy_war_defender - target_title = scope:sponsored_holy_war_target - } - } - } - else_if = { - limit = { - scope:sponsored_holy_war_target.tier = tier_duchy - } - hidden_effect = { - start_war = { - casus_belli = religious_war - target = scope:sponsored_holy_war_defender - target_title = scope:sponsored_holy_war_target - } - } - } - else = { - hidden_effect = { - start_war = { - casus_belli = minor_religious_war - target = scope:sponsored_holy_war_defender - target_title = scope:sponsored_holy_war_target - } - } - } - random_character_war = { - limit = { - OR = { - using_cb = major_religious_war - using_cb = religious_war - using_cb = minor_religious_war - } - primary_defender = scope:recipient - } - save_scope_as = holy_war - set_variable = { - name = holy_instigator - value = scope:puppet_or_actor - } - } - } - scope:puppet_or_actor = { - custom_tooltip = inciter_gain_prestige_if_holy_war_won_tt - if = { - limit = { - scope:fund_war ?= yes - } - pay_treasury_or_gold = { - target = scope:secondary_recipient - value = scope:puppet_or_actor.major_gold_value - } - } - if = { - limit = { - scope:join_war ?= yes - } - custom_tooltip = holy_war_interaction_join_war_tt - custom_tooltip = holy_war_cleric_loss_penalty_tt - scope:holy_war ?= { - hidden_effect = { add_attacker = scope:puppet_or_actor } - set_variable = { - name = holy_joiner - value = scope:puppet_or_actor - } - } - } - if = { - limit = { - scope:use_hook ?= yes - has_usable_hook = scope:secondary_recipient - } - use_hook = scope:secondary_recipient - } - if = { - limit = { - scope:rally_crusaders ?= yes - } - scope:secondary_recipient = { - if = { - limit = { - highest_held_title_tier < scope:puppet_or_actor.highest_held_title_tier - current_military_strength < scope:puppet_or_actor.current_military_strength - } - if = { - limit = { - is_ai = yes - } - add_character_modifier = { - modifier = crusader_momentum_modifier_large - years = 10 - desc = crusader_momentum_ai_behavior_large_tt - } - custom_tooltip = crusader_momentum_ai_behavior_large_tt - } - else = { - add_character_modifier = { - modifier = crusader_momentum_modifier_large - years = 10 - } - } - } - else = { - if = { - limit = { - is_ai = yes - } - add_character_modifier = { - modifier = crusader_momentum_modifier - years = 10 - desc = crusader_momentum_ai_behavior_tt - } - custom_tooltip = crusader_momentum_ai_behavior_tt - } - else = { - add_character_modifier = { - modifier = crusader_momentum_modifier - years = 10 - } - } - } - } - if = { - limit = { - exists = scope:target - } - add_prestige = { - value = minor_prestige_loss - multiply = { - value = scope:target.tier - subtract = 1 - } - } - } - else = { - add_prestige = medium_prestige_loss - } - } - if = { - limit = { - scope:inspire_realm ?= yes - } - scope:secondary_recipient = { - add_character_modifier = { - modifier = holy_war_incited_throughout_realm_modifier - years = 15 - } - } - } - #Discount to expanding archbishopric into the area - if = { - limit = { - pam_can_expand_clerical_region_after_war_trigger = { HEATHEN = scope:recipient } - } - custom_tooltip = can_expand_clerical_region_into_target_tt - } - } - scope:recipient = { - trigger_event = { - id = pam_interactions_events.0072 - days = 3 - } - } - scope:puppet_or_actor = { - if = { - limit = { - exists = scope:target - scope:target.tier >= tier_kingdom - any_character_situation = { - situation_type = the_christian_church - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_major_holy_war_incited - } - } - trigger_situation_catalyst = catalyst_major_holy_war_incited - } - else_if = { - limit = { - exists = scope:target - scope:target.tier >= tier_duchy - any_character_situation = { - situation_type = the_christian_church - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_holy_war_incited - } - } - trigger_situation_catalyst = catalyst_holy_war_incited - } - else = { - limit = { - any_character_situation = { - situation_type = the_christian_church - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_minor_holy_war_incited - } - } - trigger_situation_catalyst = catalyst_minor_holy_war_incited - } - } -} -pam_incite_war_refusal_effect = { - if = { - limit = { - scope:target.tier >= tier_kingdom - } - add_piety_level = -1 - } - else = { - add_piety_experience = { - value = major_piety_loss - multiply = { - value = scope:target.tier - subtract = 1 - } - } - } - -} -pam_redirect_request_excommunication_ruler_effect = { - #Is the secondary recipient a theocrat? Only their superior can excommunicate them - if = { - limit = { - scope:secondary_recipient = { - government_has_flag = government_is_theocracy - exists = superior - NOR = { - superior = scope:secondary_recipient - superior = scope:actor - } - } - } - scope:secondary_recipient.superior = { - save_scope_as = recipient - } - } - #Redirect to bishop superior of court chaplain - else_if = { - limit = { - scope:secondary_recipient.cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - superior ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - } - scope:secondary_recipient.cp:councillor_court_chaplain.superior = { - save_scope_as = recipient - } - } - #Redirect to ecclesiastical/theocratic liege or above - else_if = { - limit = { - scope:secondary_recipient = { - any_liege_or_above = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - scope:secondary_recipient = { - ordered_liege_or_above = { - order_by = highest_held_title_tier - limit = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - save_scope_as = recipient - } - } - } - #Redirect to court chaplain of liege or above - else_if = { - limit = { - scope:secondary_recipient = { - any_liege_or_above = { - cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - } - } - scope:secondary_recipient = { - ordered_liege_or_above = { - order_by = { - value = highest_held_title_tier - multiply = -1 - } - limit = { - cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - cp:councillor_court_chaplain = { - save_scope_as = recipient - } - } - } - } - #Redirect to bishop - else_if = { - limit = { - scope:secondary_recipient.cp:councillor_court_chaplain ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - scope:secondary_recipient.cp:councillor_court_chaplain = { - save_scope_as = recipient - } - } - #Redirect to clerical region_holder - else_if = { - limit = { - scope:secondary_recipient.capital_county = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - } - scope:secondary_recipient.capital_county.clerical_region_title.holder = { - save_scope_as = recipient - } - } - #Redirect to neighboring clerical region_holder - else_if = { - limit = { - scope:secondary_recipient = { - any_character_to_title_neighboring_county = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - } - } - scope:secondary_recipient = { - random_character_to_title_neighboring_county = { - limit = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - clerical_region_title.holder = { - save_scope_as = recipient - } - } - } - } -} -pam_redirect_request_excommunication_courtier_effect = { - #liege - if = { - limit = { - scope:secondary_recipient = { - liege = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - scope:secondary_recipient.liege = { - save_scope_as = recipient - } - } - #Redirect to court chaplain of liege or above - else_if = { - limit = { - scope:secondary_recipient = { - any_liege_or_above = { - cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - } - } - scope:secondary_recipient = { - ordered_liege_or_above = { - order_by = { - value = highest_held_title_tier - multiply = -1 - } - limit = { - cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - cp:councillor_court_chaplain = { - save_scope_as = recipient - } - } - } - } - #Redirect to clerical region_holder - else_if = { - limit = { - scope:secondary_recipient.liege.capital_county = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - } - scope:secondary_recipient.liege.capital_county.clerical_region_title.holder = { - save_scope_as = recipient - } - } - #Redirect to ecclesiastical/theocratic liege or above - else_if = { - limit = { - scope:secondary_recipient = { - any_liege_or_above = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - scope:secondary_recipient = { - ordered_liege_or_above = { - order_by = { - value = highest_held_title_tier - multiply = -1 - } - limit = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - save_scope_as = recipient - } - } - } - #Redirect to bishop superior of court chaplain - else_if = { - limit = { - scope:secondary_recipient.liege.cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - superior ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - } - scope:secondary_recipient.liege.cp:councillor_court_chaplain.superior = { - save_scope_as = recipient - } - } - #Redirect to neighboring clerical region_holder - else_if = { - limit = { - scope:secondary_recipient.liege = { - any_character_to_title_neighboring_county = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - } - } - scope:secondary_recipient.liege = { - random_character_to_title_neighboring_county = { - limit = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - clerical_region_title.holder = { - save_scope_as = recipient - } - } - } - } -} -pam_redirect_request_excommunication_wanderer_effect = { - #Location holder - if = { - limit = { - scope:secondary_recipient.location.county.holder ?= { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - scope:secondary_recipient.location.county.holder ?= { - save_scope_as = recipient - } - } - #Location holder - if = { - limit = { - scope:secondary_recipient.location.county.holder.cp:councillor_court_chaplain ?= { - highest_held_title_tier >= tier_duchy - is_clergy = yes - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - scope:secondary_recipient.location.county.holder.cp:councillor_court_chaplain ?= { - save_scope_as = recipient - } - } - #Redirect to court chaplain of holder's liege or above - else_if = { - limit = { - scope:secondary_recipient.location.county.holder ?= { - any_liege_or_above = { - cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - } - } - scope:secondary_recipient.location.county.holder ?= { - ordered_liege_or_above = { - order_by = { - value = highest_held_title_tier - multiply = -1 - } - limit = { - cp:councillor_court_chaplain ?= { - highest_held_title_tier < tier_duchy - is_clergy = yes - NOT = { - this = scope:actor - } - } - } - cp:councillor_court_chaplain = { - save_scope_as = recipient - } - } - } - } - #Redirect to ecclesiastical/theocratic liege or above - else_if = { - limit = { - scope:secondary_recipient.location.county.holder ?= { - any_liege_or_above = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - scope:secondary_recipient.location.county.holder ?= { - ordered_liege_or_above = { - order_by = { - value = highest_held_title_tier - multiply = -1 - } - limit = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_theocracy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - save_scope_as = recipient - } - } - } - #Redirect to clerical region_holder - else_if = { - limit = { - scope:secondary_recipient.location.county ?= { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - } - scope:secondary_recipient.location.county.clerical_region_title.holder = { - save_scope_as = recipient - } - } - #Redirect to neighboring clerical region_holder - else_if = { - limit = { - scope:secondary_recipient.location.county ?= { - any_neighboring_county = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - } - } - scope:secondary_recipient.location.county = { - random_neighboring_county = { - limit = { - clerical_region_title ?= { - holder ?= { - highest_held_title_tier >= tier_duchy - faith ?= scope:secondary_recipient.faith - NOT = { - this = scope:actor - } - } - } - } - clerical_region_title.holder = { - save_scope_as = recipient - } - } - } - } -} -pam_christian_situation_hof_incite_holy_war_effect = { - if = { - limit = { - faith.religious_head ?= root - is_ai = yes - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_incite_holy_war_interaction - } - piety >= 100 - piety_level >= 2 - is_available_quick = { - adult = yes - alive = yes - imprisoned = no - incapable = no - } - actor_incite_holy_war_shown_trigger = yes - } - save_scope_as = puppet_or_actor - situation:the_christian_church = { - situation_participant_group:christian_regular_main_power_rulers = { - random_situation_group_participant = { - limit = { - faith = scope:puppet_or_actor.faith - highest_held_title_tier >= tier_county - is_at_war = no - save_temporary_scope_as = secondary_temp - #First need to find a neighbor who works... - any_neighboring_top_liege_realm_owner = { - save_temporary_scope_as = recipient_temp - NOT = { - faith = scope:secondary_temp.faith - } - scope:secondary_temp.faith = { - faith_hostility_level = { - target = scope:recipient_temp.faith - value >= religious_cb_enabled_hostility_level - } - } - NOR = { - is_at_war_with = scope:puppet_or_actor - is_at_war_with = scope:secondary_temp - } - current_military_strength < scope:secondary_temp.eighty_percent_of_current_military_strength - scope:secondary_temp = { - valid_holy_war_incited_attacker_trigger = { RECIPIENT = scope:recipient_temp } - } - incite_holy_war_ai_invalidation_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_temp } - trigger_if = { - limit = { - scope:puppet_or_actor.piety_level >= 3 - highest_held_title_tier >= tier_duchy - realm_size >= 8 - } - any_realm_de_jure_kingdom = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_temp } - } - } - trigger_else_if = { - limit = { - scope:puppet_or_actor.piety_level >= 2 - realm_size >= 2 - } - any_realm_de_jure_duchy = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_temp } - } - } - trigger_else = { - any_realm_county = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_temp } - } - } - } - } - save_scope_as = secondary_recipient - ordered_neighboring_top_liege_realm_owner = { - order_by = { - value = current_military_strength - multiply = -1 - } - limit = { - save_temporary_scope_as = recipient_temp - NOT = { - faith = scope:secondary_recipient.faith - } - scope:secondary_recipient.faith = { - faith_hostility_level = { - target = scope:recipient_temp.faith - value >= religious_cb_enabled_hostility_level - } - } - NOR = { - is_at_war_with = scope:puppet_or_actor - is_at_war_with = scope:secondary_recipient - } - current_military_strength < scope:secondary_recipient.eighty_percent_of_current_military_strength - scope:secondary_recipient = { - valid_holy_war_incited_attacker_trigger = { RECIPIENT = scope:recipient_temp } - } - incite_holy_war_ai_invalidation_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_recipient } - trigger_if = { - limit = { - scope:puppet_or_actor.piety_level >= 3 - highest_held_title_tier >= tier_duchy - realm_size >= 8 - } - any_realm_de_jure_kingdom = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_recipient } - } - } - trigger_else_if = { - limit = { - scope:puppet_or_actor.piety_level >= 2 - realm_size >= 2 - } - any_realm_de_jure_duchy = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_recipient } - } - } - trigger_else = { - any_realm_county = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient_temp SECONDARY = scope:secondary_recipient } - } - } - } - save_scope_as = recipient - #Save target - if = { - limit = { - scope:puppet_or_actor.piety_level >= 3 - highest_held_title_tier >= tier_duchy - realm_size >= 8 - } - ordered_realm_de_jure_kingdom = { - order_by = de_jure_counties_held_by_recipient_value - limit = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient SECONDARY = scope:secondary_recipient } - } - save_scope_as = target - } - } - else_if = { - limit = { - scope:puppet_or_actor.piety_level >= 2 - realm_size >= 2 - } - ordered_realm_de_jure_duchy = { - order_by = de_jure_counties_held_by_recipient_value - limit = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient SECONDARY = scope:secondary_recipient } - } - save_scope_as = target - } - } - else = { - random_realm_county = { - limit = { - incite_holy_war_title_can_be_picked_trigger = { RECIPIENT = scope:recipient SECONDARY = scope:secondary_recipient } - } - save_scope_as = target - } - } - } - } - } - } - save_scope_as = actor - if = { - limit = { - exists = scope:secondary_recipient - exists = scope:recipient - } - ecclesiastic_incite_holy_war_interaction_effect = yes - } - } -} -ecclesiastic_incite_holy_war_interaction_effect = { - scope:target = { - save_scope_as = sponsored_holy_war_target - } - show_as_tooltip = { - pam_incite_holy_war_effect = yes - scope:recipient = { custom_tooltip = holy_war_joining_interaction_warning_tt } - } - #Secondary recipient gets to call this off if player - if = { - limit = { - scope:secondary_recipient = { - is_ai = no - } - } - scope:secondary_recipient = { - trigger_event = pam_interactions_events.0070 - } - } - else = { - scope:actor = { - trigger_event = pam_interactions_events.0071 - } - } -} - -pam_notify_claim_war_instigator_effect_win = { - if = { - limit = { - scope:war ?= { - has_variable = claim_instigator - var:claim_instigator = { - is_alive = yes - save_temporary_scope_as = instigator_temp - } - OR = { - has_variable = claim_joiner - NOT = { - any_war_participant = { - this = scope:instigator_temp - } - } - } - } - } - every_in_list = { - list = target_titles - save_scope_as = target - } - scope:war = { - var:claim_instigator = { - send_interface_message = { - type = event_generic_good - title = pam_instigated_claim_war_won.t - left_icon = scope:attacker - right_icon = scope:defender - if = { - limit = { - is_ai = no - } - add_prestige = pam_holy_war_inciter_prestige_value - } - else = { - hidden_effect = { - add_prestige = pam_holy_war_inciter_prestige_value - } - } - custom_tooltip = pam_instigated_claim_war_won_tt - } - } - } - } -} -pam_notify_claim_war_instigator_effect_draw = { - if = { - limit = { - scope:war ?= { - has_variable = claim_instigator - var:claim_instigator = { - is_alive = yes - save_temporary_scope_as = instigator_temp - } - OR = { - has_variable = claim_joiner - NOT = { - any_war_participant = { - this = scope:instigator_temp - } - } - } - } - } - every_in_list = { - list = target_titles - save_scope_as = target - } - scope:war = { - var:claim_instigator = { - send_interface_message = { - type = event_generic_bad - title = pam_instigated_claim_war_draw.t - left_icon = scope:attacker - right_icon = scope:defender - custom_tooltip = pam_instigated_claim_war_draw_tt - } - } - } - } -} -pam_notify_claim_war_instigator_effect_loss = { - if = { - limit = { - scope:war ?= { - has_variable = claim_instigator - var:claim_instigator = { - is_alive = yes - save_temporary_scope_as = instigator_temp - } - OR = { - has_variable = claim_joiner - NOT = { - any_war_participant = { - this = scope:instigator_temp - } - } - } - } - } - every_in_list = { - list = target_titles - save_scope_as = target - } - scope:war = { - if = { - limit = { - has_variable = claim_joiner - } - var:claim_joiner = { - send_interface_message = { - type = event_generic_bad - title = pam_instigated_claim_war_lost.t - left_icon = scope:attacker - right_icon = scope:defender - add_prestige_level = -2 - } - } - } - else = { - var:claim_instigator = { - send_interface_message = { - type = event_generic_bad - title = pam_instigated_claim_war_lost.t - left_icon = scope:attacker - right_icon = scope:defender - custom_tooltip = pam_instigated_claim_war_lost_tt - } - } - } - } - } -} -pam_incite_claim_war_effect = { - scope:secondary_recipient = { - save_scope_as = sponsored_claim_war_attacker - add_piety = { - value = medium_piety_value - multiply = { - value = scope:target.tier - subtract = 1 - } - } - } - scope:recipient = { - save_scope_as = sponsored_claim_war_defender - if = { - limit = { - NOT = { - root ?= scope:secondary_recipient - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = incited_claim_war_opinion - opinion = -50 - } - } - } - if = { - limit = { - root ?= scope:secondary_recipient - } - custom_tooltip = interaction_claim_war_attacker_tt - show_as_tooltip = { - scope:recipient = { - add_opinion = { - modifier = declared_war - target = scope:secondary_recipient - } - } - } - } - else = { - scope:recipient = { - custom_tooltip = interaction_claim_war_attacked_tt - } - } - - scope:sponsored_claim_war_attacker = { - add_character_flag = { - flag = temp_no_claim_war_cost - days = 10 - } - hidden_effect = { - start_war = { - casus_belli = claim_cb - target = scope:sponsored_claim_war_defender - claimant = scope:sponsored_claim_war_attacker - target_title = scope:sponsored_claim_war_target - } - remove_character_flag = temp_no_claim_war_cost - } - random_character_war = { - limit = { - using_cb = claim_cb - primary_defender = scope:recipient - } - save_scope_as = claim_war - set_variable = { - name = claim_instigator - value = scope:puppet_or_actor - } - } - } - scope:puppet_or_actor = { - custom_tooltip = inciter_gain_prestige_if_claim_war_won_tt - if = { - limit = { - scope:fund_war ?= yes - } - pay_treasury_or_gold = { - target = scope:secondary_recipient - value = scope:puppet_or_actor.major_gold_value - } - } - if = { - limit = { - scope:join_war ?= yes - } - custom_tooltip = claim_war_interaction_join_war_tt - custom_tooltip = holy_war_cleric_loss_penalty_tt - scope:claim_war ?= { - hidden_effect = { add_attacker = scope:puppet_or_actor } - set_variable = { - name = claim_joiner - value = scope:puppet_or_actor - } - } - } - if = { - limit = { - scope:use_hook ?= yes - has_usable_hook = scope:secondary_recipient - } - use_hook = scope:secondary_recipient - } - } -} -ecclesiastic_incite_claim_war_interaction_effect = { - scope:target = { - save_scope_as = sponsored_claim_war_target - } - show_as_tooltip = { - pam_incite_claim_war_effect = yes - } - hidden_effect = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = ecclesiastic_incite_claim_war_interaction_toast - desc = incite_claim_war_past_tense_tt - left_icon = scope:secondary_recipient - right_icon = scope:recipient - pam_incite_claim_war_effect = yes - } - } - if = { - limit = { - scope:secondary_recipient = { - is_ai = no - this != scope:actor - } - } - scope:secondary_recipient = { - send_interface_toast = { - type = event_toast_effect_neutral - title = ecclesiastic_incite_claim_war_interaction_attacker_toast - desc = incite_claim_war_past_tense_tt - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - if = { - limit = { scope:join_war ?= yes } - custom_tooltip = incite_claim_war_joined_tt - } - else_if = { - limit = { scope:fund_war ?= yes } - custom_tooltip = incite_claim_war_funded_tt - } - } - } - } - if = { - limit = { - scope:recipient = { - is_ai = no - this != scope:actor - this != scope:secondary_recipient - } - } - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_bad - title = ecclesiastic_incite_claim_war_interaction_defender_toast - desc = incite_claim_war_past_tense_tt - left_icon = scope:secondary_recipient - right_icon = scope:puppet_or_actor - if = { - limit = { scope:join_war ?= yes } - custom_tooltip = incite_claim_war_joined_tt - } - } - } - } - } -} - -request_white_peace_interaction_effect = { - scope:puppet_or_actor = { - random_character_war = { - limit = { - pam_request_white_peace_war_with_enemy_trigger = { ENEMY = scope:secondary_recipient } - } - save_scope_as = white_peace_war - save_scope_as = war #release_prisoners_of_war_effect resolves the war through scope:war - } - } - scope:white_peace_war = { - casus_belli = { - primary_attacker = { - save_scope_as = attacker - } - primary_defender = { - save_scope_as = defender - } - } - release_prisoners_of_war_effect = yes - end_war = white_peace - } - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_good - title = request_white_peace_interaction_recipient_toast - left_icon = scope:puppet_or_actor - right_icon = scope:secondary_recipient - if = { - limit = { - OR = { - rite = { - OR = { - has_tenet_status = { tenet = tenet_peace_of_god status = core } - has_tenet_status = { tenet = tenet_pacifism status = core } - has_tenet_status = { tenet = tenet_dharmic_pacifism status = core } - } - } - any_personal_tenet = { - OR = { - this = tenet:tenet_peace_of_god - this = tenet:tenet_pacifism - this = tenet:tenet_dharmic_pacifism - } - } - } - } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - else_if = { - limit = { - NOT = { has_character_modifier = pam_white_peace_enforcer_modifier } - } - add_character_modifier = { - modifier = pam_white_peace_enforcer_modifier - years = 10 - } - } - if = { - limit = { has_any_nickname = no } - hidden_effect = { - random = { - chance = { - value = 1 - if = { - limit = { is_ai = no } - add = 9 - } - } - give_nickname = nick_the_peacemaker - } - } - } - } - } - scope:secondary_recipient = { - if = { - limit = { is_ai = yes } - add_opinion = { - target = scope:recipient - modifier = pam_enforced_white_peace_opinion - } - } - trigger_event = pam_interactions_events.0080 - } - if = { - limit = { - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_white_peace_enforced - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_white_peace_enforced - } - } - scope:puppet_or_actor = { - if = { - limit = { - scope:donate_faith = yes - } - pay_treasury_or_gold = { - target = scope:recipient - value = major_gold_value - } - } - if = { - limit = { - scope:offer_piety = yes - } - add_piety = major_piety_loss - scope:recipient = { - add_piety = major_piety_gain - } - } - if = { - limit = { - scope:offer_hook = yes - } - scope:recipient = { - add_hook = { - type = favor_hook - target = scope:puppet_or_actor - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - send_interface_toast = { - type = event_toast_effect_neutral - title = request_white_peace_interaction_toast_title - custom_tooltip = request_white_peace_interaction_toast - left_icon = scope:recipient - right_icon = scope:secondary_recipient - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:actor != scope:recipient - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = request_white_peace_interaction_toast_title - custom_tooltip = request_white_peace_interaction_toast_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - } - } - } -} - -request_victory_interaction_effect = { - scope:puppet_or_actor = { - random_character_war = { - limit = { - pam_request_victory_war_with_enemy_trigger = { ENEMY = scope:secondary_recipient } - } - save_scope_as = requested_victory_war - save_scope_as = war #release_prisoners_of_war_effect resolves the war through scope:war - } - } - if = { - #The war can end during the reply window, leaving nothing to rule on - limit = { exists = scope:requested_victory_war } - scope:requested_victory_war = { - casus_belli = { - primary_attacker = { - save_scope_as = attacker - } - primary_defender = { - save_scope_as = defender - } - } - release_prisoners_of_war_effect = yes - if = { - limit = { - casus_belli = { - primary_attacker = scope:puppet_or_actor - } - } - end_war = attacker - } - else = { - end_war = defender - } - } - scope:recipient = { - send_interface_toast = { - type = event_toast_effect_neutral - title = request_victory_interaction_recipient_toast - left_icon = scope:puppet_or_actor - right_icon = scope:secondary_recipient - } - } - #The Church makes it worth the loser's while, so that obeying a ruling is not simply a defeat - scope:secondary_recipient = { - if = { - limit = { - NOT = { has_character_modifier = pam_church_compensation_modifier } - } - add_character_modifier = { - modifier = pam_church_compensation_modifier - years = 10 - } - } - if = { - limit = { is_ai = yes } - add_opinion = { - target = scope:recipient - modifier = pam_enforced_victory_opinion - } - } - trigger_event = pam_interactions_events.0083 - } - if = { - limit = { - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_the_christian_church_victory_enforced - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_the_christian_church_victory_enforced - } - } - scope:puppet_or_actor = { - if = { - limit = { - scope:donate_faith = yes - } - pay_treasury_or_gold = { - target = scope:recipient - value = major_gold_value - } - } - if = { - limit = { - scope:offer_piety = yes - } - add_piety = major_piety_loss - scope:recipient = { - add_piety = major_piety_gain - } - } - if = { - limit = { - scope:offer_hook = yes - } - scope:recipient = { - add_hook = { - type = favor_hook - target = scope:puppet_or_actor - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - send_interface_toast = { - type = event_toast_effect_neutral - title = request_victory_interaction_toast_title - custom_tooltip = request_victory_interaction_toast - left_icon = scope:recipient - right_icon = scope:secondary_recipient - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:actor != scope:recipient - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_neutral - title = request_victory_interaction_toast_title - custom_tooltip = request_victory_interaction_toast_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - } - } - } - } -} - -pam_enforce_title_succession_effect = { - scope:target = { save_scope_as = succession_title } - scope:target.holder = { save_scope_as = succession_holder } - scope:succession_title = { - current_heir = { save_scope_as = enforced_heir } - } - if = { - limit = { - exists = scope:enforced_heir - NOT = { scope:enforced_heir = scope:succession_holder } - } - create_title_and_vassal_change = { - type = stepped_down - save_scope_as = succession_title_change - add_claim_on_loss = no - } - scope:succession_title = { - change_title_holder_include_vassals = { - holder = scope:enforced_heir - change = scope:succession_title_change - } - } - resolve_title_and_vassal_change = scope:succession_title_change - } - if = { - limit = { scope:succession_holder = { is_ai = yes } } - scope:succession_holder = { - add_opinion = { - target = scope:actor - modifier = meddling_church_opinion - } - } - } -} - -pam_increase_papabile_score_effect = { - if = { - limit = { scope:pam_papabile_gold_option = yes } - custom_tooltip = { - text = pam_increase_papabile_score_effect_20_tt - if = { - limit = { exists = var:pam_papabile_score } - change_variable = { - name = pam_papabile_score - add = $VALUE$ - } - } - else = { - set_variable = { - name = pam_papabile_score - value = $VALUE$ - } - } - } - if = { - limit = { this != scope:actor } - add_opinion = { - target = scope:actor - modifier = grateful_opinion - opinion = 30 - } - } - } - else = { - custom_tooltip = { - text = pam_increase_papabile_score_effect_10_tt - if = { - limit = { exists = var:pam_papabile_score } - change_variable = { - name = pam_papabile_score - add = $VALUE$ - } - } - else = { - set_variable = { - name = pam_papabile_score - value = $VALUE$ - } - } - } - if = { - limit = { this != scope:actor } - add_opinion = { - target = scope:actor - modifier = grateful_opinion - opinion = 15 - } - } - } - # Both branches above have already created the variable - if = { - limit = { - scope:actor ?= { - has_personal_tenet_flag = tenet_apostolic_succession_papabile_influence - } - } - custom_tooltip = { - text = pam_increase_papabile_score_apostolic_succession_tt - change_variable = { - name = pam_papabile_score - add = pam_apostolic_succession_papabile_bonus_value - } - } - } - if = { - limit = { exists = scope:actor } - custom_tooltip = { - text = pam_papabile_leaning_tt - pam_spread_papabile_leaning_effect = { VALUE = $VALUE$ } - } - } -} - -pam_spread_papabile_leaning_effect = { - save_scope_as = pam_papabile_candidate - faith = { - every_clerical_elector_title = { - limit = { - holder ?= { - this != scope:pam_papabile_candidate - OR = { - this = scope:actor - is_vassal_or_below_of = scope:actor - top_liege ?= scope:actor.top_liege - is_close_or_extended_family_of = scope:actor - scope:actor.puppet:theological_agent_puppet ?= this - scope:actor.puppet:external_theological_agent_puppet ?= this - opinion = { - target = scope:actor - value >= medium_positive_opinion - } - } - } - } - holder ?= { - pam_apply_papabile_leaning_effect = { VALUE = $VALUE$ } - } - } - } -} - -pam_apply_papabile_leaning_effect = { - set_variable = { - name = pam_papabile_leaning_target - value = scope:pam_papabile_candidate - years = 20 - } - set_variable = { - name = pam_papabile_leaning_value - value = $VALUE$ - years = 20 - } -} - -# We declare the cardinal for that seat, otherwise a holy candidate is listed as The Pious -pam_place_first_as_powerful_effect = { - custom_tooltip = { - text = pam_place_first_as_powerful_tt - if = { - limit = { exists = var:pam_papabile_score } - change_variable = { - name = pam_papabile_score - add = $VALUE$ - } - } - else = { - set_variable = { - name = pam_papabile_score - value = $VALUE$ - } - } - } - custom_tooltip = { - text = pam_campaign_as_powerful_tt - remove_variable = pam_campaign_as_populist - set_variable = { - name = pam_campaign_as_powerful - years = 20 - } - } - # Deliberately the flat nudge rather than the purchased score: buying the seat should not also buy the vote. - if = { - limit = { exists = scope:actor } - custom_tooltip = { - text = pam_papabile_leaning_tt - pam_spread_papabile_leaning_effect = { VALUE = 10 } - } - } -} - -pam_place_first_as_populist_effect = { - # Own variable, and the elector vote modifier also reads pam_propagate_word_of_my_piety the same way - custom_tooltip = { - text = pam_place_first_as_populist_tt - if = { - limit = { exists = var:pam_papabile_populist_score } - change_variable = { - name = pam_papabile_populist_score - add = $VALUE$ - } - } - else = { - set_variable = { - name = pam_papabile_populist_score - value = $VALUE$ - } - } - } - custom_tooltip = { - text = pam_campaign_as_populist_tt - remove_variable = pam_campaign_as_powerful - set_variable = { - name = pam_campaign_as_populist - years = 20 - } - } - # Deliberately the flat nudge rather than the purchased score, matching the Powerful path. - if = { - limit = { exists = scope:actor } - custom_tooltip = { - text = pam_papabile_leaning_tt - pam_spread_papabile_leaning_effect = { VALUE = 10 } - } - } -} - -# $TT$ localizes the papabile loss for the losing side (defender on victory, attacker on defeat) -pam_humiliation_war_church_standing_loss_effect = { - if = { - limit = { - OR = { - exists = clerical_elector_title - exists = var:pam_papabile_score - } - } - custom_tooltip = { - text = $TT$ - if = { - limit = { exists = var:pam_papabile_score } - change_variable = { - name = pam_papabile_score - subtract = 25 - } - } - else = { - set_variable = { - name = pam_papabile_score - value = -25 - } - } - } - } - # Only clerical rulers carry standing the disgrace can bite into; it feeds clerical appointment scoring - if = { - limit = { government_has_flag = government_uses_church_authority } - add_character_modifier = { - modifier = pam_clerical_disgrace_modifier - years = 20 - } - } -} - -pam_on_conversion_effect = { - if = { - limit = { is_ai = no } - add_character_flag = { - flag = faith_conversion_recently_converted - years = pam_ui_conversion_cooldown - } - } -} - -remove_personal_tenet_if_has = { - if = { - limit = { has_personal_tenet = $TENET$ } - remove_personal_tenet = $TENET$ - } -} - -add_known_tenet_if_not = { - if = { - limit = { NOT = { knows_tenet = $TENET$ } } - add_known_tenet = $TENET$ - } -} - -update_syncretism_personal_tenet_effect = { - if = { - limit = { - is_available_quick = { advanced_ruler = yes } - scope:old_faith.religion != faith.religion - } - scope:old_faith = { - if = { - limit = { has_doctrine = sinitic_hostility_doctrine } - prev = { add_known_tenet_if_not = { TENET = tenet_sinitic_syncretism } } - } - else_if = { - limit = { has_doctrine = eastern_hostility_doctrine } - prev = { add_known_tenet_if_not = { TENET = tenet_eastern_syncretism } } - } - else_if = { - limit = { has_doctrine = pagan_hostility_doctrine } - prev = { add_known_tenet_if_not = { TENET = tenet_unreformed_syncretism } } - } - else_if = { - limit = { religion_tag = christianity_religion } - prev = { add_known_tenet_if_not = { TENET = tenet_christian_syncretism } } - } - else_if = { - limit = { religion_tag = islam_religion } - prev = { add_known_tenet_if_not = { TENET = tenet_islamic_syncretism } } - } - else_if = { - limit = { religion_tag = judaism_religion } - prev = { add_known_tenet_if_not = { TENET = tenet_jewish_syncretism } } - } - } - faith = { - if = { - limit = { has_doctrine = sinitic_hostility_doctrine } - prev = { remove_personal_tenet_if_has = { TENET = tenet_sinitic_syncretism } } - } - else_if = { - limit = { has_doctrine = eastern_hostility_doctrine } - prev = { remove_personal_tenet_if_has = { TENET = tenet_eastern_syncretism } } - } - else_if = { - limit = { has_doctrine = pagan_hostility_doctrine } - prev = { remove_personal_tenet_if_has = { TENET = tenet_unreformed_syncretism } } - } - else_if = { - limit = { religion_tag = christianity_religion } - prev = { remove_personal_tenet_if_has = { TENET = tenet_christian_syncretism } } - } - else_if = { - limit = { religion_tag = islam_religion } - prev = { remove_personal_tenet_if_has = { TENET = tenet_islamic_syncretism } } - } - else_if = { - limit = { religion_tag = judaism_religion } - prev = { remove_personal_tenet_if_has = { TENET = tenet_jewish_syncretism } } - } - } - } -} - -# Keep branches in sync with pam_sway_to_rite_variant_can_send_trigger -pam_open_sway_to_rite_variant_effect = { - if = { - limit = { scope:recipient = { is_courtier_of = scope:actor } } - open_interaction_window = { - interaction = sway_courtier_to_my_rite_interaction - actor = scope:actor - recipient = scope:recipient - } - } - else_if = { - limit = { - scope:recipient = { - OR = { - target_is_liege_or_above = scope:actor - is_tributary_of = scope:actor - pam_rite_sway_house_lane_trigger = { - ACTOR = scope:actor - RECIPIENT = scope:recipient - } - } - } - } - open_interaction_window = { - interaction = sway_vassal_to_my_rite_interaction - actor = scope:actor - recipient = scope:recipient - } - } - else = { - open_interaction_window = { - interaction = sway_ruler_to_my_rite_interaction - actor = scope:actor - recipient = scope:recipient - } - } -} - -# Shared on_accept for the three Sway to Rite interactions -# Option flags exist only on outreach, so the ?= checks do nothing elsewhere -pam_sway_to_rite_on_accept_effect = { - if = { - limit = { scope:is_puppet_action ?= yes } - scope:puppet_or_actor = { - if = { - limit = { pam_sway_ruler_to_my_rite_cost_value > 0 } - add_piety = { - value = { - add = pam_sway_ruler_to_my_rite_cost_value - max = piety - multiply = -1 - } - } - } - } - } - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_good - title = sway_ruler_to_my_rite_interaction_toast - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - scope:recipient = { - set_character_rite = scope:puppet_or_actor.rite - if = { - limit = { is_ai = yes } - add_opinion = { - target = scope:puppet_or_actor - modifier = pious_opinion - opinion = 10 - } - } - if = { # Accepting the founding wave of a freshly created rite pulls the whole domain and court along, but only if they are actually tied to us - limit = { - is_ruler = yes - is_landed = yes - scope:puppet_or_actor.rite ?= { - has_variable = pam_rite_founding_window - } - pam_rite_sway_connected_recipient_trigger = { ACTOR = scope:puppet_or_actor } - } - pam_convert_domain_counties_to_rite_effect = { RITE = scope:puppet_or_actor.rite } - pam_convert_court_to_rite_effect = { RITE = scope:puppet_or_actor.rite } - } - else_if = { # We also convert their capital county - limit = { - is_ruler = yes - is_landed = yes - capital_county = { - this.faith = scope:puppet_or_actor.faith # set_county_rite would drag a foreign-faith capital across faiths - this.rite != scope:puppet_or_actor.rite - any_neighboring_county = { # only if a neighbor shares the same liege or IS the liege, aka I'm not surrounded by complete strangers - OR = { - this.holder.liege = prev.holder.liege - this.holder = prev.holder.liege - } - } - } - } - capital_county = { set_county_rite = scope:puppet_or_actor.rite } - } - if = { - limit = { scope:pam_sway_pledge_favor ?= yes } - add_hook = { - target = scope:puppet_or_actor - type = favor_hook - } - } - } - if = { - limit = { scope:pam_sway_endowment ?= yes } - scope:puppet_or_actor = { - pay_treasury_or_gold = { - target = scope:recipient - value = pam_sway_to_rite_endowment_cost_value - } - } - } - } - # Catalysts - if = { - limit = { - scope:puppet_or_actor.religion = religion:christianity_religion - situation:the_christian_church ?= { situation_top_has_catalyst = catalyst_the_christian_church_swayed_to_rite } - } - situation:the_christian_church = { trigger_situation_catalyst = catalyst_the_christian_church_swayed_to_rite } - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:actor != scope:recipient - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = sway_ruler_to_my_rite_interaction_toast_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - } - } - } - scope:puppet_or_actor = { - pam_tax_nonbelievers_conversion_fulfillment_effect = yes - } -} - -# Shared on_decline for the three Sway to Rite interactions. -pam_sway_to_rite_on_decline_effect = { - scope:puppet_or_actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = sway_ruler_to_my_rite_interaction_decline_toast - right_icon = scope:recipient - scope:recipient = { - if = { - limit = { is_ai = yes } - add_opinion = { - target = scope:puppet_or_actor - modifier = annoyed_opinion - opinion = -10 - } - } - } - } - } - if = { - limit = { - scope:is_puppet_action ?= yes - scope:actor != scope:recipient - } - scope:actor = { - send_interface_toast = { - type = event_toast_effect_bad - title = sway_ruler_to_my_rite_interaction_decline_toast_puppeteer - left_icon = scope:puppet_or_actor - right_icon = scope:recipient - } - } - } -} - -# PAM - Converts every county in a ruler's domain that shares their faith to $RITE$ -# The capital is skipped while a different-rite clerical region holder is seated in it, unless that holder is our puppet -pam_convert_domain_counties_to_rite_effect = { - save_temporary_scope_as = domain_rite_converter - every_held_title = { - limit = { - tier = tier_county - faith = scope:domain_rite_converter.faith - rite != $RITE$ - trigger_if = { - limit = { scope:domain_rite_converter.capital_county ?= this } - NOT = { - clerical_region_title ?= { - holder ?= { - capital_county = scope:domain_rite_converter.capital_county - faith = scope:domain_rite_converter.faith - rite != $RITE$ - NOR = { - scope:domain_rite_converter.puppet:theological_agent_puppet ?= this - scope:domain_rite_converter.puppet:external_theological_agent_puppet ?= this - } - } - } - } - } - } - set_county_rite = $RITE$ - } -} - -# PAM - Converts a ruler's court (present, away, and guests) that shares their faith to $RITE$, mirroring rite growth's court conversion -pam_convert_court_to_rite_effect = { - every_courtier_or_guest = { - limit = { - is_physically_able_ai = yes - faith = $RITE$.faith - rite != $RITE$ - NOT = { has_character_flag = ai_will_not_convert } - } - set_character_rite = $RITE$ - } - every_courtier_away = { - limit = { - is_physically_able_ai = yes - faith = $RITE$.faith - rite != $RITE$ - NOT = { has_character_flag = ai_will_not_convert } - } - set_character_rite = $RITE$ - } -} - -# PAM - Faith counterpart of pam_convert_court_to_rite_effect: converts a ruler's court still on $OLD_FAITH$ to $FAITH$ -pam_convert_court_to_faith_effect = { - every_courtier_or_guest = { - limit = { - is_physically_able_ai = yes - faith = $OLD_FAITH$ - NOT = { has_character_flag = ai_will_not_convert } - } - set_character_faith = $FAITH$ - } - every_courtier_away = { - limit = { - is_physically_able_ai = yes - faith = $OLD_FAITH$ - NOT = { has_character_flag = ai_will_not_convert } - } - set_character_faith = $FAITH$ - } -} - -# PAM Great Schism: shows $TT$, and $VALUE$ goes up when positive (zero still shows the tooltip) -# Progress only goes up, and we do nothing once the schism has happened or been prevented -pam_change_great_schism_progress_effect = { - custom_tooltip = $TT$ - hidden_effect = { - if = { - limit = { pam_great_schism_progress_can_change_trigger = yes } - if = { - limit = { $VALUE$ > 0 } - situation:the_christian_church = { - if = { - limit = { NOT = { has_variable = pam_progress_towards_great_schism } } - set_variable = { name = pam_progress_towards_great_schism value = 0 } - } - change_variable = { - name = pam_progress_towards_great_schism - add = $VALUE$ - } - } - every_player = { - limit = { - faith.religion = religion:christianity_religion - exists = top_participant_group:the_christian_church - } - send_interface_message = { - type = msg_pam_great_schism_progress - desc = $TT$ - } - } - } - if = { - limit = { - situation:the_christian_church = { - NOT = { has_variable = pam_great_schism_status } - pam_great_schism_progress_value >= pam_great_schism_progress_threshold_value - } - } - situation:the_christian_church = { - pam_update_schism_rite_variables_effect = yes - var:schism_mainline_rite ?= { save_scope_as = schism_mainline_rite } - var:schism_competitor_rite ?= { save_scope_as = schism_competitor_rite } - set_variable = { - name = pam_great_schism_status - value = flag:threshold_reached - } - } - scope:schism_mainline_rite.head_of_rite ?= { save_scope_as = schism_mainline_head } - scope:schism_competitor_rite.head_of_rite ?= { save_scope_as = schism_competitor_head } - every_player = { - limit = { - faith.religion = religion:christianity_religion - any_character_situation = { this = situation:the_christian_church } - } - trigger_event = pam_the_christian_church.0064 - } - } - } - } -} - -# Situation scope, and a third rite as mainline keeps the existing Rome and Constantinople order -pam_update_schism_rite_variables_effect = { - if = { - limit = { - #stop updating it if the schism is going to happen - situation:the_christian_church ?= { - NOT = { has_variable = pam_great_schism_status } - } - } - if = { - limit = { faith:christian_faith.main_rite ?= rite:roman_rite } - set_variable = { name = schism_mainline_rite value = rite:roman_rite } - set_variable = { name = schism_competitor_rite value = rite:byzantine_rite } - } - else_if = { - limit = { faith:christian_faith.main_rite ?= rite:byzantine_rite } - set_variable = { name = schism_mainline_rite value = rite:byzantine_rite } - set_variable = { name = schism_competitor_rite value = rite:roman_rite } - } - else_if = { - limit = { NOT = { has_variable = schism_mainline_rite } } - set_variable = { name = schism_mainline_rite value = rite:roman_rite } - set_variable = { name = schism_competitor_rite value = rite:byzantine_rite } - } - } -} - -# Converters are root, with scope:old_rite the rite they left, when on_rite_change fires -# Flag spaces repeats and stops the event's own conversion from chaining -pam_schism_rite_conversion_dissent_effect = { - if = { - limit = { - is_landed = yes - exists = scope:old_rite - scope:old_rite != rite - OR = { - highest_held_title_tier >= tier_kingdom - pam_is_investiture_clergy_trigger = yes - } - pam_schism_rite_in_pair_trigger = { RITE = scope:old_rite } - pam_schism_rite_in_pair_trigger = { RITE = root.rite } - pam_great_schism_progress_can_change_trigger = yes - NOT = { has_character_flag = pam_schism_rite_conversion_dissent_recently } - } - random = { - chance = pam_schism_rite_conversion_dissent_chance_value - scope:old_rite = { save_scope_as = pam_dissent_rite } - add_character_flag = { - flag = pam_schism_rite_conversion_dissent_recently - years = 10 - } - trigger_event = { - id = pam_the_christian_church.0063 - days = { 3 10 } - } - } - } -} - -# $RITE$ is the rite they stayed with, evaluated on the character -# Shares pam_schism_rite_dissenter_valid_trigger with pam_the_christian_church.0063 -pam_save_schism_rite_dissenter_effect = { - every_courtier = { - limit = { pam_schism_rite_dissenter_valid_trigger = { RITE = $RITE$ } } - add_to_list = pam_schism_dissenter_candidates - } - every_vassal_or_below = { - limit = { pam_schism_rite_dissenter_valid_trigger = { RITE = $RITE$ } } - add_to_list = pam_schism_dissenter_candidates - } - every_pool_character = { - province = root.location - limit = { pam_schism_rite_dissenter_valid_trigger = { RITE = $RITE$ } } - add_to_list = pam_schism_dissenter_candidates - } - random_in_list = { - list = pam_schism_dissenter_candidates - weight = { - base = 1 - modifier = { - add = 10 - pam_is_investiture_clergy_trigger = yes - } - modifier = { - add = 5 - highest_held_title_tier >= tier_county - } - modifier = { - add = 5 - is_close_family_of = root - } - } - save_scope_as = schism_dissenter - } - if = { - limit = { - NOT = { exists = scope:schism_dissenter } - } - create_character = { - template = priest_character_template - employer = root - faith = root.faith - rite = $RITE$ - culture = root.culture - save_scope_as = schism_dissenter - after_creation = { - add_character_flag = created - } - } - } -} - -# A county is root when on_county_rite_change runs this, with scope:old_rite the rite it used to have -# A faith swap books nothing, because the schism is a quarrel within Christianity -pam_schism_county_conversion_progress_effect = { - if = { - limit = { - exists = scope:old_rite - rite != scope:old_rite - pam_schism_rite_in_pair_trigger = { RITE = scope:old_rite } - any_county_holy_site = { - any_holy_site_faith = { this = faith:christian_faith } - } - } - if = { - limit = { pam_schism_county_rite_in_pair_trigger = { COUNTY = root } } - pam_change_great_schism_progress_effect = { - VALUE = pam_great_schism_progress_county_conversion_value - TT = pam_great_schism_progress_county_conversion_tt - } - } - else = { # Attribute to the pair rite losing the county (gainer is outside the pair) - pam_change_great_schism_progress_effect = { - VALUE = pam_great_schism_progress_county_conversion_edge_value - TT = pam_great_schism_progress_county_conversion_edge_tt - } - } - } -} - -# Fire the Great Schism catalyst again on phase change to make sure Saeculum Obscurum happens -pam_refire_great_schism_catalyst_effect = { - if = { - limit = { - pam_great_schism_progress_can_change_trigger = yes - var:pam_great_schism_status ?= flag:threshold_reached - pam_great_schism_progress_value >= pam_great_schism_progress_threshold_value - situation_top_has_catalyst = catalyst_the_christian_church_great_schism - } - trigger_situation_catalyst = catalyst_the_christian_church_great_schism - } -} - -# PAM - Great Schism: fire the schism start event for Chalcedonian rulers once conditions hold -pam_fire_great_schism_start_event_effect = { - if = { - limit = { var:pam_great_schism_status ?= flag:threshold_reached } - var:schism_mainline_rite = { save_scope_as = schism_mainline_rite } - var:schism_competitor_rite = { save_scope_as = schism_competitor_rite } - scope:schism_mainline_rite.head_of_rite ?= { save_scope_as = schism_mainline_head } - scope:schism_competitor_rite.head_of_rite ?= { save_scope_as = schism_competitor_head } - set_variable = { - name = pam_great_schism_status - value = flag:ongoing - } - every_situation_participant = { - limit = { - is_ruler = yes - faith = faith:christian_faith - } - trigger_event = pam_the_christian_church.0060 - } - } -} - -pam_offer_great_schism_stance_effect = { - if = { - limit = { - pam_can_pick_great_schism_stance_trigger = yes - NOR = { - has_variable = pam_schism_stance - has_character_flag = pam_offered_great_schism_stance - } - } - pam_send_great_schism_stance_offer_effect = yes - } -} - -pam_offer_great_schism_stance_to_new_player_effect = { - if = { - limit = { pam_can_pick_great_schism_stance_trigger = yes } - pam_send_great_schism_stance_offer_effect = yes - } -} - -pam_send_great_schism_stance_offer_effect = { - add_character_flag = pam_offered_great_schism_stance - situation:the_christian_church = { - var:schism_mainline_rite = { save_scope_as = schism_mainline_rite } - var:schism_competitor_rite = { save_scope_as = schism_competitor_rite } - } - trigger_event = pam_the_christian_church.0060 -} - -# PAM - Sacred Childbirth: scaled piety (regular tenet) for a live birth. Also triggers spiritual fulfillment and stress loss rewards (personal tenet), shown in birth events -pam_childbirth_piety_reward_effect = { - if = { - limit = { rite = { rite_has_parameter = piety_from_childbirth_active } } - if = { - limit = { scope:child = { has_any_negative_bastard_trait_trigger = no } } - add_piety = { - value = major_piety_gain - if = { limit = { any_child = { is_twin_of = scope:child } } add = major_piety_gain } - if = { limit = { any_child = { count >= 3 is_twin_of = scope:child } } add = major_piety_gain } - } - } - else = { - add_piety = { - value = minor_piety_gain - if = { limit = { any_child = { is_twin_of = scope:child } } add = minor_piety_gain } - if = { limit = { any_child = { count >= 3 is_twin_of = scope:child } } add = minor_piety_gain } - } - } - } - pam_childbirth_spiritual_fulfillment_reward_effect = yes -} - -# PAM - Carnal Exaltation: piety for a successful seduce scheme -pam_seduction_piety_reward_effect = { - if = { - limit = { rite = { rite_has_parameter = piety_from_seduction_active } } - add_piety = medium_piety_gain - } -} - -# PAM - Sacred Childbirth: scaled spiritual fulfillment + stress loss (personal tenet) for a live birth; called on its own for children conceived in secret. shown in birth events -pam_childbirth_spiritual_fulfillment_reward_effect = { - if = { - limit = { - has_personal_tenet_flag = spiritual_fulfillment_from_childbirth_personal_active - has_pam_dlc_trigger = yes - } - if = { - limit = { scope:child = { has_any_negative_bastard_trait_trigger = no } } - change_spiritual_fulfillment = { - value = medium_spiritual_fulfillment_value - if = { limit = { any_child = { is_twin_of = scope:child } } add = medium_spiritual_fulfillment_value } - if = { limit = { any_child = { count >= 3 is_twin_of = scope:child } } add = medium_spiritual_fulfillment_value } - } - } - else = { - change_spiritual_fulfillment = { - value = minor_spiritual_fulfillment_value - if = { limit = { any_child = { is_twin_of = scope:child } } add = minor_spiritual_fulfillment_value } - if = { limit = { any_child = { count >= 3 is_twin_of = scope:child } } add = minor_spiritual_fulfillment_value } - } - } - } - if = { - limit = { - has_personal_tenet_flag = stress_loss_from_childbirth_personal_active - has_pam_dlc_trigger = yes - } - if = { - limit = { scope:child = { has_any_negative_bastard_trait_trigger = no } } - add_stress = { - value = medium_stress_loss - if = { limit = { any_child = { is_twin_of = scope:child } } add = medium_stress_loss } - if = { limit = { any_child = { count >= 3 is_twin_of = scope:child } } add = medium_stress_loss } - } - } - else = { - add_stress = { - value = minor_stress_loss - if = { limit = { any_child = { is_twin_of = scope:child } } add = minor_stress_loss } - if = { limit = { any_child = { count >= 3 is_twin_of = scope:child } } add = minor_stress_loss } - } - } - } -} - -# PAM - Sacred Childbirth: spiritual fulfillment loss for a child-death birth, shown in birth events -pam_childbirth_spiritual_fulfillment_penalty_effect = { - if = { - limit = { has_personal_tenet_flag = spiritual_fulfillment_from_childbirth_personal_active } - if = { - limit = { has_pam_dlc_trigger = yes } - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - } - } -} - -# PAM - Epidemics: spiritual fulfillment loss from pestilence as divine wrath. Exaltation of Pain (faith or personal tenet) exempts the character. Needs argument AMOUNT (spiritual fulfillment script value) -pam_epidemic_spiritual_fulfillment_loss_effect = { - if = { - limit = { - is_playable_character = yes - NOR = { - rite = { rite_has_parameter = no_epidemic_fulfillment_loss_active } - has_personal_tenet_flag = no_epidemic_fulfillment_loss_personal_active - } - } - change_spiritual_fulfillment = $AMOUNT$ - } -} - -# PAM Epidemics: expects scope:epidemic, shown in epidemic arrival events -pam_epidemic_arrival_spiritual_fulfillment_loss_effect = { - if = { - limit = { scope:epidemic = { outbreak_intensity = apocalyptic } } - pam_epidemic_spiritual_fulfillment_loss_effect = { AMOUNT = massive_spiritual_fulfillment_loss } - } - else_if = { - limit = { scope:epidemic = { outbreak_intensity = major } } - pam_epidemic_spiritual_fulfillment_loss_effect = { AMOUNT = major_spiritual_fulfillment_loss } - } - else = { - pam_epidemic_spiritual_fulfillment_loss_effect = { AMOUNT = medium_spiritual_fulfillment_loss } - } -} - -# PAM - Epidemics: spiritual fulfillment loss when your court physician treats you for an epidemic disease (chronic diseases are exempt). Expects scope:disease_type, shown in disease treatment events -pam_epidemic_disease_treatment_spiritual_fulfillment_loss_effect = { - if = { - limit = { - OR = { - scope:disease_type = flag:bubonic_plague - scope:disease_type = flag:smallpox - scope:disease_type = flag:typhus - scope:disease_type = flag:measles - scope:disease_type = flag:dysentery - scope:disease_type = flag:consumption - scope:disease_type = flag:ergotism - } - } - pam_epidemic_spiritual_fulfillment_loss_effect = { AMOUNT = medium_spiritual_fulfillment_loss } - } -} - -consecrate_kingdom_effect = { - #If you don't have sway over the pope... they get sway over you - if = { - limit = { - NOT = { - this = scope:religious_authority - } - } - if = { - limit = { - NOR = { - has_hook = scope:religious_authority - scope:king_aspirant.puppet:theological_agent_puppet ?= scope:religious_authority - scope:king_aspirant.puppet:external_theological_agent_puppet ?= scope:religious_authority - } - } - scope:religious_authority = { - add_hook = { - type = strong_obligation_hook - target = scope:king_aspirant - } - } - } - else = { - scope:religious_authority = { - add_hook = { - type = obligation_hook - target = scope:king_aspirant - } - } - } - } - if = { - limit = { - scope:religious_authority = { - this = scope:king_aspirant - } - } - every_held_title = { - limit = { - tier = tier_county - } - empire = { - every_de_jure_county = { - limit = { - holder ?= { - faith = scope:king_aspirant.faith - NOT = { - government_has_flag = government_is_theocracy - } - } - } - holder = { - add_to_list = angry_seculars - every_liege_or_above = { - limit = { - faith = scope:king_aspirant.faith - NOT = { - government_has_flag = government_is_theocracy - } - } - add_to_list = angry_seculars - } - } - } - } - } - every_in_list = { - custom = custom.every_empire_secular_ruler - list = angry_seculars - - add_opinion = { - modifier = power_hungry_priest_opinion - target = scope:king_aspirant - opinion = -30 - } - } - } - create_custom_kingdom_effect = yes - if = { - limit = { - NOT = { - this = scope:religious_authority - } - top_participant_group:the_christian_church ?= { - OR = { - participant_group_type = christian_clerical_main_power_rulers - participant_group_type = christian_regular_main_power_rulers - } - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_consecrated_kingdom_for_ruler - } - NOT = { - scope:king_aspirant = { government_has_flag = government_is_theocracy } - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_consecrated_kingdom_for_ruler - } - } - else_if = { - limit = { - this = scope:religious_authority - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_prelate_empowered_self_with_kingdom - } - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_prelate_empowered_self_with_kingdom - } - } - else_if = { - limit = { - top_participant_group:the_christian_church ?= { - OR = { - participant_group_type = christian_clerical_main_power_rulers - participant_group_type = christian_regular_main_power_rulers - } - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_consecrated_kingdom_for_theocrat - } - government_has_flag = government_is_theocracy - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_consecrated_kingdom_for_theocrat - } - } - if = { - limit = { - is_ai = no - NOT = { exists = global_var:found_kingdom_decision } - } - set_global_variable = { - name = found_kingdom_decision - value = root - } - set_global_variable = { - name = found_kingdom_decision_kingdom - value = root.primary_title - } - } -} -consecrate_kingdom_player_cleric_effect = { - if = { - limit = { - is_ai = yes - } - if = { - limit = { - NOT = { - exists = scope:interaction - } - } - add_opinion = { - target = scope:religious_authority - modifier = support_opinion - opinion = 50 - } - } - else = { - add_opinion = { - target = scope:religious_authority - modifier = support_opinion - opinion = 25 - } - } - add_character_modifier = { - modifier = consecrated_king_modifier - desc = consecrated_king_ai_behavior_large_tt - years = 20 - } - custom_tooltip = consecrated_king_ai_behavior_large_tt - } - else = { - add_character_modifier = { - modifier = consecrated_king_modifier_small - years = 20 - } - } - scope:religious_authority = { save_scope_as = cleric } - ecclesiastical_title_bestowing_clerical_hesitation_effect = yes -} -grant_title_populate_concerned_de_jure_list_effect = { - if = { - limit = { - $TITLE_GAINER$ = { - any_held_title = { - tier = tier_duchy - kingdom.holder ?= { - religion = scope:puppet_or_actor.religion - NOT = { - this = scope:puppet_or_actor - } - } - } - } - } - $TITLE_GAINER$ = { - every_held_title = { - limit = { - tier = tier_duchy - kingdom.holder ?= { - religion = scope:puppet_or_actor.religion - NOT = { - this = scope:puppet_or_actor - } - } - } - kingdom.holder = { - add_to_list = grateful_refusal_chars - } - } - } - } -} -bestow_title_effect = { - if = { - limit = { - scope:use_hook ?= yes - scope:puppet_or_actor ?= { has_usable_hook = scope:recipient } - } - scope:puppet_or_actor = { use_hook = scope:recipient } - } - if = { - limit = { - scope:gain_weak_hook ?= yes - } - scope:puppet_or_actor = { - add_hook = { - type = obligation_hook - target = scope:recipient - } - } - } - else_if = { - limit = { - scope:gain_strong_hook ?= yes - } - scope:puppet_or_actor = { - add_hook = { - type = strong_obligation_hook - target = scope:recipient - } - } - } - else = { - if = { - limit = { - exists = scope:target - } - scope:puppet_or_actor = { - add_prestige = { - value = minor_prestige_gain - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - - } - else = { - scope:puppet_or_actor = { - add_prestige = minor_prestige_gain - } - } - } - - scope:recipient = { save_scope_as = bestowed_title_holder } - scope:puppet_or_actor = { save_scope_as = bestowing_cleric } - bestow_title_shared_effect = yes -} -# Creates the unheld title and hands it to its new holder. Runs in the new holder's scope; callers must save scope:bestowed_title_holder and scope:bestowing_cleric first, since the clergy and the ruler swap roles between the bestowal and the petition. -bestow_title_shared_effect = { - create_title_and_vassal_change = { - type = created - save_scope_as = ecclesiastical_bestow_title_change - add_claim_on_loss = no - } - scope:target = { - change_title_holder = { - holder = scope:bestowed_title_holder - change = scope:ecclesiastical_bestow_title_change - } - } - resolve_title_and_vassal_change = scope:ecclesiastical_bestow_title_change - - scope:target ?= { - if = { - limit = { tier = tier_empire } - scope:bestowed_title_holder = { - add_opinion = { - modifier = received_title_empire - target = scope:bestowing_cleric - opinion = 50 - } - } - } - else_if = { - limit = { tier = tier_kingdom } - scope:bestowed_title_holder = { - add_opinion = { - modifier = received_title_kingdom - target = scope:bestowing_cleric - opinion = 25 - } - } - } - else_if = { - limit = { tier = tier_duchy } - scope:bestowed_title_holder = { - add_opinion = { - modifier = received_title_duchy - target = scope:bestowing_cleric - opinion = 15 - } - } - } - } - if = { - limit = { - NOT = { government_has_flag = government_is_theocracy } - top_participant_group:the_christian_church ?= { - OR = { - participant_group_type = christian_clerical_main_power_rulers - participant_group_type = christian_regular_main_power_rulers - } - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_hof_bestowed_title - } - scope:target.tier >= tier_kingdom - } - if = { - limit = { - exists = scope:target - scope:target.tier >= tier_empire - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_hof_bestowed_title_major - } - } - else = { - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_hof_bestowed_title - } - } - } - else_if = { - limit = { - government_has_flag = government_is_theocracy - top_participant_group:the_christian_church ?= { - OR = { - participant_group_type = christian_clerical_main_power_rulers - participant_group_type = christian_regular_main_power_rulers - } - } - situation:the_christian_church ?= { - situation_top_has_catalyst = catalyst_hof_bestowed_title_clergy - } - } - if = { - limit = { - exists = scope:target - scope:target.tier >= tier_empire - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_hof_bestowed_title_clergy_major - } - } - else_if = { - limit = { - exists = scope:target - scope:target.tier >= tier_kingdom - } - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_hof_bestowed_title_clergy - } - } - else = { - situation:the_christian_church = { - trigger_situation_catalyst = catalyst_hof_bestowed_title_clergy_minor - } - } - } - scope:bestowing_cleric = { save_scope_as = cleric } - if = { - limit = { - scope:bestowing_cleric = { - is_ai = no - } - } - ecclesiastical_title_bestowing_clerical_hesitation_effect = yes - } - else = { - hidden_effect = { - ecclesiastical_title_bestowing_clerical_hesitation_effect = yes - } - } -} -# The petition counterpart to bestow_title_effect: the clergy proclaim the unheld title and crown the petitioner. Runs in the petitioner's scope. -request_unformed_title_effect = { - custom_tooltip = request_unformed_title_gain_tt - if = { - limit = { - scope:donate_faith ?= yes - } - pay_short_term_gold = { - target = scope:recipient - gold = major_gold_value - } - } - if = { - limit = { - scope:use_hook ?= yes - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - if = { - limit = { - scope:offer_hook ?= yes - } - scope:recipient = { - add_hook = { - type = favor_hook - target = scope:puppet_or_actor - } - } - } - pam_offer_pilgrimage_effect = { - ACTOR = scope:puppet_or_actor - CLERIC = scope:recipient - } - - scope:puppet_or_actor = { save_scope_as = bestowed_title_holder } - scope:recipient = { save_scope_as = bestowing_cleric } - bestow_title_shared_effect = yes - - #The clergy publicly stand behind the new crown, and their flock is expected to respect it - if = { - limit = { - is_ai = yes - } - add_character_modifier = { - modifier = consecrated_king_modifier - desc = consecrated_king_ai_behavior_large_tt - years = 20 - } - custom_tooltip = consecrated_king_ai_behavior_large_tt - } - else = { - add_character_modifier = { - modifier = consecrated_king_modifier_small - years = 20 - } - } - if = { - limit = { - scope:promise_holy_war ?= yes - } - faith = { save_scope_as = promised_holy_war_faith } - custom_tooltip = { - text = bonus_holy_war_tt - add_character_flag = { - flag = bonus_major_holy_war - years = 5 - } - } - custom_tooltip = request_unformed_title_holy_war_deadline_tt - #The clergy come looking for results; pam_interactions_events.0098 judges the vow - trigger_event = { - id = pam_interactions_events.0098 - years = 5 - } - } -} - -# Runs in the scope of the ruler being judged; the cleric weighing the act must be saved as scope:cleric by the caller. -ecclesiastical_title_bestowing_clerical_hesitation_effect = { - save_scope_as = only_consideration - if = { - limit = { - clerical_hesitation_claim_interaction_value >= 9 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = major_spiritual_fulfillment_loss - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - } - custom_tooltip = clerical_hesitation_high_bestowing_tt - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 6 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = medium_spiritual_fulfillment_loss - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - } - custom_tooltip = clerical_hesitation_high_bestowing_tt - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 3 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = minor_spiritual_fulfillment_loss - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - } - custom_tooltip = clerical_hesitation_high_bestowing_tt - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= 1 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = miniscule_spiritual_fulfillment_loss - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = minor_spiritual_fulfillment_loss - } - custom_tooltip = clerical_hesitation_high_bestowing_tt - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value < 1 - clerical_hesitation_claim_interaction_value >= -2 - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -3 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = miniscule_spiritual_fulfillment_value - divide = 2 - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value - } - custom_tooltip = clerical_hesitation_low_bestowing_tt - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -5 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = miniscule_spiritual_fulfillment_value - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - custom_tooltip = clerical_hesitation_low_bestowing_tt - } - } - else_if = { - limit = { - clerical_hesitation_claim_interaction_value >= -8 - } - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = minor_spiritual_fulfillment_value - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } - custom_tooltip = clerical_hesitation_low_bestowing_tt - } - } - else = { - scope:cleric = { - if = { - limit = { - exists = scope:target - } - change_spiritual_fulfillment = { - value = medium_spiritual_fulfillment_value - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - else = { - change_spiritual_fulfillment = major_spiritual_fulfillment_value - } - custom_tooltip = clerical_hesitation_low_bestowing_tt - } - } -} - -# Never pair with a firing stress_and_fulfillment_impact on the same option -# Punishing/executing a proven witch -pam_witch_justice_fulfillment_effect = { - if = { - limit = { rite = { rite_has_parameter = witchcraft_illegal } } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } - else_if = { - limit = { rite = { rite_has_parameter = witchcraft_accepted } } - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - } - # witchcraft_shunned: no SF either way -} - -# Knowingly sparing/releasing a proven witch. -pam_witch_leniency_fulfillment_effect = { - if = { - limit = { rite = { rite_has_parameter = witchcraft_illegal } } - change_spiritual_fulfillment = medium_spiritual_fulfillment_loss - } - else_if = { - limit = { rite = { rite_has_parameter = witchcraft_accepted } } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } -} - -# Recruiting/protecting/allying with a witch. -pam_witch_embrace_fulfillment_effect = { - if = { - limit = { rite = { rite_has_parameter = witchcraft_illegal } } - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - } - else_if = { - limit = { rite = { rite_has_doctrine = doctrine_witchcraft_virtuous } } - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } - else_if = { - limit = { rite = { rite_has_parameter = witchcraft_accepted } } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } -} - -add_clerical_region_with_non_christian_capital_effect = { - $REGION_TITLE$ ?= { - if = { - limit = { - holder.religion ?= religion:christianity_religion - NOT = { title_province.religion ?= religion:christianity_religion } - } - scope:core_region = { add_clerical_realm_to_sub_region = prev } - } - } -} - -ecclesiastical_de_jure_shifting_effect = { - custom_tooltip = gain_de_jure_target_title_tt - if = { - limit = { - scope:promise_domination ?= yes - } - if = { - limit = { - has_legitimacy = yes - } - custom_tooltip = domination_promise_tt - } - else = { - custom_tooltip = domination_promise_no_legitimacy_tt - } - trigger_event = { - id = pam_interactions_events.0093 - years = 5 - } - } - if = { - limit = { - scope:donate_faith ?= yes - } - pay_short_term_gold = { - target = $CLERIC$ - gold = major_gold_value - } - } - if = { - limit = { - scope:use_hook ?= yes - has_usable_hook = $CLERIC$ - } - use_hook = $CLERIC$ - } - pam_offer_pilgrimage_effect = { - ACTOR = $DE_JURE_MASTER$ - CLERIC = $CLERIC$ - } - if = { - limit = { - scope:promise_conversion ?= yes - } - remove_treasury_or_gold = { - value = { - value = $DE_JURE_MASTER$.miniscule_gold_value - if = { - limit = { - exists = scope:target - } - scope:target = { - every_de_jure_county = { - limit = { - OR = { - NOT = { - faith = $DE_JURE_MASTER$.faith - } - trigger_if = { - limit = { - $DE_JURE_MASTER$.rite = $CLERIC$.rite - } - AND = { - NOT = { - rite = $DE_JURE_MASTER$.rite - } - rite = { - "divergence(scope:de_jure_master.rite)" >= medium_rite_divergence_value - } - } - } - } - } - add = $DE_JURE_MASTER$.miniscule_gold_value - } - } - } - divide = 2 - } - } - add_piety_experience = { - value = { - value = $DE_JURE_MASTER$.miniscule_piety_gain - if = { - limit = { - exists = scope:target - } - scope:target = { - every_de_jure_county = { - limit = { - OR = { - NOT = { - faith = $DE_JURE_MASTER$.faith - } - trigger_if = { - limit = { - $DE_JURE_MASTER$.rite = $CLERIC$.rite - } - AND = { - NOT = { - rite = $DE_JURE_MASTER$.rite - } - rite = { - "divergence(scope:de_jure_master.rite)" >= medium_rite_divergence_value - } - } - } - } - } - add = $DE_JURE_MASTER$.miniscule_piety_gain - } - } - } - divide = 2 - } - } - scope:target = { - if = { - limit = { - $DE_JURE_MASTER$.rite = $CLERIC$.rite - scope:target ?= { - any_de_jure_county = { - faith = $DE_JURE_MASTER$.faith - NOR = { - rite = $DE_JURE_MASTER$.rite - holder = { - is_ai = no - NOR = { - this = $DE_JURE_MASTER$ - this = $CLERIC$ - } - } - } - rite = { - "divergence(scope:de_jure_master.rite)" >= medium_rite_divergence_value - # Freshly founded rites get a grace period before missionaries convert their counties back - NOT = { has_variable = pam_rite_grace_period } - } - } - } - } - every_de_jure_county = { - custom = custom.every_non_recipient_rite_county_in_target - limit = { - faith = $DE_JURE_MASTER$.faith - NOR = { - rite = $DE_JURE_MASTER$.rite - holder = { - is_ai = no - NOR = { - this = $DE_JURE_MASTER$ - this = $CLERIC$ - } - } - } - rite = { - "divergence(scope:de_jure_master.rite)" >= medium_rite_divergence_value - # Freshly founded rites get a grace period before missionaries convert their counties back - NOT = { has_variable = pam_rite_grace_period } - } - } - custom_tooltip = dispatch_missionaries_random_chance_of_counties_converting_rite_tt - hidden_effect = { - random = { - chance = 20 - set_county_rite = $DE_JURE_MASTER$.rite - } - } - } - } - if = { - limit = { - scope:target ?= { - any_de_jure_county = { - NOR = { - faith = $DE_JURE_MASTER$.faith - holder = { - is_ai = no - NOR = { - this = $DE_JURE_MASTER$ - this = $CLERIC$ - } - } - } - } - } - } - every_de_jure_county = { - custom = custom.every_non_actor_faith_county_in_target - limit = { - NOR = { - faith = $DE_JURE_MASTER$.faith - holder = { - is_ai = no - NOR = { - this = $DE_JURE_MASTER$ - this = $CLERIC$ - } - } - } - } - custom_tooltip = dispatch_missionaries_random_chance_of_counties_converting_faith_tt - hidden_effect = { - random = { - chance = 10 - set_county_faith = $DE_JURE_MASTER$.faith - } - } - } - } - } - } - if = { - limit = { - scope:offer_hook ?= yes - } - $CLERIC$ = { - add_hook = { - type = favor_hook - target = $DE_JURE_MASTER$ - } - } - } - - scope:target = { - hidden_effect = { set_de_jure_liege_title = $DE_JURE_MASTER$.primary_title } - if = { - limit = { - scope:recipient = $CLERIC$ - } - every_de_jure_county = { - custom = custom.every_non_actor_faith_county_controlled_in_target - limit = { - NOT = { faith = $DE_JURE_MASTER$.faith } - holder = { - target_is_same_character_or_above = $DE_JURE_MASTER$ - } - } - change_county_control = extreme_county_control_loss - } - } - else = { - every_de_jure_county = { - custom = custom.every_non_recipient_faith_county_controlled_in_target - limit = { - NOT = { faith = $DE_JURE_MASTER$.faith } - holder = { - target_is_same_character_or_above = $DE_JURE_MASTER$ - } - } - change_county_control = extreme_county_control_loss - } - } - if = { - limit = { - scope:recipient = $CLERIC$ - } - every_de_jure_county = { - custom = custom.every_non_recipient_rite_county_controlled_in_target - limit = { - faith = $DE_JURE_MASTER$.faith - NOT = { - rite = $CLERIC$.rite - } - holder = { - target_is_same_character_or_above = $DE_JURE_MASTER$ - } - } - change_county_control = medium_county_control_loss - } - } - else = { - every_de_jure_county = { - custom = custom.every_non_actor_rite_county_controlled_in_target - limit = { - faith = $DE_JURE_MASTER$.faith - NOT = { - rite = $CLERIC$.rite - } - holder = { - target_is_same_character_or_above = $DE_JURE_MASTER$ - } - } - change_county_control = medium_county_control_loss - } - } - } - scope:puppet_or_actor ?= { - if = { - limit = { - has_legitimacy = yes - exists = scope:target - } - add_legitimacy = { - value = medium_legitimacy_loss - multiply = { - value = scope:target.tier - subtract = 2 - } - } - } - } -} - -pam_cardinal_vacancy_on_death_effect = { - if = { - limit = { - has_pam_dlc_trigger = yes - OR = { - exists = clerical_elector_title - has_character_flag = cardinal_flag - } - OR = { - exists = faith.religious_head - exists = title:k_papal_state.holder - } - faith = { - has_doctrine_parameter = has_clerical_electors - any_clerical_elector_title = { count < 10 } - } - } - if = { - limit = { exists = faith.religious_head } - faith.religious_head = { save_scope_as = head_of_faith } - } - else = { - title:k_papal_state.holder = { save_scope_as = head_of_faith } - } - if = { - limit = { - scope:head_of_faith = { is_ai = yes } - } - faith = { - ordered_clerical_region_title = { - limit = { - holder ?= { - is_alive = yes - is_adult = yes - is_incapable = no - NOT = { has_trait = excommunicated } - NOT = { exists = clerical_elector_title } - this != scope:head_of_faith - pam_can_hold_cardinalate_trigger = yes - pam_pope_is_head_of_faith_or_rite_trigger = yes - } - } - order_by = holder.piety_level - max = 1 - check_range_bounds = no - holder = { - save_scope_as = cardinal_candidate - trigger_event = { - id = pam_clergy_events.0040 - days = 3 - } - } - } - } - } - else = { - faith = { - ordered_clerical_region_title = { - limit = { - holder ?= { - is_ai = yes - is_alive = yes - is_adult = yes - is_incapable = no - NOT = { has_trait = excommunicated } - NOT = { exists = clerical_elector_title } - this != scope:head_of_faith - pam_can_hold_cardinalate_trigger = yes - pam_pope_is_head_of_faith_or_rite_trigger = yes - } - } - order_by = holder.piety_level - max = 1 - check_range_bounds = no - holder = { - save_scope_as = cardinal_candidate - } - } - } - if = { - limit = { - exists = scope:cardinal_candidate - } - scope:head_of_faith = { - trigger_event = { - id = pam_clergy_events.0041 - days = 3 - } - } - } - } - } -} -demand_church_succession_side_effects = { - primary_title = { - every_title_heir = { - limit = { - NOR = { - this = scope:actor - this = scope:puppet_or_actor - } - prev = { - place_in_line_of_succession = { - target = prev - value <= 3 - } - } - } - add_opinion = { - target = scope:puppet_or_actor - modifier = meddling_church_opinion - } - } - } -} -# A Realm Priest Puppet who has grown into a titled cleric belongs in the Clerical Ruler Puppet slot, -# which also frees the Realm Priest slot for whoever takes over the council seat. -# ROOT = the puppet, $PUPPETEER$ = the ruler holding them. -# No-op if the target slot is taken, or if they still hold the court chaplain seat. -pam_make_clerical_ruler_puppet_effect = { - # Both scopes are saved up front because clear_puppet_status severs the puppeteer link - save_temporary_scope_as = pam_clerical_ruler_puppet - $PUPPETEER$ = { save_temporary_scope_as = pam_clerical_puppeteer } - if = { - limit = { - scope:pam_clerical_puppeteer = { - NOR = { - exists = puppet:external_theological_agent_puppet - cp:councillor_court_chaplain ?= scope:pam_clerical_ruler_puppet - } - } - } - # Silent: the slot they move into is what the player is told about, not the one they leave - hidden_effect = { clear_puppet_status = yes } - scope:pam_clerical_puppeteer = { - send_interface_toast = { - type = event_toast_effect_good - title = make_external_clerical_puppet_on_action_notification - left_icon = scope:pam_clerical_puppeteer - right_icon = scope:pam_clerical_ruler_puppet - set_puppet = { - target = scope:pam_clerical_ruler_puppet - type = external_theological_agent_puppet - } - } - } - } -} - -pam_generic_set_puppet_interaction_side_effects = { - if = { - limit = { scope:hook ?= yes } - use_hook = scope:recipient - } - if = { - limit = { - scope:skill_support ?= yes - } - scope:recipient = { - if = { - limit = { - scope:actor = { - highest_skill = diplomacy - } - } - add_character_modifier = { - modifier = skilled_puppeteer_modifier_diplomacy - desc = skilled_puppeteer_behavior_tt - } - } - else_if = { - limit = { - scope:actor = { - highest_skill = martial - } - } - add_character_modifier = { - modifier = skilled_puppeteer_modifier_martial - desc = skilled_puppeteer_behavior_tt - } - } - else_if = { - limit = { - scope:actor = { - highest_skill = stewardship - } - } - add_character_modifier = { - modifier = skilled_puppeteer_modifier_stewardship - desc = skilled_puppeteer_behavior_tt - } - } - else_if = { - limit = { - scope:actor = { - highest_skill = intrigue - } - } - add_character_modifier = { - modifier = skilled_puppeteer_modifier_intrigue - desc = skilled_puppeteer_behavior_tt - } - } - else_if = { - limit = { - scope:actor = { - highest_skill = learning - } - } - add_character_modifier = { - modifier = skilled_puppeteer_modifier_learning - desc = skilled_puppeteer_behavior_tt - } - } - else = { - add_character_modifier = { - modifier = skilled_puppeteer_modifier_general - desc = skilled_puppeteer_behavior_tt - } - } - custom_tooltip = skilled_puppeteer_behavior_tt - } - } - if = { - limit = { - scope:piety_support ?= yes - } - scope:recipient = { - if = { - limit = { is_playable_character = yes } # Only playable characters have spiritual fulfillment - change_spiritual_fulfillment = medium_spiritual_fulfillment_value - } - if = { - limit = { - is_clergy = yes - } - add_character_modifier = { - modifier = spiritual_puppeteer_modifier_cleric - desc = spiritual_puppeteer_behavior_tt - } - } - else = { - add_character_modifier = { - modifier = spiritual_puppeteer_modifier_secular - desc = spiritual_puppeteer_behavior_tt - } - } - custom_tooltip = spiritual_puppeteer_behavior_tt - } - } - if = { - limit = { - scope:dread_support ?= yes - } - scope:recipient = { - if = { - limit = { - OR = { - has_trait = compassionate - has_trait = forgiving - has_trait = generous - has_trait = just - } - } - add_stress = medium_stress_gain - } - add_character_modifier = { - modifier = dreadful_puppeteer_modifier - desc = dreadful_puppeteer_behavior_tt - } - custom_tooltip = dreadful_puppeteer_behavior_tt - } - } - if = { - limit = { - scope:friendly_support ?= yes - } - scope:recipient = { - if = { - limit = { - scope:actor = { - is_ai = no - } - OR = { - has_trait = trusting - has_trait = compassionate - has_trait = generous - has_trait = forgiving - has_trait = just - has_trait = humble - } - } - add_trait = loyal - } - else = { - random = { - chance = { - value = 25 - if = { - limit = { - OR = { - has_trait = trusting - has_trait = compassionate - has_trait = generous - has_trait = forgiving - has_trait = just - has_trait = humble - } - } - add = 25 - } - if = { - limit = { - scope:actor = { - is_ai = no - } - } - add = 25 - } - } - add_trait = loyal - } - } - add_character_modifier = { - modifier = beloved_puppeteer_modifier - desc = beloved_puppeteer_behavior_tt - } - custom_tooltip = beloved_puppeteer_behavior_tt - } - stress_impact = { - sadistic = medium_stress_impact_gain - arbitrary = medium_stress_impact_gain - } - } - if = { - limit = { - scope:lunacy_support ?= yes - } - scope:recipient = { - if = { - limit = { - is_adult = yes - } - add_stress = massive_stress_gain - change_spiritual_fulfillment = massive_spiritual_fulfillment_loss - } - else = { - add_stress = major_stress_gain - change_spiritual_fulfillment = major_spiritual_fulfillment_loss - } - add_character_modifier = { - modifier = deranging_puppeteer_modifier - desc = deranging_puppeteer_behavior_tt - } - custom_tooltip = deranging_puppeteer_behavior_tt - } - } - if = { - limit = { - OR = { - scope:lunacy_support ?= yes - scope:dread_support ?= yes - } - } - stress_impact = { - compassionate = major_stress_impact_gain - just = major_stress_impact_gain - humble = major_stress_impact_gain - } - } - if = { - limit = { - scope:friendly_support ?= yes - } - stress_impact = { - compassionate = minor_stress_impact_gain - trusting = minor_stress_impact_gain - humble = minor_stress_impact_gain - generous = minor_stress_impact_gain - forgiving = minor_stress_impact_gain - honest = minor_stress_impact_gain - just = minor_stress_impact_gain - } - } - if = { - limit = { - OR = { - scope:skill_support ?= yes - scope:piety_support ?= yes - scope:dread_support ?= yes - scope:friendly_support ?= yes - scope:lunacy_support ?= yes - } - } - scope:recipient = { - custom_tooltip = modifier_removed_when_puppeting_ends_tt - } - } - #Tracking variable that makes it easier to re-puppet former puppets - scope:recipient = { - add_to_variable_list = { - name = puppeteers - target = scope:actor - } - } -} -remove_puppet_modifiers_effect = { - if = { - limit = { - OR = { - has_character_modifier = skilled_puppeteer_modifier_diplomacy - has_character_modifier = skilled_puppeteer_modifier_martial - has_character_modifier = skilled_puppeteer_modifier_stewardship - has_character_modifier = skilled_puppeteer_modifier_intrigue - has_character_modifier = skilled_puppeteer_modifier_learning - has_character_modifier = skilled_puppeteer_modifier_general - has_character_modifier = spiritual_puppeteer_modifier_cleric - has_character_modifier = spiritual_puppeteer_modifier_secular - has_character_modifier = dreadful_puppeteer_modifier - has_character_modifier = beloved_puppeteer_modifier - has_character_modifier = deranging_puppeteer_modifier - } - } - send_interface_toast = { - type = event_toast_effect_neutral - title = puppet_modifier_removal.t - if = { - limit = { - has_character_modifier = skilled_puppeteer_modifier_diplomacy - } - remove_character_modifier = skilled_puppeteer_modifier_diplomacy - } - if = { - limit = { - has_character_modifier = skilled_puppeteer_modifier_martial - } - remove_character_modifier = skilled_puppeteer_modifier_martial - } - if = { - limit = { - has_character_modifier = skilled_puppeteer_modifier_stewardship - } - remove_character_modifier = skilled_puppeteer_modifier_stewardship - } - if = { - limit = { - has_character_modifier = skilled_puppeteer_modifier_intrigue - } - remove_character_modifier = skilled_puppeteer_modifier_intrigue - } - if = { - limit = { - has_character_modifier = skilled_puppeteer_modifier_learning - } - remove_character_modifier = skilled_puppeteer_modifier_learning - } - if = { - limit = { - has_character_modifier = skilled_puppeteer_modifier_general - } - remove_character_modifier = skilled_puppeteer_modifier_general - } - if = { - limit = { - has_character_modifier = spiritual_puppeteer_modifier_cleric - } - remove_character_modifier = spiritual_puppeteer_modifier_cleric - } - if = { - limit = { - has_character_modifier = spiritual_puppeteer_modifier_secular - } - remove_character_modifier = spiritual_puppeteer_modifier_secular - } - if = { - limit = { - has_character_modifier = dreadful_puppeteer_modifier - } - remove_character_modifier = dreadful_puppeteer_modifier - } - if = { - limit = { - has_character_modifier = beloved_puppeteer_modifier - } - remove_character_modifier = beloved_puppeteer_modifier - } - if = { - limit = { - has_character_modifier = deranging_puppeteer_modifier - } - remove_character_modifier = deranging_puppeteer_modifier - } - } - } -} -gnostic_tenet_learning_effect = { - if = { - limit = { - has_personal_tenet_flag = gnosticism_other_tenets - NAND = { - knows_tenet = tenet_astrology - knows_tenet = tenet_inner_journey - knows_tenet = tenet_esotericism - knows_tenet = tenet_miaphysitism - knows_tenet = tenet_asceticism - knows_tenet = tenet_vows_of_poverty - knows_tenet = tenet_pacifism - knows_tenet = tenet_mortification_of_the_flesh - knows_tenet = tenet_aniconism - knows_tenet = tenet_natural_primitivism - knows_tenet = tenet_false_conversion_sanction - knows_tenet = tenet_consolamentum - knows_tenet = tenet_scholasticism - knows_tenet = tenet_pursuit_of_knowledge - knows_tenet = tenet_alexandrian_catechism - knows_tenet = tenet_mendicant_preachers - knows_tenet = tenet_reincarnation - } - } - random = { - chance = { - value = 10 - if = { - limit = { - has_trait_xp = { - trait = lifestyle_scholar - value >= 60 - } - } - add = 10 - } - if = { - limit = { - has_trait_xp = { - trait = lifestyle_scholar - value >= 80 - } - } - add = 15 - } - if = { - limit = { - has_trait_xp = { - trait = lifestyle_scholar - value >= 100 - } - } - add = 15 - } - } - random_list = { - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_astrology - } - } - tenet:tenet_astrology = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_inner_journey - } - } - tenet:tenet_inner_journey = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_esotericism - } - } - tenet:tenet_esotericism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_miaphysitism - } - } - tenet:tenet_miaphysitism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_asceticism - } - } - tenet:tenet_asceticism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_vows_of_poverty - } - } - tenet:tenet_vows_of_poverty = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_pacifism - } - } - tenet:tenet_pacifism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_mortification_of_the_flesh - } - } - tenet:tenet_mortification_of_the_flesh = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_aniconism - } - } - tenet:tenet_aniconism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_natural_primitivism - } - } - tenet:tenet_natural_primitivism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_false_conversion_sanction - } - } - tenet:tenet_false_conversion_sanction = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_consolamentum - } - } - tenet:tenet_consolamentum = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_scholasticism - } - } - tenet:tenet_scholasticism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_pursuit_of_knowledge - } - } - tenet:tenet_pursuit_of_knowledge = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_alexandrian_catechism - } - } - tenet:tenet_alexandrian_catechism = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_mendicant_preachers - } - } - tenet:tenet_mendicant_preachers = { save_scope_as = gnostic_tenet } - } - 1 = { - trigger = { - NOT = { - knows_tenet = tenet_reincarnation - } - } - tenet:tenet_reincarnation = { save_scope_as = gnostic_tenet } - } - } - send_interface_message = { - type = msg_passive_learned_tenet_special - desc = gnostic_tenet_learning.t - left_icon = root - right_icon = scope:gnostic_tenet - - hidden_effect = { add_known_tenet = scope:gnostic_tenet } - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - } - } -} - -# Character scope. Runs from yearly_playable_pulse -# The modifier stacks, so remove-all first -pam_harmonious_society_five_bonds_effect = { - remove_all_character_modifier_instances = tenet_harmonious_society_five_bonds_modifier - - set_local_variable = { - name = five_bonds_tally - value = pam_five_bonds_tally_value - } - - set_local_variable = { - name = five_bonds_change - value = local_var:five_bonds_tally - } - if = { - limit = { has_variable = pam_five_bonds_tally_var } - change_local_variable = { - name = five_bonds_change - subtract = var:pam_five_bonds_tally_var - } - } - - # The pulse runs every year; only say something when the tally has actually moved. - if = { - limit = { local_var:five_bonds_change > 0 } - send_interface_toast = { - type = event_toast_effect_good - title = pam_harmonious_society_five_bonds_toast - desc = pam_harmonious_society_five_bonds_toast_desc - left_icon = root - pam_harmonious_society_apply_five_bonds_effect = yes - } - } - else_if = { - limit = { local_var:five_bonds_change < 0 } - send_interface_toast = { - type = event_toast_effect_bad - title = pam_harmonious_society_five_bonds_toast - desc = pam_harmonious_society_five_bonds_toast_desc - left_icon = root - pam_harmonious_society_apply_five_bonds_effect = yes - } - } - else = { - hidden_effect = { - pam_harmonious_society_apply_five_bonds_effect = yes - } - } - - set_variable = { - name = pam_five_bonds_tally_var - value = local_var:five_bonds_tally - } -} - -# Character scope. One stack for each bond kept, named individually so the toast reads as a tally. -pam_harmonious_society_apply_five_bonds_effect = { - if = { - limit = { pam_five_bonds_ruler_subject_trigger = yes } - custom_tooltip = pam_five_bonds_ruler_subject_tt - add_character_modifier = tenet_harmonious_society_five_bonds_modifier - } - if = { - limit = { pam_five_bonds_parent_child_trigger = yes } - custom_tooltip = pam_five_bonds_parent_child_tt - add_character_modifier = tenet_harmonious_society_five_bonds_modifier - } - if = { - limit = { pam_five_bonds_spouse_trigger = yes } - custom_tooltip = pam_five_bonds_spouse_tt - add_character_modifier = tenet_harmonious_society_five_bonds_modifier - } - if = { - limit = { pam_five_bonds_sibling_trigger = yes } - custom_tooltip = pam_five_bonds_sibling_tt - add_character_modifier = tenet_harmonious_society_five_bonds_modifier - } - if = { - limit = { pam_five_bonds_friend_trigger = yes } - custom_tooltip = pam_five_bonds_friend_tt - add_character_modifier = tenet_harmonious_society_five_bonds_modifier - } -} - -# One stack of $MODIFIER$ per trait the rite counts as a sin -pam_add_modifier_per_sin_trait_effect = { - remove_all_character_modifier_instances = $MODIFIER$ - - every_character_trait = { - limit = { - root.rite = { trait_is_sin_rite = prev } - } - root = { - add_character_modifier = $MODIFIER$ - } - } -} - -pam_tenet_purgatory_sin_penalty_effect = { - pam_add_modifier_per_sin_trait_effect = { MODIFIER = tenet_purgatory_sin_penalty_modifier } -} - -pam_tenet_original_sin_insight_effect = { - pam_add_modifier_per_sin_trait_effect = { MODIFIER = tenet_original_sin_sinners_insight_modifier } -} - -# New lover or soulmate; one payout a year -pam_tenet_polyamory_new_beloved_effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_polyamory_new_beloved - NOT = { has_character_flag = pam_polyamory_new_beloved_cooldown } - } - send_interface_toast = { - type = event_toast_effect_good - title = tenet_polyamory_new_beloved_toast - left_icon = root - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - add_stress = medium_stress_loss - add_character_modifier = { - modifier = tenet_polyamory_new_beloved_modifier - years = 5 - } - } - add_character_flag = { - flag = pam_polyamory_new_beloved_cooldown - days = 365 - } - } -} - -pam_tenet_apostolic_succession_episcopate_effect = { - remove_character_modifier = tenet_apostolic_succession_episcopate_modifier - - if = { - limit = { - is_valid_for_legitimacy_change = yes - pam_apostolic_succession_bishop_count_value > 0 - } - add_character_modifier = tenet_apostolic_succession_episcopate_modifier - } -} - -pam_tenet_divine_liturgy_choirs_effect = { - remove_character_modifier = tenet_divine_liturgy_choirs_modifier - - if = { - limit = { - pam_divine_liturgy_temple_count_value > 0 - } - add_character_modifier = tenet_divine_liturgy_choirs_modifier - } -} - -pam_tenet_divine_liturgy_officiant_effect = { - remove_character_modifier = tenet_divine_liturgy_officiant_modifier - - if = { - limit = { - pam_divine_liturgy_chaplain_learning_value > 0 - } - add_character_modifier = tenet_divine_liturgy_officiant_modifier - } - - # Timed past yearly retally so a lapsed chaplain ages out - if = { - limit = { - has_personal_tenet_flag = tenet_divine_liturgy_schola_cantorum - cp:councillor_court_chaplain ?= { faith = root.faith } - } - cp:councillor_court_chaplain = { - add_character_modifier = { - modifier = tenet_divine_liturgy_schola_cantorum_modifier - months = 13 - } - } - } -} - -############################################### -# Holy Myron - -# OWNER - character receiving the ampulla (artifact is created in their scope) -# CREATOR - the cleric who gathered the balsams and consecrated the oil -# RARITY - common | masterwork | famed | illustrious -pam_create_holy_myron_artifact_effect = { - get_artifact_quality_effect = yes - get_artifact_wealth_effect = yes - - $OWNER$ = { - create_artifact = { - name = pam_holy_myron_artifact_name - description = pam_holy_myron_artifact_desc_$RARITY$ - creator = $CREATOR$ - visuals = flask - type = miscellaneous - template = pam_holy_myron_template - rarity = $RARITY$ - modifier = artifact_placeholder_modifier - decaying = no - save_scope_as = newly_created_artifact - wealth = scope:wealth - quality = scope:quality - } - } - scope:newly_created_artifact = { - save_scope_as = pam_myron_vessel - if = { - limit = { rarity = common } - set_variable = { - name = pam_holy_myron_charges - value = 1 - } - add_artifact_modifier = pam_holy_myron_vessel_modifier - } - else_if = { - limit = { rarity = masterwork } - set_variable = { - name = pam_holy_myron_charges - value = 2 - } - add_artifact_modifier = pam_holy_myron_vessel_modifier - } - else_if = { - limit = { rarity = famed } - set_variable = { - name = pam_holy_myron_charges - value = 3 - } - add_artifact_modifier = pam_holy_myron_vessel_potent_modifier - } - else = { - set_variable = { - name = pam_holy_myron_charges - value = 4 - } - add_artifact_modifier = pam_holy_myron_vessel_potent_modifier - } - # We set the description again once the charge variable exists, reading it through scope:pam_myron_vessel - set_artifact_description = pam_holy_myron_artifact_desc_charged_$RARITY$ - remove_artifact_modifier = artifact_placeholder_modifier - } -} - -# Character scope: saves the owned ampulla as scope:pam_holy_myron_artifact. -pam_save_holy_myron_artifact_effect = { - random_character_artifact = { - limit = { pam_is_holy_myron_artifact_trigger = yes } - save_scope_as = pam_holy_myron_artifact - } -} - -# $ARTIFACT$ = the ampulla -# trigger_event with no delay runs after this script, so destroy (0002) never leaves a live empty vessel -pam_holy_myron_consume_charge_effect = { - if = { - limit = { exists = $ARTIFACT$ } - $ARTIFACT$ = { - change_variable = { - name = pam_holy_myron_charges - subtract = 1 - } - } - if = { - limit = { - $ARTIFACT$ = { var:pam_holy_myron_charges <= 0 } - } - $ARTIFACT$ = { save_scope_as = pam_holy_myron_spent_vessel } - $ARTIFACT$.artifact_owner ?= { - trigger_event = pam_holy_myron.0002 - } - } - else = { - $ARTIFACT$ = { - save_scope_as = pam_myron_vessel - if = { - limit = { rarity = masterwork } - set_artifact_description = pam_holy_myron_artifact_desc_charged_masterwork - } - else_if = { - limit = { rarity = famed } - set_artifact_description = pam_holy_myron_artifact_desc_charged_famed - } - else_if = { - limit = { rarity = illustrious } - set_artifact_description = pam_holy_myron_artifact_desc_charged_illustrious - } - else = { - set_artifact_description = pam_holy_myron_artifact_desc_charged_common - } - } - } - } -} - -# Character scope on the owner, run alongside pam_holy_myron_consume_charge_effect at every spend site -pam_holy_myron_spend_warning_effect = { - if = { - limit = { - any_character_artifact = { - pam_is_holy_myron_artifact_trigger = yes - trigger_if = { - limit = { has_variable = pam_holy_myron_charges } - var:pam_holy_myron_charges <= 1 - } - trigger_else = { - always = no - } - } - } - custom_tooltip = pam_holy_myron_spend_last_tt - } - else = { - custom_tooltip = pam_holy_myron_spend_tt - } -} - -# $PARENT$ is the devoted parent, and the child is sealed once by whichever parent we reach first -pam_holy_myron_chrismation_effect = { - if = { - limit = { - scope:child = { - is_alive = yes - NOT = { has_variable = pam_holy_myron_chrismated } - } - } - # Twins are one ceremony, and later paths cover the sibling through scope:pam_myron_twin - scope:child = { - set_variable = pam_holy_myron_chrismated - if = { - limit = { has_trait = twin } - random_sibling = { - limit = { - is_twin_of = scope:child - is_alive = yes - NOT = { has_variable = pam_holy_myron_chrismated } - } - save_scope_as = pam_myron_twin - } - } - } - scope:pam_myron_twin ?= { - set_variable = pam_holy_myron_chrismated - } - if = { - limit = { - $PARENT$ = { - pam_has_usable_holy_myron_trigger = yes - is_available = yes - exists = cp:councillor_court_chaplain - } - } - $PARENT$ = { - trigger_event = { - id = pam_holy_myron.0300 - days = 3 - } - } - } - else = { - $PARENT$ = { - send_interface_toast = { - type = event_generic_good - title = pam_holy_myron_chrismation_toast - left_icon = scope:child - right_icon = $PARENT$ - scope:child = { - if = { - limit = { - NOR = { - has_character_modifier = pam_chrismated_child_modifier - has_character_modifier = pam_myron_chrismated_child_modifier - } - } - add_character_modifier = { - modifier = pam_chrismated_child_modifier - years = 16 - } - } - } - scope:pam_myron_twin ?= { - if = { - limit = { - is_alive = yes - NOR = { - has_character_modifier = pam_chrismated_child_modifier - has_character_modifier = pam_myron_chrismated_child_modifier - } - } - add_character_modifier = { - modifier = pam_chrismated_child_modifier - years = 16 - } - } - } - } - } - } - } -} - -# Chaplain scope: clears all Holy Myron journey bookkeeping (journey end, death, or abort). -pam_holy_myron_journey_cleanup_effect = { - var:pam_holy_myron_liege ?= { - remove_variable = pam_holy_myron_journey_active - } - remove_variable = pam_holy_myron_journey_tier - remove_variable = pam_holy_myron_legs - remove_variable = pam_holy_myron_expected_legs - remove_variable = pam_holy_myron_robbed - remove_variable = pam_holy_myron_ransom_fired - remove_variable = pam_holy_myron_fever_fired - remove_variable = pam_holy_myron_liege - remove_character_modifier = pam_holy_myron_pilgrim_modifier -} - -# Artifact scope: rarity-scaled Religious Study phase-speed modifier for devotional books -add_scaled_artifact_modifier_study_scripture_scheme_phase_duration_add_effect = { - if = { - limit = { rarity = common } - add_artifact_modifier = artifact_study_scripture_scheme_phase_duration_add_1_modifier - } - else_if = { - limit = { rarity = masterwork } - add_artifact_modifier = artifact_study_scripture_scheme_phase_duration_add_2_modifier - } - else_if = { - limit = { rarity = famed } - add_artifact_modifier = artifact_study_scripture_scheme_phase_duration_add_3_modifier - } - else_if = { - limit = { rarity = illustrious } - add_artifact_modifier = artifact_study_scripture_scheme_phase_duration_add_4_modifier - } -} - -pam_evangelize_personal_tenet_effect = { - scope:recipient = { - pam_replace_personal_tenet_effect = { TENET = scope:pam_evangelize_tenet } - } - if = { - limit = { - scope:hook = yes - has_usable_hook = scope:recipient - } - use_hook = scope:recipient - } - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value - pam_tenet_popularity_on_evangelized_tenet_effect = { - TENET = scope:pam_evangelize_tenet - CHANGE = scope:recipient.pam_evangelize_tenet_popularity_gain - } - if = { - limit = { - faith.main_rite = { - has_tenet_status = { - tenet = scope:pam_evangelize_tenet - status = prohibited - } - } - } - every_secret = { - type = secret_forbidden_personal_tenet - limit = { NOT = { is_known_by = scope:recipient } } - reveal_to = scope:recipient - } - show_as_tooltip = { - scope:recipient = { - add_secret = { type = secret_forbidden_personal_tenet } - every_secret = { - type = secret_forbidden_personal_tenet - reveal_to = scope:actor - } - } - } - scope:recipient = { - set_variable = { - name = tenet_evangelized_by - value = scope:actor - days = 1 - } - } - } -} - -pam_evangelize_personal_tenet_decline_effect = { - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_loss - if = { - limit = { - faith.main_rite = { - has_tenet_status = { - tenet = scope:pam_evangelize_tenet - status = prohibited - } - } - } - every_secret = { - type = secret_forbidden_personal_tenet - limit = { NOT = { is_known_by = scope:recipient } } - reveal_to = scope:recipient - } - } -} - -pam_reform_order_effect = { - pam_save_selected_interaction_tenet_effect = yes - - scope:actor.rite = { save_scope_as = pam_reform_order_rite } - scope:recipient = { - holy_order = { - save_scope_as = pam_reform_order - title = { save_scope_as = pam_reform_order_title } - if = { - limit = { exists = scope:pam_selected_interaction_tenet } - custom_tooltip = { # Order adopts the tenet - text = pam_reform_order_adopt_tenet_tt - hidden_effect = { - scope:pam_reform_order = { set_order_tenet = scope:pam_selected_interaction_tenet } - } - } - } - if = { # Order adopts rite - limit = { - NOT = { order_rite = scope:pam_reform_order_rite } - } - custom_tooltip = { - text = pam_reform_order_adopt_rite_tt - hidden_effect = { - scope:pam_reform_order = { - set_order_rite = scope:pam_reform_order_rite - } - } - } - } - } - if = { # Adopt the PT - limit = { exists = scope:pam_selected_interaction_tenet } - if = { - limit = { - NOT = { has_personal_tenet = scope:pam_selected_interaction_tenet } - } - pam_replace_personal_tenet_effect = { TENET = scope:pam_selected_interaction_tenet } - } - custom_tooltip = { - text = pam_reform_order_courtiers_adopt_tenet_tt - every_courtier = { - limit = { - OR = { - pam_is_monastic_order_member_trigger = yes - pam_is_military_order_member_trigger = yes - } - NOT = { has_personal_tenet = scope:pam_selected_interaction_tenet } - } - pam_replace_personal_tenet_effect = { TENET = scope:pam_selected_interaction_tenet } - } - } - } - if = { # Adopt the rite - limit = { exists = scope:pam_reform_order_rite } - if = { - limit = { - NOT = { rite = scope:pam_reform_order_rite } - } - set_character_rite = scope:pam_reform_order_rite - } - custom_tooltip = { - text = pam_reform_order_courtiers_adopt_rite_tt - every_courtier = { - limit = { - OR = { - pam_is_monastic_order_member_trigger = yes - pam_is_military_order_member_trigger = yes - } - NOT = { rite = scope:pam_reform_order_rite } - } - set_character_rite = scope:pam_reform_order_rite - } - } - } - } - - hidden_effect = { - scope:actor = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_reform_order_interaction_toast - right_icon = scope:recipient - custom_tooltip = pam_reform_order_interaction_toast_tt - } - } - } -} - diff --git a/common/scripted_effects/tgp_debate_scripted_effects.txt b/common/scripted_effects/tgp_debate_scripted_effects.txt deleted file mode 100644 index af3616e0e..000000000 --- a/common/scripted_effects/tgp_debate_scripted_effects.txt +++ /dev/null @@ -1,709 +0,0 @@ -# Find debate target -set_debate_target_effect = { - save_scope_as = debate_contender - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_favor - } - } - } - #Save current empowered movement. - situation:dynastic_cycle ?= { - random_participant_group = { - limit = { exists = var:movement_favored } - save_scope_as = current_empowered_movement - } - } - if = { # Grab the movement leader if available - limit = { - scope:current_empowered_movement = { - var:movement_leader = { involved_activity = scope:activity } - } - } - scope:current_empowered_movement = { - var:movement_leader = { save_scope_as = challenged_movement_leader } - } - } - else_if = { # Else grab a proxy - limit = { - scope:activity = { - any_attending_character = { - top_participant_group:dynastic_cycle ?= scope:current_empowered_movement - } - } - } - scope:activity = { - ordered_attending_character = { - order_by = movement_power_character_value - check_range_bounds = no - limit = { - top_participant_group:dynastic_cycle ?= scope:current_empowered_movement - } - save_scope_as = challenged_movement_leader - } - } - } - else_if = { # Else grab a character from _another_ movement - limit = { - scope:activity = { - any_attending_character = { - NOR = { - top_participant_group:dynastic_cycle ?= { participant_group_type = undecided_movement } - top_participant_group:dynastic_cycle ?= scope:host.top_participant_group:dynastic_cycle - } - } - } - } - scope:activity = { - ordered_attending_character = { - order_by = movement_power_character_value - check_range_bounds = no - limit = { - NOR = { - top_participant_group:dynastic_cycle ?= { participant_group_type = undecided_movement } - top_participant_group:dynastic_cycle ?= scope:host.top_participant_group:dynastic_cycle - } - } - save_scope_as = challenged_movement_leader - } - } - } - else = { # Invalidate activity - trigger_event = activity_system.0552 - } - } - else_if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_leadership - } - } - } - scope:activity.special_guest:movement_leader ?= { save_scope_as = challenged_movement_leader } - } - scope:activity = { - set_variable = { - name = challenged_movement_leader - value = scope:challenged_movement_leader - } - set_variable = { - name = debate_contender - value = scope:debate_contender - } - } -} - -# > 0 contender won and will become new leader -# <= 0 movement leader won and defended position -debate_determine_outcome_effect = { - random_list = { - 10 = { # Contender is winner - modifier = { - add = 240 - scope:activity.debate_outcome_value = 3 - } - modifier = { - add = 70 - scope:activity.debate_outcome_value = 2 - } - modifier = { - add = 10 - scope:activity.debate_outcome_value = 1 - } - modifier = { # If opponents score is TOO high, you cannot win - factor = 0 - scope:activity.debate_outcome_value <= -3 - } - scope:activity.var:debate_contender = { - save_scope_as = debate_winner - } - scope:activity.var:challenged_movement_leader = { - save_scope_as = debate_loser - } - if = { - limit = { - scope:activity.debate_outcome_value < 0 - } - save_scope_as = debate_unexpected_win - } - } - 10 = { # challenged leader is winner - modifier = { - add = 240 - scope:activity.debate_outcome_value = -3 - } - modifier = { - add = 70 - scope:activity.debate_outcome_value = -2 - } - modifier = { - add = 10 - scope:activity.debate_outcome_value = -1 - } - modifier = { # If opponents score is TOO high, you cannot win - factor = 0 - scope:activity.debate_outcome_value >= 3 - } - - scope:activity.var:debate_contender = { - save_scope_as = debate_loser - } - scope:activity.var:challenged_movement_leader = { - save_scope_as = debate_winner - } - if = { - limit = { - scope:activity.debate_outcome_value > 0 - } - save_scope_as = debate_unexpected_win - } - } - } - # Apply effects - # Seize movement leadership success - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_leadership - } - } - } - # Set variables for activity conclusion desc - note that for the favor special option, these are set in the hegemon's follow up event. - scope:activity = { - set_variable = { - name = debate_winner - value = scope:debate_winner - } - } - scope:activity = { - set_variable = { - name = debate_loser - value = scope:debate_loser - } - } - # Record it - involved_activity = { - if = { - limit = { - scope:debate_winner = { - is_any_movement_leader = no - } - } - add_activity_log_entry = { - key = debate_become_movement_leader_reward - score = 80 - tags = { completed } - character = scope:debate_winner - location = scope:debate_winner.location - } - } - else = { - add_activity_log_entry = { - key = debate_remain_movement_leader_reward - score = 80 - tags = { completed } - character = scope:debate_winner - location = scope:debate_winner.location - } - } - } - } -} - -debate_disburse_activity_ai_guest_rewards = { - if = { - limit = { - NOT = { exists = var:tgp_debate_success_score } - } - set_variable = { - name = tgp_debate_success_score - value = tgp_debate_success_score_value - } - } - if = { - limit = { - has_activity_intent = debate_increase_movement_power_intent - exists = top_participant_group:dynastic_cycle - } - top_participant_group:dynastic_cycle ?= { - save_scope_as = my_movement - } - random = { - chance = { - value = 25 - if = { - limit = { var:tgp_debate_success_score >= 100 } - add = 75 - } - else_if = { - limit = { var:tgp_debate_success_score >= 75 } - add = 50 - } - else_if = { - limit = { var:tgp_debate_success_score >= 50 } - add = 25 - } - } - if = { - limit = { var:tgp_debate_success_score >= 100 } - change_influence = major_influence_gain - scope:my_movement = { - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_major_value - } - } - } - else_if = { - limit = { var:tgp_debate_success_score >= 75 } - change_influence = medium_influence_gain - scope:my_movement = { - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_medium_value - } - } - } - else = { - change_influence = minor_influence_gain - scope:my_movement = { - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_minor_value - } - } - } - } - } - else = { - save_scope_as = ai_guest - if = { - limit = { - NOT = { - any_relation = { - type = elder - is_ai = no - } - } - } - random = { - chance = { - value = 25 - } - scope:activity = { - random_attending_character = { - limit = { - is_ai = yes - merit > scope:ai_guest.merit - num_of_relation_disciple < disciples_limit_value - NOR = { - has_relation_elder = scope:ai_guest - has_relation_disciple = scope:ai_guest - } - # Not busy with their own things. - this != scope:host - this != scope:activity.var:challenged_movement_leader - } - weight = { - base = 100 - modifier = { - any_relation = { - type = disciple - count > 0 - } - # even out the distribution of disciples - add = { - every_relation = { - type = disciple - add = -5 - } - } - } - } - save_scope_as = elder - set_elder_relation_effect = { - ELDER = scope:elder - DISCIPLE = scope:ai_guest - MERIT = minor_merit_gain - } - } - } - } - } - } -} - -debate_host_rewards_effect = { - if = { - # Host won debate - limit = { - this = scope:activity.var:debate_winner - } - # Activity is imperial debate (determines favored movement) - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_favor - } - } - } - root.top_participant_group:dynastic_cycle ?= { - # Make favored movement - save_scope_as = my_movement - } - # We raise our own Movement Power - custom_tooltip = event_increase_movement_power_major_effect_tooltip - scope:my_movement = { - make_movement_favored_effect = yes - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_major_value - } - switch = { - trigger = participant_group_type - pro_hegemon_movement = { - if = { - limit = { - situation:dynastic_cycle = { - situation_top_has_catalyst = catalyst_movement_gained_power_pro_hegemon - } - } - situation:dynastic_cycle = { - trigger_situation_catalyst = catalyst_movement_gained_power_pro_hegemon - } - } - } - advancement_movement = { - if = { - limit = { - situation:dynastic_cycle = { - situation_top_has_catalyst = catalyst_movement_gained_power_advancement - } - } - situation:dynastic_cycle = { - trigger_situation_catalyst = catalyst_movement_gained_power_advancement - } - } - } - expansion_movement = { - if = { - limit = { - situation:dynastic_cycle = { - situation_top_has_catalyst = catalyst_movement_gained_power_expansion - } - } - situation:dynastic_cycle = { - trigger_situation_catalyst = catalyst_movement_gained_power_expansion - } - } - } - conservative_movement = { - if = { - limit = { - situation:dynastic_cycle = { - situation_top_has_catalyst = catalyst_movement_gained_power_conservative - } - } - situation:dynastic_cycle = { - trigger_situation_catalyst = catalyst_movement_gained_power_conservative - } - } - } - } - } - } - else = { - make_movement_leader_effect = yes - } - } - # Then dole out secondary rewards - if = { - # We have the intent to gain disciples and gained at least one. - limit = { has_variable_list = debate_disciples } - if = { - # Code math starts at 0 - limit = { - variable_list_size = { - name = debate_disciples - value >= 1 - } - num_of_relation_disciple >= 1 - } - ordered_in_list = { - variable = debate_disciples - order_by = learning - save_scope_as = disciple_1 - } - } - if = { - limit = { - variable_list_size = { - name = debate_disciples - value >= 2 - } - num_of_relation_disciple >= 2 - } - ordered_in_list = { - variable = debate_disciples - order_by = learning - position = 1 - save_scope_as = disciple_2 - } - } - if = { - limit = { - variable_list_size = { - name = debate_disciples - value >= 3 - } - num_of_relation_disciple >= 3 - } - ordered_in_list = { - variable = debate_disciples - order_by = learning - position = 2 - save_scope_as = disciple_3 - } - } - if = { - limit = { - exists = scope:disciple_3 - } - custom_tooltip = gained_many_disciples - } - else_if = { - limit = { - exists = scope:disciple_2 - } - custom_tooltip = gained_few_disciples - } - else_if = { - limit = { - exists = scope:disciple_1 - } - custom_tooltip = gained_one_disciple - } - } - change_influence = { - # Modest reward as a base - you're the host after all! - value = major_influence_value - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_favor - } - } - this = scope:activity.var:debate_winner - } - add = monumental_influence_value - } - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_leadership - } - } - this = scope:activity.var:debate_winner - } - add = major_influence_value - } - } - add_prestige = { - # Modest reward as a base - you're the host after all! - value = major_prestige_value - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_favor - } - } - this = scope:activity.var:debate_winner - } - add = monumental_prestige_value - } - if = { - limit = { - scope:activity = { - has_activity_option = { - category = special_type - option = debate_type_leadership - } - } - this = scope:activity.var:debate_winner - } - add = major_prestige_value - } - } -} - -debate_disburse_activity_host_rewards = { - # Regardless of outcome for intents, you should receive some influence and prestige from having hosted debate. - if = { - limit = { this = scope:host } - # Record it - involved_activity = { - add_activity_log_entry = { - key = debate_host_rewards - score = 80 - tags = { completed } - show_in_conclusion = yes - character = scope:host - location = scope:host.location - scope:host = { debate_host_rewards_effect = yes } - } - } - pam_vows_of_poverty_host_completion_piety_effect = yes - } - else = { - show_as_tooltip = { debate_host_rewards_effect = yes } - } -} - -debate_guest_rewards = { - if = { - limit = { - this = scope:activity.var:challenged_movement_leader - this = scope:activity.var:debate_winner - } - add_prestige = major_prestige_value - change_influence = major_influence_value - } - if = { - limit = { - has_activity_intent = debate_gain_elder_intent - } - if = { - limit = { - has_variable = new_elder - } - custom_tooltip = gained_new_elder_tt - } - change_influence = debate_guest_influence_reward_value - } - if = { - limit = { - has_activity_intent = debate_increase_movement_power_intent - exists = var:tgp_debate_success_score - } - top_participant_group:dynastic_cycle ?= { - save_scope_as = my_movement - } - random = { - chance = { - value = 25 - if = { - limit = { var:tgp_debate_success_score >= 100 } - add = 75 - } - else_if = { - limit = { var:tgp_debate_success_score >= 75 } - add = 50 - } - else_if = { - limit = { var:tgp_debate_success_score >= 50 } - add = 25 - } - } - if = { - limit = { var:tgp_debate_success_score >= 100 } - change_influence = major_influence_gain - scope:my_movement = { - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_major_value - } - } - } - else_if = { - limit = { var:tgp_debate_success_score >= 75 } - change_influence = medium_influence_gain - scope:my_movement = { - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_medium_value - } - } - } - else = { - change_influence = minor_influence_gain - scope:my_movement = { - event_change_movement_power_effect = { - VALUE = event_increase_movement_power_minor_value - } - } - } - } - change_influence = debate_guest_influence_reward_value - } - add_trait_xp = { - trait = confucian_education - value = { - value = lifestyle_confucian_education_xp_gain_minor_value - #High Score - if = { - limit = { - has_variable = tgp_debate_success_score - var:tgp_debate_success_score >= 75 - } - multiply = 3 - } - #Good Score - else_if = { - limit = { - has_variable = tgp_debate_success_score - var:tgp_debate_success_score < 75 - var:tgp_debate_success_score >= 50 - } - multiply = 1.5 - } - #Poor Score - else_if = { - limit = { - has_variable = tgp_debate_success_score - var:tgp_debate_success_score < 50 - } - multiply = 0.8 - } - } - } -} - -debate_disburse_activity_guest_rewards = { - save_scope_as = guest - involved_activity = { - add_activity_log_entry = { - key = debate_guest_rewards - score = 80 - tags = { completed } - show_in_conclusion = yes - character = scope:guest - location = scope:guest.location - scope:guest = { debate_guest_rewards = yes } - } - } -} - -debate_cleanup_effect = { - if = { - limit = { - has_variable = tgp_debate_success_score - } - set_variable = { - name = tgp_debate_success_score - value = var:tgp_debate_success_score - days = 60 - } - } - # Debates - remove_variable ?= debate_selected_tactic - remove_variable ?= debate_crowd_sentiment -} diff --git a/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt b/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt deleted file mode 100644 index 266723b94..000000000 --- a/common/scripted_effects/tgp_imperial_examination_scripted_effects.txt +++ /dev/null @@ -1,2012 +0,0 @@ - -#Tweak exam advantage variable -imperial_examination_adjust_advantage_variable_effect = { - if = { - limit = { - NOT = { has_variable = has_exam_advantage } - } - set_variable = { - name = has_exam_advantage - value = 1 - } - } - else = { - change_variable = { - name = has_exam_advantage - add = 1 - } - } -} - -imperial_examination_adjust_advantage_variable_neg_effect = { - if = { - limit = { - NOT = { has_variable = has_exam_advantage } - } - set_variable = { - name = has_exam_advantage - value = 0 - } - } - else = { - change_variable = { - name = has_exam_advantage - add = -1 - } - } -} - -#Is run in the imperial_examination_cheat_washing_effect -imperial_examination_update_cheat_washing_effect = { - if = { - limit = { has_variable = washed_cheater } - change_variable = { - name = washed_cheater - add = 1 - } - } - else = { - set_variable = { - name = washed_cheater - value = 1 - } - } -} - -imperial_examination_cheat_washing_effect = { - #What a relief. - stress_and_fulfillment_impact = { base = major_stress_impact_loss } - #Gonzo! - custom_tooltip = imperial_examination.cheat_wash.tt - remove_variable ?= been_caught_cheating - remove_variable ?= been_caught_cheating_longterm - #How many times have we washed out cheat, exactly? - imperial_examination_update_cheat_washing_effect = yes -} - - -#Rewards -imperial_examination_disburse_activity_host_rewards = { - involved_activity = { - add_activity_log_entry = { - key = imperial_examination_host_rewards - score = 100 - tags = { completed } - show_in_conclusion = yes - character = scope:host - location = scope:host.location - - scope:host = { - #Legend spread - if = { - limit = { - has_dlc_feature = legends - exists = promoted_legend - #Lots of entrants - scope:activity = { activity_has_imperial_exams_trigger = yes } - } - promoted_legend ?= { - change_legend_quality_effect = { VALUE = medium_legend_quality_increase } - } - } - - #Influence based on your... setup - change_influence = { - value = imperial_examination_influence_base_reward_value - #Lots of entrants - if = { - limit = { scope:activity = { activity_has_imperial_exams_trigger = yes } } - multiply = 4 - } - #Smaller amount of entrants - else_if = { - limit = { scope:activity = { activity_has_grand_exams_trigger = yes } } - multiply = 2 - } - } - - #Legitimacy - add_legitimacy = { - value = imperial_examination_legitimacy_base_reward_value - #Extreme Grade - if = { - limit = { scope:activity = { activity_has_extreme_grade_trigger = yes } } - multiply = 2 - } - #High Grade is the default, as it were, so no post for that case - #Mediocre Grade - else_if = { - limit = { scope:activity = { activity_has_mediocre_grade_trigger = yes } } - multiply = 0.8 - } - #Low Grade - else = { - limit = { scope:activity = { activity_has_low_grade_trigger = yes } } - multiply = 0.5 - } - } - - #Prestige - add_prestige = { - value = imperial_examination_prestige_base_reward_value - #Extreme Grade - if = { - limit = { scope:activity = { activity_has_extreme_grade_trigger = yes } } - multiply = 4 - } - #High Grade - else_if = { - limit = { scope:activity = { activity_has_high_grade_trigger = yes } } - multiply = 2 - } - #Mediocre Grade - #Low Grade - else = { - limit = { scope:activity = { activity_has_low_grade_trigger = yes } } - multiply = 0.8 - } - } - } - } - } - pam_vows_of_poverty_host_completion_piety_effect = yes -} - -local_examination_disburse_activity_host_rewards = { - involved_activity = { - add_activity_log_entry = { - key = imperial_examination_host_rewards - score = 100 - tags = { completed } - show_in_conclusion = yes - character = scope:host - location = scope:host.location - - scope:host = { - #Influence based on your... setup - change_influence = { - value = local_examination_influence_base_reward_value - #Lots of entrants - if = { - limit = { scope:activity = { activity_has_imperial_exams_trigger = yes } } - multiply = 4 - } - #Smaller amount of entrants - else_if = { - limit = { scope:activity = { activity_has_grand_exams_trigger = yes } } - multiply = 2 - } - } - - if = { - limit = { has_legitimacy = yes } - #Legitimacy (for those who have it) - add_legitimacy = { - value = local_examination_legitimacy_base_reward_value - #Extreme Grade - if = { - limit = { scope:activity = { activity_has_extreme_grade_trigger = yes } } - multiply = 2 - } - #High Grade is the default, as it were, so no post for that case - #Mediocre Grade - else_if = { - limit = { scope:activity = { activity_has_mediocre_grade_trigger = yes } } - multiply = 0.8 - } - #Low Grade - else = { - limit = { scope:activity = { activity_has_low_grade_trigger = yes } } - multiply = 0.5 - } - } - } - else = { - # Merit for the rest - change_merit = { - value = local_examination_legitimacy_base_reward_value - #Extreme Grade - if = { - limit = { scope:activity = { activity_has_extreme_grade_trigger = yes } } - multiply = 2 - } - #High Grade is the default, as it were, so no post for that case - #Mediocre Grade - else_if = { - limit = { scope:activity = { activity_has_mediocre_grade_trigger = yes } } - multiply = 0.8 - } - #Low Grade - else = { - limit = { scope:activity = { activity_has_low_grade_trigger = yes } } - multiply = 0.5 - } - } - } - - #Prestige - add_prestige = { - value = local_examination_prestige_base_reward_value - #Extreme Grade - if = { - limit = { scope:activity = { activity_has_extreme_grade_trigger = yes } } - multiply = 4 - } - #High Grade - else_if = { - limit = { scope:activity = { activity_has_high_grade_trigger = yes } } - multiply = 2 - } - #Mediocre Grade - #Low Grade - else = { - limit = { scope:activity = { activity_has_low_grade_trigger = yes } } - multiply = 0.8 - } - } - } - } - } - pam_vows_of_poverty_host_completion_piety_effect = yes -} - -imperial_examination_disburse_activity_examiner_rewards = { - #Add some influence & prestige - change_influence = imperial_examination_influence_base_reward_value - add_prestige = imperial_examination_prestige_base_reward_value - #Change some opinion - add_opinion = { - modifier = examiner_opinion - target = scope:host - opinion = 25 - } -} - -imperial_examination_disburse_activity_entrant_rewards = { - save_temporary_scope_as = entrant - #This variable is set to track the loc we show players when notifying them of their family's results. - - #Cheaters - if = { - limit = { has_variable = been_caught_cheating_longterm } - #No influence for cheaters - change_merit = { - value = imperial_examination_merit_base_reward_value - multiply = 0.1 - } - } - #Entrants - else_if = { - limit = { - OR = { - is_in_guest_subset = { name = entrants } - is_in_guest_subset = { name = palace_entrants } - } - } - #Influence based on your score - if = { - limit = { is_ai = no } - #Record it - involved_activity = { - add_activity_log_entry = { - key = imperial_examination_entrant_rewards - score = 80 - tags = { completed } - show_in_conclusion = yes - character = scope:entrant - location = scope:entrant.location - scope:entrant = { - if = { - limit = { - NOT = { has_character_modifier = tgp_passed_provincial_exam_modifier } - } - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_bypassed_provincial_exam_modifier - } - } - change_influence = imperial_examination_entrant_influence_reward_value - #Merit based on your score - change_merit = imperial_examination_entrant_merit_reward_value - # Gain Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_gain - } - } - } - } - } - else = { - if = { - limit = { - NOT = { has_character_modifier = tgp_passed_provincial_exam_modifier } - } - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_bypassed_provincial_exam_modifier - } - if = { - limit = { is_lowborn = no } - change_merit = local_examination_merit_base_reward_value - } - } - if = { - limit = { - OR = { - is_lowborn = no - has_perfect_score_trigger = { SCORE_VAR = imperial_examination_score } - } - - } - change_influence = imperial_examination_entrant_influence_reward_value - #Merit based on your score - change_merit = imperial_examination_entrant_merit_reward_value - # Gain Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_gain - } - } - } - if = { - limit = { - is_in_guest_subset = { name = palace_entrants } - } - if = { - limit = { - NOT = { has_character_flag = passed_metropolitan_exam } - } - add_character_flag = passed_metropolitan_exam - add_character_modifier = { - modifier = tgp_passed_metropolitan_exam_modifier - } - } - add_character_flag = passed_palace_exam - add_character_modifier = { - modifier = tgp_passed_palace_exam_modifier - } - create_character_memory = { - type = passed_metropolitan_exam_memory - } - create_character_memory = { - type = passed_palace_exam_memory - } - # Notify close family members - every_close_family_member = { - # House head is notified separately - limit = { is_house_head = no } - send_interface_message = { - type = event_msg_merit_effect_good - title = palace_exam_close_family_passed - right_icon = root - desc = msg_palace_exam_close_family_passed_desc - } - } - } - else_if = { - limit = { - is_in_guest_subset = { name = entrants } - } - save_temporary_scope_as = temp_scope - add_character_flag = passed_metropolitan_exam - add_character_modifier = { - modifier = tgp_passed_metropolitan_exam_modifier - } - if = { - limit = { - # Let's give metropolitan entrants the chance to pass Palace as well. - is_ai = yes - is_lowborn = no - # We don't mess with any player families - NOT = { - any_close_or_extended_family_member = { is_ai = no } - } - } - random = { - chance = 20 - add_character_flag = passed_palace_exam - add_character_modifier = { - modifier = tgp_passed_palace_exam_modifier - } - change_merit = empire_starting_merit_value - } - } - create_character_memory = { - type = passed_metropolitan_exam_memory - } - # Notify close family members - every_close_family_member = { - # House head is notified separately - limit = { is_house_head = no } - send_interface_message = { - type = event_msg_merit_effect_good - title = metropolitan_exam_close_family_passed - right_icon = root - desc = msg_metropolitan_exam_close_family_passed_desc - } - } - } - #Remove failed_imperial_examination flags for those who have it - if = { - limit = { - has_character_flag = failed_imperial_examination - } - remove_character_flag = failed_imperial_examination - } - if = { - limit = { - has_character_flag = exam_cheat_intent - has_none_of_variables = { - name = been_caught_cheating - name = been_caught_cheating_longterm - } - government_allows = merit - } - add_secret = { - target = scope:host - type = secret_exam_cheater - } - } - } - #Failees - else = { - if = { - limit = { is_ai = no } - #Record it - involved_activity = { - add_activity_log_entry = { - key = imperial_examination_entrant_rewards - score = 80 - tags = { completed } - show_in_conclusion = yes - character = scope:entrant - location = scope:entrant.location - scope:entrant = { - #Dwindling influence & merit for failees - change_influence = imperial_examination_failee_influence_reward_value - change_merit = imperial_examination_failee_merit_reward_value - # Gain Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_loss - } - } - failee_chance_to_gain_elder_effect = yes - } - } - } - else = { - #Dwindling influence & merit for failees - change_influence = imperial_examination_failee_influence_reward_value - change_merit = imperial_examination_failee_merit_reward_value - involved_activity = { - failee_chance_to_gain_elder_effect = yes - } - # Gain Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_loss - } - } - #Set "failed examination" flags - add_character_flag = failed_imperial_examination - create_character_memory = { - type = failed_metropolitan_exam_memory - } - # Notify close family members - every_close_family_member = { - # House head is notified separately - limit = { is_house_head = no } - send_interface_message = { - type = event_msg_merit_effect_bad - title = metropolitan_exam_close_family_failed - right_icon = root - desc = msg_metropolitan_exam_close_family_failed_desc - } - } - } - scope:entrant = { add_to_list = exam_entrants } -} - -local_examination_disburse_activity_entrant_rewards = { - save_temporary_scope_as = entrant - #This variable is set to track the loc we show players when notifying them of their family's results. - - #Cheaters - if = { - limit = { has_variable = been_caught_cheating_longterm } - #No influence for cheaters - change_merit = { - value = imperial_examination_merit_base_reward_value - multiply = 0.1 - } - } - #Entrants - else_if = { - limit = { - is_in_guest_subset = { name = entrants } - } - #Influence based on your score - if = { - limit = { is_ai = no } - #Record it - involved_activity = { - add_activity_log_entry = { - key = imperial_examination_entrant_rewards - score = 80 - tags = { completed } - show_in_conclusion = yes - character = scope:entrant - location = scope:entrant.location - scope:entrant = { - change_influence = local_examination_entrant_influence_reward_value - #Merit based on your score - change_merit = local_examination_merit_base_reward_value - # Gain Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_gain - } - } - } - } - } - else = { - change_influence = local_examination_entrant_influence_reward_value - #Merit based on your score - change_merit = local_examination_merit_base_reward_value - # Gain Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_gain - } - } - - #Save flags - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_passed_provincial_exam_modifier - } - #Create memory of passing the exam - create_character_memory = { - type = passed_provincial_exam_memory - } - ordered_memory = { - order_by = memory_creation_date - set_variable = { name = location value = memory_owner.location } - } - #Send interface_message to relevant chars to notify them - every_close_family_member = { - send_interface_message = { - type = event_msg_merit_effect_good - title = provincial_exam_close_family_passed - right_icon = root - desc = msg_provincial_exam_close_family_passed_desc - } - } - if = { - limit = { - has_character_flag = exam_cheat_intent - has_none_of_variables = { - name = been_caught_cheating - name = been_caught_cheating_longterm - } - government_allows = merit - } - add_secret = { - target = scope:host - type = secret_exam_cheater - } - } - } - #Failees - else = { - if = { - limit = { is_ai = no } - #Record it - involved_activity = { - add_activity_log_entry = { - key = imperial_examination_entrant_rewards - score = 80 - tags = { completed } - show_in_conclusion = yes - character = scope:entrant - location = scope:entrant.location - scope:entrant = { - #Dwindling influence & merit for failees - change_influence = imperial_examination_failee_influence_reward_value - change_merit = imperial_examination_failee_merit_reward_value - # Lose Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_loss - } - } - failee_chance_to_gain_elder_effect = yes - } - } - } - else = { - #Dwindling influence & merit for failees - change_influence = imperial_examination_failee_influence_reward_value - change_merit = imperial_examination_failee_merit_reward_value - involved_activity = { - failee_chance_to_gain_elder_effect = yes - } - # Lose Prestige if you have the relevant flag - if = { - limit = { has_character_flag = examination_prestige_reward } - remove_character_flag = examination_prestige_reward - add_prestige = major_prestige_loss - } - } - create_character_memory = { - type = failed_provincial_exam_memory - } - ordered_memory = { - order_by = memory_creation_date - set_variable = { name = location value = memory_owner.location } - } - #Send interface_message to relevant chars to notify them - every_close_family_member = { - send_interface_message = { - type = event_msg_merit_effect_bad - title = provincial_exam_close_family_failed - right_icon = root - desc = msg_provincial_exam_close_family_failed_desc - } - } - } - # Everyone should get Confucian Education XP - if = { - limit = { - NOT = { has_trait = confucian_education } - } - add_trait = confucian_education - } - add_trait_xp = { - trait = confucian_education - value = { - value = lifestyle_confucian_education_xp_gain_minor_value - #High Score - if = { - limit = { has_perfect_score_trigger = { SCORE_VAR = imperial_examination_score } } - multiply = 3 - } - #Good Score - else_if = { - limit = { has_good_score_trigger = { SCORE_VAR = imperial_examination_score } } - multiply = 1.5 - } - #Poor Score - else_if = { - limit = { has_questionable_score_trigger = { SCORE_VAR = imperial_examination_score } } - multiply = 0.8 - } - } - } - scope:entrant = { - add_to_list = exam_entrants - } -} - -#a chance to set an elder/disciple relation between examiners and failees -failee_chance_to_gain_elder_effect = { - random = { - chance = { - value = 25 - scope:entrant = { - every_held_title = { - add = 5 - } - if = { - limit = { - # No Elders for known cheaters - has_character_flag = been_caught_cheating - } - add = -25 - } - } - } - random_guest_subset = { - name = imperial_examiners - limit = { - merit > scope:entrant.merit - } - weight = { - base = 100 - modifier = { - any_relation = { - type = disciple - count > 0 - } - # even out the distribution of disciples - add = { - every_relation = { - type = disciple - add = -5 - } - } - } - } - save_scope_as = elder - set_elder_relation_effect = { - ELDER = scope:elder - DISCIPLE = scope:entrant - MERIT = minor_merit_gain - } - scope:entrant = { add_character_flag = exam_got_elder } - } - } -} - -imperial_examination_create_appropriate_examiner_effect = { - scope:activity.activity_location = { save_scope_as = location } - if = { - limit = { - scope:host = { - involved_activity = { has_activity_type = activity_imperial_examination } - } - } - if = { - limit = { - scope:activity = { activity_is_martial_focus_trigger = yes } - } - create_character = { - template = tgp_examiner_martial_template - location = scope:location - save_scope_as = new_examiner - } - } - else_if = { - limit = { - scope:activity = { activity_is_stewardship_focus_trigger = yes } - } - create_character = { - template = tgp_examiner_stewardship_template - location = scope:location - save_scope_as = new_examiner - } - } - else = { - create_character = { - template = tgp_examiner_learning_template - location = scope:location - save_scope_as = new_examiner - } - } - } - else = { - create_character = { - template = tgp_examiner_learning_template - location = scope:location - save_scope_as = new_examiner - } - } -} - -#Grab any eligible examiners, pre-Activity -imperial_examination_set_up_examiners_effect = { - scope:activity.activity_location = { save_scope_as = location } - #Got anyone else we can invite to be an examiner? - $HOST$ = { - ordered_courtier = { - limit = { - has_trait = confucian_education - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - is_available_imperial_examiner_trigger = { ATTENDING_CHAR = $HOST$ } - #It's not one of our dedicated examiners - save_temporary_scope_as = char_check - scope:activity = { - NOT = { - is_target_in_variable_list = { - name = imperial_examiners_list - target = scope:char_check - } - } - } - } - order_by = imperial_examination_entry_value - max = examiners_amount - check_range_bounds = no #Don't care if this is 0 - save_temporary_scope_as = temp_char - #Yes we do it this way to pull in people who might not be interested in being Entrants - scope:activity = { - add_to_variable_list = { - name = imperial_examiners_list - target = scope:temp_char - } - } - } - } - #Check for available landed rulers visiting the event (AI only) - if = { - limit = { - scope:activity = { - OR = { - NOT = { has_variable_list = imperial_examiners_list } - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - } - } - #List exists - scope:activity = { - if = { - limit = { - has_variable_list = imperial_examiners_list - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - while = { - limit = { - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - any_attending_character = { - location = scope:location - this != scope:host - is_ai = yes - tgp_gender_can_be_exam_entrant_trigger = yes - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - } - } - random_attending_character = { - limit = { - location = scope:location - is_ai = yes - this != scope:host - tgp_gender_can_be_exam_entrant_trigger = yes - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - } - save_scope_as = new_examiner - } - #Yes we do it this way to pull in people who might not be interested in being Entrants - add_to_variable_list = { - name = imperial_examiners_list - target = scope:new_examiner - } - } - } - #List doesn't exist - else = { - while = { - count = examiners_amount - limit = { - any_attending_character = { - location = scope:activity.activity_location - is_ai = yes - #tgp_gender_can_be_exam_entrant_trigger = yes - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - } - } - random_attending_character = { - limit = { - location = scope:activity.activity_location - is_ai = yes - #tgp_gender_can_be_exam_entrant_trigger = yes - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - } - save_scope_as = new_examiner - } - #Yes we do it this way to pull in people who might not be interested in being Entrants - add_to_variable_list = { - name = imperial_examiners_list - target = scope:new_examiner - } - } - } - } - } - - #Check for available pool examiners first - if = { - limit = { - scope:activity = { - OR = { - NOT = { has_variable_list = imperial_examiners_list } - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - } - } - #List exists - if = { - limit = { - scope:activity = { - has_variable_list = imperial_examiners_list - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - } - while = { - limit = { - scope:activity = { - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - any_pool_character = { - province = scope:location - has_trait = confucian_education - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - is_available_imperial_examiner_trigger = { ATTENDING_CHAR = $HOST$ } - } - } - random_pool_character = { - province = scope:location - limit = { - has_trait = confucian_education - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - is_available_imperial_examiner_trigger = { ATTENDING_CHAR = $HOST$ } - } - save_scope_as = new_examiner - #Add as courtier, if possible - if = { - limit = { - NOT = { is_courtier_of = $HOST$ } - } - $HOST$ = { add_courtier = scope:new_examiner } - } - } - #Yes we do it this way to pull in people who might not be interested in being Entrants - scope:activity = { - add_to_variable_list = { - name = imperial_examiners_list - target = scope:new_examiner - } - } - } - } - #List doesn't exist - else = { - while = { - count = examiners_amount - limit = { - any_pool_character = { - province = scope:location - has_trait = confucian_education - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - is_available_imperial_examiner_trigger = { ATTENDING_CHAR = $HOST$ } - } - } - random_pool_character = { - province = scope:location - limit = { - has_trait = confucian_education - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - has_character_flag = passed_metropolitan_exam - } - trigger_else = { - has_character_flag = passed_provincial_exam - } - is_available_imperial_examiner_trigger = { ATTENDING_CHAR = $HOST$ } - } - save_scope_as = new_examiner - #Add as courtier, if possible - if = { - limit = { - NOT = { is_courtier_of = $HOST$ } - } - $HOST$ = { add_courtier = scope:new_examiner } - } - } - #Yes we do it this way to pull in people who might not be interested in being Entrants - scope:activity = { - add_to_variable_list = { - name = imperial_examiners_list - target = scope:new_examiner - } - } - } - } - } - #Then start creating them - if = { - limit = { - scope:activity = { - OR = { - NOT = { has_variable_list = imperial_examiners_list } - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - } - } - #List exists - if = { - limit = { - scope:activity = { - has_variable_list = imperial_examiners_list - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - } - while = { - limit = { - scope:activity = { - variable_list_size = { - name = imperial_examiners_list - value < examiners_amount - } - } - } - imperial_examination_create_appropriate_examiner_effect = yes - scope:new_examiner = { - if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - add_character_flag = passed_metropolitan_exam - add_character_modifier = { - modifier = tgp_passed_metropolitan_exam_modifier - } - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_passed_provincial_exam_modifier - } - } - else = { - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_passed_provincial_exam_modifier - } - } - } - $HOST$ = { add_courtier = scope:new_examiner } - scope:activity = { - add_to_variable_list = { - name = imperial_examiners_list - target = scope:new_examiner - } - } - } - } - #List doesn't exist - else = { - while = { - count = examiners_amount - imperial_examination_create_appropriate_examiner_effect = yes - scope:new_examiner = { - if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - add_character_flag = passed_metropolitan_exam - add_character_modifier = { - modifier = tgp_passed_metropolitan_exam_modifier - } - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_passed_provincial_exam_modifier - } - } - else = { - add_character_flag = passed_provincial_exam - add_character_modifier = { - modifier = tgp_passed_provincial_exam_modifier - } - } - } - $HOST$ = { add_courtier = scope:new_examiner } - scope:activity = { - add_to_variable_list = { - name = imperial_examiners_list - target = scope:new_examiner - } - } - } - } - } - #Add 'em to the activity - every_in_list = { - variable = imperial_examiners_list - limit = { - NOR = { - exists = involved_activity - scope:activity = { - any_attending_character = { this = scope:new_examiner } - } - any_invited_activity = { this = scope:activity } - } - } - add_to_activity = scope:activity - } -} - -#When the Activity is concluded -imperial_examination_clean_up_variables_effect = { - #Exams - remove_variable ?= had_essay_examination - remove_variable ?= had_classics_examination - remove_variable ?= had_poetry_examination - remove_variable ?= had_archery_examination - remove_variable ?= had_polearm_examination - remove_variable ?= had_riding_examination - remove_variable ?= been_caught_cheating - remove_variable ?= been_caught_cheating_longterm - remove_variable ?= imperial_examination_score - remove_variable ?= temporary_exam_score - remove_variable ?= discovering_examiner - remove_character_flag ?= exam_cheat_intent - remove_character_flag ?= exam_perform_intent - remove_character_flag ?= set_activity_intent - remove_variable ?= has_perfect_score - remove_variable ?= has_great_score - remove_variable ?= has_decent_score - remove_variable ?= has_questionable_score - remove_variable ?= your_exam_position - #Cheats - remove_variable ?= has_exam_taker - remove_variable ?= has_bribed_examiner - remove_variable ?= has_blackmailed_examiner - remove_variable ?= has_planted_answers - remove_variable ?= parent_has_bribed_examiner - #Advantages - remove_variable ?= has_exam_advantage - remove_variable ?= has_stayed_up_studying - remove_variable ?= has_studied_with_friend - #Palace Flags - remove_character_flag ?= palace_success - remove_character_flag ?= palace_great_success - remove_character_flag ?= palace_critical_success - remove_character_flag ?= safe_start -} - -#Run at the beginning of the Activity -imperial_examination_gather_examiners_effect = { - scope:activity = { - every_attending_character = { - limit = { - scope:activity = { - is_target_in_variable_list = { - name = imperial_examiners_list - target = prev - } - } - } - save_temporary_scope_as = temp_char - scope:temp_char = { - add_character_flag = imperial_examiner - } - scope:activity = { - add_to_guest_subset = { - name = imperial_examiners - target = scope:temp_char - } - } - } - } -} - -imperial_examination_gather_guests_effect = { - scope:activity = { - every_attending_character = { - limit = { - # You should get as many shots at the Palace Exam as you want. - has_character_flag = passed_palace_exam - NOR = { - this = scope:host - is_in_guest_subset = { name = imperial_examiners } - is_in_guest_subset = { name = entrants } - } - } - save_temporary_scope_as = temp_character - scope:activity = { - add_to_guest_subset = { - name = guests - target = scope:temp_character - } - } - } - } -} - -imperial_examination_gather_entrants_effect = { - scope:activity = { - set_variable = { - name = num_initial_entrants - value = 0 - } - every_attending_character = { - limit = { - is_landed = no - tgp_gender_can_be_exam_entrant_trigger = yes - trigger_if = { - limit = { - exists = primary_title - } - primary_title = { - is_mercenary_company = no - is_holy_order = no - } - } - NOR = { - this = scope:host - is_in_guest_subset = { name = imperial_examiners } - # If you are a player, you should get as many shots at the Palace Exam as you want. - has_character_flag = passed_palace_exam - has_trait = devoted - has_trait = eunuch - } - is_adult = yes - } - save_temporary_scope_as = temp_character - scope:activity = { - add_to_guest_subset = { - name = entrants - target = scope:temp_character - } - } - set_variable = { - name = imperial_examination_score - value = imperial_examination_score_value - } - if = { - limit = { - is_ai = yes - } - set_activity_intent = imperial_exam_taker_intent - } - } - #Run seperately to make sure we include characters added to the entrants subset through edge cases. - every_guest_subset = { - name = entrants - #Record the initial amount of entrants - scope:activity = { - change_variable = { - name = num_initial_entrants - add = 1 - } - } - } - #Set the base amount of failees we expect during the entire activity - set_variable = { - name = failee_quota - value = imperial_examination_failee_quota_value - } - if = { limit = { exists = var:failee_quota } } - } -} - -local_examination_gather_entrants_effect = { - scope:activity = { - set_variable = { - name = num_initial_entrants - value = 0 - } - every_attending_character = { - limit = { - is_landed = no - tgp_gender_can_be_exam_entrant_trigger = yes - trigger_if = { - limit = { - exists = primary_title - } - primary_title = { - is_mercenary_company = no - is_holy_order = no - } - } - NOR = { - this = scope:host - is_in_guest_subset = { name = imperial_examiners } - # You have passed the any of the higher level exams - has_character_flag = passed_metropolitan_exam - # You have already passed the Provincial - has_character_flag = passed_provincial_exam - has_trait = devoted - has_trait = eunuch - } - is_adult = yes - } - save_temporary_scope_as = temp_character - scope:activity = { - add_to_guest_subset = { - name = entrants - target = scope:temp_character - } - } - set_variable = { - name = imperial_examination_score - value = imperial_examination_score_value - } - if = { - limit = { - is_ai = yes - } - set_activity_intent = local_exam_taker_intent - } - } - #Run seperately to make sure we include characters added to the entrants subset through edge cases. - every_guest_subset = { - name = entrants - scope:activity = { - change_variable = { - name = num_initial_entrants - add = 1 - } - } - } - #Set the base amount of failees we expect during the entire activity - set_variable = { - name = failee_quota - value = imperial_examination_failee_quota_value - } - if = { limit = { exists = var:failee_quota } } - } -} - -imperial_examination_gather_stray_entrants_effect = { - if = { - # Before we add anyone to the activity, we have to make sure it is not already full. - limit = { - scope:activity = { - OR = { - AND = { - has_activity_option = { - category = imperial_examination_breadth - option = imperial_examination_breadth_exclusive - } - any_attending_character = { - count < exclusive_exam_guests_full_calc - } - } - AND = { - has_activity_option = { - category = imperial_examination_breadth - option = imperial_examination_breadth_restricted - } - any_attending_character = { - count < restricted_exam_guests_full_calc - } - } - AND = { - has_activity_option = { - category = imperial_examination_breadth - option = imperial_examination_breadth_open - } - any_attending_character = { - count < open_exam_guests_full_calc - } - } - } - } - } - every_courtier = { - limit = { - involved_activity ?= scope:activity - this != root - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - NOT = { has_character_flag = passed_palace_exam} - } - trigger_else = { - has_none_of_variables = { - name = passed_provincial_exam - name = passed_metropolitan_exam - } - } - # To make sure no characters appear that shouldn't. - NOR = { - has_trait = devoted - has_trait = eunuch - } - tgp_gender_can_be_exam_entrant_trigger = yes - } - add_to_list = entourage_entrants - } - current_travel_plan ?= { - every_entourage_character = { - limit = { - this != root - is_landed = no - trigger_if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - NOT = { has_character_flag = passed_palace_exam } - } - trigger_else = { - has_none_of_variables = { - name = passed_provincial_exam - name = passed_metropolitan_exam - } - } - # To make sure no characters appear that shouldn't. - NOR = { - has_trait = devoted - has_trait = eunuch - } - trigger_if = { - limit = { - exists = primary_title - } - primary_title = { - is_mercenary_company = no - is_holy_order = no - } - } - tgp_gender_can_be_exam_entrant_trigger = yes - } - add_to_list = entourage_entrants - } - } - every_in_list = { - list = entourage_entrants - if = { - limit = { - NOT = { - involved_activity ?= scope:activity - } - location = scope:activity.activity_location - can_join_activity = scope:activity - } - add_to_activity_without_travel = scope:activity - } - if = { - limit = { - involved_activity ?= scope:activity - } - scope:activity = { - add_to_guest_subset = { - name = entrants - target = prev - } - } - set_variable = { - name = imperial_examination_score - value = imperial_examination_score_value - } - } - } - } -} - -metropolitan_examination_scoreboard_setup_effect = { - #Do we actually have 10 entrants for the scoreboard? - set_variable = { - name = scoreboard_size - value = 0 - } - if = { - limit = { - any_guest_subset = { - name = entrants - count >= 10 - } - } - change_variable = { - name = scoreboard_size - add = 10 - } - } - #Otherwise set the scoreboard size to the amount of entrants - else = { - every_guest_subset = { - name = entrants - scope:activity = { - change_variable = { - name = scoreboard_size - add = 1 - } - } - } - } - #Add the fresh entrants to the scoreboard - every_attending_character = { - limit = { - is_in_guest_subset = { name = entrants } - NOR = { - is_in_guest_subset = { name = scoreboard } - scope:activity = { - any_guest_subset = { - name = scoreboard - count = scope:activity.var:scoreboard_size - } - } - } - } - save_temporary_scope_as = temp_character - scope:activity = { - add_to_guest_subset = { - name = scoreboard - target = scope:temp_character - } - } - } -} - -palace_examination_scoreboard_setup_effect = { - #Do we actually have 10 entrants for the scoreboard? - set_variable = { - name = scoreboard_size - value = 0 - } - if = { - limit = { - any_guest_subset = { - name = palace_entrants - count >= 10 - } - } - change_variable = { - name = scoreboard_size - add = 10 - } - } - #Otherwise set the scoreboard size to the amount of entrants - else = { - every_guest_subset = { - name = palace_entrants - scope:activity = { - change_variable = { - name = scoreboard_size - add = 1 - } - } - } - } - #Add the fresh entrants to the scoreboard - every_attending_character = { - limit = { - is_in_guest_subset = { name = palace_entrants } - NOR = { - is_in_guest_subset = { name = scoreboard } - scope:activity = { - any_guest_subset = { - name = scoreboard - count = scope:activity.var:scoreboard_size - } - } - } - } - save_temporary_scope_as = temp_character - scope:activity = { - add_to_guest_subset = { - name = scoreboard - target = scope:temp_character - } - } - } -} - - -#Run at the end of each Phase -imperial_examination_determine_exam_outcome_effect = { - #Get the people in the last place and fail them - scope:activity = { - #Account for the cheating AI entrants - every_guest_subset = { - name = entrants - limit = { has_variable = been_caught_cheating } - set_variable = failee_to_be_removed - } - #Otherwise run through the list and trim it from the bottom up - if = { - limit = { imperial_examination_failee_quota_value > 0 } - ordered_guest_subset = { - name = entrants - limit = { - NOT = { has_variable = failee_to_be_removed } - } - order_by = { - value = temporary_exam_score_value - multiply = -1 - } - max = imperial_examination_failee_quota_value - check_range_bounds = no - set_variable = failee_to_be_removed - } - } - # Check how many successful entrants we have with a martial education. - if = { - limit = { - any_guest_subset = { - name = entrants - count < { - value = 20 - if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - add = 20 - } - } - has_trait = education_martial - NOT = { has_variable = failee_to_be_removed } - } - } - # If we don't have enough, let some of the failees pass. - ordered_guest_subset = { - name = entrants - check_range_bounds = no - limit = { - has_trait = education_martial - has_variable = failee_to_be_removed - is_ai = yes - } - order_by = { - value = temporary_exam_score_value - } - max = { - if = { - limit = { - scope:activity = { - has_activity_type = activity_imperial_examination - } - } - value = 20 - } - else = { - value = 3 - } - } - remove_variable = failee_to_be_removed - change_merit = { 100 150 } - } - } - } -} - -imperial_examination_prune_failees_effect = { - if = { - limit = { has_variable = failee_to_be_removed } - save_temporary_scope_as = temp_char - #Don't fail players - if = { - limit = { is_ai = yes } - scope:activity = { - remove_from_guest_subset = { - name = entrants - target = scope:temp_char - } - add_to_guest_subset = { - name = failees - target = scope:temp_char - } - } - } - remove_variable ?= failee_to_be_removed - } -} - -#After each Phase -imperial_examination_clean_up_phase_variables_effect = { - scope:activity = { - every_attending_character = { - #Exams - remove_variable ?= had_essay_examination - remove_variable ?= had_classics_examination - remove_variable ?= had_poetry_examination - remove_variable ?= been_caught_cheating - #Cheats - remove_variable ?= has_exam_taker - remove_variable ?= has_bribed_examiner - #Advantages - remove_variable ?= has_exam_advantage - remove_variable ?= has_stayed_up_studying - remove_variable ?= has_studied_with_friend - #Events - remove_variable ?= has_greeted_palace_entrants - } - } -} - -imperial_examination_guest_sort_effect = { - save_scope_value_as = { - name = exam_invited_guests_amount - value = { - value = 0 - add = exam_invited_guests_amount_calc - } - } - while = { - count = scope:exam_invited_guests_amount - random_in_list = { - list = potential_exam_guest_list - limit = { - NOT = { is_in_list = characters } - } - add_to_list = characters - } - } -} - -imperial_examination_entrants_sort_effect = { - save_scope_value_as = { - name = exam_invited_guests_amount - value = { - value = 0 - add = exam_invited_entrants_amount_calc - } - } - while = { - count = scope:exam_invited_guests_amount - random_in_list = { - list = potential_exam_entrants_list - limit = { - NOT = { is_in_list = characters } - } - add_to_list = characters - } - } -} - -examination_clear_timeout_effect = { - if = { # If we still have a short duration remaining on our appointment timeout, clear it - limit = { - appointment_timeout_days > 0 - appointment_timeout_days < 365 - } - clear_appointment_timeout = yes - } -} - -imperial_examination_grab_nr_of_family_entrants_effect = { - set_variable = { - name = num_exam_family_entrants - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - root = { - change_variable = { - name = num_exam_family_entrants - add = 1 - } - } - } - # Then measure how many characters did pass the exam - set_variable = { - name = num_exam_family_entrants_passed - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - limit = { - has_variable = { - name = passed_palace_exam - name = passed_metropolitan_exam - } - } - root = { - change_variable = { - name = num_exam_family_entrants_passed - add = 1 - } - } - } - # More specifically, how many passed the Metropolitan exam - set_variable = { - name = num_exam_family_passed_metropolitan - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - limit = { - has_character_flag = passed_metropolitan_exam - NOT = { has_character_flag = passed_palace_exam } - } - root = { - change_variable = { - name = num_exam_family_passed_metropolitan - add = 1 - } - } - } - # And how many made it to the Palace exam - set_variable = { - name = num_exam_family_passed_palace - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - limit = { - has_character_flag = passed_palace_exam - } - root = { - change_variable = { - name = num_exam_family_passed_palace - add = 1 - } - } - } - # Finally, how many did bitterly disappoint... - set_variable = { - name = num_exam_family_entrants_failed - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - limit = { has_character_flag = failed_imperial_examination } - root = { - change_variable = { - name = num_exam_family_entrants_failed - add = 1 - } - } - } -} - -local_examination_grab_nr_of_family_entrants_effect = { - set_variable = { - name = num_exam_family_entrants - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - root = { - change_variable = { - name = num_exam_family_entrants - add = 1 - } - } - } - # Then measure how many characters did pass the exam - set_variable = { - name = num_exam_family_entrants_passed - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - limit = { has_character_flag = passed_provincial_exam } - root = { - change_variable = { - name = num_exam_family_entrants_passed - add = 1 - } - } - } - # Finally, how many did bitterly disappoint... - set_variable = { - name = num_exam_family_entrants_failed - value = 0 - } - every_in_list = { - list = parent_relevant_entrants - limit = { - NOT = { has_character_flag = passed_provincial_exam } - } - root = { - change_variable = { - name = num_exam_family_entrants_failed - add = 1 - } - } - } -} - -exam_grab_entrant_position_effect = { - scope:activity = { - every_attending_character = { - limit = { - exists = var:imperial_examination_score - var:imperial_examination_score >= root.var:imperial_examination_score - } - add_to_list = exam_position_list - } - } - set_variable = { - name = your_exam_position - value = list_size:exam_position_list - } -} diff --git a/common/scripted_effects/tgp_mandala_scripted_effects.txt b/common/scripted_effects/tgp_mandala_scripted_effects.txt deleted file mode 100644 index aba69805d..000000000 --- a/common/scripted_effects/tgp_mandala_scripted_effects.txt +++ /dev/null @@ -1,3777 +0,0 @@ - - - -##Mandala Capital Great Project Contribution Rewards -mandala_owner_reward_01_effect = { - add_prestige = major_prestige_value - dynasty = { add_dynasty_prestige = major_dynasty_prestige_gain } - add_legitimacy = medium_legitimacy_gain -} - -mandala_contributor_reward_effect = { - add_prestige = major_prestige_value - add_legitimacy = miniscule_legitimacy_gain -} - -mandala_contributor_opinion_reward_effect = { - $OVERLORD$ = { save_scope_as = overlord_scope } - add_prestige = major_prestige_value - add_legitimacy = miniscule_legitimacy_gain -} - -gather_contributors_in_list_effect = { - every_contribution = { - limit = { contribution_is_funded = yes } - contributor = { - if = { - limit = { - scope:great_project = { - trigger_if = { - limit = { has_variable = plundered_contributors } - NOT = { - is_target_in_variable_list = { - name = plundered_contributors - target = prev - } - } - } - } - } - add_to_list = contributors_to_reward - } - } - } -} - -determine_if_contributed_and_save_scope_effect = { - scope:great_project = { - if = { - limit = { - any_contribution = { - contribution_id = $CONTRIBUTION$ - contribution_is_funded = yes - } - } - every_contribution = { - limit = { - contribution_id = $CONTRIBUTION$ - contribution_is_funded = yes - } - contributor = { - if = { - limit = { - is_alive = no - house = scope:owner.house - } - scope:owner = { save_scope_as = contributed_$CONTRIBUTION$ } - } - else = { - save_scope_as = contributed_$CONTRIBUTION$ - } - } - } - } - } -} - - -### Capital 01 Breakdown Effects ### -mandala_contributor_minor_rite_reward_effect = { - add_legitimacy = mandala_contribution_minor_legitimacy_reward - add_piety_experience = mandala_contribution_medium_piety_reward -} -contributed_rites_of_worthiness_effect = { - custom_description_no_bullet = { text = contributed_rite_of_worthiness } - mandala_contributor_minor_rite_reward_effect = yes -} - -mandala_contributor_slabs_of_sandstone_reward_effect = { add_prestige = mandala_contribution_major_prestige_reward } -contributed_slabs_of_sandstone_effect = { - custom_description_no_bullet = { text = contributed_slabs_of_sandstone } - mandala_contributor_slabs_of_sandstone_reward_effect = yes -} - -mandala_contributor_laterite_blocks_reward_effect = { - add_prestige = mandala_contribution_medium_prestige_reward - add_piety_experience = medium_piety_value -} -contributed_laterite_blocks_effect = { - custom_description_no_bullet = { text = contributed_laterite_blocks } - mandala_contributor_laterite_blocks_reward_effect = yes -} - -mandala_contributor_timber_reward_effect = { add_prestige_experience = mandala_contribution_minor_prestige_reward } -contributed_timber_effect = { - custom_description_no_bullet = { text = contributed_timber } - mandala_contributor_timber_reward_effect = yes -} - -mandala_contributor_work_force_reward_effect = { - add_character_modifier = { - modifier = mandala_strong_workers_modifier - years = 15 - } -} -contributed_work_force_effect = { - custom_description_no_bullet = { text = contributed_work_force } - mandala_contributor_work_force_reward_effect = yes -} - -mandala_contributor_woodcarvings_reward_effect = { - add_legitimacy = { - value = { - add = mandala_contribution_minor_legitimacy_reward - multiply = 1.5 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } -} -contributed_woodcarvings_effect = { - custom_description_no_bullet = { text = contributed_woodcarvings } - mandala_contributor_woodcarvings_reward_effect = yes -} - -mandala_contributor_sanctified_domes_reward_effect = { - custom_tooltip = mandala_contributor_sanctified_domes_reward_effect_tt - if = { - limit = { this != scope:owner } - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.5 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } - } - hidden_effect = { - scope:owner.dynasty = { - add_dynasty_modifier = { modifier = mandala_sanctified_domes_dynasty_modifier } - } - } -} -contributed_sanctified_domes_effect = { - custom_description_no_bullet = { text = contributed_sanctified_domes } - mandala_contributor_sanctified_domes_reward_effect = yes -} - -mandala_contributor_ornate_reliefs_reward_effect = { - if = { - limit = { this = scope:owner } - if = { - limit = { exists = scope:province } - scope:province = { - add_province_modifier = { modifier = mandala_ornate_reliefs_tax_province_modifier } - } - } - else = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_ornate_reliefs_tax_province_modifier } - } - } - } - else = { - add_character_modifier = { - modifier = mandala_ornate_reliefs_tax_modifier - years = 10 - } - } -} -contributed_ornate_reliefs_effect = { - custom_description_no_bullet = { text = contributed_ornate_reliefs } - mandala_contributor_ornate_reliefs_reward_effect = yes -} - -mandala_contributor_family_shrine_reward_effect = { - dynasty ?= { add_dynasty_prestige = medium_dynasty_prestige_value } - player_heir ?= { add_piety_experience = medium_piety_value } -} -contributed_family_shrine_effect = { - custom_description_no_bullet = { text = contributed_family_shrine } - mandala_contributor_family_shrine_reward_effect = yes -} - -#The actual effect -check_and_reward_contributions_01_effect = { - if = { - limit = { scope:contributed_rite_of_worthiness ?= root } - contributed_rites_of_worthiness_effect = yes - } - if = { - limit = { scope:contributed_slabs_of_sandstone ?= root } - contributed_slabs_of_sandstone_effect = yes - } - if = { - limit = { scope:contributed_laterite_blocks ?= root } - contributed_laterite_blocks_effect = yes - } - if = { - limit = { scope:contributed_timber ?= root } - contributed_timber_effect = yes - } - if = { - limit = { scope:contributed_work_force ?= root } - contributed_work_force_effect = yes - } - if = { - limit = { scope:contributed_woodcarvings ?= root } - contributed_woodcarvings_effect = yes - } - if = { - limit = { scope:contributed_sanctified_domes ?= root } - contributed_sanctified_domes_effect = yes - } - if = { - limit = { scope:contributed_ornate_reliefs ?= root } - contributed_ornate_reliefs_effect = yes - } - if = { - limit = { scope:contributed_family_shrine ?= root } - contributed_family_shrine_effect = yes - } -} - - -### Capital 02 Breakdown Effects ### - -#mandala_contributor_minor_rite_reward_effect Reused from Capital 01 -#contributed_rites_of_worthiness_effect Reused from Capital 01 - -mandala_contributor_brick_reward_effect = { add_prestige = mandala_contribution_major_prestige_reward } -contributed_brick_effect = { - custom_description_no_bullet = { text = contributed_brick } - mandala_contributor_brick_reward_effect = yes -} - -mandala_contributor_tiles_reward_effect = { - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.5 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } - add_piety_experience = mandala_contribution_medium_piety_reward -} -contributed_tiles_effect = { - custom_description_no_bullet = { text = contributed_tiles } - mandala_contributor_tiles_reward_effect = yes -} - -mandala_contributor_shallow_pools_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.5 - } - } - } - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_shallow_pools_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_shallow_pools_defense_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_shallow_pools_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_shallow_pools_defense_modifier } - } - } - } -} -contributed_shallow_pools_effect = { - custom_description_no_bullet = { text = contributed_shallow_pools } - mandala_contributor_shallow_pools_reward_effect = yes -} - -#mandala_contributor_work_force_reward_effect Reused from Capital 01 -#contributed_work_force_effect Reused from Capital 01 - -mandala_contributor_decorative_tiles_reward_effect = { - add_legitimacy = { - value = { - add = mandala_contribution_minor_legitimacy_reward - multiply = 1.5 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } -} -contributed_decorative_tiles_effect = { - custom_description_no_bullet = { text = contributed_decorative_tiles } - mandala_contributor_decorative_tiles_reward_effect = yes -} - -mandala_contributor_decorated_domes_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = mandala_contribution_major_prestige_reward - } - scope:owner.dynasty = { - if = { - limit = { has_dynasty_modifier = mandala_sanctified_domes_dynasty_modifier } - scope:owner = { custom_tooltip = mandala_contributor_decorated_domes_reward_effect_tt_replaced } - hidden_effect = { - remove_dynasty_modifier = mandala_sanctified_domes_dynasty_modifier - add_dynasty_modifier = { modifier = mandala_decorated_domes_dynasty_modifier } - } - } - else = { - scope:owner = { custom_tooltip = mandala_contributor_decorated_domes_reward_effect_tt } - hidden_effect = { - add_dynasty_modifier = { modifier = mandala_decorated_domes_dynasty_modifier } - } - } - } -} -contributed_decorated_domes_effect = { - custom_description_no_bullet = { text = contributed_decorated_domes } - mandala_contributor_decorated_domes_reward_effect = yes -} - -mandala_contributor_family_statues_reward_effect = { - dynasty ?= { add_dynasty_prestige = major_dynasty_prestige_value } - player_heir ?= { - add_piety_experience = major_piety_value - } -} -contributed_family_statues_effect = { - custom_description_no_bullet = { text = contributed_family_statues } - mandala_contributor_family_statues_reward_effect = yes -} - -#The actual effect -check_and_reward_contributions_02_effect = { - if = { - limit = { scope:contributed_rite_of_worthiness ?= root } - contributed_rites_of_worthiness_effect = yes - } - if = { - limit = { scope:contributed_brick ?= root } - contributed_brick_effect = yes - } - if = { - limit = { scope:contributed_tiles ?= root } - contributed_tiles_effect = yes - } - if = { - limit = { scope:contributed_shallow_pools ?= root } - contributed_shallow_pools_effect = yes - } - if = { - limit = { scope:contributed_work_force ?= root } - contributed_work_force_effect = yes - } - if = { - limit = { scope:contributed_decorative_tiles ?= root } - contributed_decorative_tiles_effect = yes - } - if = { - limit = { scope:contributed_decorated_domes ?= root } - contributed_decorated_domes_effect = yes - } - if = { - limit = { scope:contributed_family_statues ?= root } - contributed_family_statues_effect = yes - } -} - - -### Capital 03 Breakdown Effects ### -mandala_contributor_medium_rite_reward_effect = { - add_legitimacy = mandala_contribution_medium_legitimacy_reward - add_piety_experience = mandala_contribution_major_piety_reward -} -contributed_rites_of_worthiness_02_effect = { - custom_description_no_bullet = { text = contributed_rite_of_worthiness } - mandala_contributor_medium_rite_reward_effect = yes -} - -mandala_contributor_volcanic_stone_reward_effect = { - add_prestige = { - value = { - add = mandala_contribution_major_prestige_reward - multiply = 1.25 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } -} -contributed_volcanic_stone_effect = { - custom_description_no_bullet = { text = contributed_volcanic_stone } - mandala_contributor_volcanic_stone_reward_effect = yes -} - -mandala_contributor_corbel_gateways_reward_effect = { - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.75 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } - add_piety_experience = { - value = { - add = mandala_contribution_medium_dynasty_reward - multiply = 1.75 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } -} -contributed_corbel_gateways_effect = { - custom_description_no_bullet = { text = contributed_corbel_gateways } - mandala_contributor_corbel_gateways_reward_effect = yes -} - -mandala_contributor_divine_statues_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.5 - } - } - add_piety_experience = mandala_contribution_medium_piety_reward - } - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_divine_statues_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_divine_statues_province_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_divine_statues_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_divine_statues_province_modifier } - } - } - } -} -contributed_divine_statues_effect = { - custom_description_no_bullet = { text = contributed_divine_statues } - mandala_contributor_divine_statues_reward_effect = yes -} - -#mandala_contributor_work_force_reward_effect Reused from Capital 01 -#contributed_work_force_effect Reused from Capital 01 - -mandala_contributor_creation_aspect_reward_effect = { - add_stewardship_skill = 1 - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_creation_aspect_statues_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_creation_aspect_statues_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_creation_aspect_statues_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_creation_aspect_statues_modifier } - } - } - } -} -contributed_creation_aspect_effect = { - custom_description_no_bullet = { text = contributed_creation_aspect } - mandala_contributor_creation_aspect_reward_effect = yes -} - -mandala_contributor_serenity_aspect_reward_effect = { - add_diplomacy_skill = 1 - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_serenity_aspect_statues_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_serenity_aspect_statues_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_serenity_aspect_statues_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_serenity_aspect_statues_modifier } - } - } - } -} -contributed_serenity_aspect_effect = { - custom_description_no_bullet = { text = contributed_serenity_aspect } - mandala_contributor_serenity_aspect_reward_effect = yes -} - -mandala_contributor_destruction_aspect_reward_effect = { - add_martial_skill = 1 - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_destruction_aspect_statues_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_destruction_aspect_statues_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_destruction_aspect_statues_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_destruction_aspect_statues_modifier } - } - } - } -} -contributed_destruction_aspect_effect = { - custom_description_no_bullet = { text = contributed_destruction_aspect } - mandala_contributor_destruction_aspect_reward_effect = yes -} - -mandala_contributor_trickery_aspect_reward_effect = { - add_intrigue_skill = 1 - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_trickery_aspect_statues_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_trickery_aspect_statues_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_trickery_aspect_statues_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_trickery_aspect_statues_modifier } - } - } - } -} -contributed_trickery_aspect_effect = { - custom_description_no_bullet = { text = contributed_trickery_aspect } - mandala_contributor_trickery_aspect_reward_effect = yes -} - -mandala_contributor_gilded_domes_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = mandala_contribution_major_prestige_reward - } - scope:owner.dynasty = { - if = { - limit = { has_dynasty_modifier = mandala_sanctified_domes_dynasty_modifier } - scope:owner = { custom_tooltip = mandala_contributor_sanctified_gilded_domes_reward_effect_tt_replaced } - hidden_effect = { - remove_dynasty_modifier = mandala_sanctified_domes_dynasty_modifier - add_dynasty_modifier = { modifier = mandala_gilded_domes_dynasty_modifier } - } - } - else_if = { - limit = { has_dynasty_modifier = mandala_decorated_domes_dynasty_modifier } - scope:owner = { custom_tooltip = mandala_contributor_decorated_gilded_domes_reward_effect_tt_replaced } - hidden_effect = { - remove_dynasty_modifier = mandala_decorated_domes_dynasty_modifier - add_dynasty_modifier = { modifier = mandala_gilded_domes_dynasty_modifier } - } - } - else = { - scope:owner = { custom_tooltip = mandala_contributor_gilded_domes_reward_effect_tt } - hidden_effect = { - add_dynasty_modifier = { modifier = mandala_gilded_domes_dynasty_modifier } - } - } - } -} -contributed_gilded_domes_effect = { - custom_description_no_bullet = { text = contributed_gilded_domes } - mandala_contributor_gilded_domes_reward_effect = yes -} - -mandala_contributor_family_temple_compound_reward_effect = { - dynasty ?= { add_dynasty_prestige = major_dynasty_prestige_value } - player_heir ?= { - add_piety_experience = massive_piety_value - } -} -contributed_family_temple_compound_effect = { - custom_description_no_bullet = { text = contributed_family_temple_compound } - mandala_contributor_family_temple_compound_reward_effect = yes -} - -#The actual effect -check_and_reward_contributions_03_effect = { - if = { - limit = { scope:contributed_rite_of_worthiness ?= root } - contributed_rites_of_worthiness_02_effect = yes - } - if = { - limit = { scope:contributed_volcanic_stone ?= root } - contributed_volcanic_stone_effect = yes - } - if = { - limit = { scope:contributed_corbel_gateways ?= root } - contributed_corbel_gateways_effect = yes - } - if = { - limit = { scope:contributed_divine_statues ?= root } - contributed_divine_statues_effect = yes - } - if = { - limit = { scope:contributed_work_force ?= root } - contributed_work_force_effect = yes - } - if = { - limit = { scope:contributed_creation_aspect ?= root } - contributed_creation_aspect_effect = yes - } - if = { - limit = { scope:contributed_serenity_aspect ?= root } - contributed_serenity_aspect_effect = yes - } - if = { - limit = { scope:contributed_destruction_aspect ?= root } - contributed_destruction_aspect_effect = yes - } - if = { - limit = { scope:contributed_trickery_aspect ?= root } - contributed_trickery_aspect_effect = yes - } - if = { - limit = { scope:contributed_gilded_domes ?= root } - contributed_gilded_domes_effect = yes - } - if = { - limit = { scope:contributed_family_temple_compound ?= root } - contributed_family_temple_compound_effect = yes - } -} - - -### Capital 04 Breakdown Effects ### - -#mandala_contributor_medium_rite_reward_effect Reused from Capital 03 -#contributed_rites_of_worthiness_02_effect Reused from Capital 03 - -mandala_contributor_slabs_of_granite_reward_effect = { - add_prestige = { - value = { - add = mandala_contribution_major_prestige_reward - multiply = 1.25 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } -} -contributed_slabs_of_granite_effect = { - custom_description_no_bullet = { text = contributed_slabs_of_granite } - mandala_contributor_slabs_of_granite_reward_effect = yes -} - -mandala_contributor_zaungdans_reward_effect = { - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.75 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } - add_piety_experience = { - value = { - add = mandala_contribution_medium_dynasty_reward - multiply = 1.75 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } -} -contributed_zaungdans_effect = { - custom_description_no_bullet = { text = contributed_zaungdans } - mandala_contributor_zaungdans_reward_effect = yes -} - -mandala_contributor_gilded_shrines_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.5 - } - } - add_piety_experience = mandala_contribution_medium_piety_reward - } - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_gilded_shrines_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_gilded_shrines_province_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_gilded_shrines_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_gilded_shrines_province_modifier } - } - } - } -} -contributed_gilded_shrines_effect = { - custom_description_no_bullet = { text = contributed_gilded_shrines } - mandala_contributor_gilded_shrines_reward_effect = yes -} - -#mandala_contributor_work_force_reward_effect Reused from Capital 01 -#contributed_work_force_effect Reused from Capital 01 - -mandala_contributor_bell_stupas_reward_effect = { - add_character_modifier = { modifier = mandala_bell_stupas_modifier } -} -contributed_bell_stupas_effect = { - custom_description_no_bullet = { text = contributed_bell_stupas } - mandala_contributor_bell_stupas_reward_effect = yes -} - -mandala_contributor_bejeweled_domes_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = mandala_contribution_major_prestige_reward - } - scope:owner.dynasty = { - if = { - limit = { has_dynasty_modifier = mandala_sanctified_domes_dynasty_modifier } - scope:owner = { custom_tooltip = mandala_contributor_sanctified_bejeweled_domes_reward_effect_tt_replaced } - hidden_effect = { - remove_dynasty_modifier = mandala_sanctified_domes_dynasty_modifier - add_dynasty_modifier = { modifier = mandala_bejeweled_domes_dynasty_modifier } - } - } - else_if = { - limit = { has_dynasty_modifier = mandala_decorated_domes_dynasty_modifier } - scope:owner = { custom_tooltip = mandala_contributor_decorated_bejeweled_domes_reward_effect_tt_replaced } - hidden_effect = { - remove_dynasty_modifier = mandala_decorated_domes_dynasty_modifier - add_dynasty_modifier = { modifier = mandala_bejeweled_domes_dynasty_modifier } - } - } - else_if = { - limit = { has_dynasty_modifier = mandala_gilded_domes_dynasty_modifier } - scope:owner = { custom_tooltip = mandala_contributor_gilded_bejeweled_domes_reward_effect_tt_replaced } - hidden_effect = { - remove_dynasty_modifier = mandala_gilded_domes_dynasty_modifier - add_dynasty_modifier = { modifier = mandala_bejeweled_domes_dynasty_modifier } - } - } - else = { - scope:owner = { custom_tooltip = mandala_contributor_bejeweled_domes_reward_effect_tt } - hidden_effect = { - add_dynasty_modifier = { modifier = mandala_bejeweled_domes_dynasty_modifier } - } - } - } -} -contributed_bejeweled_domes_effect = { - custom_description_no_bullet = { text = contributed_bejeweled_domes } - mandala_contributor_bejeweled_domes_reward_effect = yes -} - -mandala_contributor_family_temple_complex_reward_effect = { - dynasty = { add_dynasty_prestige = monumental_dynasty_prestige_value } - player_heir ?= { - add_piety_experience = monumental_piety_value - } -} -contributed_family_temple_complex_effect = { - custom_description_no_bullet = { text = contributed_family_temple_complex } - mandala_contributor_family_temple_complex_reward_effect = yes -} - - -#The actual effect -check_and_reward_contributions_04_effect = { - if = { - limit = { scope:contributed_rite_of_worthiness ?= root } - contributed_rites_of_worthiness_02_effect = yes - } - if = { - limit = { scope:contributed_slabs_of_granite ?= root } - contributed_slabs_of_granite_effect = yes - } - if = { - limit = { scope:contributed_zaungdans ?= root } - contributed_zaungdans_effect = yes - } - if = { - limit = { scope:contributed_gilded_shrines ?= root } - contributed_gilded_shrines_effect = yes - } - if = { - limit = { scope:contributed_work_force ?= root } - contributed_work_force_effect = yes - } - if = { - limit = { scope:contributed_bell_stupas ?= root } - contributed_bell_stupas_effect = yes - } - if = { - limit = { scope:contributed_bejeweled_domes ?= root } - contributed_bejeweled_domes_effect = yes - } - if = { - limit = { scope:contributed_family_temple_complex ?= root } - contributed_family_temple_complex_effect = yes - } -} - - -### Capital 05 Breakdown Effects ### - -#mandala_contributor_medium_rite_reward_effect Reused from Capital 03 -#contributed_rites_of_worthiness_02_effect Reused from Capital 03 - -mandala_contributor_marble_foundation_reward_effect = { - add_prestige = { - value = { - add = mandala_contribution_major_prestige_reward - multiply = 1.5 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } - add_piety_experience = { - value = { - add = mandala_contribution_medium_dynasty_reward - multiply = 1.5 - #Rounds up to the closest number divisible by 5 - divide = 5 - ceiling = yes - multiply = 5 - } - } - add_legitimacy = mandala_contribution_medium_legitimacy_reward -} -contributed_marble_foundation_effect = { - custom_description_no_bullet = { text = contributed_marble_foundation } - mandala_contributor_marble_foundation_reward_effect = yes -} - -mandala_contributor_divine_barays_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige = { - value = { - add = mandala_contribution_medium_prestige_reward - multiply = 1.5 - } - } - } - if = { - limit = { exists = scope:province } - custom_tooltip = mandala_contributor_divine_barays_reward_province_effect_tt - hidden_effect = { - scope:province = { - add_province_modifier = { modifier = mandala_divine_barays_defense_modifier } - } - } - } - else = { - custom_tooltip = mandala_contributor_divine_barays_reward_effect_tt - hidden_effect = { - scope:owner.capital_province = { - add_province_modifier = { modifier = mandala_divine_barays_defense_modifier } - } - } - } -} -contributed_divine_barays_effect = { - custom_description_no_bullet = { text = contributed_divine_barays } - mandala_contributor_divine_barays_reward_effect = yes -} - -#mandala_contributor_work_force_reward_effect Reused from Capital 01 -#contributed_work_force_effect Reused from Capital 01 - -mandala_contributor_bejeweled_reliefs_reward_effect = { - #Before Planning has started - if = { - limit = { - scope:owner ?= { - any_character_artifact = { has_variable = mandala_capital_05_unconfirmed_talisman } - } - } - scope:owner = { - random_character_artifact = { - limit = { has_variable = mandala_capital_05_unconfirmed_talisman } - save_scope_as = target_talisman - } - } - if = { - limit = { - scope:owner = { - house ?= { has_house_aspiration_parameter = aspect_of_creation } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_creator_reward_artifact_effect_tt - #Set the modifiers - hidden_effect = { - scope:target_talisman = { - set_artifact_description = mandala_capital_05_creation_talisman_desc - add_artifact_modifier = artifact_health_gain_2_modifier - add_artifact_modifier = artifact_fertility_gain_2_modifier - } - } - } - else_if = { - limit = { - scope:owner = { - house ?= { has_house_aspiration_parameter = aspect_of_serenity } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_serenity_reward_artifact_effect_tt - #Set the modifiers - hidden_effect = { - scope:target_talisman = { - set_artifact_description = mandala_capital_05_serenity_talisman_desc - add_artifact_modifier = artifact_vassal_limit_1_modifier - add_artifact_modifier = artifact_short_reign_duration_mult_3_modifier - } - } - } - else_if = { - limit = { - scope:owner = { - house ?= { has_house_aspiration_parameter = aspect_of_destruction } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_destruction_reward_artifact_effect_tt - #Set the modifiers - hidden_effect = { - scope:target_talisman = { - set_artifact_description = mandala_capital_05_destruction_talisman_desc - add_artifact_modifier = artifact_dread_baseline_add_2_modifier - add_artifact_modifier = artifact_pursue_efficiency_2_modifier - add_artifact_modifier = artifact_controlled_province_advantage_5_modifier - } - } - } - else_if = { - limit = { - scope:owner = { - house ?= { has_house_aspiration_parameter = aspect_of_trickery } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_trickery_reward_artifact_effect_tt - #Set the modifiers - hidden_effect = { - scope:target_talisman = { - set_artifact_description = mandala_capital_05_trickery_talisman_desc - add_artifact_modifier = artifact_negate_health_penalty_add_2_modifier - add_artifact_modifier = artifact_scheme_resistance_add_3_modifier - } - } - } - scope:target_talisman = { - remove_variable = mandala_capital_05_unconfirmed_talisman - set_variable = mandala_capital_05_talisman - if = { - limit = { has_variable = mandala_capital_05_talisman } - #To prevent 'unused except in loc' errors :catto: - } - hidden_effect = { - set_artifact_rarity = famed - remove_artifact_modifier = artifact_monthly_piety_gain_mult_1_modifier - add_artifact_modifier = artifact_monthly_piety_gain_mult_5_modifier - } - } - } - #After planning has started - else_if = { - limit = { - this = { - house ?= { has_house_aspiration_parameter = aspect_of_creation } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_creator_reward_pre_artifact_effect_tt - } - else_if = { - limit = { - this = { - house ?= { has_house_aspiration_parameter = aspect_of_serenity } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_serenity_reward_pre_artifact_effect_tt - } - else_if = { - limit = { - this = { - house ?= { has_house_aspiration_parameter = aspect_of_destruction } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_destruction_reward_pre_artifact_effect_tt - } - else_if = { - limit = { - this = { - house ?= { has_house_aspiration_parameter = aspect_of_trickery } - } - } - custom_tooltip = mandala_contributor_bejeweled_reliefs_trickery_reward_pre_artifact_effect_tt - } - else = { custom_tooltip = mandala_contributor_bejeweled_reliefs_reward_artifact_effect_none_tt } - - #And set the owner, if the project owner neglected to do this Contribution - if = { - limit = { - NOT = { this = scope:owner } - exists = scope:target_talisman - } - if = { - limit = { exists = scope:target_talisman } - scope:target_talisman = { set_owner = prev } - } - else = { custom_tooltip = mandala_contributor_bejeweled_reliefs_reward_gain_artifact_effect_tt } - } - -} -contributed_bejeweled_reliefs_effect = { - custom_description_no_bullet = { text = contributed_bejeweled_reliefs } - mandala_contributor_bejeweled_reliefs_reward_effect = yes -} - -mandala_contributor_bunga_mas_forest_reward_effect = { - if = { - limit = { this != scope:owner } - add_prestige_experience = mandala_contribution_major_prestige_reward - if = { - limit = { - can_add_hook = { - target = scope:owner - type = strong_contribution_hook - } - } - add_hook = { - target = scope:owner - type = strong_contribution_hook - } - } - } - custom_tooltip = mandala_contributor_bunga_mas_forest_reward_effect_tt - hidden_effect = { - scope:owner.dynasty = { - add_dynasty_modifier = { modifier = mandala_forest_of_bunga_mas_modifier } - } - } -} -contributed_bunga_mas_forest_effect = { - custom_description_no_bullet = { text = contributed_bunga_mas_forest } - mandala_contributor_bunga_mas_forest_reward_effect = yes -} - -mandala_contributor_dynastic_temple_complex_reward_effect = { - dynasty = { add_dynasty_prestige = monumental_dynasty_prestige_value } - player_heir ?= { - add_piety_experience = { - value = monumental_piety_value - add = massive_piety_value - } - } -} -contributed_dynastic_temple_complex_effect = { - custom_description_no_bullet = { text = contributed_family_temple_complex } - mandala_contributor_family_temple_complex_reward_effect = yes -} - -#The actual effect -check_and_reward_contributions_05_effect = { - if = { - limit = { scope:contributed_rite_of_worthiness ?= root } - contributed_rites_of_worthiness_02_effect = yes - } - if = { - limit = { scope:contributed_marble_foundation ?= root } - contributed_marble_foundation_effect = yes - } - if = { - limit = { scope:contributed_divine_barays ?= root } - contributed_divine_barays_effect = yes - } - if = { - limit = { scope:contributed_work_force ?= root } - contributed_work_force_effect = yes - } - if = { - limit = { scope:contributed_bejeweled_reliefs ?= root } - contributed_bejeweled_reliefs_effect = yes - } - if = { - limit = { scope:contributed_bunga_mas_forest ?= root } - contributed_bunga_mas_forest_effect = yes - } - if = { - limit = { scope:contributed_dynastic_temple_complex ?= root } - contributed_dynastic_temple_complex_effect = yes - } -} - - - - - -##War Effects -mandala_war_victory_effects = { - scope:attacker = { - if = { - limit = { has_realm_law_flag = piety_devotion_from_offensive_wars } - add_piety = { - value = medium_piety_value - multiply = scope:defender.primary_title.tier - } - } - } - scope:defender = { - if = { - limit = { has_realm_law_flag = piety_devotion_from_defensive_wars } - add_piety_experience = medium_piety_loss - } - } -} - -mandala_war_defeat_effects = { - scope:attacker = { - if = { - limit = { has_realm_law_flag = piety_devotion_from_offensive_wars } - add_piety_experience = medium_piety_loss - } - } - scope:defender = { - if = { - limit = { has_realm_law_flag = piety_devotion_from_defensive_wars } - add_piety_experience = { - value = minor_piety_value - multiply = scope:defender.primary_title.tier - } - } - } -} - -mandala_rebel_attacker_independency_effect = { - create_title_and_vassal_change = { - type = independency - save_scope_as = change - } - becomes_independent = { change = scope:change } - resolve_title_and_vassal_change = scope:change -} - -mandala_not_quite_depose_effect = { - #Your piety - add_piety_level = remove_piety_levels_value - add_piety = -5000 - #Your tributaries - if = { - limit = { number_of_tributaries > 0 } - custom_tooltip = { - text = mandala_depose_war_leaving_tributaries.tt - every_tributary = { end_tributary = yes } - } - } - #Your radiance - add_character_modifier = { - modifier = recently_tarnished_mandala_modifier - years = 10 - } -} - -mandala_peacemaker_perk_serenity_effect = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_serenity } - is_house_head = yes - has_perk = peacemaker_perk - } - add_piety_experience = mandala_peacemaker_perk_piety_value - } -} - - -##Change to Mandala Government effects -change_to_mandala_government_effect = { - change_government = mandala_government - change_to_mandala_government_decree_effect = yes -} - -change_to_mandala_government_and_citadel_effect = { - if = { - limit = { government_has_flag = government_is_tribal } - change_tribal_holdings_to_citadels_effect = yes #Includes change_to_mandala_government_effect - } - else = { - change_capital_holding_to_citadel_effect = yes #Includes change_to_mandala_government_effect - } - show_as_tooltip = { change_to_mandala_government_effect = yes } -} - -change_capital_holding_to_citadel_effect = { - custom_tooltip = realm_capital_will_change_to_citadel - save_scope_as = current_holder - hidden_effect_new_object = { - capital_province = { - if = { - limit = { has_holding_type = temple_citadel_holding } - scope:current_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - change_to_mandala_government_effect = yes - } - } - } - else = { - set_variable = { - name = generic_to_mandala_building_level - value = combined_building_level - days = 1 - } - if = { - limit = { holding_is_tribal = yes } - holding_pre_feudalize_effect = yes - } - set_holding_type = temple_citadel_holding - #Did any buildings invalidate? Calculate! - set_variable = { - name = new_generic_to_mandala_building_level - value = combined_building_level - days = 1 - } - if = { - limit = { var:new_generic_to_mandala_building_level < var:generic_to_mandala_building_level } - change_variable = { - name = generic_to_mandala_building_level - subtract = var:new_generic_to_mandala_building_level - } - } - #We need to set the holding type BEFORE we can change to the government, lest it invalidates - scope:current_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - change_to_mandala_government_effect = yes - } - } - #We need to set the government type BEFORE we generate buildings, otherwise basically none are valid - while = { - limit = { var:generic_to_mandala_building_level > 0 } - generate_building = yes - change_variable = { - name = generic_to_mandala_building_level - subtract = 1 - } - } - remove_variable = generic_to_mandala_building_level - remove_variable = new_generic_to_mandala_building_level - } - } - } -} - -change_tribal_holdings_to_citadels_effect = { - custom_tooltip = all_tribal_holdings_will_change_to_citadels - save_scope_as = current_tribal_holder - if = { - limit = { - any_directly_owned_province = { - has_holding_type = tribal_holding - count >= 1 - } - } - hidden_effect_new_object = { - every_directly_owned_province = { - limit = { has_holding_type = tribal_holding } - set_variable = { - name = tribal_to_mandala_building_level - value = combined_building_level - days = 1 - } - if = { - limit = { holding_is_tribal = yes } - holding_pre_feudalize_effect = yes - } - set_holding_type = temple_citadel_holding - #We need to set the holding type BEFORE we can change to the government, lest it invalidates - scope:current_tribal_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - change_to_mandala_government_effect = yes - } - } - #We need to set the government type BEFORE we generate buildings, otherwise basically none are valid - while = { - limit = { var:tribal_to_mandala_building_level > 0 } - generate_building = yes - change_variable = { - name = tribal_to_mandala_building_level - subtract = 1 - } - } - remove_variable = tribal_to_mandala_building_level - } - } - } - #You're somehow a tribal with all your holdings being Temple Citadels? Good for you. - else = { - scope:current_tribal_holder = { - if = { - limit = { - NOT = { government_has_flag = government_is_mandala } - } - change_to_mandala_government_effect = yes - } - } - } -} - -mandala_nuke_realm_laws_effect = { - hidden_effect = { - #Tribal - if = { - limit = { has_realm_law = tribal_authority_0 } - remove_realm_law = tribal_authority_0 - } - if = { - limit = { has_realm_law = tribal_authority_1 } - remove_realm_law = tribal_authority_1 - } - if = { - limit = { has_realm_law = tribal_authority_2 } - remove_realm_law = tribal_authority_2 - } - if = { - limit = { has_realm_law = tribal_authority_3 } - remove_realm_law = tribal_authority_3 - } - #Feudal - if = { - limit = { has_realm_law = crown_authority_0 } - remove_realm_law = crown_authority_0 - } - if = { - limit = { has_realm_law = crown_authority_1 } - remove_realm_law = crown_authority_1 - } - if = { - limit = { has_realm_law = crown_authority_2 } - remove_realm_law = crown_authority_2 - } - if = { - limit = { has_realm_law = crown_authority_3 } - remove_realm_law = crown_authority_3 - } - #Admin - if = { - limit = { has_realm_law = imperial_bureaucracy_0 } - remove_realm_law = imperial_bureaucracy_0 - } - if = { - limit = { has_realm_law = imperial_bureaucracy_1 } - remove_realm_law = imperial_bureaucracy_1 - } - if = { - limit = { has_realm_law = imperial_bureaucracy_2 } - remove_realm_law = imperial_bureaucracy_2 - } - if = { - limit = { has_realm_law = imperial_bureaucracy_3 } - remove_realm_law = imperial_bureaucracy_3 - } - #Nomads - if = { - limit = { has_realm_law = nomadic_authority_1 } - remove_realm_law = nomadic_authority_1 - } - if = { - limit = { has_realm_law = nomadic_authority_2 } - remove_realm_law = nomadic_authority_2 - } - if = { - limit = { has_realm_law = nomadic_authority_3 } - remove_realm_law = nomadic_authority_3 - } - if = { - limit = { has_realm_law = nomadic_authority_4 } - remove_realm_law = nomadic_authority_4 - } - if = { - limit = { has_realm_law = nomadic_authority_5 } - remove_realm_law = nomadic_authority_5 - } - #Celestial - if = { - limit = { has_realm_law = celestial_bureaucracy_0 } - remove_realm_law = celestial_bureaucracy_0 - } - if = { - limit = { has_realm_law = celestial_bureaucracy_1 } - remove_realm_law = celestial_bureaucracy_1 - } - if = { - limit = { has_realm_law = celestial_bureaucracy_2 } - remove_realm_law = celestial_bureaucracy_2 - } - if = { - limit = { has_realm_law = celestial_bureaucracy_3 } - remove_realm_law = celestial_bureaucracy_3 - } - #Confucian - if = { - limit = { has_realm_law = meritocratic_bureaucracy_0 } - remove_realm_law = meritocratic_bureaucracy_0 - } - if = { - limit = { has_realm_law = meritocratic_bureaucracy_1 } - remove_realm_law = meritocratic_bureaucracy_1 - } - if = { - limit = { has_realm_law = meritocratic_bureaucracy_2 } - remove_realm_law = meritocratic_bureaucracy_2 - } - if = { - limit = { has_realm_law = meritocratic_bureaucracy_3 } - remove_realm_law = meritocratic_bureaucracy_3 - } - #Japanese - if = { - limit = { has_realm_law = japanese_bureaucracy_0 } - remove_realm_law = japanese_bureaucracy_0 - } - if = { - limit = { has_realm_law = japanese_bureaucracy_1 } - remove_realm_law = japanese_bureaucracy_1 - } - if = { - limit = { has_realm_law = japanese_bureaucracy_2 } - remove_realm_law = japanese_bureaucracy_2 - } - if = { - limit = { has_realm_law = japanese_bureaucracy_3 } - remove_realm_law = japanese_bureaucracy_3 - } - } -} - -mandala_nuke_mandala_decrees_effect = { - hidden_effect = { - if = { - limit = { has_realm_law = mandala_decree_prosperity } - remove_realm_law = mandala_decree_prosperity - } - if = { - limit = { has_realm_law = mandala_decree_expansion } - remove_realm_law = mandala_decree_expansion - } - if = { - limit = { has_realm_law = mandala_decree_reverence } - remove_realm_law = mandala_decree_reverence - } - } -} - -change_to_mandala_government_decree_effect = { - #Nuke all laws - mandala_nuke_realm_laws_effect = yes - if = { - limit = { - NOT = { has_realm_law = mandala_decree_none } - } - add_realm_law_skip_effects = mandala_decree_none - } -} - -divine_happenstance_adopt_mandala_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = divine_happenstance_fulfilled - desc = divine_happenstance_fulfilled_desc - left_icon = root - add_piety = { - value = major_piety_value - multiply = 1.5 - } - if = { - limit = { government_has_flag = government_is_mandala } - add_legitimacy_effect = { LEGITIMACY = major_legitimacy_gain } - } - else = { - #Add legitimacy sans displaying levels (only for show, we shouldn't end up here outside of show_as_tooltip) - add_major_legitimacy_no_tier_effect = yes - } - } - if = { - limit = { has_variable = vying_for_mandala_divinity } - create_character_memory = { type = ascended_as_divined_mandala_devaraja_memory } - } - else = { - create_character_memory = { type = ascended_as_mandala_devaraja_memory } - } -} - -mandala_adopt_clan_government_effect = { - #Remove Mandala Decrees - mandala_nuke_mandala_decrees_effect = yes - #Check if capital holding is castle or temple citadel otherwise convert - clan_convert_capital_effect = yes - change_government = clan_government - #Start off crown authorities - hidden_effect = { - if = { - limit = { - NOT = { has_realm_law = crown_authority_0 } - } - add_realm_law_skip_effects = crown_authority_0 - } - } - #All muslim vassals swap to Clan - if = { - limit = { - any_vassal = { - primary_title = { - target_is_de_jure_liege_or_above = root.primary_title #We only auto convert de jure vassals - } - NOR = { - government_has_flag = government_is_theocracy - government_has_flag = government_is_republic - government_has_flag = government_is_landless_adventurer - government_has_flag = government_is_tribal - government_has_flag = government_is_clan - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - faith.religion = religion:islam_religion - } - } - custom_tooltip = all_muslim_vassals_change_to_clan - hidden_effect = { - every_vassal_or_below = { - limit = { - primary_title = { - target_is_de_jure_liege_or_above = root.primary_title #We only auto convert de jure vassals - } - NOR = { - government_has_flag = government_is_theocracy - government_has_flag = government_is_republic - government_has_flag = government_is_landless_adventurer - government_has_flag = government_is_tribal - government_has_flag = government_is_clan - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - faith.religion = religion:islam_religion - } - clan_convert_capital_effect = yes - change_government = clan_government - #Nuke all laws - mandala_nuke_realm_laws_effect = yes - #Remove Mandala Decrees - mandala_nuke_mandala_decrees_effect = yes - #Start off crown authorities - if = { - limit = { - NOT = { has_realm_law = crown_authority_0 } - } - add_realm_law_skip_effects = crown_authority_0 - } - #Notify them of what just happened - if = { - limit = { is_ai = no } - trigger_event = tgp_east_asia_decision_events.0030 - } - set_variable = { - name = changed_government_recently - years = 5 - } - } - } - } - set_variable = { - name = changed_government_recently - years = 5 - } -} - - - -##Conversion Effects -mandala_converter_piety_effect = { - #Mandala conversion! - if = { - limit = { government_has_flag = government_is_mandala } - if = { - limit = { has_realm_law = mandala_decree_reverence } - add_piety = { - add = medium_piety_gain - multiply = 1.5 - } - } - else = { add_piety = medium_piety_gain } - } -} - -mandala_assimilation_effect = { - overlord = { - send_interface_message = { - type = event_conversion_good - title = subject_assimilated_under_your_rule_msg - left_icon = root - right_icon = overlord - show_as_tooltip = { - root = { - if = { - limit = { - NOT = { has_government = mandala_government } - } - change_government = mandala_government - } - if = { - limit = { - NOR = { - faith = overlord.faith - faith.religious_head ?= root - } - } - set_character_faith = overlord.faith - } - } - } - if = { - limit = { has_realm_law = mandala_decree_reverence } - mandala_converter_piety_effect = yes - } - } - } - #The Decree - show_as_tooltip = { change_to_mandala_government_decree_effect = yes } -} - -mandala_clean_up_variables_effect = { - remove_variable = mandala_assimilation_devaraja - remove_variable = mandala_assimilation_devaraja_piety_level - remove_character_flag = assimilation_payout_t1 - remove_character_flag = assimilation_payout_t2 - remove_character_flag = assimilation_payout_t3 -} - - - -##Building Effects -mandala_built_piety_building_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - #Liege paid for the building - if = { - limit = { - root.county.holder = { is_independent_ruler = no } - this = scope:character - government_has_flag = government_is_mandala - } - add_piety = { - value = minor_piety_value - multiply = 1.5 - } - root.county.holder = { - if = { - limit = { government_has_flag = government_is_mandala } - } - add_piety = { - value = miniscule_piety_value - multiply = 1.5 - } - } - } - #Vassal paid for the building - else_if = { - limit = { - government_has_flag = government_is_mandala - is_alive = yes - } - add_piety = { - value = minor_piety_value - multiply = 1.5 - } - } - } -} - -mandala_built_piety_duchy_building_t1_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - #Liege paid for the building - if = { - limit = { - root.county.holder = { is_independent_ruler = no } - this = scope:character - government_has_flag = government_is_mandala - } - add_piety = { - value = medium_piety_value - multiply = 1.5 - } - root.county.holder = { - if = { - limit = { government_has_flag = government_is_mandala } - } - add_piety = { - value = minor_piety_value - multiply = 1.5 - } - } - } - #Vassal paid for the building - else_if = { - limit = { government_has_flag = government_is_mandala } - add_piety = { - value = medium_piety_value - multiply = 1.5 - } - } - } -} - -mandala_built_piety_duchy_building_t2_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - #Liege paid for the building - if = { - limit = { - root.county.holder = { is_independent_ruler = no } - this = scope:character - government_has_flag = government_is_mandala - } - add_piety = { - value = major_piety_value - multiply = 1.5 - } - root.county.holder = { - if = { - limit = { government_has_flag = government_is_mandala } - } - add_piety = { - value = medium_piety_value - multiply = 1.5 - } - } - } - #Vassal paid for the building - else_if = { - limit = { government_has_flag = government_is_mandala } - add_piety = { - value = major_piety_value - multiply = 1.5 - } - } - } -} - -mandala_built_piety_duchy_building_t3_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - #Liege paid for the building - if = { - limit = { - root.county.holder = { is_independent_ruler = no } - this = scope:character - government_has_flag = government_is_mandala - } - add_piety = { - value = massive_piety_value - multiply = 1.5 - } - root.county.holder = { - if = { - limit = { government_has_flag = government_is_mandala } - } - add_piety = { - value = major_piety_value - multiply = 1.5 - } - } - } - #Vassal paid for the building - else_if = { - limit = { government_has_flag = government_is_mandala } - add_piety = { - value = massive_piety_value - multiply = 1.5 - } - } - } -} - -mandala_built_temple_holding_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - save_scope_as = character - } - scope:character = { - #Liege paid for the holding - if = { - limit = { - root.county.holder = { is_independent_ruler = no } - this = scope:character - government_has_flag = government_is_mandala - } - add_piety = { - value = massive_piety_value - multiply = { - value = 1.5 - } - if = { - limit = { - culture = { has_cultural_parameter = founding_temple_citadels_gives_more_piety } - } - multiply = 2 - } - } - root.county.holder = { - if = { - limit = { government_has_flag = government_is_mandala } - } - add_piety = { - value = major_piety_value - multiply = 1.5 - } - } - } - #Vassal paid for the holding - else_if = { - limit = { government_has_flag = government_is_mandala } - add_piety = { - value = massive_piety_value - multiply = { - value = 1.5 - } - if = { - limit = { - culture = { has_cultural_parameter = founding_temple_citadels_gives_more_piety } - } - multiply = 2 - } - } - } - } -} - -mandala_upgraded_temple_holding_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - #Liege paid for the holding - if = { - limit = { - root.county.holder = { is_independent_ruler = no } - this = scope:character - government_has_flag = government_is_mandala - } - add_piety = { - value = medium_piety_value - multiply = 1.5 - } - root.county.holder = { - if = { - limit = { government_has_flag = government_is_mandala } - } - add_piety = { - value = minor_piety_value - multiply = 1.5 - } - } - } - #Vassal paid for the holding - else_if = { - limit = { government_has_flag = government_is_mandala } - add_piety = { - value = medium_piety_value - multiply = 1.5 - } - } - } -} - - -creator_mandala_built_regular_building_piety_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_creation } - is_house_head = yes - } - add_piety = { - value = minor_piety_value - multiply = { value = creator_mandala_piety_gain_scale } - } - } - } -} - -creator_mandala_built_regular_duchy_building_t1_piety_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_creation } - is_house_head = yes - } - add_piety = { - value = medium_piety_value - multiply = { value = creator_mandala_piety_gain_scale } - } - } - } -} - -creator_mandala_built_regular_duchy_building_t2_piety_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_creation } - is_house_head = yes - } - add_piety = { - value = major_piety_value - multiply = { value = creator_mandala_piety_gain_scale } - } - } - } -} - -creator_mandala_built_regular_duchy_building_t3_piety_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_creation } - is_house_head = yes - } - add_piety = { - value = massive_piety_value - multiply = { value = creator_mandala_piety_gain_scale } - } - } - } -} - -creator_mandala_built_regular_holding_piety_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_creation } - is_house_head = yes - } - add_piety = { - value = massive_piety_value - multiply = { value = creator_mandala_piety_gain_scale } - } - } - } -} - -creator_mandala_upgraded_regular_holding_piety_effect = { - if = { - limit = { - NOT = { exists = scope:character } - } - county.holder = { save_scope_as = character } - } - scope:character = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_creation } - is_house_head = yes - } - add_piety = { - value = medium_piety_value - multiply = { value = creator_mandala_piety_gain_scale } - } - } - } -} - - - -##Interaction Effects -mandala_end_tributary_with_notification_effect = { - save_scope_as = leaving_tributary - suzerain = { - if = { - limit = { - government_has_flag = government_is_mandala - } - trigger_event = tgp_east_asia_interaction_events.0010 - } - } - end_tributary = yes -} - -mandala_embrace_tributary_effect = { - scope:recipient = { - add_opinion = { - modifier = accepted_tributary_status_opinion # this opinion also acts as a built-in cooldown - target = scope:actor - opinion = 20 - } - } - start_tributary_interaction_effect = { - TRIBUTARY = scope:recipient - SUZERAIN = scope:actor - } - scope:actor = { - trigger_event = char_interaction.0362 - } - consume_all_criminal_reasons_effect = { - LIEGE = scope:actor - CRIMINAL = scope:recipient - } -} - -decommission_temple_accept_effect = { - custom_tooltip = { - text = decommission_mandala_temple_effect_tt - capital_province = { - if = { - limit = { has_building_with_flag = mandala_capital_building } - ruin_great_building = yes - } - } - } - if = { - limit = { has_character_flag = devaraja_flag } - remove_character_flag = devaraja_flag - } - if = { - limit = { has_character_modifier = mandala_rise_from_the_ashes_modifier } - remove_character_modifier = mandala_rise_from_the_ashes_modifier - } - add_opinion = { - target = scope:actor - modifier = ruined_my_temple_opinion - opinion = -50 - } -} - -decommission_temple_decline_effect = { - if = { - limit = { is_vassaL_of = scope:actor } - start_war = { - casus_belli = independence_war - target = scope:actor - } - } - else = { - mandala_end_tributary_with_notification_effect = yes - } - progress_towards_rival_effect = { - REASON = rival_ruined_temple_building - CHARACTER = scope:actor - OPINION = -100 - } -} - - - -##Aspect Effects -mandala_apply_10_year_modifier = { - add_character_modifier = { - modifier = mandala_creator_modifier - years = 10 - } - trigger_event = { - id = tgp_east_asia_mandala_events.0010 - days = 3651 # 10 years and 1 day - } -} - -mandala_apply_20_year_modifier = { - add_character_modifier = { - modifier = mandala_creator_modifier - years = 20 - } - trigger_event = { - id = tgp_east_asia_mandala_events.0010 - days = 7301 # 20 years and 1 day - } -} - -mandala_apply_30_year_modifier = { - add_character_modifier = { - modifier = mandala_creator_modifier - years = 30 - } - trigger_event = { - id = tgp_east_asia_mandala_events.0010 - days = 10951 # 30 years and 1 day - } -} - -mandala_upgrade_creator_effect = { - if = { - limit = { has_variable = mandala_house_power_accumulated_creator } - #Save what we gained so far so we can add it to the refreshed variable - save_temporary_scope_value_as = { - name = accumulated_creator_increments - value = var:mandala_house_power_accumulated_creator - } - remove_variable = mandala_house_power_accumulated_creator - #Clean up any existing modifier - hidden_effect = { - if = { - limit = { has_character_modifier = mandala_creator_modifier } - remove_character_modifier = mandala_creator_modifier - } - } - #What cadence are we on? - if = { - limit = { - house = { has_house_head_parameter = creator_30_year_modifier } - } - set_variable = { - name = mandala_house_power_accumulated_creator - value = { - value = 1 - add = scope:accumulated_creator_increments - } - years = 30 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_creator_streak_accumulated - desc = mandala_creator_streak_accumulated_desc - left_icon = root - mandala_apply_30_year_modifier = yes - } - } - } - else_if = { - limit = { - house = { house_has_creator_20_years_trigger = yes } - } - set_variable = { - name = mandala_house_power_accumulated_creator - value = { - value = 1 - add = scope:accumulated_creator_increments - } - years = 20 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_creator_streak_accumulated - desc = mandala_creator_streak_accumulated_desc - left_icon = root - mandala_apply_20_year_modifier = yes - } - } - } - else_if = { - limit = { - house = { house_has_creator_10_years_trigger = yes } #This is just to stop some scope errors - } - set_variable = { - name = mandala_house_power_accumulated_creator - value = { - value = 1 - add = scope:accumulated_creator_increments - } - years = 10 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_creator_streak_accumulated - desc = mandala_creator_streak_accumulated_desc - left_icon = root - mandala_apply_10_year_modifier = yes - } - } - } - } - else = { - #Clean up any existing modifier - hidden_effect = { - if = { - limit = { has_character_modifier = mandala_creator_modifier } - remove_character_modifier = mandala_creator_modifier - } - } - #Start from the beginning - if = { - limit = { - house = { has_house_head_parameter = creator_30_year_modifier } - } - set_variable = { - name = mandala_house_power_accumulated_creator - value = 1 - years = 30 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_creator_streak_accumulated - desc = mandala_creator_streak_accumulated_desc - left_icon = root - mandala_apply_30_year_modifier = yes - } - } - } - else_if = { - limit = { - house = { house_has_creator_20_years_trigger = yes } - } - set_variable = { - name = mandala_house_power_accumulated_creator - value = 1 - years = 20 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_creator_streak_accumulated - desc = mandala_creator_streak_accumulated_desc - left_icon = root - mandala_apply_20_year_modifier = yes - } - } - } - else = { - set_variable = { - name = mandala_house_power_accumulated_creator - value = 1 - years = 10 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_creator_streak_accumulated - desc = mandala_creator_streak_accumulated_desc - left_icon = root - mandala_apply_10_year_modifier = yes - } - } - } - } -} - - -mandala_upgrade_increment_of_peace_effect = { - if = { - limit = { has_variable = mandala_house_power_accumulated_increments_of_peace } - change_variable = { - name = mandala_house_power_accumulated_increments_of_peace - add = 1 - } - hidden_effect = { - remove_character_modifier = mandala_increments_of_peace_modifier - send_interface_message = { - type = msg_mandala_good_with_text - title = mandala_increments_of_peace_accumulated - desc = mandala_increments_of_peace_accumulated_desc - left_icon = root - add_character_modifier = { modifier = mandala_increments_of_peace_modifier } - } - } - } -} - -mandala_reset_increment_of_peace_effect = { - remove_variable = mandala_house_power_accumulated_increments_of_peace - set_variable = { - name = mandala_house_power_accumulated_increments_of_peace - value = 1 - } - hidden_effect = { - send_interface_message = { - type = msg_mandala_bad_with_text - title = mandala_increments_of_peace_broken - desc = mandala_increments_of_peace_broken_desc - left_icon = root - remove_character_modifier = mandala_increments_of_peace_modifier - remove_variable = mandala_house_power_accumulated_increments_of_peace - } - add_character_modifier = mandala_increments_of_peace_modifier - } -} - -mandala_remove_increment_of_peace_effect = { - send_interface_message = { - type = msg_mandala_neutral_with_text - title = mandala_increments_of_peace_invalid - desc = mandala_increments_of_peace_invalid_desc - left_icon = root - remove_character_modifier = mandala_increments_of_peace_modifier - remove_variable = mandala_house_power_accumulated_increments_of_peace - } -} - - -mandala_change_between_aspects_effect = { - if = { - limit = { - NOT = { - house = { has_default_house_aspiration = yes } - } - } - if = { - limit = { has_variable = changed_aspect_once } - add_piety_level = -1 - } - else = { - custom_tooltip = { - text = change_aspect_once_per_lifetime.tt - set_variable = changed_aspect_once - } - } - if = { - limit = { - NOT = { has_character_flag = devaraja_flag } - } - add_character_flag = devaraja_flag - } - } -} - - -##Reverence Decree Effects -mandala_piety_gain_effect = { - if = { - limit = { has_realm_law = mandala_decree_reverence } - add_piety = { - add = $PIETY_AMOUNT$ - multiply = 1.5 - } - } - else = { add_piety = $PIETY_AMOUNT$ } -} - - -mandala_trickster_increment_successful_schemes_effect = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_trickery } - } - increment_variable_effect = { - VAR = num_successful_schemes - VAL = 1 - } - } -} - -mandala_trickster_increment_gold_ransomed_effect = { - if = { - limit = { - government_has_flag = government_is_mandala - house ?= { has_house_aspiration_parameter = aspect_of_trickery } - } - increment_variable_effect = { - VAR = amount_of_gold_ransomed - VAL = $GOLD_AMOUNT$ - } - } -} - - -##Task Contracts -# Select the Contract Tier (somewhat randomized, based on your Radiance) -spawn_mandala_realm_task_contract_effect = { - save_scope_as = mandala_ruler - # Select which contract to create - trigger_event = { - on_action = spawn_mandala_realm_contract_on_action - } - -} - -manage_new_mandala_contract_effect = { - if = { - limit = { exists = scope:target_province } - send_interface_message = { - type = msg_mandala_contracts_text_neutral - title = msg_mandala_realm_contract_appear.t - desc = msg_mandala_realm_contract_appear.desc - right_icon = scope:target_province.county - } - } - if = { - limit = { - is_ai = yes - exists = scope:new_mandala_visit - } - accept_task_contract = scope:new_mandala_visit - } - - #play_sound_effect = "event:/DLC/EP3/SFX/Stingers/Byzantine_Flavor/ep3_mx_sting_byzantineflavor_become_governor" -} - -mandala_travel_to_contract_location_effect = { - save_scope_as = court_owner - random_courtier = { - limit = { - is_available = yes - NOT = { has_court_position = travel_leader_court_position } - } - weight = { - base = 1 - modifier = { - add = 100 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - OR = { - is_child_of = scope:court_owner - is_grandchild_of = scope:court_owner - is_great_grandchild_of = scope:court_owner - is_consort_of = scope:court_owner - } - } - modifier = { - add = 10 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - is_close_or_extended_family_of = scope:court_owner - } - modifier = { - add = diplomacy - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_serenity - } - } - modifier = { - add = prowess - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_destruction - } - } - modifier = { - add = intrigue - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_trickery - } - } - modifier = { - add = 1000 - has_court_position = court_physician_court_position - } - } - save_scope_as = follower_1 - } - if = { - limit = { - exists = scope:follower_1 - } - random_courtier = { - limit = { - is_available = yes - this != scope:follower_1 - NOT = { has_court_position = travel_leader_court_position } - } - weight = { - base = 1 - modifier = { - add = 100 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - OR = { - is_child_of = scope:court_owner - is_grandchild_of = scope:court_owner - is_great_grandchild_of = scope:court_owner - is_consort_of = scope:court_owner - } - } - modifier = { - add = 10 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - is_close_or_extended_family_of = scope:court_owner - } - modifier = { - add = diplomacy - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_serenity - } - } - modifier = { - add = prowess - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_destruction - } - } - modifier = { - add = intrigue - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_trickery - } - } - } - save_scope_as = follower_2 - } - } - if = { - limit = { - exists = scope:follower_2 - } - random_courtier = { - limit = { - is_available = yes - this != scope:follower_1 - this != scope:follower_2 - NOT = { has_court_position = travel_leader_court_position } - } - weight = { - base = 1 - modifier = { - add = 100 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - OR = { - is_child_of = scope:court_owner - is_grandchild_of = scope:court_owner - is_great_grandchild_of = scope:court_owner - is_consort_of = scope:court_owner - } - } - modifier = { - add = 10 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - is_close_or_extended_family_of = scope:court_owner - } - modifier = { - add = diplomacy - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_serenity - } - } - modifier = { - add = prowess - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_destruction - } - } - modifier = { - add = intrigue - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_trickery - } - } - } - save_scope_as = follower_3 - } - } - if = { - limit = { - exists = scope:follower_3 - } - random_courtier = { - limit = { - is_available = yes - this != scope:follower_1 - this != scope:follower_2 - this != scope:follower_3 - NOT = { has_court_position = travel_leader_court_position } - } - weight = { - base = 1 - modifier = { - add = 100 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - OR = { - is_child_of = scope:court_owner - is_grandchild_of = scope:court_owner - is_great_grandchild_of = scope:court_owner - is_consort_of = scope:court_owner - } - } - modifier = { - add = 10 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - is_close_or_extended_family_of = scope:court_owner - } - modifier = { - add = diplomacy - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_serenity - } - } - modifier = { - add = prowess - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_destruction - } - } - modifier = { - add = intrigue - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_trickery - } - } - } - save_scope_as = follower_4 - } - } - if = { - limit = { - exists = scope:follower_4 - } - random_courtier = { - limit = { - is_available = yes - this != scope:follower_1 - this != scope:follower_2 - this != scope:follower_3 - this != scope:follower_4 - NOT = { has_court_position = travel_leader_court_position } - } - weight = { - base = 1 - modifier = { - add = 100 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - OR = { - is_child_of = scope:court_owner - is_grandchild_of = scope:court_owner - is_great_grandchild_of = scope:court_owner - is_consort_of = scope:court_owner - } - } - modifier = { - add = 10 - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_creation - } - is_close_or_extended_family_of = scope:court_owner - } - modifier = { - add = diplomacy - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_serenity - } - } - modifier = { - add = prowess - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_destruction - } - } - modifier = { - add = intrigue - scope:court_owner.house = { - has_house_aspiration_parameter = aspect_of_trickery - } - } - } - save_scope_as = follower_5 - } - } - if = { - limit = { - exists = scope:follower_1 - exists = scope:follower_2 - exists = scope:follower_3 - exists = scope:follower_4 - exists = scope:follower_5 - } - start_travel_plan = { - destination = $DESTINATION$ - on_arrival_event = $ARRIVAL_EVENT$ - companion = scope:follower_1 - companion = scope:follower_2 - companion = scope:follower_3 - companion = scope:follower_4 - companion = scope:follower_5 - on_travel_planner_cancel_event = tgp_east_asia_mandala_task_contract_events.0990 - on_arrival_destinations = all_but_last - } - } - else_if = { - limit = { - exists = scope:follower_1 - exists = scope:follower_2 - exists = scope:follower_3 - exists = scope:follower_4 - } - start_travel_plan = { - destination = $DESTINATION$ - on_arrival_event = $ARRIVAL_EVENT$ - companion = scope:follower_1 - companion = scope:follower_2 - companion = scope:follower_3 - companion = scope:follower_4 - on_travel_planner_cancel_event = tgp_east_asia_mandala_task_contract_events.0990 - on_arrival_destinations = all_but_last - } - } - else_if = { - limit = { - exists = scope:follower_1 - exists = scope:follower_2 - exists = scope:follower_3 - } - start_travel_plan = { - destination = $DESTINATION$ - on_arrival_event = $ARRIVAL_EVENT$ - companion = scope:follower_1 - companion = scope:follower_2 - companion = scope:follower_3 - on_travel_planner_cancel_event = tgp_east_asia_mandala_task_contract_events.0990 - on_arrival_destinations = all_but_last - } - } - else_if = { - limit = { - exists = scope:follower_1 - exists = scope:follower_2 - } - start_travel_plan = { - destination = $DESTINATION$ - on_arrival_event = $ARRIVAL_EVENT$ - companion = scope:follower_1 - companion = scope:follower_2 - on_travel_planner_cancel_event = tgp_east_asia_mandala_task_contract_events.0990 - on_arrival_destinations = all_but_last - } - } - else_if = { - limit = { - exists = scope:follower_1 - } - start_travel_plan = { - destination = $DESTINATION$ - on_arrival_event = $ARRIVAL_EVENT$ - companion = scope:follower_1 - on_travel_planner_cancel_event = tgp_east_asia_mandala_task_contract_events.0990 - on_arrival_destinations = all_but_last - } - } - else = { - start_travel_plan = { - destination = $DESTINATION$ - on_arrival_event = $ARRIVAL_EVENT$ - on_travel_planner_cancel_event = tgp_east_asia_mandala_task_contract_events.0990 - on_arrival_destinations = all_but_last - } - } -} - -mandala_contract_clean_up_location_effect = { - task_contract_location = { - remove_variable = requested_mandala_ritual - } - task_contract_taker = { - increment_variable_remove_at_zero_effect = { - VAR = available_mandala_rituals - VALUE = -1 - } - } -} - -mandala_invalidate_contracts_effect = { - if = { - limit = { - any_character_active_contract = { is_a_mandala_contract_trigger = yes } - } - random_character_active_contract = { - limit = { is_a_mandala_contract_trigger = yes } - save_scope_as = invalidating_task_contract - task_contract_taker = { - save_scope_as = task_contract_character - send_interface_message = { - type = event_generic_bad_with_text - title = mandala_contract_invalidated_title - left_icon = scope:task_contract_character - desc = mandala_contract_invalidated_desc - } - scope:invalidating_task_contract = { invalidate_contract = yes } - } - } - } - if = { - limit = { has_character_flag = recently_completed_mandala_contract } - remove_character_flag = recently_completed_mandala_contract - } -} - -mandala_contract_complete_contract_effect = { - hidden_effect = { - scope:task_contract = { complete_task_contract = common_mandala } - current_travel_plan ?= { - if = { - limit = { is_paused = yes } - resume_travel_plan = yes - } - } - } - add_character_flag = recently_completed_mandala_contract -} - -mandala_contract_piety_reward_display_effect = { - save_scope_as = task_contract - task_contract_taker = { - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - custom_tooltip = mandala_realm_contract_piety_high_reward_tt - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - custom_tooltip = mandala_realm_contract_piety_mid_reward_tt - } - else = { - custom_tooltip = mandala_realm_contract_piety_reward_tt - } - } - -} - -mandala_contract_legitimacy_reward_display_effect = { - save_scope_as = task_contract - task_contract_taker = { - if = { - limit = { scope:task_contract.task_contract_tier = define:NTaskContract|HIGH_TASK_CONTRACT_TIER } - custom_tooltip = mandala_realm_contract_legitimacy_high_reward_tt - } - else_if = { - limit = { scope:task_contract.task_contract_tier = define:NTaskContract|MEDIUM_TASK_CONTRACT_TIER } - custom_tooltip = mandala_realm_contract_legitimacy_mid_reward_tt - } - else = { - custom_tooltip = mandala_realm_contract_legitimacy_reward_tt - } - } -} - -add_all_valid_mandala_contract_provinces_to_list_effect = { - save_scope_as = mandala_ruler - every_sub_realm_county = { - every_county_province = { - limit = { - has_holding = yes - is_occupied = no - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - every_tributary = { - every_sub_realm_county = { - every_county_province = { - limit = { - has_holding = yes - is_occupied = no - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - } -} - -add_all_valid_mandala_contract_provinces_with_crocodiles_to_list_effect = { - save_scope_as = mandala_ruler - every_sub_realm_county = { - every_county_province = { - limit = { - has_holding = yes - is_occupied = no - hunt_animal_crocodile_trigger = yes - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - every_tributary = { - every_sub_realm_county = { - every_county_province = { - limit = { - has_holding = yes - is_occupied = no - hunt_animal_crocodile_trigger = yes - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - } -} - -add_all_valid_mandala_contract_provinces_with_neighbor_to_list_effect = { - save_scope_as = mandala_ruler - every_sub_realm_county = { - limit = { - any_neighboring_county = { - holder = { - is_ai = yes - } - title_province = { - has_holding = yes - } - } - } - every_county_province = { - limit = { - has_holding = yes - is_occupied = no - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - every_tributary = { - every_sub_realm_county = { - limit = { - any_neighboring_county = { - holder = { - is_ai = yes - } - title_province = { - has_holding = yes - } - } - } - every_county_province = { - limit = { - has_holding = yes - is_occupied = no - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - } -} - -add_all_valid_mandala_contract_provinces_no_holding_to_list_effect = { - save_scope_as = mandala_ruler - every_sub_realm_county = { - every_county_province = { - limit = { - has_holding = no - is_occupied = no - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - every_tributary = { - every_sub_realm_county = { - every_county_province = { - limit = { - has_holding = no - is_occupied = no - NOR = { - this = scope:mandala_ruler.capital_province - has_variable = requested_mandala_ritual - has_variable = mandala_ritual_cooldown - } - } - add_to_list = valid_target_provinces - } - } - } -} - -set_mandala_contract_tier_effect = { - #Consider county_opinion as a factor - random_list = { - 30 = { - save_scope_value_as = { - name = mandala_task_contract_tier - value = define:NTaskContract|LOW_TASK_CONTRACT_TIER - } - } - 10 = { - save_scope_value_as = { - name = mandala_task_contract_tier - value = define:NTaskContract|MEDIUM_TASK_CONTRACT_TIER - } - - modifier = { - add = 10 - scope:target_province.county.county_opinion >= 10 - } - modifier = { - add = 10 - scope:target_province.county.county_opinion >= 20 - } - } - 5 = { - save_scope_value_as = { - name = mandala_task_contract_tier - value = define:NTaskContract|HIGH_TASK_CONTRACT_TIER - } - - modifier = { - add = 10 - scope:target_province.county.county_opinion >= 40 - } - modifier = { - add = 10 - scope:target_province.county.county_opinion >= 60 - } - modifier = { - add = 10 - scope:target_province.county.county_opinion >= 80 - } - modifier = { - add = 10 - scope:target_province.county.county_opinion >= 100 - } - } - } -} - -choose_address_mandala_effect = { - random_list = { - 1 = { - set_variable = { - name = loc_compliment - value = flag:holy_compliment_almighty - } - } - 1 = { - set_variable = { - name = loc_compliment - value = flag:holy_compliment_most_omnipotent - } - } - 1 = { - set_variable = { - name = loc_compliment - value = flag:holy_compliment_divine - } - } - 1 = { - set_variable = { - name = loc_compliment - value = flag:holy_compliment_venerable - } - } - 1 = { - set_variable = { - name = loc_compliment - value = flag:holy_compliment_reverent - } - } - } - #Error suppression - if = { - limit = { - OR = { - var:loc_desc ?= flag:mandala_provincial_ritual_desc_01 - var:loc_desc ?= flag:mandala_provincial_ritual_desc_02 - var:loc_compliment ?= flag:holy_compliment_almighty - var:loc_compliment ?= flag:holy_compliment_most_omnipotent - var:loc_compliment ?= flag:holy_compliment_divine - var:loc_compliment ?= flag:holy_compliment_venerable - var:loc_compliment ?= flag:holy_compliment_reverent - } - } - } -} - -mandala_set_ritual_variables_effect = { - task_contract_location = { - set_variable = requested_mandala_ritual - set_variable = { - name = mandala_ritual_cooldown - years = mandala_ritual_cooldown_years - } - } - task_contract_taker = { - increment_variable_effect = { - VAR = available_mandala_rituals - VAL = 1 - } - } -} - -big_mandala_piety_reward_effect = { - add_piety = { - value = mandala_contract_piety - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - multiply = 1.5 - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - multiply = 1.25 - } - multiply = 1.5 - } -} - -mandala_piety_reward_effect = { - add_piety = { - value = mandala_contract_piety - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - multiply = 1.5 - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - multiply = 1.25 - } - multiply = 0.75 - } -} - -small_mandala_piety_reward_effect = { - add_piety = { - value = mandala_contract_piety - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - multiply = 2 - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - multiply = 1.5 - } - multiply = 0.25 - } -} - -big_mandala_legitimacy_reward_effect = { - add_legitimacy = { - value = mandala_contract_legitimacy - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - multiply = 2 - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - multiply = 1.5 - } - multiply = 2 - } -} - -mandala_legitimacy_reward_effect = { - add_legitimacy = { - value = mandala_contract_legitimacy - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - multiply = 2 - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - multiply = 1.5 - } - } -} - -small_mandala_legitimacy_reward_effect = { - add_legitimacy = { - value = mandala_contract_legitimacy - if = { - limit = { contract_is_tier_3_contract_trigger = yes } - multiply = 2 - } - else_if = { - limit = { contract_is_tier_2_contract_trigger = yes } - multiply = 1.5 - } - multiply = 0.25 - } -} - -mandala_contract_failure_standard_reward_effect = { - if = { - limit = { is_ai = no } - add_piety = { - value = mandala_contract_piety - multiply = -1.5 - } - add_piety_experience = { - value = mandala_contract_piety - multiply = -1.5 - } - add_legitimacy = { - value = mandala_contract_legitimacy - multiply = -1.5 - } - } -} - - -change_to_mandala_interaction_effect = { - scope:actor = { - pay_short_term_gold = { - target = scope:recipient - gold = { - value = 50 - scope:recipient = { - if = { - limit = { highest_held_title_tier >= tier_kingdom } - multiply = 10 - } - else_if = { - limit = { highest_held_title_tier >= tier_duchy } - multiply = 6 - } - else_if = { - limit = { highest_held_title_tier >= tier_county } - multiply = 3 - } - } - if = { - limit = { scope:gold ?= yes } - add = scope:actor.medium_gold_value - } - } - } - } - scope:recipient = { change_to_mandala_government_and_citadel_effect = yes } - if = { - limit = { - scope:hook = yes - scope:actor = { has_usable_hook = scope:recipient } - } - scope:actor = { use_hook = scope:recipient } - } - if = { - limit = { scope:piety = yes } - scope:actor = { - add_piety = { - value = { - subtract = piety_bribe_value - } - } - } - } -} - - -mandala_no_longer_polytheist_effect = { - if = { - limit = { - is_ruler = yes - government_has_flag = government_is_mandala - faith = { - NOT = { has_doctrine = doctrine_polytheist } - } - } - convert_whole_realm_to_feudalism_effect = yes - hidden_effect = { - every_vassal = { - trigger_event = { - id = major_decisions.0002 - days = 3 - } - } - } - every_tributary = { end_tributary = yes } - } -} - - -#Remember to set wealth and quality beforehand -create_bunga_mas_artifact_effect = { - hidden_effect_new_object = { - create_artifact = { - name = bunga_mas - description = common_bunga_mas_desc - modifier = artifact_placeholder_modifier - wealth = scope:wealth - quality = scope:quality - type = pedestal - visuals = bunga_mas - save_scope_as = newly_created_bunga_mas - } - } -} - - -### STORY CYCLE -mandala_story_go_on_pilgrimage_effect = { - if = { - limit = { can_host_activity = activity_pilgrimage } - ai_attempt_to_host_activity = activity_pilgrimage - } - else = { - move_budget_gold = { gold = short_term_gold from = budget_war_chest to = budget_short_term } - move_budget_gold = { gold = long_term_gold from = budget_long_term to = budget_short_term } - } -} - -mandala_story_creation_aspect_get_kids_effect = { - if = { - limit = { - is_adult = yes - is_available = yes - } - if = { - limit = { is_female = no } - if = { - limit = { - any_consort = { - is_adult = yes - is_available = yes - fertility > 0 - is_pregnant = no - } - } - random_consort = { - limit = { - is_adult = yes - is_available = yes - fertility > 0 - is_pregnant = no - } - make_pregnant = { father = scope:root_scope } - } - } - } - if = { - limit = { is_female = yes } - if = { - limit = { - is_pregnant = no - any_consort = { - is_adult = yes - is_available = yes - fertility > 0 - } - } - random_consort = { - limit = { - is_adult = yes - is_available = yes - fertility > 0 - } - scope:root_scope = { - make_pregnant = { father = prev } - } - } - } - } - } -} - -mandala_story_serenity_aspect_befriend_effect = { - if = { - limit = { - any_courtier = { - can_set_relation_friend_trigger = { CHARACTER = scope:root_scope } - } - any_vassal = { - can_set_relation_friend_trigger = { CHARACTER = scope:root_scope } - } - } - every_courtier = { - limit = { - can_set_relation_friend_trigger = { CHARACTER = scope:root_scope } - } - add_to_list = serenity_potential_friends - } - every_vassal = { - limit = { - can_set_relation_friend_trigger = { CHARACTER = scope:root_scope } - } - add_to_list = serenity_potential_friends - } - ordered_in_list = { - list = serenity_potential_friends - order_by = "opinion(scope:root_scope)" - random = { - chance = 10 - set_relation_friend = scope:root_scope - } - } - } - else = { - mandala_story_befriend_scheme_effect = yes - } -} - -mandala_story_befriend_scheme_effect = { - if = { - limit = { - OR = { - house = { has_house_head_parameter = unlock_befriend_scheme } - has_perk = befriend_perk - } - OR = { - NOT = { - any_scheme = { - OR = { - scheme_type = befriend - scheme_type = sway - scheme_type = seduce - scheme_type = courting - scheme_type = elope - scheme_type = learn_language - } - } - } - AND = { - OR = { - dynasty ?= { has_dynasty_perk = glory_legacy_5 } - AND = { - has_royal_court = yes - has_dlc_feature = royal_court - has_court_type = court_diplomatic - court_grandeur_current_level >= 10 - } - } - any_scheme = { - count < 2 - OR = { - scheme_type = befriend - scheme_type = sway - scheme_type = seduce - scheme_type = courting - scheme_type = elope - scheme_type = learn_language - } - } - } - AND = { - dynasty ?= { has_dynasty_perk = glory_legacy_5 } - has_royal_court = yes - has_dlc_feature = royal_court - has_court_type = court_diplomatic - court_grandeur_current_level >= 10 - any_scheme = { - count < 3 - OR = { - scheme_type = befriend - scheme_type = sway - scheme_type = seduce - scheme_type = courting - scheme_type = elope - scheme_type = learn_language - } - } - } - } - } - every_courtier = { - limit = { - has_council_position = councillor_spymaster - opinion = { - target = scope:root_scope - value < 100 - } - save_temporary_scope_as = courtier_check - scope:root_scope = { - can_start_scheme = { - type = befriend - target_character = scope:courtier_check - } - } - } - add_to_list = befriend_targets - } - every_tributary = { - limit = { - opinion = { - target = scope:root_scope - value < 100 - } - save_temporary_scope_as = tributary_check - scope:root_scope = { - can_start_scheme = { - type = befriend - target_character = scope:tributary_check - } - } - } - add_to_list = befriend_targets - } - every_vassal = { - limit = { - highest_held_title_tier >= tier_county - opinion = { - target = scope:root_scope - value < 100 - } - save_temporary_scope_as = vassal_check - scope:root_scope = { - can_start_scheme = { - type = befriend - target_character = scope:vassal_check - } - } - } - add_to_list = befriend_targets - } - every_neighboring_and_across_water_top_liege_realm_owner = { - limit = { - highest_held_title_tier >= tier_county - opinion = { - target = scope:root_scope - value < 100 - } - save_temporary_scope_as = ruler_check - scope:root_scope = { - can_start_scheme = { - type = befriend - target_character = scope:ruler_check - } - } - } - every_tributary = { - limit = { - highest_held_title_tier >= tier_county - opinion = { - target = scope:root_scope - value < 100 - } - save_temporary_scope_as = ruler_tributary_check - scope:root_scope = { - can_start_scheme = { - type = befriend - target_character = scope:ruler_tributary_check - } - } - } - add_to_list = befriend_targets - } - add_to_list = befriend_targets - } - random_in_list = { - list = befriend_targets - limit = { - save_temporary_scope_as = befriend_check - NOT = { - scope:root_scope = { - any_scheme = { - is_hostile = yes - scheme_target_character = scope:befriend_check - } - } - } - } - weight = { - base = 1 - modifier = { - add = 10 - opinion = { - target = scope:root_scope - value < 100 - } - } - modifier = { - is_tributary = no - add = 150 - } - modifier = { - OR = { - realm_size <= scope:root_scope.realm_size - primary_title.tier <= scope:root_scope.primary_title.tier - } - add = 250 - } - modifier = { - primary_title ?= { is_neighbor_to_realm = scope:root_scope } - add = 250 - } - modifier = { - scope:root_scope = { - is_character_interaction_potentially_accepted = { - recipient = prev - interaction = offer_tributary_status_interaction - ai_accept = -30 - } - } - add = 1000 - } - } - save_scope_as = befriend_target - } - if = { - limit = { exists = scope:befriend_target } - start_scheme = { - type = befriend - target_character = scope:befriend_target - } - } - } -} - -mandala_story_destruction_aspect_declare_war_effect = { - if = { - limit = { - is_at_war = no - war_chest_gold >= war_chest_gold_maximum - } - add_stress = major_stress_loss - ai_start_best_war = { - cb = { - make_tributary_cb - mandala_raze_capital_structure_cb - } - is_valid = { - scope:target_character = { - current_military_strength < root.current_military_strength - OR = { - gold < root.gold - current_military_strength <= root.fifty_percent_of_current_military_strength - } - } - } - } - } -} - -mandala_story_destruction_aspect_buff_skill_effect = { - random = { - chance = 30 - add_$SKILL$_skill = 1 - } -} diff --git a/common/scripted_effects/tgp_tribute_mission_scripted_effects.txt b/common/scripted_effects/tgp_tribute_mission_scripted_effects.txt deleted file mode 100644 index f0ddd6f14..000000000 --- a/common/scripted_effects/tgp_tribute_mission_scripted_effects.txt +++ /dev/null @@ -1,678 +0,0 @@ -tribute_mission_clean_up_variables_effect = { - remove_variable = tribute_mission_target_scope - remove_variable = offered_gold_value - remove_variable = tribute_mission_type - remove_variable = offered_herd_value - remove_variable = offered_concubine - remove_variable = offered_eunuch - remove_variable = offered_artifact - remove_variable = tribute_reward_fascination_progress - - if = { - limit = { - has_character_flag = tribute_mission_character_flag # Under select circumstances it's possible this will be rerun, so this avoids an error - } - remove_character_flag = tribute_mission_character_flag - } - - if = { - limit = { exists = scope:receiving_character } - scope:receiving_character = { - if = { - limit = { has_character_flag = created_attendant } - silent_disappearance_effect = yes - } - } - } -} - -tribute_mission_clean_up_request_variables_effect = { - remove_variable = requested_tribute_mission - remove_variable = requested_tribute_mission_type_gold - remove_variable = requested_tribute_mission_type_herd - remove_variable = requested_tribute_mission_type_artifact - remove_variable = requested_tribute_mission_type_concubine - remove_variable = requested_tribute_mission_type_eunuch - remove_variable = declined_requested_tribute_recently - remove_variable = predetermined_concubine_tribute - remove_variable = predetermined_eunuch_tribute - remove_variable = predetermined_artifact_tribute -} - -requested_tribute_mission_clean_up_variables_effect = { - remove_variable = requested_tribute_mission - remove_variable = invalidation_should_fail_ongoing_requested_tribute_mission -} - -tribute_mission_decision_effect = { - if = { - #Are you a tributary of a Hegemon? - limit = { subject_standing >= 0 } - if = { - limit = { is_tributary = yes } - #If it's China, flavorize Imperial Grace - if = { - limit = { suzerain = { primary_title = title:h_china } } - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_imperial_grace - } - #Else standard stuff - else = { - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_generic_hegemon - } - } - } - else = { - if = { - limit = { $TARGET$ = { primary_title = title:h_china } } - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_china - } - else_if = { - limit = { $TARGET$ = { primary_title = title:h_roman_empire } } - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_roman_empire - } - else_if = { - limit = { $TARGET$ = { primary_title = title:h_eastern_roman_empire } } - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_eastern_roman_empire - } - else_if = { - limit = { $TARGET$ = { primary_title = title:h_dar_al_islam } } - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_dar_al_islam - } - else_if = { - limit = { $TARGET$ = { primary_title = title:h_india } } - custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt_india - } - else = { custom_tooltip = tribute_mission_interaction_anticipated_rewards_tt } - } - - hidden_effect = { - tribute_mission_clean_up_variables_effect = yes - - if = { - limit = { is_tributary = yes } - suzerain = { - save_scope_as = tribute_mission_target - add_character_flag = { - flag = pay_tribute_cooldown - years = 3 - } - } - } - else = { - $TARGET$ = { - save_scope_as = tribute_mission_target - } - } - - set_variable = { # persist for later interactions - name = tribute_mission_target_scope - value = scope:tribute_mission_target - } - } - # not all tribute decisions have this option - if = { - limit = { NOT = { exists = scope:tribute_mission_bunga_mas } } - save_temporary_scope_value_as = { name = tribute_mission_bunga_mas value = no } - } - - #Your Suzerain requested this specifically - if = { - limit = { - has_variable = requested_tribute_mission - is_ai = yes - } - switch = { - trigger = has_variable - requested_tribute_mission_type_gold = { # Gold - run_interaction = { - interaction = tribute_mission_gold_interaction - actor = root - recipient = scope:tribute_mission_target - execute_threshold = accept - } - } - requested_tribute_mission_type_herd = { # Herd - run_interaction = { - interaction = tribute_mission_herd_interaction - actor = root - recipient = scope:tribute_mission_target - execute_threshold = accept - } - } - requested_tribute_mission_type_artifact = { # Artifact - var:predetermined_artifact_tribute ?= { save_scope_as = predetermined_artifact_tribute_scope } - #Do the things from the interaction - scope:predetermined_artifact_tribute_scope = { - set_variable = is_tribute_mission_artifact - } - #Save the Artifact - set_variable = { - name = tribute_mission_type - value = flag:artifact_tribute - } - set_variable = { - name = offered_artifact - value = scope:predetermined_artifact_tribute_scope - } - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - requested_tribute_mission_type_concubine = { # Concubine - var:predetermined_concubine_tribute ?= { - save_scope_as = predetermined_concubine_tribute_scope - } - scope:predetermined_concubine_tribute_scope = { - add_character_flag = { - flag = cannot_be_diarch # just enough to make sure they don't succeed to the diarchy while en route - years = 2 - } - } - run_interaction = { - interaction = tribute_mission_concubine_interaction - actor = root - recipient = scope:tribute_mission_target - secondary_recipient = scope:predetermined_concubine_tribute_scope - execute_threshold = accept - } - } - requested_tribute_mission_type_eunuch = { # Eunuch - var:predetermined_eunuch_tribute ?= { save_scope_as = predetermined_eunuch_tribute_scope } - run_interaction = { - interaction = tribute_mission_eunuch_interaction - actor = root - recipient = scope:tribute_mission_target - secondary_recipient = scope:predetermined_eunuch_tribute_scope - execute_threshold = accept - } - } - } - } - else_if = { - limit = { is_ai = yes } - switch = { - trigger = yes - - scope:tribute_mission_gold = { # Gold - run_interaction = { - interaction = tribute_mission_gold_interaction - actor = root - recipient = scope:tribute_mission_target - execute_threshold = accept - } - } - - scope:tribute_mission_herd = { # Herd - run_interaction = { - interaction = tribute_mission_herd_interaction - actor = root - recipient = scope:tribute_mission_target - execute_threshold = accept - } - } - - scope:tribute_mission_artifact = { # Artifact - random_character_artifact = { - limit = { is_suitable_artifact_tribute_trigger = yes } - save_scope_as = decision_predetermined_artifact_tribute - } - #Do the things from the interaction - scope:decision_predetermined_artifact_tribute = { - set_variable = is_tribute_mission_artifact - } - #Save the Artifact - set_variable = { - name = tribute_mission_type - value = flag:artifact_tribute - } - set_variable = { - name = offered_artifact - value = scope:decision_predetermined_artifact_tribute - } - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - - scope:tribute_mission_concubine = { # Concubine - every_courtier_or_guest = { - limit = { - can_be_offered_as_concubine_to_character_trigger = { - GIVER = root - CHARACTER = scope:tribute_mission_target - } - tribute_mission_is_available_concubine_trigger = yes - } - add_to_list = potential_concubine_tribute_list - random_in_list = { - list = potential_concubine_tribute_list - weight = { - #Let's try to make a sane choice here - base = 0 - #No marginally relevant court people - modifier = { - add = 10 - NOR = { - is_councillor = yes - has_any_court_position = yes - } - } - #No knights - modifier = { - add = 5 - is_knight = no - } - #No inspired people? - modifier = { - add = 20 - NOT = { exists = inspiration } - } - #No close family - modifier = { - add = 15 - NOT = { is_close_or_extended_family_of = root } - } - #No friends? - modifier = { - add = 20 - NOT = { has_relation_friend = root } - } - #No children - modifier = { - add = 25 - NOT = { is_child_of = root } - } - } - save_scope_as = decision_predetermined_concubine_tribute - } - } - # Fallback in case there's no saved concubine - if = { - limit = { - NOT = { exists = scope:decision_predetermined_concubine_tribute } - } - create_character = { - template = tgp_concubine_template - location = root.location - save_scope_as = decision_predetermined_concubine_tribute - } - } - scope:decision_predetermined_concubine_tribute = { - add_character_flag = { - flag = cannot_be_diarch # just enough to make sure they don't succeed to the diarchy while en route - years = 2 - } - } - run_interaction = { - interaction = tribute_mission_concubine_interaction - actor = root - recipient = scope:tribute_mission_target - secondary_recipient = scope:decision_predetermined_concubine_tribute - execute_threshold = accept - } - } - - scope:tribute_mission_eunuch = { # Eunuch - every_courtier = { - limit = { - tribute_mission_is_available_eunuch_trigger = yes - NOT = { is_heir_of = root } - } - add_to_list = potential_eunuch_tribute_list - random_in_list = { - list = potential_eunuch_tribute_list - weight = { - #Let's try to make a sane choice here - base = 0 - #No marginally relevant court people - modifier = { - add = 10 - NOR = { - is_councillor = yes - has_any_court_position = yes - } - } - #No knights - modifier = { - add = 5 - is_knight = no - } - #No inspired people? - modifier = { - add = 20 - NOT = { exists = inspiration } - } - #No close family - modifier = { - add = 15 - NOT = { is_close_or_extended_family_of = scope:tribute_mission_target } - } - #No friends? - modifier = { - add = 20 - NOT = { has_relation_friend = scope:tribute_mission_target } - } - #No children - modifier = { - add = 25 - NOT = { is_child_of = scope:tribute_mission_target } - } - } - save_scope_as = decision_predetermined_eunuch_tribute - } - } - run_interaction = { - interaction = tribute_mission_eunuch_interaction - actor = root - recipient = scope:tribute_mission_target - secondary_recipient = scope:decision_predetermined_eunuch_tribute - execute_threshold = accept - } - } - - scope:tribute_mission_bunga_mas = { # Bunga Mas - random_character_artifact = { - limit = { var:bunga_mas_created_by ?= root } - save_scope_as = decision_predetermined_bunga_mas_tribute - } - #Do the things from the interaction - scope:decision_predetermined_bunga_mas_tribute = { - set_variable = is_tribute_mission_artifact - } - #Save the Artifact - set_variable = { - name = tribute_mission_type - value = flag:bunga_mas_tribute - } - set_variable = { - name = offered_bunga_mas - value = scope:decision_predetermined_bunga_mas_tribute - } - #Travel - tribute_mission_set_up_tribute_travel_effect = yes - } - } - } - #Natural flow of the decision - else_if = { - limit = { is_ai = no } - switch = { - trigger = yes - - scope:tribute_mission_gold = { # Gold - open_interaction_window = { - interaction = tribute_mission_gold_interaction - actor = root - recipient = scope:tribute_mission_target - } - } - - scope:tribute_mission_herd = { # Herd - open_interaction_window = { - interaction = tribute_mission_herd_interaction - actor = root - recipient = scope:tribute_mission_target - } - } - - scope:tribute_mission_artifact = { # Artifact - open_interaction_window = { - interaction = tribute_mission_artifact_interaction - actor = root - recipient = scope:tribute_mission_target - } - } - - scope:tribute_mission_concubine = { # Concubine - open_interaction_window = { - interaction = tribute_mission_concubine_interaction - actor = root - recipient = scope:tribute_mission_target - } - } - - scope:tribute_mission_eunuch = { # Eunuch - open_interaction_window = { - interaction = tribute_mission_eunuch_interaction - actor = root - recipient = scope:tribute_mission_target - } - } - - scope:tribute_mission_bunga_mas = { # Bunga Mas - open_interaction_window = { - interaction = tribute_mission_bunga_mas_interaction - actor = root - recipient = scope:tribute_mission_target - } - } - } - } - - if = { - limit = { - is_ai = yes - scope:tribute_mission_target = { highest_held_title_tier = tier_hegemony } - } - scope:tribute_mission_target = { - set_variable = { - name = ai_tribute_mission_cooldown - years = 1 - } - } - } -} - -set_or_change_offered_tribute_value_effect = { - if = { - limit = { has_variable = offered_$TYPE$_value } - change_variable = { - name = offered_$TYPE$_value - add = $VALUE$ - } - } - else = { - set_variable = { - name = offered_$TYPE$_value - value = $VALUE$ - } - } -} - - -tribute_mission_set_up_tribute_travel_effect = { - #Recover the tribute_mission_target scope from saved var if it doesn't already exist - if = { - limit = { exists = var:tribute_mission_target_scope } - var:tribute_mission_target_scope = { - save_scope_as = tribute_mission_target - } - } - else = { - error_log = "Tribute mission target scope variable not set on character intending to travel!" - } - #Travel posted first should look neater in tooltip - hidden_effect = { # ensure we subtract everything we've offered - if = { - limit = { has_variable = offered_gold_value } - remove_short_term_gold = var:offered_gold_value - } - if = { - limit = { has_variable = offered_herd_value } - domicile ?= { - change_herd = { subtract = prev.var:offered_herd_value } - } - } - } - trigger_event = { on_action = tribute_mission_start } - if = { - limit = { location = scope:tribute_mission_target.capital_province } - trigger_event = tribute_mission.0002 - } - #Add the concubine - else_if = { - limit = { has_variable = offered_concubine } - start_travel_plan = { - destination = scope:tribute_mission_target.capital_province - companion = var:offered_concubine - on_travel_planner_cancel_on_action = tribute_mission_travel_planner_exit - on_arrival_event = tribute_mission.0002 - } - } - #Add the eunuch - else_if = { - limit = { has_variable = offered_eunuch } - start_travel_plan = { - destination = scope:tribute_mission_target.capital_province - companion = var:offered_eunuch - on_travel_planner_cancel_on_action = tribute_mission_travel_planner_exit - on_arrival_event = tribute_mission.0002 - } - } - else = { - custom_tooltip = tribute_mission.travel_to.tt - start_travel_plan = { - destination = scope:tribute_mission_target.capital_province - on_travel_planner_cancel_on_action = tribute_mission_travel_planner_exit - on_arrival_event = tribute_mission.0002 - } - } -} - -tribute_mission_invalidation_effect = { - if = { - limit = { has_variable = tribute_mission_type } - if = { - limit = { # sanity check to ensure we're still a valid tribute provider - OR = { - is_independent_ruler = no # if we have a liege we cannot also pay tribute to someone else - AND = { # if we're not a tributary we are only valid if we're paying tribute to a hegemony - is_tributary = no - OR = { - NOT = { exists = var:tribute_mission_target_scope } - var:tribute_mission_target_scope = { NOT = { highest_held_title_tier = tier_hegemony } } - } - } - } - } - #Return home and refund - trigger_event = tribute_mission.9800 - } - else_if = { #If our offerings have perished or been imprisoned along the way, maybe swap to gold - limit = { - has_variable = tribute_mission_type - OR = { - AND = { - has_variable = offered_concubine - OR = { - var:offered_concubine = { is_alive = no } - var:offered_concubine = { is_imprisoned = yes } - } - } - AND = { - has_variable = offered_eunuch - OR = { - var:offered_eunuch = { is_alive = no } - var:offered_eunuch = { is_imprisoned = yes } - } - } - } - } - trigger_event = tribute_mission.9750 - } - else_if = { - #We're still a tributary on our way to pay tribute, but our suzerain is not the person we were going to pay tribute to - limit = { - has_variable = tribute_mission_target_scope - OR = { - AND = { - is_tributary = yes - var:tribute_mission_target_scope != suzerain - } - AND = { - is_tributary = no - OR = { - NOT = { exists = var:tribute_mission_target_scope } - var:tribute_mission_target_scope = { NOT = { highest_held_title_tier = tier_hegemony } } - } - } - } - } - var:tribute_mission_target_scope = { save_scope_as = old_overlord } - suzerain = { save_scope_as = new_overlord } - #Clean up Requested Tribute Mission variables - requested_tribute_mission_clean_up_variables_effect = yes - #The new Overlord is in the same place and can accept the tribute - if = { - limit = { - #Make sure they can still accept our offerings; if so, just set the new target - current_travel_plan.next_destination_province = scope:new_overlord.capital_province - has_variable = tribute_mission_type - trigger_if = { - limit = { - has_variable = { - name = offered_concubine - name = offered_eunuch - } - } - OR = { - AND = { - has_variable = offered_concubine - var:offered_concubine = { - can_become_concubine_of_character_valid_trigger = { CHARACTER = scope:new_overlord } - } - } - AND = { - has_variable = offered_eunuch - scope:new_overlord = { - culture = { has_cultural_parameter = can_appoint_chief_eunuch } - } - } - } - } - } - send_interface_message = { - type = msg_mandala_neutral_text - title = tribute_mission_notification.new_overlord.title - left_icon = scope:new_overlord - desc = tribute_mission_notification.new_overlord.desc - } - set_variable = { - name = tribute_mission_target_scope - value = scope:new_overlord - } - } - #The Overlord is somewhere else; please try again - else_if = { - limit = { - current_travel_plan.next_destination_province != scope:new_overlord.capital_province - } - set_variable = new_overlord_somewhere_else - #Return home and refund - trigger_event = tribute_mission.9800 - } - else = { - set_variable = new_overlord_unable_to_accept_tribute - #Return home and refund - trigger_event = tribute_mission.9800 - } - } - } -} - -tribute_mission_mandala_piety_effect = { - if = { - limit = { government_has_flag = government_is_mandala } - overlord = { add_piety = minor_piety_gain } - } -} - -requested_tribute_mission_penalty_effect = { - if = { - limit = { - has_variable = invalidation_should_fail_ongoing_requested_tribute_mission - } - trigger_event = { - id = tribute_mission.9500 - delayed = yes - } - } -}