From bce2aa31a1251c738fd7eefaebb072619bb61983 Mon Sep 17 00:00:00 2001 From: Greekman Date: Sat, 21 Nov 2026 19:27:08 +0000 Subject: [PATCH] fixes big evebts abd on actions plus mroe --- common/artifacts/types/00_types.txt | 18 +- .../00_casus_belli_groups.txt | 13 + common/casus_belli_types/09_mpo_wars.txt | 34 +- .../N3OW_cultural_maa_innovations.txt | 124 +- .../00_cultural_tradition_decisions.txt | 3 + common/decisions/00_dynasty_decisions.txt | 109 +- common/decisions/00_guest_decisions.txt | 11 +- common/decisions/00_holy_order_decisions.txt | 139 +- common/decisions/00_lifestyle_decisions.txt | 15 +- common/decisions/00_trait_decisions.txt | 17 +- common/decisions/00_unity_decisions.txt | 1373 +- common/decisions/04_ep2_decisions.txt | 2 +- common/decisions/06_ce1_decisions.txt | 76 +- common/decisions/10_ach_oath_decisions.txt | 8 +- .../10_culture_conversion_decisions.txt | 1 + common/decisions/10_religious_decisions.txt | 7 +- common/decisions/30_activity_decisions.txt | 48 +- common/decisions/30_court_decisions.txt | 17 + common/decisions/40_japan_decisions.txt | 8 +- common/decisions/80_major_decisions.txt | 281 +- common/decisions/90_minor_decisions.txt | 13 +- .../bp3/00_bp3_other_decisions.txt | 100 +- .../bp_2/00_bp2_other_decisions.txt | 4 + .../decisions/dlc_decisions/ep3_decisions.txt | 7 +- .../ep_1/00_ep1_other_decisions.txt | 19 +- .../ep_3/06_ep3_admin_decisions.txt | 47 +- .../ep_3/06_ep3_laamp_decisions.txt | 114 +- .../06_ep3_separatist_uprising_decision.txt | 2 +- .../decisions/dlc_decisions/fp3_decisions.txt | 4 +- .../fp_1/00_fp1_other_decisions.txt | 2 +- .../dlc_decisions/mpo/09_mpo_decisions_2.txt | 19 +- .../dlc_decisions/mpo/mpo_decisions.txt | 2262 +-- .../mpo/mpo_pax_mongolica_decision.txt | 255 +- .../dlc_decisions/pam/bulls_decisions.txt | 64 + .../pam/pam_antipope_decisions.txt | 42 +- .../dlc_decisions/pam/pam_decisions.txt | 487 +- .../dlc_decisions/pam/pam_saint_decisions.txt | 3 +- .../tgp/tgp_dynastic_cycle_decisions.txt | 35 +- .../tgp/tgp_east_asia_decisions.txt | 17 +- .../tgp/tgp_silk_road_decisions.txt | 87 +- .../tgp/tgp_steppe_decisions.txt | 3 +- .../tgp/tgp_tribute_mission_decisions.txt | 19 +- .../NEOW_minority_community_buildings.txt | 10 +- common/factions/00_peasant_faction_new.txt | 2 +- common/game_concepts/00_game_concepts.txt | 6 +- common/landed_titles/caucasus.txt | 2 +- common/landed_titles/finland.txt | 2 +- common/landed_titles/religious_titles.txt | 2 +- common/laws/00_realm_laws.txt | 707 +- common/laws/00_succession_laws.txt | 287 + common/on_action/army_on_actions.txt | 225 +- common/on_action/barter_on_actions.txt | 33 +- common/on_action/combat_on_actions.txt | 217 +- common/on_action/death.txt | 36 +- .../dlc/fp2/fp2_other_decision_on_actions.txt | 29 + common/on_action/game_start.txt | 559 +- common/on_action/inventory_on_actions.txt | 43 + common/on_action/prison_on_actions.txt | 537 + common/on_action/province_on_actions.txt | 71 +- common/on_action/religion_on_actions.txt | 173 +- ...ory_cycle_roman_restoration_on_actions.txt | 39 + common/on_action/title_on_actions.txt | 663 +- common/on_action/travel_on_actions.txt | 134 +- common/on_action/war_on_actions.txt | 12 +- common/on_action/yearly_groups_on_actions.txt | 1 + common/on_action/yearly_on_actions.txt | 340 +- common/script_values/00_building_values.txt | 2 + common/script_values/00_travel_values.txt | 5 +- common/script_values/00_war_values.txt | 166 +- .../script_values/06_ce1_epidemics_values.txt | 52 + common/script_values/NEOW_custom_values.txt | 6 +- ...gdp_guelph_ghibelline_scripted_effects.txt | 2700 +++ .../00_holy_order_effects.txt | 24 +- .../scripted_effects/00_religion_effects.txt | 2 +- .../00_scheme_scripted_effects.txt | 9 + .../07_dlc_ep3_scripted_effects.txt | 1 - .../00_ai_value_triggers.txt | 35 + .../00_clothing_triggers.txt | 10 + common/scripted_triggers/00_coa_triggers.txt | 13 + .../scripted_triggers/00_laamp_triggers.txt | 4 +- .../scripted_triggers/00_weather_triggers.txt | 2 - .../03_fp2_scripted_triggers.txt | 23 +- .../07_frankokratia_triggers.txt | 33 + .../pam_scripted_triggers.txt | 423 +- .../pam_secular_faith_triggers.txt | 11 + .../fp3_story_cycle_zanj_rebellion.txt | 65 +- .../mpo_story_cycle_greatest_of_khans.txt | 511 +- .../story_cycle_almohad_invasion.txt | 297 +- .../story_cycle_mongol_invasion.txt | 1039 +- .../story_cycle_seljuk_invasion.txt | 317 +- .../groups/subject_contract_groups.txt | 24 + .../NEOW_succession_elections.txt | 8 +- .../county_potential_trade_goods.txt | 77 + .../coronation_activity/coronation_events.txt | 134 +- .../coronation_events_1.txt | 35 +- .../coronation_events_6.txt | 191 +- .../pam_ecumenical_council_events_josh.txt | 49 +- .../hold_court_events_general.txt | 60 +- .../pilgrimage_activity/pilgrimage_events.txt | 71 +- .../tour_grounds_events_chad.txt | 912 +- .../tour_phase_cultural_festival.txt | 185 +- .../tour_activity/tour_travel_events.txt | 26 +- events/artifacts/artifact_events.txt | 35 +- events/court_events/01_ep3_court_events_3.txt | 20 +- events/court_events/court_events_general.txt | 71 +- .../court_events/court_events_general_1.txt | 13 +- .../major_decisions_events.txt | 60 +- .../mpo_greatest_of_khans_events.txt | 5610 +++--- events/dlc/ach/ach_coronation_events.txt | 23 +- .../bp2_adult_education_activity_events.txt | 6 +- events/dlc/bp3/bp3_journey_events.txt | 20 +- events/dlc/ce1/epidemic_events.txt | 55 +- events/dlc/ce1/legend_spread_events_8.txt | 22 +- .../dlc/ep1/ep1_fund_inspiration_events.txt | 113 +- events/dlc/ep2/ep2_tournament_events.txt | 34 +- events/dlc/ep3/ep3_decisions_events.txt | 37 +- events/dlc/ep3/ep3_emperor_yearly_2.txt | 95 +- events/dlc/ep3/ep3_emperor_yearly_8.txt | 36 +- events/dlc/ep3/ep3_eparch_events.txt | 4 +- events/dlc/ep3/ep3_governor_yearly_3.txt | 66 +- events/dlc/ep3/ep3_governor_yearly_8.txt | 47 +- events/dlc/ep3/ep3_interactions_events.txt | 85 +- events/dlc/ep3/ep3_laamp_decision_events.txt | 64 +- events/dlc/ep3/ep3_laamp_events.txt | 270 +- events/dlc/ep3/ep3_laamp_events_8.txt | 7 +- .../dlc/ep3/ep3_roman_restoration_events.txt | 73 +- .../ep3_story_cycle_admin_eunuch_events.txt | 17 +- ...ep3_story_cycle_grand_ambitions_events.txt | 7 +- events/dlc/ep3/ep3_travel_events_3.txt | 6 +- events/dlc/ep3/ep3_travel_option_events.txt | 1240 +- events/dlc/fp1/fp1_jomsvikings_events.txt | 39 +- events/dlc/fp1/fp1_other_decision_events.txt | 10 +- .../fp1_scandinavian_adventurer_events.txt | 15 +- events/dlc/fp1/fp1_trade_events.txt | 2505 +++ events/dlc/fp1/fp1_yearly_events.txt | 20 +- events/dlc/fp1/fp1_yearly_events_oltner.txt | 27 +- events/dlc/fp2/fp2_yearly_events.txt | 25 +- events/dlc/fp3/fp3_heritage_events.txt | 24 +- events/dlc/fp3/fp3_misc_decision_events.txt | 28 +- .../dlc/fp3/fp3_religious_decision_events.txt | 6 +- .../dlc/fp3/fp3_yearly_events_ola_batch_1.txt | 22 +- events/dlc/gdp/gdp_burgher_events.txt | 655 + .../gdp/gdp_civic_agitation_scheme_events.txt | 263 + events/dlc/gdp/gdp_decision_events.txt | 950 + .../dlc/gdp/gdp_guelph_ghibelline_events.txt | 864 + .../gdp_guelph_ghibelline_scheme_events.txt | 923 + .../gdp/gdp_incite_unrest_scheme_events.txt | 178 + .../dlc/gdp/gdp_merchant_activity_events.txt | 1580 ++ events/dlc/gdp/gdp_merchant_events.txt | 9503 ++++++++++ events/dlc/gdp/gdp_merchant_family_events.txt | 4023 ++++ .../gdp_merchant_luxury_contract_events.txt | 8478 +++++++++ .../gdp_merchant_patron_contract_events.txt | 196 + .../gdp_merchant_scheme_advantage_events.txt | 817 + .../dlc/gdp/gdp_merchant_schmooze_events.txt | 1357 ++ .../gdp_merchant_trade_opportunity_events.txt | 6780 +++++++ .../gdp_merchant_unity_contract_events.txt | 2099 ++ ...p_patrician_find_secrets_scheme_events.txt | 143 + events/dlc/gdp/gdp_purpose_events.txt | 376 + events/dlc/gdp/gdp_republic_events.txt | 615 + ...gdp_republic_patrician_decision_events.txt | 2172 +++ .../gdp_republic_popular_opinion_events.txt | 952 + events/dlc/gdp/gdp_republic_unrest_events.txt | 2335 +++ .../dlc/gdp/gdp_trade_good_flavor_events.txt | 15798 ++++++++++++++++ events/dlc/gdp/gdp_trade_league_events.txt | 22 + events/dlc/gdp/gdp_trade_scheme_events.txt | 280 + .../gdp/gdp_visit_holding_decision_event.txt | 5003 +++++ .../gdp_visit_holding_decision_event_2.txt | 4050 ++++ ...romote_candidate_scheme_outcome_events.txt | 102 + .../dlc/mpo/mpo_migration_travel_events.txt | 4 +- events/dlc/mpo/mpo_nomad_events_1.txt | 24 +- events/dlc/mpo/mpo_nomads_flavour_events.txt | 16 +- .../heresy/pam_heresy_historical_events.txt | 4 +- events/dlc/pam/pam_antipope_events.txt | 12 +- .../pam/pam_christian_situation_events.txt | 62 +- events/dlc/pam/pam_clergy_events.txt | 52 +- events/dlc/pam/pam_decision_events.txt | 35 +- events/dlc/pam/pam_interactions_events.txt | 27 +- events/dlc/pam/pam_secular_faith_events.txt | 22 +- .../dlc/pam/pam_theocratic_ruler_events.txt | 827 +- .../dlc/tgp/tgp_ceremonial_liege_events.txt | 2 +- .../dlc/tgp/tgp_child_personality_events.txt | 350 +- events/dlc/tgp/tgp_china_yearly_events.txt | 97 +- events/dlc/tgp/tgp_silk_road_events.txt | 13 +- events/factions/faction_demands.txt | 6 +- events/game_rule_events.txt | 23 +- events/global_religion_events.txt | 197 +- events/historical_character_events.txt | 6 +- .../learning_medicine_events.txt | 10 +- .../learning_theology_events.txt | 17 +- .../false_conversion_events.txt | 73 + .../religion_events/great_holy_war_events.txt | 28 +- .../court_scheme_ongoing_events.txt | 50 +- .../governor_contract_events.txt | 4 +- .../disbelieve_mandala_scheme_events.txt | 4 +- events/single_combat_events.txt | 11 +- events/test_events/debug.txt | 178 +- events/title_events.txt | 81 +- events/travel_events/gdp_travel_events.txt | 2128 +++ events/travel_events/travel_events_bp3.txt | 28 +- events/travel_events/travel_events_james.txt | 17 +- events/war_events/combat_events.txt | 95 +- events/war_events/raid_events.txt | 42 +- events/yearly_events/bp1_yearly_james.txt | 83 +- events/yearly_events/court_yearly_events.txt | 45 +- events/yearly_events/yearly_events_3.txt | 10 +- .../yearly_events/yearly_events_republic.txt | 6050 ++++++ events/yearly_events/yearly_events_sahara.txt | 8 +- 207 files changed, 100377 insertions(+), 9296 deletions(-) create mode 100644 common/on_action/dlc/fp2/fp2_other_decision_on_actions.txt create mode 100644 common/on_action/prison_on_actions.txt create mode 100644 common/on_action/story_cycles/story_cycle_roman_restoration_on_actions.txt create mode 100644 common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt create mode 100644 common/trade/county_potential_trade_goods/county_potential_trade_goods.txt create mode 100644 events/dlc/fp1/fp1_trade_events.txt create mode 100644 events/dlc/gdp/gdp_burgher_events.txt create mode 100644 events/dlc/gdp/gdp_civic_agitation_scheme_events.txt create mode 100644 events/dlc/gdp/gdp_decision_events.txt create mode 100644 events/dlc/gdp/gdp_guelph_ghibelline_events.txt create mode 100644 events/dlc/gdp/gdp_guelph_ghibelline_scheme_events.txt create mode 100644 events/dlc/gdp/gdp_incite_unrest_scheme_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_activity_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_family_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_luxury_contract_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_patron_contract_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_scheme_advantage_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_schmooze_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_trade_opportunity_events.txt create mode 100644 events/dlc/gdp/gdp_merchant_unity_contract_events.txt create mode 100644 events/dlc/gdp/gdp_patrician_find_secrets_scheme_events.txt create mode 100644 events/dlc/gdp/gdp_purpose_events.txt create mode 100644 events/dlc/gdp/gdp_republic_events.txt create mode 100644 events/dlc/gdp/gdp_republic_patrician_decision_events.txt create mode 100644 events/dlc/gdp/gdp_republic_popular_opinion_events.txt create mode 100644 events/dlc/gdp/gdp_republic_unrest_events.txt create mode 100644 events/dlc/gdp/gdp_trade_good_flavor_events.txt create mode 100644 events/dlc/gdp/gdp_trade_league_events.txt create mode 100644 events/dlc/gdp/gdp_trade_scheme_events.txt create mode 100644 events/dlc/gdp/gdp_visit_holding_decision_event.txt create mode 100644 events/dlc/gdp/gdp_visit_holding_decision_event_2.txt create mode 100644 events/dlc/gdp/republic_promote_candidate_scheme_outcome_events.txt create mode 100644 events/travel_events/gdp_travel_events.txt create mode 100644 events/yearly_events/yearly_events_republic.txt diff --git a/common/artifacts/types/00_types.txt b/common/artifacts/types/00_types.txt index 1eb0b8b3b..0380b3ee8 100644 --- a/common/artifacts/types/00_types.txt +++ b/common/artifacts/types/00_types.txt @@ -201,7 +201,7 @@ journal = { miscellaneous_when_not_court = { slot = miscellaneous # Just add to this list as new DLC court artifacts are designed. - optional_features = { sculpture_material generic_material_wood decoration_material_inlay goblet_material } + optional_features = { sculpture_material generic_material_wood decoration_material_inlay goblet_material icon_decoration } } brooch = { @@ -463,3 +463,19 @@ crossbow = { slot = primary_armament required_features = { bow_wood bow_string } } + + +library_item = { + slot = library + optional_features = { book_topic book_title book_decoration decoration_pattern generic_material_wood decoration_material_gem decoration_material_inlay_HSB } +} + + +creature = { + slot = creature +} + + +curio = { + slot = curio +} diff --git a/common/casus_belli_groups/00_casus_belli_groups.txt b/common/casus_belli_groups/00_casus_belli_groups.txt index 1ddf25c90..943736faf 100644 --- a/common/casus_belli_groups/00_casus_belli_groups.txt +++ b/common/casus_belli_groups/00_casus_belli_groups.txt @@ -257,3 +257,16 @@ celestial = { } } } + + +merchant_seize_realm = { + allowed_for_character = { + herders_and_tributary_constraints = yes + tgp_dynastic_cycle_offensive_wars_ban_trigger = yes + tgp_war_ban_all_ministers_trigger = yes + NOT = { government_has_flag = government_is_theocracy } + } + allowed_for_character_display_regardless = { + pam_personal_pacifism_offensive_war_ban_trigger = yes + } +} diff --git a/common/casus_belli_types/09_mpo_wars.txt b/common/casus_belli_types/09_mpo_wars.txt index 5e6ddda23..35ed04efd 100644 --- a/common/casus_belli_types/09_mpo_wars.txt +++ b/common/casus_belli_types/09_mpo_wars.txt @@ -1,4 +1,4 @@ -#migration_cb +#migration_cb #mpo_nomad_invasion_cb #humiliation_cb #retaliation_cb @@ -4565,10 +4565,10 @@ mpo_great_war_of_defiance_cb = { mpo_war_of_defiance_notified_player_trigger = yes } } - trigger_event = { - id = mpo_greatest_of_khans.0103 - days = 2 - } +# trigger_event = { +# id = mpo_greatest_of_khans.0103 +# days = 2 +# } } } @@ -4702,10 +4702,10 @@ mpo_great_war_of_defiance_cb = { } } } - trigger_event = { - id = mpo_greatest_of_khans.0001 - days = 1 - } +# trigger_event = { +# id = mpo_greatest_of_khans.0001 +# days = 1 +# } } # Truce add_truce_attacker_defeat_effect = yes @@ -5477,10 +5477,10 @@ mpo_gok_onslaught_cb = { is_ai = no top_liege = scope:attacker } - trigger_event = { - id = mpo_greatest_of_khans.0050 - days = 2 - } +# trigger_event = { +# id = mpo_greatest_of_khans.0050 +# days = 2 +# } } #Send taunt to unlanded losers every_in_list = { @@ -5489,10 +5489,10 @@ mpo_gok_onslaught_cb = { is_ai = no NOT = { top_liege = scope:attacker } } - trigger_event = { - id = mpo_greatest_of_khans.0051 - days = 2 - } +# trigger_event = { +# id = mpo_greatest_of_khans.0051 +# days = 2 +# } } # Allies on both sides get full prestige value for helping in the war, based on their war participation. diff --git a/common/culture/innovations/N3OW_cultural_maa_innovations.txt b/common/culture/innovations/N3OW_cultural_maa_innovations.txt index b2f731e68..66d102c5a 100644 --- a/common/culture/innovations/N3OW_cultural_maa_innovations.txt +++ b/common/culture/innovations/N3OW_cultural_maa_innovations.txt @@ -54,7 +54,7 @@ innovation_british_ironsides = { icon = @knight potential = { - NOT = { culture = culture:angler } + NOT = { this = culture:angler } OR = { has_cultural_pillar = heritage_brythonic has_cultural_pillar = heritage_anglo_frisian @@ -93,7 +93,7 @@ innovation_pioneers = { icon = @knighthood potential = { - culture = culture:metropolitain + this = culture:metropolitain } @@ -131,9 +131,9 @@ innovation_gardians = { potential = { OR = { - culture = culture:provencal - culture = culture:rottisch - culture = culture:patoues + this = culture:provencal + this = culture:rottisch + this = culture:patoues } } @@ -154,9 +154,9 @@ innovation_voltigeurs = { potential = { OR = { - culture = culture:elsasse - culture = culture:lorin - culture = culture:gascon + this = culture:elsasse + this = culture:lorin + this = culture:gascon } } @@ -197,8 +197,8 @@ innovation_guides = { potential = { OR = { - culture = culture:belge - culture = culture:letzebuerge + this = culture:belge + this = culture:letzebuerge } } @@ -217,7 +217,7 @@ innovation_cacadores = { icon = @gunpowder potential = { - culture = culture:portuguese + this = culture:portuguese } unlock_maa = cacadores @@ -236,11 +236,11 @@ innovation_almogavares = { potential = { OR = { - culture = culture:andorra - culture = culture:aragonese - culture = culture:asturleonese - culture = culture:basque - culture = culture:galician + this = culture:andorra + this = culture:aragonese + this = culture:asturleonese + this = culture:basque + this = culture:galician } } @@ -257,9 +257,9 @@ innovation_tercos = { potential = { OR = { - culture = culture:catalan - culture = culture:balearic - culture = culture:valencian + this = culture:catalan + this = culture:balearic + this = culture:valencian } } @@ -275,9 +275,9 @@ innovation_lanceros = { potential = { OR = { - culture = culture:castilian - culture = culture:extremeno - culture = culture:NEOW_andalusian + this = culture:castilian + this = culture:extremeno + this = culture:NEOW_andalusian } } @@ -293,14 +293,14 @@ innovation_betyars = { potential = { OR = { - culture = culture:hungarian - culture = culture:szeklers - culture = culture:translyvanian - culture = culture:czech - culture = culture:NEOW_moravian - culture = culture:NEOW_slovak - culture = culture:goral - culture = culture:NEOW_carpathian + this = culture:hungarian + this = culture:szeklers + this = culture:translyvanian + this = culture:czech + this = culture:NEOW_moravian + this = culture:NEOW_slovak + this = culture:goral + this = culture:NEOW_carpathian } } unlock_maa = betyars @@ -315,11 +315,11 @@ innovation_peacekeepers = { potential = { OR = { - culture = culture:wallachian - culture = culture:banatian - culture = culture:moldavian - culture = culture:NEOW_gagauz - culture = culture:NEOW_ucrainean + this = culture:wallachian + this = culture:banatian + this = culture:moldavian + this = culture:NEOW_gagauz + this = culture:NEOW_ucrainean } } unlock_maa = peacekeepers @@ -334,12 +334,12 @@ innovation_tachanka { potential = { OR = { - culture = culture:NEOW_kievan - culture = culture:NEOW_cossack - culture = culture:NEOW_crimean - culture = culture:NEOW_nizhnevolzhan - culture = culture:NEOW_povolzhan - culture = culture:kalmyk + this = culture:NEOW_kievan + this = culture:NEOW_cossack + this = culture:NEOW_crimean + this = culture:NEOW_nizhnevolzhan + this = culture:NEOW_povolzhan + this = culture:kalmyk } } unlock_maa = tachanka @@ -354,20 +354,20 @@ innovation_uhlan = { potential = { OR = { - culture = culture:NEOW_greater_polish - culture = culture:NEOW_lesser_polish - culture = culture:NEOW_mazovian_polish - culture = culture:sorbian - culture = culture:kashubian - culture = culture:goral - culture = culture:NEOW_silesian - culture = culture:lipka - culture = culture:NEOW_pribaltic - culture = culture:NEOW_polessian - culture = culture:NEOW_minskian - culture = culture:NEOW_vohlynian - culture = culture:lithuanian - culture = culture:samogitian + this = culture:NEOW_greater_polish + this = culture:NEOW_lesser_polish + this = culture:NEOW_mazovian_polish + this = culture:sorbian + this = culture:kashubian + this = culture:goral + this = culture:NEOW_silesian + this = culture:lipka + this = culture:NEOW_pribaltic + this = culture:NEOW_polessian + this = culture:NEOW_minskian + this = culture:NEOW_vohlynian + this = culture:lithuanian + this = culture:samogitian } } unlock_maa = uhlan @@ -382,13 +382,13 @@ innovation_bike_cav = { potential = { OR = { - culture = culture:latvian - culture = culture:latgalian - culture = culture:estonian - culture = culture:livonian - culture = culture:voroseto - culture = culture:dansk - culture = culture:slesvigsk + this = culture:latvian + this = culture:latgalian + this = culture:estonian + this = culture:livonian + this = culture:voroseto + this = culture:dansk + this = culture:slesvigsk has_cultural_pillar = heritage_west_germanic } } diff --git a/common/decisions/00_cultural_tradition_decisions.txt b/common/decisions/00_cultural_tradition_decisions.txt index 2c215860b..2374e8986 100644 --- a/common/decisions/00_cultural_tradition_decisions.txt +++ b/common/decisions/00_cultural_tradition_decisions.txt @@ -39,6 +39,9 @@ recruit_terrain_specialist_decision = { decision_group_type = courtier is_shown = { + is_landless_adventurer = no + is_landless_merchant = no + is_herder = no # You can hire at least one type of terrain expert OR = { culture ?= { diff --git a/common/decisions/00_dynasty_decisions.txt b/common/decisions/00_dynasty_decisions.txt index 39039dc6f..db08ab156 100644 --- a/common/decisions/00_dynasty_decisions.txt +++ b/common/decisions/00_dynasty_decisions.txt @@ -21,9 +21,12 @@ create_cadet_branch_decision = { } is_shown = { - highest_held_title_tier > tier_barony - government_allows = rulers_should_have_dynasty + NOT = { + highest_held_title_tier = tier_barony + } is_house_head = no + government_allows = rulers_should_have_dynasty + is_lowborn = no NOR = { AND = { has_council_position = councillor_court_chaplain @@ -34,7 +37,6 @@ create_cadet_branch_decision = { has_tgp_dlc_trigger = yes } } - exists = house.house_head is_playable_character = yes } @@ -183,6 +185,17 @@ create_cadet_branch_decision = { } ai_potential = { + is_house_head = no + highest_held_title_tier > tier_barony + is_adult = yes + is_playable_character = yes + government_allows = rulers_should_have_dynasty + government_allows = create_cadet_branches + exists = house.house_head + trigger_if = { + limit = { government_has_flag = government_is_clan } + top_liege = this + } any_child = { is_alive = yes } # move it beforehand for performance reason trigger_if = { limit = { @@ -195,6 +208,7 @@ create_cadet_branch_decision = { } } } + years_from_game_start >= 5 # Childless rulers should not found houses any_child = { is_alive = yes @@ -237,7 +251,6 @@ create_cadet_branch_decision = { } } } - years_from_game_start >= 5 } } @@ -245,18 +258,77 @@ create_cadet_branch_decision = { base = 30 modifier = { # Dukes and above are more keen - add = { - value = primary_title.tier - subtract = tier_county - multiply = 20 + add = 70 + exists = primary_title + primary_title.tier > tier_county + } + + modifier = { # Prefer to stay in liege's dynasty + add = -50 + government_is_japanese_trigger = no + top_liege != this + any_liege_or_above = { + dynasty = root.dynasty + } + } + + modifier = { # Childless rulers should not found houses + factor = 0 + any_child = { + is_alive = yes + count < 3 + } + } + + modifier = { # Stop stealing player's house members + factor = 0 + any_player = { + OR = { + any_child = { + OR = { + is_child_of = root + is_grandchild_of = root + is_great_grandchild_of = root + } + } + any_child = { + even_if_dead = yes + any_child = { + OR = { + is_child_of = root + is_grandchild_of = root + is_great_grandchild_of = root + } + } + } + any_child = { + even_if_dead = yes + any_child = { + even_if_dead = yes + any_child = { + OR = { + is_child_of = root + is_grandchild_of = root + is_great_grandchild_of = root + } + } + } + } + } } } # we don't want AI to split from their House unless they dislike their house head modifier = { - add = { - value = 0 - subtract = "opinion(house.house_head)" + factor = 0 + OR = { + government_has_flag = government_is_clan + government_has_flag = government_is_merchant + } + + opinion = { + target = house.house_head + value >= -50 } } @@ -264,11 +336,13 @@ create_cadet_branch_decision = { modifier = { add = 1000 government_allows = noble_families - liege = this - trigger_if = { - limit = { exists = house.house_head.liege } - house.house_head.liege != root - } + top_liege = this + this != house.house_head.top_liege + } + + modifier = { + add = -250 + years_from_game_start < 5 } ### TGP @@ -278,7 +352,7 @@ create_cadet_branch_decision = { top_liege.primary_title = { any_past_holder = { is_close_family_of = root } } - add = -20 + add = -25 } modifier = { # Prefer to branch away from leading house if distant to split up blocs @@ -298,7 +372,6 @@ create_cadet_branch_decision = { modifier = { # Ruler should not break family apart government_is_japanese_trigger = yes is_independent_ruler = yes - house.house_head ?= { is_vassal_or_below_of = root } add = -1000 } diff --git a/common/decisions/00_guest_decisions.txt b/common/decisions/00_guest_decisions.txt index 85f732274..93ae9e445 100644 --- a/common/decisions/00_guest_decisions.txt +++ b/common/decisions/00_guest_decisions.txt @@ -31,8 +31,9 @@ invite_knights_decision = { cooldown = { years = invite_knights_decision_cooldown_value } is_shown = { - max_number_of_knights > 0 is_landless_adventurer = no + is_landless_merchant = no + max_number_of_knights > 0 } is_valid = { @@ -139,8 +140,8 @@ invite_claimants_decision = { cooldown = { days = 3650 } is_shown = { - primary_title.tier > tier_county is_landed_or_landless_administrative = yes + primary_title.tier > tier_county NOT = { government_has_flag = government_is_nomadic } } @@ -210,10 +211,10 @@ scrape_the_barrel_decision = { cooldown = { years = 2 } is_shown = { - has_royal_court = yes - court_grandeur_current_level <= 4 - has_dlc_feature = royal_court is_landed_or_landless_administrative_or_theocratic = yes + has_royal_court = yes + has_dlc_feature = royal_court + court_grandeur_current_level <= 4 } effect = { diff --git a/common/decisions/00_holy_order_decisions.txt b/common/decisions/00_holy_order_decisions.txt index d6722df6a..625b816a6 100644 --- a/common/decisions/00_holy_order_decisions.txt +++ b/common/decisions/00_holy_order_decisions.txt @@ -21,7 +21,8 @@ create_holy_order_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_major_religion.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 30 ai_goal = yes @@ -31,6 +32,7 @@ create_holy_order_decision = { highest_held_title_tier >= tier_kingdom any_held_county = { any_in_de_jure_hierarchy = { + holder = root barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root } } } @@ -65,6 +67,7 @@ create_holy_order_decision = { title_valid = { trigger_if = { limit = { exists = this } + holder = scope:ruler barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = scope:ruler } } trigger_else = { @@ -102,6 +105,7 @@ create_holy_order_decision = { text = "has_two_castle_county" any_held_county = { any_in_de_jure_hierarchy = { + holder = root barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root } } } @@ -185,24 +189,6 @@ create_holy_order_decision = { limit = { exists = scope:barony } - hidden_effect = { - if = { - limit = { scope:barony.holder != root } - create_title_and_vassal_change = { - type = leased_out - save_scope_as = change - add_claim_on_loss = no - } - scope:barony = { - change_title_holder_include_vassals = { - holder = root - change = scope:change - } - } - resolve_title_and_vassal_change = scope:change - } - } - create_character = { template = holy_order_leader_character location = scope:barony.title_province @@ -239,18 +225,11 @@ create_holy_order_decision = { ai_potential = { highest_held_title_tier >= tier_kingdom is_playable_character = yes - OR = { - any_held_title = { - title_tier = barony - barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root } - } - any_vassal = { - primary_title.tier = tier_barony - any_held_title = { - barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root } - } - } - } + is_at_war = no + piety_level >= 1 + trigger_if = { limit = { has_pam_dlc_trigger = yes } OR = { government_has_flag = government_is_theocracy exists = root.puppet:theological_agent_puppet exists = root.puppet:external_theological_agent_puppet } } + is_available_adult = yes + any_held_title = { title_tier = barony barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = root } } } ai_will_do = { @@ -304,6 +283,7 @@ borrow_from_holy_order_decision = { #by Linnéa Thimrén is_shown = { highest_held_title_tier > tier_barony + is_playable_character = yes faith ?= { any_faith_holy_order = { #Your faith must have a Military Order leader = { @@ -311,12 +291,6 @@ borrow_from_holy_order_decision = { #by Linnéa Thimrén } } } - is_playable_character = yes - # cannot already have a loan - keep it simple - NOR = { - exists = var:loan_amount_owed - exists = var:loan_holder - } } is_valid_showing_failures_only = { @@ -331,6 +305,15 @@ borrow_from_holy_order_decision = { #by Linnéa Thimrén NOT = { has_any_bad_relationship_with_character_trigger = { CHARACTER = root } } + save_temporary_scope_as = lender_temp + } + root = { + NOT = { + any_owned_story = { + story_Type = story_cycle_loan + var:lender = scope:lender_temp + } + } } } } @@ -360,7 +343,7 @@ borrow_from_holy_order_decision = { #by Linnéa Thimrén } ai_potential = { - always = yes + is_available = yes } ai_will_do = { @@ -431,6 +414,30 @@ cancel_holy_order_lease_decision = { trigger_if = { limit = { exists = this } barony_is_valid_for_holy_order_lease_cancellation_trigger = { ACTOR = scope:ruler } + trigger_if = { + limit = { + scope:ruler = { is_ai = yes } + exists = lessee.faith + } + trigger_if = { + limit = { scope:ruler.faith = root.lessee.faith } + scope:ruler.piety >= cancel_holy_order_piety_cost + } + trigger_else_if = { + limit = { + scope:ruler.faith = { + faith_hostility_level = { + target = root.lessee.faith + value <= faith_astray_level + } + } + } + scope:ruler.piety >= cancel_astray_holy_order_piety_cost + } + trigger_else = { + always = yes + } + } } trigger_else = { custom_description = { @@ -537,11 +544,12 @@ cancel_holy_order_lease_decision = { age >= 12 is_at_war = no highest_held_title_tier >= tier_county + years_from_game_start >= 1 any_sub_realm_barony = { + is_under_holy_order_lease = yes county.holder = { is_ai = yes } barony_is_valid_for_holy_order_lease_cancellation_trigger = { ACTOR = root } } - years_from_game_start >= 1 } ai_will_do = { @@ -597,7 +605,8 @@ create_holy_order_monastic_decision = { picture = { reference = "gfx/interface/illustrations/decisions/pam_pre-romanesque_church_exterior.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 30 ai_goal = yes @@ -713,6 +722,20 @@ create_holy_order_monastic_decision = { ai_potential = { highest_held_title_tier >= tier_duchy is_playable_character = yes + is_at_war = no + piety_level >= 1 + trigger_if = { + limit = { + has_pam_dlc_trigger = yes + } + OR = { + government_has_flag = government_is_theocracy + exists = root.puppet:theological_agent_puppet + exists = root.puppet:external_theological_agent_puppet + } + } + faith ?= { faith_has_monasticism_trigger = yes } + is_available_adult = yes any_held_county = { county_is_valid_for_monastic_lease_trigger = { CHARACTER = root } } @@ -1135,6 +1158,42 @@ pam_monastic_order_new_movement_decision = { ai_potential = { highest_held_title_tier >= tier_duchy is_playable_character = yes + piety_level >= 1 + trigger_if = { + limit = { + has_pam_dlc_trigger = yes + NOT = { + government_has_flag = government_is_theocracy + } + } + exists = root.puppet:theological_agent_puppet + } + trigger_else = { + OR = { + AND = { + has_trait = lifestyle_scholar + has_trait_xp = { + trait = lifestyle_scholar + value >= 60 + } + } + has_trait = theologian + has_trait = erudite + has_trait = lifestyle_mystic + has_trait = devoted + has_trait = family_first + has_trait = diplomat + has_trait = schemer + } + } + trigger_if = { + limit = { + has_pam_dlc_trigger = yes + } + exists = root.puppet:external_theological_agent_puppet + } + faith = { faith_has_monasticism_trigger = yes } + is_available_adult = yes any_held_county = { county_is_valid_for_monastic_lease_trigger = { CHARACTER = root } } diff --git a/common/decisions/00_lifestyle_decisions.txt b/common/decisions/00_lifestyle_decisions.txt index d095f2363..8c4ee5f46 100644 --- a/common/decisions/00_lifestyle_decisions.txt +++ b/common/decisions/00_lifestyle_decisions.txt @@ -186,7 +186,14 @@ sale_of_titles_decision = { } cost = { - prestige = @sale_of_titles_prestige_cost + prestige = { + value = 250 + multiply = { + value = root.highest_held_title_tier + subtract = 1 + min = 1 + } + } } effect = { @@ -208,7 +215,10 @@ sale_of_titles_decision = { } } - add_gold = major_gold_value + add_gold = { + value = medium_gold_value + divide = 2 + } custom_tooltip = sale_of_titles_side_effects_tt @@ -526,6 +536,7 @@ local_arbitration_decision = { is_valid_showing_failures_only = { custom_tooltip = { text = inside_realm_trigger + exists = root.location.county any_sub_realm_county = { this = root.location.county } diff --git a/common/decisions/00_trait_decisions.txt b/common/decisions/00_trait_decisions.txt index 4f5fda9bd..741d9096e 100644 --- a/common/decisions/00_trait_decisions.txt +++ b/common/decisions/00_trait_decisions.txt @@ -3,7 +3,7 @@ ################### @deceitful_progress_hostile_schemes_cooldown_time = 1095 -@diligent_development_focus_cooldown_time = 3650 +@diligent_prosperity_focus_cooldown_time = 3650 @impatient_rushing_all_schemes_cooldown_time = 1825 @vengeful_fabricate_hook_rivals_cooldown_time = 3665 @@ -116,7 +116,7 @@ deceitful_progress_hostile_schemes_decision = { #Diligent overwork ### Develop Capital ### -diligent_development_focus_decision = { +diligent_prosperity_focus_decision = { ai_check_interval = 0 picture = { @@ -140,11 +140,11 @@ diligent_development_focus_decision = { } sort_order = 60 - desc = diligent_development_focus_decision_desc + desc = diligent_prosperity_focus_decision_desc - selection_tooltip = diligent_development_focus_decision_tooltip + selection_tooltip = diligent_prosperity_focus_decision_tooltip - cooldown = { days = @diligent_development_focus_cooldown_time } + cooldown = { days = @diligent_prosperity_focus_cooldown_time } is_shown = { is_landed = yes @@ -167,7 +167,7 @@ diligent_development_focus_decision = { send_interface_toast = { type = event_toast_effect_neutral - title = msg_diligent_development_focus + title = msg_diligent_prosperity_focus left_icon = root if = { @@ -178,7 +178,7 @@ diligent_development_focus_decision = { } add_character_modifier = { - modifier = diligent_development_focus + modifier = diligent_prosperity_focus years = 10 } } @@ -244,6 +244,7 @@ impatient_rushing_all_schemes_decision = { is_shown = { has_trait = impatient + any_scheme = { count >= 1 } } is_valid_showing_failures_only = { @@ -260,7 +261,7 @@ impatient_rushing_all_schemes_decision = { effect = { if = { limit = { - any_scheme = { } + any_scheme = { count >= 1 } } send_interface_toast = { type = event_toast_effect_neutral diff --git a/common/decisions/00_unity_decisions.txt b/common/decisions/00_unity_decisions.txt index 87d6ad935..2560381e4 100644 --- a/common/decisions/00_unity_decisions.txt +++ b/common/decisions/00_unity_decisions.txt @@ -25,24 +25,21 @@ unity_reinforce_army_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house - is_landed = yes + government_has_flag = government_uses_house_unity } is_valid = { - house = { - has_house_unity_stage = antagonistic - } is_house_head = yes } is_valid_showing_failures_only = { house = { - has_house_unity_stage = antagonistic NOT = { has_house_unity_modifier = unity_antagonistic_maa_modifier } } - is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_reinforce_army_decision } + } } effect = { @@ -59,12 +56,32 @@ unity_reinforce_army_decision = { value = medium_gold_value } piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -106,31 +123,42 @@ unity_establish_network_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house - is_landed = yes + government_has_flag = government_uses_house_unity + is_ruler = yes } is_valid = { - house = { - has_house_unity_stage = competitive - } is_house_head = yes } is_valid_showing_failures_only = { house = { - has_house_unity_stage = competitive NOT = { has_house_unity_modifier = unity_competitive_spies_modifier } } - is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_establish_network_decision } + } } effect = { - house = { - add_house_unity_modifier = { - modifier = unity_competitive_spies_modifier - years = 10 + switch = { + trigger = is_landed + yes = { + house = { + add_house_unity_modifier = { + modifier = unity_competitive_spies_modifier + years = 10 + } + } + } + fallback = { # add more entries if other landless governments use unity in future + house = { + add_house_unity_modifier = { + modifier = unity_competitive_spies_landless_merchant_modifier + years = 10 + } + } } } } @@ -140,12 +168,32 @@ unity_establish_network_decision = { value = medium_gold_value } piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -176,7 +224,13 @@ unity_improve_taxation_decision = { hegemony = 36 } picture = { - reference = "gfx/interface/illustrations/decisions/fp3/impassive.dds" + trigger = { + NOT = { government_has_flag = government_is_clan } + } + reference = "gfx/interface/illustrations/decisions/decision_misc.dds" + } + picture = { + reference = "gfx/interface/illustrations/decisions/fp3_decision_tax_collector.dds" } is_invisible = yes @@ -187,24 +241,23 @@ unity_improve_taxation_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house + government_has_flag = government_uses_house_unity is_landed = yes } is_valid = { - house = { - has_house_unity_stage = impassive - } is_house_head = yes } is_valid_showing_failures_only = { house = { - has_house_unity_stage = impassive NOT = { has_house_unity_modifier = unity_impassive_tax_modifier } } is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_improve_taxation_decision } + } } effect = { @@ -218,12 +271,32 @@ unity_improve_taxation_decision = { cost = { piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -265,24 +338,22 @@ unity_send_bailiffs_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house + government_has_flag = government_uses_house_unity is_landed = yes } is_valid = { - house = { - has_house_unity_stage = friendly - } is_house_head = yes } is_valid_showing_failures_only = { house = { - has_house_unity_stage = friendly NOT = { has_house_unity_modifier = unity_friendly_bailiff_modifier } } - is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_send_bailiffs_decision } + } } effect = { @@ -299,12 +370,32 @@ unity_send_bailiffs_decision = { value = medium_gold_value } piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -349,24 +440,22 @@ unity_placate_vassals_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house + government_has_flag = government_uses_house_unity is_landed = yes } is_valid = { - house = { - has_house_unity_stage = harmonious - } is_house_head = yes } is_valid_showing_failures_only = { house = { - has_house_unity_stage = harmonious NOT = { has_house_unity_modifier = unity_harmonious_placation_modifier } } - is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_placate_vassals_decision } + } } effect = { @@ -383,12 +472,32 @@ unity_placate_vassals_decision = { value = medium_gold_value } piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -430,30 +539,31 @@ unity_organize_house_for_war_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house + government_has_flag = government_uses_house_unity is_landed = yes + house ?= { # We still want to show these in tooltips for other unity levels + trigger_if = { + limit = { has_house_unity_parameter = unity_organize_house_for_war_decision } + has_house_unity_parameter = unity_organize_house_for_war_decision + } + } + } + + is_valid = { + is_house_head = yes } is_valid_showing_failures_only = { house = { - NOT = { has_house_modifier = unity_house_focused_on_economy_modifier } # Cannot promote war while the house is focused on economy already - OR = { - has_house_unity_stage = antagonistic - has_house_unity_stage = competitive + NOR = { + has_house_modifier = unity_house_focused_on_economy_modifier # Cannot promote war while the house is focused on economy already + has_house_modifier = unity_house_organized_for_war_modifier } } - is_house_head = yes - } - - is_valid = { - house = { - OR = { - has_house_unity_stage = antagonistic - has_house_unity_stage = competitive - } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_organize_house_for_war_decision } } - is_house_head = yes } effect = { @@ -467,12 +577,26 @@ unity_organize_house_for_war_decision = { cost = { piety = { - value = unity_minor_decision_piety_cost + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_minor_decision_piety_cost + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_minor_decision_prestige_cost + } } } ai_potential = { - government_has_flag = government_is_clan + government_has_flag = government_uses_house_unity + is_landed = yes ai_has_warlike_personality = yes } @@ -503,29 +627,24 @@ unity_encourage_house_economy_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - exists = house + government_has_flag = government_uses_house_unity is_landed = yes } is_valid_showing_failures_only = { house = { - NOT = { has_house_modifier = unity_house_organized_for_war_modifier } # Cannot promote economy while the house is focused on war already - OR = { - has_house_unity_stage = friendly - has_house_unity_stage = harmonious + NOR = { + has_house_modifier = unity_house_organized_for_war_modifier # Cannot promote economy while the house is focused on war already + has_house_modifier = unity_house_focused_on_economy_modifier } } - is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_encourage_house_economy_decision } + } } is_valid = { - house = { - OR = { - has_house_unity_stage = friendly - has_house_unity_stage = harmonious - } - } is_house_head = yes } @@ -540,17 +659,30 @@ unity_encourage_house_economy_decision = { cost = { piety = { - value = unity_minor_decision_piety_cost + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_minor_decision_piety_cost + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_minor_decision_prestige_cost + } } } ai_potential = { + government_has_flag = government_uses_house_unity + is_house_head = yes ai_has_economical_boom_personality = yes } - ai_will_do = { - base = 20 - } + ai_will_do = { base = 20 } } ### Steer House Unity ### @@ -574,14 +706,12 @@ unity_steer_house_direction_decision = { cooldown = { years = 10 } is_shown = { - government_has_flag = government_is_clan + government_has_flag = government_uses_house_unity + is_ruler = yes exists = house - is_landed = yes } is_valid_showing_failures_only = { - is_house_head = yes - # Option localisation trigger_if = { limit = { scope:steer_unity_towards_harmonious = yes } @@ -652,115 +782,76 @@ unity_steer_house_direction_decision = { } effect = { - if = { # Increase Unity - limit = { scope:steer_unity_towards_harmonious = yes } - - house = { - add_unity_value = { - value = massive_unity_gain - character = root - desc = clan_unity_steer_direction_change.desc - } - } - custom_tooltip = steer_unity_towards_harmonious_passive_gain_tt - add_character_flag = { - flag = steer_unity_towards_harmonious_passive_gain - years = 10 - } - - # Let's send notifications to relevant characters - hidden_effect = { - # Send a toast to yourself, as a confirmation that Unity changed - send_interface_toast = { - type = msg_house_unity_change_value - title = steer_unity_towards_harmonious_toast - desc = steer_unity_towards_harmonious_toast - left_icon = root - show_as_tooltip = { - house = { - add_unity_value = { - value = massive_unity_gain - character = root - desc = clan_unity_steer_direction_change.desc - } - } + switch = { + trigger = yes + # Increase Unity + scope:steer_unity_towards_harmonious = { + house = { + add_unity_value = { + value = massive_unity_gain + character = root + desc = clan_unity_steer_direction_change.desc } } - # Send a notification (we don't want a toast here) to any other player within the house - every_player = { - limit = { - house ?= root.house - this != root - } - send_interface_message = { - type = msg_house_unity_change_value - title = steer_unity_notification_title - desc = steer_unity_towards_harmonious_toast - left_icon = root - show_as_tooltip = { - house = { - add_unity_value = { - value = massive_unity_gain - character = root - desc = clan_unity_steer_direction_change.desc + custom_tooltip = steer_unity_towards_harmonious_passive_gain_tt + add_character_flag = { + flag = steer_unity_towards_harmonious_passive_gain + years = 10 + } + # Let's send notifications to relevant characters + hidden_effect = { + every_player = { + limit = { house ?= root.house } + send_interface_message = { + type = msg_house_unity_change_value + title = steer_unity_notification_title + desc = steer_unity_towards_harmonious_toast + left_icon = root + right_icon = house + show_as_tooltip = { + house = { + add_unity_value = { + value = massive_unity_gain + character = root + desc = clan_unity_steer_direction_change.desc + } } } } } } } - } - else_if = { # Decrease Unity - limit = { scope:steer_unity_towards_antagonistic = yes } - - house = { - add_unity_value = { - value = massive_unity_loss - character = root - desc = clan_unity_steer_direction_change.desc - } - } - custom_tooltip = steer_unity_towards_antagonistic_passive_loss_tt - add_character_flag = { - flag = steer_unity_towards_antagonistic_passive_loss - years = 10 - } - - # Let's send notifications to relevant characters - hidden_effect = { - # Send a toast to yourself, as a confirmation that Unity changed - send_interface_toast = { - type = msg_house_unity_change_value - title = steer_unity_towards_antagonistic_toast - desc = steer_unity_towards_antagonistic_toast - left_icon = root - show_as_tooltip = { - house = { - add_unity_value = { - value = massive_unity_loss - character = root - desc = clan_unity_steer_direction_change.desc - } - } + # Decrease Unity + scope:steer_unity_towards_antagonistic = { + house = { + add_unity_value = { + value = massive_unity_loss + character = root + desc = clan_unity_steer_direction_change.desc } } - # Send a notification (we don't want a toast here) to any other player within the house - every_player = { - limit = { - house ?= root.house - this != root - } - send_interface_message = { - type = msg_house_unity_change_value - title = steer_unity_notification_title - desc = steer_unity_towards_antagonistic_toast - left_icon = root - show_as_tooltip = { - house = { - add_unity_value = { - value = massive_unity_loss - character = root - desc = clan_unity_steer_direction_change.desc + custom_tooltip = steer_unity_towards_antagonistic_passive_loss_tt + add_character_flag = { + flag = steer_unity_towards_antagonistic_passive_loss + years = 10 + } + # Let's send notifications to relevant characters + hidden_effect = { + every_player = { + limit = { house ?= root.house } + send_interface_message = { + type = msg_house_unity_change_value + title = steer_unity_notification_title + desc = steer_unity_towards_antagonistic_toast + left_icon = root + right_icon = house + show_as_tooltip = { + house = { + add_unity_value = { + value = massive_unity_loss + character = root + desc = clan_unity_steer_direction_change.desc + } } } } @@ -771,14 +862,12 @@ unity_steer_house_direction_decision = { } cost = { - piety = { - value = unity_major_decision_piety_cost - } + piety = unity_major_decision_piety_cost } ai_potential = { highest_held_title_tier >= tier_county # Barons doesn't have to use the decision - is_landed = yes + is_ruler = yes exists = house } @@ -799,16 +888,20 @@ unity_steer_house_direction_decision = { OR = { AND = { ai_wants_high_unity = yes - OR = { - house = { has_house_unity_stage = antagonistic } - house = { has_house_unity_stage = competitive } + house = { + OR = { + has_house_unity_stage = antagonistic + has_house_unity_stage = competitive + } } } AND = { ai_wants_low_unity = yes - OR = { - house = { has_house_unity_stage = harmonious } - house = { has_house_unity_stage = friendly } + house = { + OR = { + has_house_unity_stage = harmonious + has_house_unity_stage = friendly + } } } } @@ -839,12 +932,10 @@ unity_search_for_administrators_decision = { cooldown = { years = 10 } is_shown = { - government_has_flag = government_is_clan - exists = house + government_has_flag = government_uses_tax_collectors + government_has_flag = government_uses_house_unity is_landed = yes - } - - is_valid = { + exists = house } effect = { @@ -934,12 +1025,14 @@ unity_search_for_administrators_decision = { } ai_potential = { - government_has_flag = government_is_clan + government_has_flag = government_uses_tax_collectors + government_has_flag = government_uses_house_unity highest_held_title_tier >= tier_duchy any_tax_collector = { count <= 0 } any_vassal = { count >= 2 - government_has_flag = government_is_clan + government_has_flag = government_uses_tax_collectors + government_has_flag = government_uses_house_unity } } @@ -971,34 +1064,26 @@ unity_improve_logistics_decision = { cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - culture ?= { has_cultural_pillar = heritage_iranian } has_fp3_dlc_trigger = yes - exists = house + culture ?= { has_cultural_pillar = heritage_iranian } + government_has_flag = government_uses_house_unity is_landed = yes } is_valid = { + is_house_head = yes # We show the culture requirement here to tell the player why they have the decision available culture = { has_cultural_pillar = heritage_iranian } - house = { - OR = { - has_house_unity_stage = antagonistic - has_house_unity_stage = competitive - } - } - is_house_head = yes } is_valid_showing_failures_only = { house = { - OR = { - has_house_unity_stage = antagonistic - has_house_unity_stage = competitive - } NOT = { has_house_unity_modifier = fp3_unity_improved_logistics_modifier } } - is_house_head = yes + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_improve_logistics_decision } + } } effect = { @@ -1015,12 +1100,32 @@ unity_improve_logistics_decision = { value = medium_gold_value } piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -1040,8 +1145,8 @@ unity_improve_logistics_decision = { } } -### Promote Development ### -unity_promote_development_decision = { +### Promote Prosperity ### +unity_promote_prosperity_decision = { ai_check_interval_by_tier = { barony = 0 county = 72 @@ -1057,45 +1162,36 @@ unity_promote_development_decision = { sort_order = 60 - desc = unity_promote_development_decision_desc + desc = unity_promote_prosperity_decision_desc cooldown = { years = 20 } is_shown = { - government_has_flag = government_is_clan - culture ?= { has_cultural_pillar = heritage_iranian } has_fp3_dlc_trigger = yes - exists = house - is_landed = yes + culture = { has_cultural_pillar = heritage_iranian } + government_has_flag = government_uses_house_unity } is_valid = { + is_house_head = yes # We show the culture requirement here to tell the player why they have the decision available culture = { has_cultural_pillar = heritage_iranian } - house = { - OR = { - has_house_unity_stage = friendly - has_house_unity_stage = harmonious - } - } - is_house_head = yes } is_valid_showing_failures_only = { house = { - OR = { - has_house_unity_stage = friendly - has_house_unity_stage = harmonious - } - NOT = { has_house_unity_modifier = fp3_unity_promoted_development_modifier } + NOT = { has_house_unity_modifier = fp3_unity_promoted_prosperity_modifier } + } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_promote_prosperity_decision } } - is_house_head = yes } effect = { house = { add_house_unity_modifier = { - modifier = fp3_unity_promoted_development_modifier + modifier = fp3_unity_promoted_prosperity_modifier years = 10 } } @@ -1106,12 +1202,32 @@ unity_promote_development_decision = { value = medium_gold_value } piety = { - value = unity_major_decision_piety_cost - add = { - value = 20 - multiply = { - value = number_of_landed_house_members_value - subtract = 1 # We don't want to add any extra for the first ruler + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } } } } @@ -1148,18 +1264,29 @@ unity_consult_house_decision = { sort_order = 60 - desc = unity_consult_house_decision_desc - - is_shown = { - government_has_flag = government_is_clan - exists = house - is_landed = yes + desc = { + first_valid = { + triggered_desc = { + trigger = { has_council = yes } + desc = unity_consult_house_decision_desc + } + desc = unity_consult_house_decision_desc_court_position + } + } + + selection_tooltip = { + first_valid = { + triggered_desc = { + trigger = { has_council = yes } + desc = unity_consult_house_decision_tooltip + } + desc = unity_consult_house_decision_tooltip_court_position + } } - is_valid = { - house = { - has_house_unity_stage = impassive - } + is_shown = { + government_has_flag = government_uses_house_unity + is_ruler = yes } is_valid_showing_failures_only = { @@ -1167,25 +1294,45 @@ unity_consult_house_decision = { text = unity_consult_house_decision.tt_cooldown NOT = { has_character_flag = fp3_consulted_house } } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_consult_house_decision } + } } effect = { - custom_tooltip = unity_consult_house_decision.tt_house_council_bonus + if = { + limit = { has_council = yes } + custom_tooltip = unity_consult_house_decision.tt_house_council_bonus + } + else = { custom_tooltip = unity_consult_house_decision.tt_house_court_position_bonus } #custom_tooltip = unity_consult_house_decision.tt_no_unity_change custom_tooltip = unity_consult_house_decision.tt_lifetime - add_character_flag = { - flag = fp3_consulted_house - } + add_character_flag = { flag = fp3_consulted_house } } cost = { - piety = { value = unity_minor_decision_piety_cost } + piety = { + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_minor_decision_piety_cost + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_minor_decision_prestige_cost + } + } } ai_potential = { - exists = house # AI has more than 1 house member that is their vassal/courtier (can serve as a councillor) - house = { + house ?= { any_house_member = { count > 1 OR = { @@ -1287,18 +1434,18 @@ unity_establish_futuwaa_lodges_decision = { is_shown = { government_has_flag = government_is_clan - culture ?= { has_cultural_tradition = tradition_futuwaa } - exists = house exists = capital_province is_landed = yes } is_valid = { - house = { - OR = { - has_house_unity_stage = antagonistic - has_house_unity_stage = competitive - } + culture = { has_cultural_tradition = tradition_futuwaa } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_establish_futuwaa_lodges_decision } } } @@ -1419,7 +1566,7 @@ unity_educate_youth_in_madrasas_decision = { triggered_desc = { trigger = { capital_county ?= { - development_level >= bad_development_level + prosperity_level >= bad_prosperity_level } } desc = unity_educate_youth_in_madrasas_decision.t_madrasas @@ -1465,19 +1612,25 @@ unity_educate_youth_in_madrasas_decision = { is_shown = { government_has_flag = government_is_clan - culture ?= { has_cultural_tradition = tradition_fp3_beacon_of_learning } - exists = house - exists = capital_province # Sanity check is_landed = yes + exists = capital_province # Sanity check + culture ?= { has_cultural_tradition = tradition_fp3_beacon_of_learning } + house ?= { # We still want to show these in tooltips for other unity levels + trigger_if = { + limit = { has_house_unity_parameter = unity_educate_youth_in_madrasas_decision } + has_house_unity_parameter = unity_educate_youth_in_madrasas_decision + } + } } is_valid = { is_at_war = no - house = { - OR = { - has_house_unity_stage = harmonious - has_house_unity_stage = friendly - } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_educate_youth_in_madrasas_decision } } } @@ -1551,3 +1704,609 @@ unity_educate_youth_in_madrasas_decision = { base = 50 } } + +# GDP Unity Decisions + +### Decentralized Trade Network ### +unity_regional_networks_decision = { + ai_check_interval_by_tier = { + barony = 0 + county = 36 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + picture = { + reference = "gfx/interface/illustrations/decisions/decision_misc.dds" + } + is_invisible = yes + + sort_order = 60 + + cooldown = { years = 20 } + + is_shown = { + government_has_flag = government_uses_company_sentiment + government_has_flag = government_is_merchant + } + + is_valid = { + is_house_head = yes + } + + is_valid_showing_failures_only = { + house = { + NOT = { has_house_unity_modifier = unity_regional_networks_landless_merchant_modifier } + } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_regional_networks_decision } + } + } + + effect = { + house = { + add_house_unity_modifier = { + modifier = unity_regional_networks_landless_merchant_modifier + years = 10 + } + } + } + + cost = { + piety = { + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + } + + ai_potential = { + house ?= { # Don't bother unless you have a few landed house members who would benefit + any_house_unity_member = { + count >= 3 + } + } + OR = { + ai_has_warlike_personality = yes + ai_has_economical_boom_personality = yes + } + } + + ai_will_do = { + base = 25 + } +} + +### Centralized Trade Office ### +unity_family_business_decision = { + ai_check_interval_by_tier = { + barony = 0 + county = 36 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + picture = { + reference = "gfx/interface/illustrations/decisions/decision_recruitment.dds" + } + is_invisible = yes + + sort_order = 60 + + cooldown = { years = 20 } + + is_shown = { + government_has_flag = government_uses_company_sentiment + government_has_flag = government_is_merchant + } + + is_valid = { + is_house_head = yes + } + + is_valid_showing_failures_only = { + house = { + NOT = { has_house_unity_modifier = unity_family_business_landless_merchant_modifier } + } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_family_business_decision } + } + } + + effect = { + house = { + add_house_unity_modifier = { + modifier = unity_family_business_landless_merchant_modifier + years = 10 + } + } + } + + cost = { + piety = { + value = 0 + if = { + limit = { government_has_flag = government_is_clan } + add = unity_major_decision_piety_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + prestige = { + value = 0 + if = { + limit = { + NOT = { government_has_flag = government_is_clan } + } + add = unity_major_decision_prestige_cost + add = { + value = 20 + multiply = { + value = number_of_landed_house_members_value + subtract = 1 # We don't want to add any extra for the first ruler + } + } + } + } + } + + ai_potential = { + house ?= { # Don't bother unless you have a few landed house members who would benefit + any_house_unity_member = { + count >= 3 + } + } + OR = { + ai_has_warlike_personality = yes + ai_has_economical_boom_personality = yes + } + } + + ai_will_do = { + base = 25 + } +} + +### Promote Prosperity +unity_merchant_prosperity_decision = { + ai_check_interval_by_tier = { + barony = 0 + county = 36 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + picture = { + reference = "gfx/interface/illustrations/decisions/ep3_decision_city.dds" + } + is_invisible = yes + + sort_order = 60 + + cooldown = { years = 20 } + + is_shown = { + government_has_flag = government_uses_company_sentiment + government_has_flag = government_is_merchant + } + + is_valid = { + is_house_head = yes + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = unity_merchant_prosperity_decision_cooldown_tooltip + house = { + NOT = { exists = var:unity_merchant_prosperity_decision_cooldown } + } + } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_merchant_prosperity_decision } + } + } + + effect = { + house = { + set_variable = { + name = unity_merchant_prosperity_decision_cooldown + years = 10 + } + } + domicile.domicile_location.county ?= { + add_county_modifier = { + modifier = unity_merchant_prosperity_modifier + years = 10 + } + } + add_prestige = 100 + } + + cost = { + gold = { + value = major_gold_value + } + } + + ai_potential = { + house ?= { # Don't bother unless you have a few landed house members who would benefit + any_house_unity_member = { + count >= 3 + } + } + } + + ai_will_do = { + base = 10 + } +} + +### Send Bailiffs ### +unity_merchant_bailiffs_decision = { + ai_check_interval_by_tier = { + barony = 0 + county = 36 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + picture = { + reference = "gfx/interface/illustrations/decisions/decision_misc.dds" + } + is_invisible = yes + + sort_order = 60 + + cooldown = { years = 20 } + + is_shown = { + government_has_flag = government_uses_company_sentiment + government_has_flag = government_is_merchant + } + + is_valid = { + is_house_head = yes + custom_tooltip = { + text = unity_merchant_bailiffs_decision_control_tooltip + domicile.domicile_location.county ?= { county_control < county_control_baseline } + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = unity_merchant_bailiffs_decision_cooldown_tooltip + house = { + NOT = { exists = var:unity_merchant_bailiffs_decision_cooldown } + } + } + custom_tooltip = { + text = unity_required_level_not_met_tooltip + house = { has_house_unity_parameter = unity_merchant_bailiffs_decision } + } + } + + effect = { + house = { + set_variable = { + name = unity_merchant_bailiffs_decision_cooldown + years = 10 + } + } + domicile.domicile_location.county ?= { + add_county_modifier = { + modifier = unity_merchant_bailiffs_modifier + years = 10 + } + } + add_prestige = 100 + } + + cost = { + gold = { + value = major_gold_value + } + } + + ai_potential = { + house ?= { # Don't bother unless you have a few landed house members who would benefit + any_house_unity_member = { + count >= 3 + } + } + OR = { + ai_has_warlike_personality = yes + ai_has_economical_boom_personality = yes + } + } + + ai_will_do = { + base = 25 + } +} + +### Promote Diligence ### +unity_merchant_promote_diligence_decision = { + ai_check_interval_by_tier = { + barony = 0 + county = 36 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + picture = { + reference = "gfx/interface/illustrations/decisions/cooperative.dds" + } + decision_group_type = house_unity + + sort_order = 1500 # We want the decision to be at the top of the list to make it real easy to find. + + cooldown = { years = merchant_promote_diligence_decision_cooldown_years_value } + + cost = { + prestige = merchant_promote_diligence_decision_prestige_cost_value + } + + is_shown = { + government_has_flag = government_is_merchant + } + + is_valid = { + is_house_head = yes + custom_tooltip = { + text = unity_required_house_member_nr + house = { + any_house_member = { + this != root + is_adult = yes + } + } + } + num_trade_routes >= 1 + custom_tooltip = { + text = unity_merchant_promote_diligence_decision_not_excess_requirement + merchant_house_head_drive_decision_not_promoting_excess = yes + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = unity_merchant_promote_diligence_decision_cooldown_tooltip + house = { + NOT = { exists = var:unity_merchant_promote_diligence_decision_cooldown } + } + } + } + + effect = { + every_courtier = { + limit = { + OR = { + is_trader = yes + has_any_court_position = yes + } + } + add_to_list = unity_promote_diligence_targets + } + house ?= { + every_house_member = { + limit = { this != root } + add_to_list = unity_promote_diligence_targets + } + } + every_in_list = { + list = unity_promote_diligence_targets + custom = custom.every_deputy_or_trader + add_character_modifier = { + modifier = gdp_promoted_diligence_modifier + years = 10 + } + } + house ?= { + add_house_unity_modifier = { + modifier = unity_promoting_diligence_modifier + years = 10 + } + custom_tooltip = unity_merchant_promote_diligence_unity_change_tt + hidden_effect = { + add_unity_value = { + value = merchant_promote_diligence_unity_loss_value + character = root + desc = merchant_unity_promote_diligence.desc + } + } + custom_tooltip = steer_unity_towards_rapacious_passive_loss_tt + } + add_character_flag = { + flag = steer_unity_towards_rapacious_passive_loss + years = 10 + } + if = { + limit = { has_perk = large_levies_perk } + add_character_modifier = { + modifier = merchant_family_mobilization_promote_diligence_modifier + years = 5 + } + } + house = { + set_variable = { + name = unity_merchant_promote_diligence_decision_cooldown + years = merchant_promote_diligence_decision_cooldown_years_value + } + } + } + + ai_potential = { + house ?= { # Don't bother unless you have a few landed house members who would benefit + any_house_unity_member = { + count >= 3 + } + } + OR = { + ai_has_warlike_personality = yes + ai_has_economical_boom_personality = yes + } + } + + ai_will_do = { + base = 25 + } +} + +### Promote Excess ### +unity_merchant_promote_excess_decision = { + ai_check_interval_by_tier = { + barony = 0 + county = 36 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + picture = { + reference = "gfx/interface/illustrations/decisions/concerted.dds" + } + decision_group_type = house_unity + + sort_order = 1490 + + cooldown = { years = merchant_promote_excess_decision_cooldown_years_value } + + cost = { + gold = major_gold_value + } + + is_shown = { + government_has_flag = government_is_merchant + } + + is_valid = { + is_house_head = yes + custom_tooltip = { + text = unity_required_house_member_nr + house = { + any_house_member = { + this != root + is_adult = yes + } + } + } + custom_tooltip = { + text = unity_merchant_promote_excess_decision_not_diligence_requirement + merchant_house_head_drive_decision_not_promoting_diligence = yes + } + } + + is_valid_showing_failures_only = { + custom_tooltip = { + text = unity_merchant_promote_excess_decision_cooldown_tooltip + house = { + NOT = { exists = var:unity_merchant_promote_excess_decision_cooldown } + } + } + } + + effect = { + every_courtier = { + limit = { + OR = { + is_trader = yes + has_any_court_position = yes + } + } + add_to_list = unity_promote_excess_targets + } + house ?= { + every_house_member = { + limit = { this != root } + add_to_list = unity_promote_excess_targets + } + } + every_in_list = { + list = unity_promote_excess_targets + custom = custom.every_deputy_or_trader + add_character_modifier = { + modifier = gdp_promoted_excess_modifier + years = 10 + } + } + house ?= { + add_house_unity_modifier = { + modifier = unity_promoting_excess_modifier + years = 10 + } + custom_tooltip = unity_merchant_promote_excess_unity_change_tt + hidden_effect = { + add_unity_value = { + value = monumental_unity_value + character = root + desc = merchant_unity_promote_excess.desc + } + } + custom_tooltip = steer_unity_towards_ennobled_passive_gain_tt + } + add_character_flag = { + flag = steer_unity_towards_ennobled_passive_gain + years = 10 + } + house = { + set_variable = { + name = unity_merchant_promote_excess_decision_cooldown + years = merchant_promote_excess_decision_cooldown_years_value + } + } + } + + ai_potential = { + house ?= { + any_house_unity_member = { + count >= 3 + } + } + } + + ai_will_do = { + base = 25 + modifier = { + add = 25 + ai_wants_high_unity = yes + } + } +} diff --git a/common/decisions/04_ep2_decisions.txt b/common/decisions/04_ep2_decisions.txt index b1f8287b9..7a7acd944 100644 --- a/common/decisions/04_ep2_decisions.txt +++ b/common/decisions/04_ep2_decisions.txt @@ -4,7 +4,7 @@ decision_solve_the_journals = { picture = { - reference = "gfx/interface/illustrations/decisions/decision_realm.dds" + reference = "gfx/interface/illustrations/decisions/decision_erudition.dds" } decision_group_type = major ai_check_interval_by_tier = { diff --git a/common/decisions/06_ce1_decisions.txt b/common/decisions/06_ce1_decisions.txt index acbcef58b..30ec64172 100644 --- a/common/decisions/06_ce1_decisions.txt +++ b/common/decisions/06_ce1_decisions.txt @@ -138,7 +138,7 @@ clear_ground_for_legendary_building = { text = clear_ground_for_legendary_building_no_barony_tt any_held_title = { title_tier = barony - title_province = { has_special_building_slot = no } + title_province = { has_special_district_slot = no } is_capital_barony = yes holder = root is_leased_out = no @@ -162,7 +162,7 @@ clear_ground_for_legendary_building = { } current_description = clear_ground_legendary_shrine_desc localization = clear_ground_legendary_shrine - icon = "gfx/interface/icons/building_types/icon_building_legendary_shrine.dds" + icon = "gfx/interface/icons/building_types/special_buildings/legendary_shrine.dds" flat = yes ai_chance = { value = 10 } } @@ -176,7 +176,7 @@ clear_ground_for_legendary_building = { } current_description = clear_ground_legendary_statue_desc localization = clear_ground_legendary_statue - icon = "gfx/interface/icons/building_types/icon_building_legendary_statue.dds" + icon = "gfx/interface/icons/building_types/special_buildings/legendary_statue.dds" flat = yes ai_chance = { value = 10 } } @@ -190,7 +190,7 @@ clear_ground_for_legendary_building = { } current_description = clear_ground_legendary_palace_desc localization = clear_ground_legendary_palace - icon = "gfx/interface/icons/building_types/icon_building_legendary_palace.dds" + icon = "gfx/interface/icons/building_types/special_buildings/legendary_palace.dds" flat = yes ai_chance = { value = 10 } } @@ -204,7 +204,7 @@ clear_ground_for_legendary_building = { } current_description = clear_ground_legendary_watchtower_desc localization = clear_ground_legendary_watchtower - icon = "gfx/interface/icons/building_types/icon_building_legendary_watchtower.dds" + icon = "gfx/interface/icons/building_types/special_buildings/legendary_watchtower.dds" flat = yes ai_chance = { value = 10 } } @@ -218,7 +218,7 @@ clear_ground_for_legendary_building = { } current_description = clear_ground_legendary_hunting_lodge_desc localization = clear_ground_legendary_hunting_lodge - icon = "gfx/interface/icons/building_types/icon_building_legendary_hunting_grounds.dds" + icon = "gfx/interface/icons/building_types/special_buildings/legendary_hunting_grounds.dds" flat = yes ai_chance = { value = 10 } } @@ -297,7 +297,7 @@ pick_legendary_barony_decision = { title_valid = { trigger_if = { limit = { exists = this } - title_province = { has_special_building_slot = no } + title_province = { has_special_district_slot = no } is_capital_barony = yes holder = scope:ruler is_leased_out = no @@ -317,27 +317,27 @@ pick_legendary_barony_decision = { trigger = root.var:clear_ground flag:legendary_shrine = { scope:barony.title_province ?= { - add_special_building_slot = legendary_shrine + add_special_district_slot = legendary_shrine_district } } flag:legendary_palace = { scope:barony.title_province ?= { - add_special_building_slot = legendary_palace + add_special_district_slot = legendary_palace_district } } flag:legendary_statue = { scope:barony.title_province ?= { - add_special_building_slot = legendary_statue + add_special_district_slot = legendary_statue_district } } flag:legendary_watchtower = { scope:barony.title_province ?= { - add_special_building_slot = legendary_watchtower + add_special_district_slot = legendary_watchtower_district } } flag:legendary_hunting_lodge = { scope:barony.title_province ?= { - add_special_building_slot = legendary_hunting_lodge + add_special_district_slot = legendary_hunting_lodge_district } } } @@ -398,6 +398,7 @@ pick_legendary_barony_decision = { } ai_potential = { + has_variable = clear_ground is_playable_character = yes } ai_will_do = { @@ -452,8 +453,8 @@ isolate_capital_decision = { } OR = { any_held_title = { - has_province_with_epidemic = { intensity = any } title_tier = county + has_province_with_epidemic = { intensity = any } } capital_county ?= { any_neighboring_county = { @@ -566,7 +567,24 @@ isolate_capital_decision = { } ai_potential = { + is_landed = yes + highest_held_title_tier >= tier_county NOT = { has_character_flag = ai_capital_isolation_cooldown } + # Mirrors the is_ai branch of is_shown + OR = { + any_held_title = { + title_tier = county + has_province_with_epidemic = { intensity = any } + } + capital_county ?= { + OR = { + has_county_modifier = isolate_capital_decision_modifier + any_neighboring_county = { + has_province_with_epidemic = { intensity = any } + } + } + } + } } ai_will_do = { @@ -745,25 +763,33 @@ isolate_family_decision = { } ai_potential = { - NOT = { has_character_flag = ai_unisolate_cooldown } + NOR = { + has_character_flag = ai_unisolate_cooldown + has_government = landless_adventurer_government + } OR = { has_character_modifier = isolating_modifier - capital_county ?= { - OR = { - # Own capital - has_province_with_epidemic = { intensity = any } - # Neighboring own capital - any_neighboring_county = { - has_province_with_epidemic = { intensity = any } - } - } - } # Somewhere in domain any_held_title = { title_tier = county has_province_with_epidemic = { intensity = any } } - tgp_natural_disaster_character_is_affected_by_any_imminent_disaster_trigger = yes + AND = { + has_trait = paranoid # without a really valid reason, ai_will_do is only positive enough to fire when paranoid + OR = { + capital_county ?= { + OR = { + # Own capital + has_province_with_epidemic = { intensity = any } + # Neighboring own capital + any_neighboring_county = { + has_province_with_epidemic = { intensity = any } + } + } + } + tgp_natural_disaster_character_is_affected_by_any_imminent_disaster_trigger = yes + } + } } } diff --git a/common/decisions/10_ach_oath_decisions.txt b/common/decisions/10_ach_oath_decisions.txt index 773830b91..56a54a049 100644 --- a/common/decisions/10_ach_oath_decisions.txt +++ b/common/decisions/10_ach_oath_decisions.txt @@ -421,7 +421,7 @@ stewardship_oath_1_decision = { } every_realm_county = { custom = custom_every_realm_county - change_development_progress_with_overflow = 250 + change_prosperity_progress_with_overflow = 250 } } @@ -508,7 +508,7 @@ stewardship_oath_2_decision = { } county = { - change_development_progress_with_overflow = 50 + change_prosperity_progress_with_overflow = 50 } } } @@ -549,7 +549,7 @@ learning_oath_1_decision = { } trigger_else = { title_province = { - has_special_building_slot = no + has_special_district_slot = no is_county_capital = yes } holder = scope:ruler @@ -754,7 +754,7 @@ learning_oath_1_decision = { } } scope:barony.title_province ?= { - add_special_building = generic_university + add_special_district = generic_university_district } } else = { diff --git a/common/decisions/10_culture_conversion_decisions.txt b/common/decisions/10_culture_conversion_decisions.txt index e074f6a71..29a17795e 100644 --- a/common/decisions/10_culture_conversion_decisions.txt +++ b/common/decisions/10_culture_conversion_decisions.txt @@ -175,6 +175,7 @@ convert_to_local_culture_decision = { ai_potential = { is_playable_character = yes + exists = capital_province culture != capital_province.culture is_landless_adventurer = no } diff --git a/common/decisions/10_religious_decisions.txt b/common/decisions/10_religious_decisions.txt index d1f6ce48e..dc6737ad8 100644 --- a/common/decisions/10_religious_decisions.txt +++ b/common/decisions/10_religious_decisions.txt @@ -1387,20 +1387,21 @@ return_rome_decision = { } ai_potential = { - is_at_war = no top_liege = this religion = religion:catholic_religion ai_zeal > very_high_negative_ai_value title:c_roma = { holder = { is_ai = yes + top_liege = root } } + is_at_war = no + ai_zeal > very_high_negative_ai_value } ai_will_do = { base = 100 - modifier = { # If you fought the pope to get rome, don't immediately hand it back factor = 0 faith.religious_head = { @@ -2513,6 +2514,8 @@ petition_head_of_faith_decision = { cooldown = { years = 4 } is_shown = { + is_landless_adventurer = no + is_landless_merchant = no is_ai = no has_pam_dlc_trigger = yes # Antipopes, their sponsors, and their realms use petition_antipope_decision instead diff --git a/common/decisions/30_activity_decisions.txt b/common/decisions/30_activity_decisions.txt index 6c6c1c5d6..741cde23e 100644 --- a/common/decisions/30_activity_decisions.txt +++ b/common/decisions/30_activity_decisions.txt @@ -32,7 +32,7 @@ hold_court_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" } - decision_group_type = major + decision_group_type = realm is_invisible = yes cost = { @@ -339,10 +339,10 @@ petition_liege_decision = { } } trigger_if = { # Opinion - limit = { scope:petition_liege_county_opinion = yes } + limit = { scope:petition_liege_popular_opinion = yes } custom_tooltip = { - text = petition_liege_county_opinion_tt - any_held_title = { petition_liege_county_opinion_trigger = yes } + text = petition_liege_popular_opinion_tt + any_held_title = { petition_liege_popular_opinion_trigger = yes } } } trigger_if = { # Fortify @@ -400,12 +400,12 @@ petition_liege_decision = { liege.gold > main_building_tier_1_cost } } - trigger_if = { # Development - limit = { scope:petition_liege_development = yes } + trigger_if = { # Prosperity + limit = { scope:petition_liege_prosperity = yes } custom_tooltip = { - text = petition_liege_development_tt + text = petition_liege_prosperity_tt exists = liege - liege.capital_province.county.development_level >= petitioner_development_difference_decision_value + liege.capital_province.county.prosperity_level >= petitioner_prosperity_difference_decision_value } } trigger_if = { # House Fief @@ -724,22 +724,22 @@ petition_liege_decision = { ai_chance = { value = 0 } # Currently unused } item = { # Opinion - value = petition_liege_county_opinion + value = petition_liege_popular_opinion is_shown = { petition_liege_admin_valid_trigger = no } is_valid = { custom_tooltip = { - text = petition_liege_county_opinion_tt - any_held_title = { petition_liege_county_opinion_trigger = yes } + text = petition_liege_popular_opinion_tt + any_held_title = { petition_liege_popular_opinion_trigger = yes } } } - current_description = petition_liege_county_opinion_desc - localization = petition_liege_decision_option_county_opinion + current_description = petition_liege_popular_opinion_desc + localization = petition_liege_decision_option_popular_opinion icon = "gfx/interface/icons/message_feed/tier_up.dds" ai_chance = { value = 0 } # Currently unused } - ### Construction/Development + ### Construction/Prosperity item = { # Fortify value = petition_liege_fortify_border is_shown = { @@ -810,18 +810,18 @@ petition_liege_decision = { icon = "gfx/interface/icons/message_feed/religious.dds" ai_chance = { value = 0 } # Currently unused } - item = { # Development - value = petition_liege_development + item = { # Prosperity + value = petition_liege_prosperity is_valid = { custom_tooltip = { - text = petition_liege_development_tt + text = petition_liege_prosperity_tt exists = liege - liege.capital_province.county.development_level >= petitioner_development_difference_decision_value + liege.capital_province.county.prosperity_level >= petitioner_prosperity_difference_decision_value } is_landed = yes } - current_description = petition_liege_development_desc - localization = petition_liege_decision_option_development + current_description = petition_liege_prosperity_desc + localization = petition_liege_decision_option_prosperity icon = "gfx/interface/icons/message_feed/guest.dds" ai_chance = { value = 0 } # Currently unused } @@ -883,8 +883,8 @@ petition_liege_decision = { scope:petition_liege_county_convert = { # Convert County set_variable = { name = petition_type value = flag:county_convert } } - scope:petition_liege_county_opinion = { # County Opinion - set_variable = { name = petition_type value = flag:county_opinion } + scope:petition_liege_popular_opinion = { # County Opinion + set_variable = { name = petition_type value = flag:popular_opinion } } scope:petition_liege_fortify_border = { # Fortify Border set_variable = { name = petition_type value = flag:fortify_border } @@ -901,8 +901,8 @@ petition_liege_decision = { scope:petition_liege_construct_temple = { # Construct Temple set_variable = { name = petition_type value = flag:construct_temple } } - scope:petition_liege_development = { # Development - set_variable = { name = petition_type value = flag:development } + scope:petition_liege_prosperity = { # Prosperity + set_variable = { name = petition_type value = flag:prosperity } } scope:petition_liege_gold = { # Gold set_variable = { name = petition_type value = flag:gold } diff --git a/common/decisions/30_court_decisions.txt b/common/decisions/30_court_decisions.txt index 380c8b2a5..2c23eb79d 100644 --- a/common/decisions/30_court_decisions.txt +++ b/common/decisions/30_court_decisions.txt @@ -33,6 +33,7 @@ pay_homage_decision = { reference = "gfx/interface/illustrations/decisions/decision_knight_kneeling.dds" } decision_group_type = major + sort_order = 20 cost = { prestige = standard_activity_base_cost @@ -348,7 +349,23 @@ pay_homage_decision = { } ai_potential = { + liege ?= { has_royal_court = yes } + top_liege != this + OR = { + government_has_flag = government_is_feudal + government_has_flag = government_is_clan + } is_at_war = no + NOT = { + liege = { has_variable = pay_homage_cooldown } + } + trigger_if = { + limit = { + has_variable = pay_homage_grace + exists = liege + } + NOT = { var:pay_homage_grace = liege } + } } ai_will_do = { diff --git a/common/decisions/40_japan_decisions.txt b/common/decisions/40_japan_decisions.txt index 98a1a7d87..d69f9bf14 100644 --- a/common/decisions/40_japan_decisions.txt +++ b/common/decisions/40_japan_decisions.txt @@ -366,7 +366,7 @@ petition_ceremonial_liege_decision = { title = { first_valid = { triggered_desc = { - trigger = { exists = top_liege.primary_title.var:administrative_ui_special_title.holder } + trigger = { exists = ceremonial_liege } desc = petition_ceremonial_liege_decision_title } desc = petition_ceremonial_liege_decision @@ -450,10 +450,10 @@ petition_ceremonial_liege_decision = { government_has_mechanic = administrative is_independent_ruler = no trigger_if = { - limit = { exists = top_liege.primary_title.var:administrative_ui_special_title.holder } + limit = { exists = ceremonial_liege } custom_tooltip = { text = petition_ceremonial_liege_regent_already_given_tt - NOT = { var:petition_liege_regent_support ?= top_liege.primary_title.var:administrative_ui_special_title.holder } + NOT = { var:petition_liege_regent_support ?= ceremonial_liege } } } trigger_else = { always = no } @@ -494,7 +494,7 @@ petition_ceremonial_liege_decision = { } effect = { - top_liege.primary_title.var:administrative_ui_special_title.holder = { save_scope_as = ceremonial_liege } + ceremonial_liege = { save_scope_as = ceremonial_liege } custom_tooltip = petition_ceremonial_liege_decision_effects if = { limit = { diff --git a/common/decisions/80_major_decisions.txt b/common/decisions/80_major_decisions.txt index 2d4edecf0..e969beaf5 100644 --- a/common/decisions/80_major_decisions.txt +++ b/common/decisions/80_major_decisions.txt @@ -7,52 +7,6 @@ # by Mathilda Bjarnehed ################################################## -# Deprecated decision of yore. -#convert_to_feudalism_decision = { - #picture = { - #reference = "gfx/interface/illustrations/decisions/decision_realm.dds" - #} - #decision_group_type = major - #desc = convert_to_feudalism_decision_desc - # - #ai_check_interval = 36 - # - #is_shown = { - #government_has_flag = government_is_tribal - #} - # - #is_valid = { - #has_realm_law = tribal_authority_3 - #custom_description = { - #text = faith_is_reformed - #subject = root - #faith = { NOT = { has_doctrine_parameter = unreformed } } - #} - #prestige_level = 5 - #} - # - #cost = { - #prestige = 150 - #} - # - #effect = { - #change_government = feudal_government - #trigger_event = major_decisions.0001 - #add_realm_law_skip_effects = crown_authority_0 - #} - # - #ai_potential = { - ##always = yes - #} - # - #ai_will_do = { - #base = 100 - #modifier = { #Go for the more lenient decision if this is the case - #add = -100 - #liege = { government_has_flag = government_is_feudal } - #} - #} -#} ################################################## # Convert Realm to Feudalism/Clan through Liege @@ -83,6 +37,7 @@ convert_to_feudalism_liege_converted_decision = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } decision_group_type = major + sort_order = 100 desc = convert_to_feudalism_liege_converted_decision_desc ai_check_interval_by_tier = { @@ -134,12 +89,47 @@ convert_to_feudalism_liege_converted_decision = { } cost = { - prestige = 150 + prestige = 250 } effect = { trigger_event = major_decisions.0001 save_scope_as = actor + # Bonus Cities and Temples only when the liege's culture is in a later era than ours + save_scope_value_as = { + name = feudalize_bonus_holdings + value = no + } + if = { + limit = { + liege ?= { + OR = { + AND = { + culture = { has_cultural_era_or_later = culture_era_early_medieval } + root.culture = { + NOT = { has_cultural_era_or_later = culture_era_early_medieval } + } + } + AND = { + culture = { has_cultural_era_or_later = culture_era_high_medieval } + root.culture = { + NOT = { has_cultural_era_or_later = culture_era_high_medieval } + } + } + AND = { + culture = { has_cultural_era_or_later = culture_era_late_medieval } + root.culture = { + NOT = { has_cultural_era_or_later = culture_era_late_medieval } + } + } + } + } + } + save_scope_value_as = { + name = feudalize_bonus_holdings + value = yes + } + } convert_whole_realm_to_feudalism_effect = yes hidden_effect = { every_vassal = { @@ -166,7 +156,8 @@ convert_clan_to_feudalism_through_liege_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = convert_clan_to_feudalism_through_liege_decision_desc ai_check_interval_by_tier = { @@ -211,7 +202,7 @@ convert_clan_to_feudalism_through_liege_decision = { } cost = { - prestige = 150 + prestige = 250 } effect = { @@ -233,7 +224,7 @@ convert_clan_to_feudalism_through_liege_decision = { } ai_potential = { - prestige >= 150 + prestige >= 250 } ai_will_do = { @@ -255,7 +246,8 @@ convert_feudalism_to_clan_through_liege_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = convert_feudalism_to_clan_through_liege_decision_desc ai_check_interval_by_tier = { @@ -300,7 +292,7 @@ convert_feudalism_to_clan_through_liege_decision = { } cost = { - prestige = 150 + prestige = 250 } effect = { @@ -322,7 +314,7 @@ convert_feudalism_to_clan_through_liege_decision = { } ai_potential = { - prestige >= 150 + prestige >= 250 } ai_will_do = { @@ -359,6 +351,7 @@ convert_whole_realm_to_feudalism_decision = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } decision_group_type = major + sort_order = 100 desc = convert_whole_realm_to_feudalism_decision_desc ai_check_interval_by_tier = { @@ -384,38 +377,70 @@ convert_whole_realm_to_feudalism_decision = { } } } + trigger_if = { + limit = { + government_has_flag = government_is_wanua + is_ai = yes + } + faith = { has_doctrine = doctrine_monotheist } + } } is_valid = { has_realm_law = tribal_authority_3 - custom_description = { - text = faith_is_reformed - subject = root - faith = { NOT = { has_doctrine_parameter = unreformed } } + trigger_if = { + limit = { + faith = { has_doctrine_parameter = unreformed } + faith_qualifies_for_west_african_pagan_feudalisation_trigger = yes + } + OR = { + custom_description = { + text = faith_is_reformed + subject = root + faith = { NOT = { has_doctrine_parameter = unreformed } } + } + calc_true_if = { + amount >= 2 + realm_size >= minor_realm_size + highest_held_title_tier >= tier_kingdom + custom_tooltip = { + text = convert_whole_realm_to_feudalism_west_african_pagan_decision.tt.vassal_count + any_vassal = { count >= convert_whole_realm_to_feudalism_west_african_pagan_decision_vassal_count_value } + } + } + } + } + trigger_else = { + custom_description = { + text = faith_is_reformed + subject = root + faith = { NOT = { has_doctrine_parameter = unreformed } } + } } prestige_level >= 2 - capital_province.county = { - development_level >= convert_to_feudalism_development_requirement + capital_province = { + province_size_level >= 2 } custom_description = { #You need to have 70% of all (non-regional/unique) tribal innovations! text = has_all_tribal_innovations subject = root.culture culture = { calc_true_if = { - amount >= 9 + amount >= 10 has_innovation = innovation_motte has_innovation = innovation_catapult has_innovation = innovation_barracks has_innovation = innovation_mustering_grounds has_innovation = innovation_bannus has_innovation = innovation_quilted_armor + has_innovation = innovation_pattern_welding has_innovation = innovation_gavelkind has_innovation = innovation_crop_rotation has_innovation = innovation_city_planning has_innovation = innovation_casus_belli has_innovation = innovation_plenary_assemblies has_innovation = innovation_ledger - has_innovation = innovation_development_01 + has_innovation = innovation_prosperity_01 has_innovation = innovation_currency_01 } } @@ -437,7 +462,7 @@ convert_whole_realm_to_feudalism_decision = { } cost = { - prestige = 200 + prestige = 500 } effect = { @@ -476,7 +501,8 @@ convert_to_tribalism_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = convert_to_tribalism_decision_desc ai_check_interval_by_tier = { @@ -540,25 +566,28 @@ convert_to_tribalism_decision = { # by Ewan Cowhig Croft ################################################## -# A decision for West African pagans to feudalise without reforming. + +###### DEPRECATED ###### (merged the functionality into regular feudal/clan adopting) ### Adopt [ROOT.Char.Custom('GetTribalReformGovernment')|U] Ways: #weak (West African Pagan)#! ### convert_whole_realm_to_feudalism_west_african_pagan_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } decision_group_type = major + sort_order = 100 desc = convert_whole_realm_to_feudalism_west_african_pagan_decision_desc ai_check_interval_by_tier = { barony = 0 - county = 72 - duchy = 36 - kingdom = 36 - empire = 36 - hegemony = 36 + county = 0 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 } is_shown = { + always = no # Only tribals need formalise. government_has_flag = government_is_tribal # Unreformed West African Pagans are our targets. @@ -584,9 +613,9 @@ convert_whole_realm_to_feudalism_west_african_pagan_decision = { prestige_level >= high_prestige_level piety_level >= high_piety_level custom_tooltip = { - text = convert_whole_realm_to_feudalism_west_african_pagan_decision.tt.wa_capital_development + text = convert_whole_realm_to_feudalism_west_african_pagan_decision.tt.wa_capital_prosperity capital_county = { - development_level >= convert_whole_realm_to_feudalism_west_african_pagan_decision_wa_capital_development_value + prosperity_level >= convert_whole_realm_to_feudalism_west_african_pagan_decision_wa_capital_prosperity_value title_province = { geographical_region = world_africa_west } } } @@ -597,20 +626,21 @@ convert_whole_realm_to_feudalism_west_african_pagan_decision = { subject = root.culture culture = { calc_true_if = { - amount >= 9 + amount >= 10 has_innovation = innovation_motte has_innovation = innovation_catapult has_innovation = innovation_barracks has_innovation = innovation_mustering_grounds has_innovation = innovation_bannus has_innovation = innovation_quilted_armor + has_innovation = innovation_pattern_welding has_innovation = innovation_gavelkind has_innovation = innovation_crop_rotation has_innovation = innovation_city_planning has_innovation = innovation_casus_belli has_innovation = innovation_plenary_assemblies has_innovation = innovation_ledger - has_innovation = innovation_development_01 + has_innovation = innovation_prosperity_01 has_innovation = innovation_currency_01 } } @@ -680,6 +710,7 @@ declare_bloodline_holy_decision = { reference = "gfx/interface/illustrations/decisions/decision_family_tree.dds" } decision_group_type = major + sort_order = 20 desc = declare_bloodline_holy_decision_desc ai_check_interval_by_tier = { @@ -799,6 +830,7 @@ strengthen_bloodline_decision = { reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" } decision_group_type = major + sort_order = 20 desc = strengthen_bloodline_decision_desc ai_check_interval_by_tier = { @@ -913,6 +945,7 @@ dynasty_of_many_crowns_decision = { } desc = dynasty_of_many_crowns_decision_desc decision_group_type = major + sort_order = 20 ai_check_interval_by_tier = { barony = 0 county = 0 @@ -1012,7 +1045,8 @@ found_kingdom_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_found_kingdom.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 50 ai_check_interval_by_tier = { barony = 0 county = 0 @@ -1147,7 +1181,8 @@ found_empire_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 50 ai_check_interval_by_tier = { barony = 0 county = 0 @@ -1171,6 +1206,7 @@ found_empire_decision = { has_game_rule = off_custom_kingdoms } is_landed_or_landless_administrative = yes + NOT = { government_has_flag = government_is_republic } is_confederation_member = no } @@ -2244,36 +2280,61 @@ found_witch_coven_decision = { ### Repay Loan ### repay_loan_decision = { - picture = { - reference = "gfx/interface/illustrations/decisions/decision_spend_money.dds" - } + picture = { reference = "gfx/interface/illustrations/decisions/decision_spend_money.dds" } decision_group_type = major desc = repay_loan_decision_decision_desc selection_tooltip = repay_loan_decision_decision_tooltip - ai_check_interval = 0 + ai_check_interval = 24 is_shown = { - var:loan_holder ?= { - any_in_list = { - variable = owes_me_money - this = root + any_owned_story = { + story_type = story_cycle_loan + exists = var:amount_owed + var:lender ?= { + any_in_list = { + variable = owes_me_money + this = root + } } } - exists = var:loan_amount_owed } is_valid_showing_failures_only = { - is_available = yes - gold >= var:loan_amount_owed + is_available_quick = { + adult = yes + incapable = no + } + custom_tooltip = { + text = repay_loan_decision_afford_any_tt + any_owned_story = { + story_type = story_cycle_loan + exists = var:amount_owed + var:amount_owed <= prev.gold + } + } } effect = { - var:loan_holder ?= { save_scope_as = recipient } - pay_short_term_gold = { - gold = var:loan_amount_owed - target = scope:recipient + scope:selected_item ?= { save_scope_as = recipient } + ordered_owned_story = { + limit = { + story_type = story_cycle_loan + exists = var:amount_owed + var:lender = { + this = scope:recipient + any_in_list = { + variable = owes_me_money + this = root + } + } + } + order_by = { # repay smallest first + value = 0 + subtract = var:amount_owed + } + save_scope_as = repaid_loan } clear_loanee_variables_effect = yes scope:recipient = { @@ -2282,14 +2343,37 @@ repay_loan_decision = { target = root } } - } - ai_potential = { - always = no + ai_select_item = { + scope:actor = { + ordered_owned_story = { + limit = { + story_type = story_cycle_loan + exists = var:amount_owed + var:lender ?= { + any_in_list = { + variable = owes_me_money + this = scope:actor + } + } + var:amount_owed < scope:actor.short_term_gold + } + order_by = { + value = 0 + add = var:years_since + if = { + limit = { var:lender = { is_ai = no } } + add = 2 + } + } + var:lender = { save_scope_as = selected_item } + } + } + } } ai_will_do = { - base = 0 + base = 25 } } @@ -2500,7 +2584,8 @@ found_duchy_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_found_kingdom.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 50 ai_check_interval_by_tier = { barony = 0 county = 60 @@ -2606,6 +2691,7 @@ expand_duchy_decision = { reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds" } decision_group_type = realm + sort_order = 20 ai_check_interval_by_tier = { barony = 0 county = 0 @@ -2671,6 +2757,7 @@ expand_duchy_decision = { has_game_rule = on_custom_duchies } is_landed_or_landless_administrative = yes + NOT = { government_has_flag = government_is_republic } trigger_if = { limit = { highest_held_title_tier = tier_duchy @@ -2821,7 +2908,7 @@ expand_duchy_decision = { } scope:barony.duchy = { ordered_de_jure_county = { - order_by = development_level + order_by = prosperity_level limit = { NOT = { this = scope:barony.county } } save_scope_as = new_duchy_capital } @@ -2880,6 +2967,7 @@ set_de_jure_capital_decision = { reference = "gfx/interface/illustrations/decisions/ep3_decision_city.dds" } decision_group_type = realm + sort_order = 20 ai_check_interval_by_tier = { barony = 0 county = 0 @@ -3147,7 +3235,6 @@ set_de_jure_capital_decision = { scope:current_de_jure_scope ?= { set_capital_county = root.capital_county } - # A bit of an ugly script hack, to make sure the Duchy Building slot is properly moved, which happens when a duchy capital is moved out of the duchy de jure. We temporarily move them out of the duchy de jure, and back again, to force this effect. Remove when Code gets a chance to have a look at it if = { limit = { scope:set_duchy_capital = yes diff --git a/common/decisions/90_minor_decisions.txt b/common/decisions/90_minor_decisions.txt index 3fbac756c..f89f2da88 100644 --- a/common/decisions/90_minor_decisions.txt +++ b/common/decisions/90_minor_decisions.txt @@ -30,7 +30,10 @@ recruit_court_position_decision = { decision_group_type = courtier is_shown = { - is_landed_or_landless_administrative_or_theocratic = yes + OR = { + is_landed_or_landless_administrative_or_theocratic = yes + government_has_flag = government_is_merchant + } } is_valid_showing_failures_only = { @@ -164,6 +167,7 @@ recruit_court_position_decision = { item = { # Charioteer value = hire_charioteer_decision is_shown = { + is_landed_or_landless_administrative_or_theocratic = yes has_ep3_dlc_trigger = yes is_landless_adventurer = no culture = { @@ -188,6 +192,7 @@ recruit_court_position_decision = { item = { # Bookmaker value = hire_bookmaker_decision is_shown = { + is_landed_or_landless_administrative_or_theocratic = yes has_ep3_dlc_trigger = yes is_landless_adventurer = no culture = { @@ -212,6 +217,7 @@ recruit_court_position_decision = { item = { # Eunuch value = hire_eunuch_decision is_shown = { + is_landed_or_landless_administrative_or_theocratic = yes has_ep3_dlc_trigger = yes is_landless_adventurer = no culture = { @@ -236,6 +242,7 @@ recruit_court_position_decision = { item = { # Gardener value = recruit_gardener_decision is_shown = { + is_landed_or_landless_administrative_or_theocratic = yes culture = { has_cultural_parameter = can_recruit_gardeners } @@ -2298,7 +2305,7 @@ stress_loss_inappetetic_decision = { #by Linnéa Thimrén ### Write Thoughts Down ### stress_loss_journaller_decision = { #by Linnéa Thimrén picture = { - reference = "gfx/interface/illustrations/decisions/decision_misc.dds" + reference = "gfx/interface/illustrations/decisions/decision_erudition.dds" } desc = stress_loss_journaller_decision_desc selection_tooltip = stress_loss_journaller_decision_tooltip @@ -2356,7 +2363,7 @@ stress_loss_journaller_decision = { #by Linnéa Thimrén ### Talk to Confidant ### stress_loss_confider_decision = { #by Linnéa Thimrén picture = { - reference = "gfx/interface/illustrations/decisions/decision_misc.dds" + reference = "gfx/interface/illustrations/decisions/decision_blood.dds" } desc = stress_loss_confider_decision_desc selection_tooltip = stress_loss_confider_decision_tooltip diff --git a/common/decisions/dlc_decisions/bp3/00_bp3_other_decisions.txt b/common/decisions/dlc_decisions/bp3/00_bp3_other_decisions.txt index d5fa5a751..77b851a96 100644 --- a/common/decisions/dlc_decisions/bp3/00_bp3_other_decisions.txt +++ b/common/decisions/dlc_decisions/bp3/00_bp3_other_decisions.txt @@ -63,7 +63,7 @@ choose_designated_terrain_decision = { current_description = designated_terrain_forest_decision localization = designated_terrain_forest_decision icon = "gfx/interface/icons/terrain_types/forest.dds" - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -85,7 +85,7 @@ choose_designated_terrain_decision = { current_description = designated_terrain_mountain_decision localization = designated_terrain_mountain_decision icon = "gfx/interface/icons/terrain_types/mountains.dds" - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -107,7 +107,7 @@ choose_designated_terrain_decision = { current_description = designated_terrain_plains_decision localization = designated_terrain_plains_decision icon = "gfx/interface/icons/terrain_types/plains.dds" - ai_chance = { + ai_chance = { value = 5 if = { limit = { @@ -129,7 +129,7 @@ choose_designated_terrain_decision = { current_description = designated_terrain_drylands_decision localization = designated_terrain_drylands_decision icon = "gfx/interface/icons/terrain_types/drylands.dds" - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -235,16 +235,16 @@ choose_master_terrain_decision = { decision_to_second_step_button = "CHOOSE_MASTER_TERRAIN_DECISION_NEXT_STEP_BUTTON" show_from_start = yes - ### Woodlands + ### Woodlands item = { # Forest value = master_terrain_forest_terrain current_description = master_terrain_forest_decision localization = master_terrain_forest_decision icon = "gfx/interface/icons/terrain_types/forest.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -259,10 +259,10 @@ choose_master_terrain_decision = { current_description = master_terrain_jungle_decision localization = master_terrain_jungle_decision icon = "gfx/interface/icons/terrain_types/jungle.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -277,10 +277,10 @@ choose_master_terrain_decision = { current_description = master_terrain_taiga_decision localization = master_terrain_taiga_decision icon = "gfx/interface/icons/terrain_types/taiga.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -295,10 +295,10 @@ choose_master_terrain_decision = { current_description = master_terrain_wetlands_decision localization = master_terrain_wetlands_decision icon = "gfx/interface/icons/terrain_types/wetlands.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = woodlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -315,10 +315,10 @@ choose_master_terrain_decision = { current_description = master_terrain_mountains_decision localization = master_terrain_mountains_decision icon = "gfx/interface/icons/terrain_types/mountains.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = highlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = highlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -333,10 +333,10 @@ choose_master_terrain_decision = { current_description = master_terrain_hills_decision localization = master_terrain_hills_decision icon = "gfx/interface/icons/terrain_types/hills.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = highlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = highlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -351,10 +351,10 @@ choose_master_terrain_decision = { current_description = master_terrain_desert_mountains_decision localization = master_terrain_desert_mountains_decision icon = "gfx/interface/icons/terrain_types/desert_mountains.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = highlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = highlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -371,10 +371,10 @@ choose_master_terrain_decision = { current_description = master_terrain_plains_decision localization = master_terrain_plains_decision icon = "gfx/interface/icons/terrain_types/plains.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -389,10 +389,10 @@ choose_master_terrain_decision = { current_description = master_terrain_steppe_decision localization = master_terrain_steppe_decision icon = "gfx/interface/icons/terrain_types/steppe.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -407,10 +407,10 @@ choose_master_terrain_decision = { current_description = master_terrain_farmlands_decision localization = master_terrain_farmlands_decision icon = "gfx/interface/icons/terrain_types/farmlands.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -425,10 +425,10 @@ choose_master_terrain_decision = { current_description = master_terrain_floodplains_decision localization = master_terrain_floodplains_decision icon = "gfx/interface/icons/terrain_types/floodplains.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = lowlands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -446,10 +446,10 @@ choose_master_terrain_decision = { current_description = master_terrain_drylands_decision localization = master_terrain_drylands_decision icon = "gfx/interface/icons/terrain_types/drylands.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = drylands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = drylands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -464,10 +464,10 @@ choose_master_terrain_decision = { current_description = master_terrain_desert_decision localization = master_terrain_desert_decision icon = "gfx/interface/icons/terrain_types/desert.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = drylands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = drylands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -482,10 +482,10 @@ choose_master_terrain_decision = { current_description = master_terrain_oasis_decision localization = master_terrain_oasis_decision icon = "gfx/interface/icons/terrain_types/oasis.dds" - is_shown = { - landless_inspector_terrain_master_trigger = { TERRAIN = drylands } + is_shown = { + landless_inspector_terrain_master_trigger = { TERRAIN = drylands } } - ai_chance = { + ai_chance = { value = 0 if = { limit = { @@ -523,7 +523,7 @@ choose_master_terrain_decision = { landless_inspector_terrain_master_trigger = { TERRAIN = highlands } } switch = { - trigger = yes + trigger = yes scope:master_terrain_mountains_terrain = { landless_inspector_master_terrain_effect = { TERRAIN = mountains } } @@ -913,7 +913,7 @@ enact_legacy_of_adventurer_decision = { has_ep3_dlc_trigger = yes is_landless_adventurer = yes NOT = { has_trait = gallowsbait } - NOT = { + NOT = { house = { has_house_modifier = legacy_adventurer_house_modifier } @@ -947,7 +947,7 @@ enact_legacy_of_adventurer_decision = { save_temporary_scope_value_as = { name = contract_tally value = 0 - } + } } custom_tooltip = { text = has_enough_contracts_tt diff --git a/common/decisions/dlc_decisions/bp_2/00_bp2_other_decisions.txt b/common/decisions/dlc_decisions/bp_2/00_bp2_other_decisions.txt index c6e3c49bd..722b69b55 100644 --- a/common/decisions/dlc_decisions/bp_2/00_bp2_other_decisions.txt +++ b/common/decisions/dlc_decisions/bp_2/00_bp2_other_decisions.txt @@ -126,6 +126,10 @@ rites_of_passage_decision = { } ai_potential = { + OR = { + government_has_flag = government_is_tribal + government_has_flag = government_is_nomadic + } OR = { any_child = { character_can_rites_of_passage_trigger = yes diff --git a/common/decisions/dlc_decisions/ep3_decisions.txt b/common/decisions/dlc_decisions/ep3_decisions.txt index 2a9e77c3a..f608f668d 100644 --- a/common/decisions/dlc_decisions/ep3_decisions.txt +++ b/common/decisions/dlc_decisions/ep3_decisions.txt @@ -2564,7 +2564,12 @@ commission_icon_decision = { if = { # Conditional exists to avoid false-positives during tooltip generation, but 'local_artisan' should always exist on execution! limit = { exists = scope:local_artisan } - root = { add_courtier = scope:local_artisan } + if = { + limit = { + NOT = { scope:local_artisan = { is_courtier_of = root } } + } + root = { add_courtier = scope:local_artisan } + } scope:local_artisan = { add_trait = devoted } diff --git a/common/decisions/dlc_decisions/ep_1/00_ep1_other_decisions.txt b/common/decisions/dlc_decisions/ep_1/00_ep1_other_decisions.txt index f0b8b61ba..09a124056 100644 --- a/common/decisions/dlc_decisions/ep_1/00_ep1_other_decisions.txt +++ b/common/decisions/dlc_decisions/ep_1/00_ep1_other_decisions.txt @@ -375,13 +375,13 @@ introduce_a_new_fashion_at_court_decision = { } ############################################# -# Finance Culture Development # +# Finance Culture Prosperity # # by Maxence Voleau # ############################################# -### Promote Other Culture Development Decision ### -promote_other_culture_development_decision = { - title = promote_other_culture_development_decision_name +### Promote Other Culture Prosperity Decision ### +promote_other_culture_prosperity_decision = { + title = promote_other_culture_prosperity_decision_name picture = { trigger = { culture = { has_graphical_east_asia_culture_group_trigger = yes } @@ -397,8 +397,8 @@ promote_other_culture_development_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_misc.dds" } - desc = promote_other_culture_development_decision_desc - selection_tooltip = promote_other_culture_development_decision_tooltip + desc = promote_other_culture_prosperity_decision_desc + selection_tooltip = promote_other_culture_prosperity_decision_tooltip cooldown = { years = 10 } sort_order = 90 @@ -410,7 +410,7 @@ promote_other_culture_development_decision = { is_valid_showing_failures_only = { custom_tooltip = { - text = promote_other_culture_development_decision_not_acceptance_tt + text = promote_other_culture_prosperity_decision_not_acceptance_tt any_sub_realm_county = { count > 0 AND = { @@ -471,11 +471,11 @@ promote_other_culture_development_decision = { every_in_list = { list = promoted_culture this = { save_scope_as = current_culture } - custom_tooltip = promote_other_culture_development_decision_effect_summary #see if a modifier can be injected for better effect + custom_tooltip = promote_other_culture_prosperity_decision_effect_summary #see if a modifier can be injected for better effect } } else = { - custom_tooltip = promote_other_culture_development_decision_no_effect + custom_tooltip = promote_other_culture_prosperity_decision_no_effect } #Apply the actual effect: add a County Modifier on the relevant Counties @@ -495,6 +495,7 @@ promote_other_culture_development_decision = { modifier = promote_culture_modifier years = 10 } + change_county_control = 5 } } } diff --git a/common/decisions/dlc_decisions/ep_3/06_ep3_admin_decisions.txt b/common/decisions/dlc_decisions/ep_3/06_ep3_admin_decisions.txt index 5003cf36f..570e5ce87 100644 --- a/common/decisions/dlc_decisions/ep_3/06_ep3_admin_decisions.txt +++ b/common/decisions/dlc_decisions/ep_3/06_ep3_admin_decisions.txt @@ -221,6 +221,7 @@ estate_governor_patrols_decision = { modifier = ep3_estate_governor_patrols_modifier years = 15 } + change_county_control = 5 } increase_governance_effect = { VALUE = 6 } } @@ -370,7 +371,7 @@ estate_granary_decision = { limit = { domicile ?= { domicile_location.county = { - county_control < 100 + county_control < county_control_baseline } } } @@ -380,21 +381,21 @@ estate_granary_decision = { limit = { domicile ?= { domicile_location.county = { - development_level >= estate_granary_development_bonus_2_value + prosperity_level >= estate_granary_prosperity_bonus_2_value } } } - custom_tooltip = estate_unlock_granary_decision_development_2_tt + custom_tooltip = estate_unlock_granary_decision_prosperity_2_tt } else_if = { limit = { domicile ?= { domicile_location.county = { - development_level >= estate_granary_development_bonus_1_value + prosperity_level >= estate_granary_prosperity_bonus_1_value } } } - custom_tooltip = estate_unlock_granary_decision_development_1_tt + custom_tooltip = estate_unlock_granary_decision_prosperity_1_tt } if = { limit = { @@ -731,7 +732,8 @@ convert_to_administrative_decision = { picture = { reference = "gfx/interface/illustrations/decisions/ep3_cerimonial_decision.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 title = { first_valid = { triggered_desc = { @@ -783,6 +785,10 @@ convert_to_administrative_decision = { government_has_flag = government_is_feudal government_has_flag = government_is_clan government_has_flag = government_is_japan_feudal + AND = { # Republic doges may become admin + government_has_flag = government_is_republic + highest_liege_matching_rule:uses_assembly = this + } } NOT = { has_character_flag = granted_title_government_blocker @@ -851,6 +857,7 @@ convert_to_administrative_decision = { limit = { top_liege = this is_ai = no + NOT = { government_has_flag = government_is_republic } } custom_tooltip = { text = all_powerful_vassals_required_tt @@ -863,6 +870,12 @@ convert_to_administrative_decision = { } } } + trigger_if = { # Republics have to be despots + limit = { + government_has_flag = government_is_republic + } + has_realm_law = republican_despot_succession_law + } trigger_if = { limit = { is_ai = yes } calc_true_if = { @@ -872,7 +885,7 @@ convert_to_administrative_decision = { culture = { has_cultural_pillar = ethos_egalitarian } culture = { has_cultural_tradition = tradition_legalistic } has_realm_law = crown_authority_3 - capital_county = { development_level > medium_development_level } + capital_county = { prosperity_level > medium_prosperity_level } rite = { rite_has_tenet = tenet_legalism } dynasty = { has_dynasty_perk = erudition_legacy_5 } dynasty = { has_dynasty_perk = law_legacy_5 } @@ -1354,7 +1367,8 @@ convert_to_feudalism_from_administrative_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = convert_to_feudalism_from_administrative_decision_desc is_shown = { @@ -1373,12 +1387,11 @@ convert_to_feudalism_from_administrative_decision = { is_valid = { is_landed = yes trigger_if = { - limit = { - is_independent_ruler = no - } - top_liege ?= { - realm_law_authority_level_0 = yes - } + limit = { is_independent_ruler = no } + custom_tooltip = { + text = liege_has_realm_law_authority_0_tt + top_liege ?= { realm_law_authority_level_0 = yes } + } custom_tooltip = { text = governorship_is_on_the_border_tt any_sub_realm_county = { @@ -1858,10 +1871,8 @@ change_imperial_aspirations_decision = { is_valid = { government_has_flag = government_is_administrative - trigger_if = { # Unavailable if you are the top liege - Unless you have either modifier, so you may remove it. - limit = { - top_liege = this - } + trigger_if = { # Unavailable if you are the top liege - Unless if you have either modifier, so you may remove it. + limit = { top_liege = this } OR = { has_character_modifier = ep3_admin_renounce_throne_personal house ?= { has_house_modifier = ep3_admin_renounce_throne_house } diff --git a/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions.txt b/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions.txt index 5c0108199..f899b50b2 100644 --- a/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions.txt +++ b/common/decisions/dlc_decisions/ep_3/06_ep3_laamp_decisions.txt @@ -112,12 +112,7 @@ become_landless_adventurer_decision = { # Relevant cultures/faiths trigger_if = { limit = { - NAND = { - is_ai = no - government_has_mechanic = administrative - top_liege = this - is_landed = no - } + NOT = { government_has_flag = government_is_merchant } } OR = { culture = { has_cultural_parameter = unlock_voluntary_laampdom } @@ -127,9 +122,27 @@ become_landless_adventurer_decision = { text = nomadic_government_tt government_has_flag = government_is_nomadic } - has_character_modifier = tgp_gave_up_modifier + OR = { + culture = { has_cultural_parameter = unlock_voluntary_laampdom } + rite = { rite_has_parameter = unlock_voluntary_laampdom_faith } + has_personal_tenet_flag = unlock_voluntary_laampdom_faith + has_trait = nomadic_philosophy + custom_tooltip = { + text = nomadic_government_tt + government_has_flag = government_is_nomadic + } + has_character_modifier = tgp_gave_up_modifier + } } } + # Triggers for merchants + trigger_else = { + custom_tooltip = { + text = gdp_recently_became_merchant_decision_cooldown_tt + NOT = { exists = var:gdp_recently_became_merchant_cooldown } + } + } + } is_valid_showing_failures_only = { @@ -141,11 +154,16 @@ become_landless_adventurer_decision = { effect = { save_scope_as = adventurer + set_variable = { + name = gdp_recently_became_adventurer_cooldown + years = 5 + } if = { limit = { player_heir ?= { this != root is_adult = yes + is_ruler = no } } player_heir = { @@ -185,12 +203,29 @@ become_landless_adventurer_decision = { } create_landless_adventurer_title_tooltip_effect = yes show_as_tooltip = { - add_prestige = medium_prestige_gain + if = { + limit = { + NOT = { government_has_flag = government_is_merchant } + } + add_prestige = medium_prestige_gain + } add_character_modifier = { modifier = ep3_voluntary_laamp_character_modifier years = 5 } } + if = { + limit = { + any_in_list = { variable = owes_me_money } + } + custom_tooltip = gdp_become_adventurer_debtors_to_contracts_tt + } + if = { + limit = { + any_owned_story = { story_type = story_cycle_loan } + } + custom_tooltip = gdp_become_adventurer_debts_transferred_tt + } trigger_event = { id = ep3_laamps.0030 } # Debug tracking if = { @@ -476,10 +511,10 @@ wipe_slate_decision = { cost = { gold = { - value = 100 + value = 50 add = { value = highest_held_title_tier - multiply = 25 + multiply = 12 } } prestige = { @@ -864,7 +899,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe geographical_region = world_steppe_west @@ -883,7 +918,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe geographical_region = world_africa_north @@ -902,7 +937,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe geographical_region = world_steppe_west @@ -922,7 +957,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe geographical_region = world_steppe_west @@ -943,7 +978,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_europe_west @@ -965,7 +1000,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_africa @@ -984,7 +1019,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_asia_minor @@ -1006,7 +1041,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_asia_minor @@ -1028,7 +1063,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_middle_east @@ -1049,7 +1084,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_middle_east @@ -1070,7 +1105,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_europe_south geographical_region = world_middle_east @@ -1093,7 +1128,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_middle_east geographical_region = world_india @@ -1114,7 +1149,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_middle_east geographical_region = world_india @@ -1135,7 +1170,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_middle_east geographical_region = world_india @@ -1156,7 +1191,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_india geographical_region = world_tibet @@ -1175,7 +1210,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_india geographical_region = world_steppe @@ -1194,7 +1229,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_india geographical_region = world_tibet @@ -1214,7 +1249,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_india geographical_region = world_tibet @@ -1237,7 +1272,7 @@ treasure_hunting_contract_decision = { is_valid = { custom_description = { text = treasure_hunting_contract_decision_limit - capital_province = { + capital_province ?= { OR = { geographical_region = world_india geographical_region = world_tibet @@ -1816,7 +1851,10 @@ reject_inheritance_decision = { # They have children with you. any_child = { count >= 1 - NOT = { has_trait = disinherited } + NOR = { + has_trait = disinherited + has_trait = adopted_no_inheritance + } any_parent = { this = root } } # Or thought they might. @@ -2171,6 +2209,12 @@ embrace_responsibilities_decision = { ### Change Election Candidacy Status ### change_election_candidacy_status_decision = { # Everyone else's picture. + picture = { + trigger = { + government_has_flag = government_is_republic + } + reference = "gfx/interface/illustrations/decisions/fractious.dds" + } picture = { reference = "gfx/interface/illustrations/decisions/decision_found_kingdom.dds" } desc = { first_valid = { @@ -2330,7 +2374,7 @@ bandit_king_decision = { } cost = { - gold = 500 + gold = 250 prestige = 2000 } @@ -2432,14 +2476,14 @@ seasoned_visitor_decision = { custom_tooltip = { text = seasoned_visitor_decision_not_enough_poi has_variable = poi_visited - var:poi_visited >= 26 #1066 all poi in India. If you change the value here, please also change the value in loc string above + var:poi_visited >= 35 } calc_true_if = { amount >= 2 custom_tooltip = { text = seasoned_visitor_decision_not_enough_poi_advanced has_variable = poi_visited - var:poi_visited >= 42 #1066 all poi in two Indias. If you change the value here, please also change the value in loc string above + var:poi_visited >= 60 } prestige_level >= 4 has_trait_xp = { @@ -2457,8 +2501,8 @@ seasoned_visitor_decision = { } cost = { - prestige = 1500 - gold = 500 + prestige = 500 + gold = 250 } effect = { diff --git a/common/decisions/dlc_decisions/ep_3/06_ep3_separatist_uprising_decision.txt b/common/decisions/dlc_decisions/ep_3/06_ep3_separatist_uprising_decision.txt index f2c6ee5e6..eb3c4d59a 100644 --- a/common/decisions/dlc_decisions/ep_3/06_ep3_separatist_uprising_decision.txt +++ b/common/decisions/dlc_decisions/ep_3/06_ep3_separatist_uprising_decision.txt @@ -63,7 +63,7 @@ separatist_uprising_decision = { cost = { prestige = 2000 - gold = 500 + gold = 250 } effect = { diff --git a/common/decisions/dlc_decisions/fp3_decisions.txt b/common/decisions/dlc_decisions/fp3_decisions.txt index db5a5fb4a..34834e0e3 100644 --- a/common/decisions/dlc_decisions/fp3_decisions.txt +++ b/common/decisions/dlc_decisions/fp3_decisions.txt @@ -1094,6 +1094,8 @@ fp3_become_clan_government_decision = { } desc = fp3_become_clan_government_decision_desc selection_tooltip = fp3_become_clan_government_decision_tooltip + decision_group_type = realm + sort_order = 40 ai_check_interval_by_tier = { barony = 0 @@ -1147,7 +1149,7 @@ fp3_become_clan_government_decision = { change_government = clan_government # Increase unity, uses this effect since both chars are not clan when script is evaluated house.house_head = { - apply_clan_unity_interaction_effect = { + apply_house_unity_interaction_effect = { CHARACTER = root TARGET = root.house.house_head DESC = clan_unity_adopt_clan.desc diff --git a/common/decisions/dlc_decisions/fp_1/00_fp1_other_decisions.txt b/common/decisions/dlc_decisions/fp_1/00_fp1_other_decisions.txt index abdcec744..eaea29e6f 100644 --- a/common/decisions/dlc_decisions/fp_1/00_fp1_other_decisions.txt +++ b/common/decisions/dlc_decisions/fp_1/00_fp1_other_decisions.txt @@ -24,7 +24,7 @@ raise_stele_decision = { cooldown = { years = 10 } - sort_order = 80 + sort_order = 10 is_shown = { # Landed characters only: nobody likes a mercenary. diff --git a/common/decisions/dlc_decisions/mpo/09_mpo_decisions_2.txt b/common/decisions/dlc_decisions/mpo/09_mpo_decisions_2.txt index add46ca53..5f737a253 100644 --- a/common/decisions/dlc_decisions/mpo/09_mpo_decisions_2.txt +++ b/common/decisions/dlc_decisions/mpo/09_mpo_decisions_2.txt @@ -82,14 +82,23 @@ mpo_desperate_stance_decision = { sort_order = 100 is_shown = { + has_mpo_dlc_trigger = yes government_has_flag = government_is_nomadic + exists = situation:the_great_steppe any_character_situation = { any_participant_group = { participant_group_type = nomad_rulers_capital } } - exists = situation:the_great_steppe - has_mpo_dlc_trigger = yes + any_character_situation = { + any_situation_sub_region = { + has_sub_region_phase_parameter = the_great_steppe_desperate_stance_decision + any_situation_sub_region_participant_group = { + participant_group_type = nomad_rulers_capital + participant_group_has_character = root + } + } + } } is_valid = { @@ -146,13 +155,13 @@ adopt_nomadic_ways_decision = { picture = { reference = "gfx/interface/illustrations/event_story/mpo_steppe_region.dds" } - decision_group_type = adventurer + decision_group_type = realm sort_order = 100 is_shown = { - is_landless_adventurer = yes - has_ep3_dlc_trigger = yes has_mpo_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes + is_landless_adventurer = yes } is_valid = { diff --git a/common/decisions/dlc_decisions/mpo/mpo_decisions.txt b/common/decisions/dlc_decisions/mpo/mpo_decisions.txt index dd7c3716b..0f27650bd 100644 --- a/common/decisions/dlc_decisions/mpo/mpo_decisions.txt +++ b/common/decisions/dlc_decisions/mpo/mpo_decisions.txt @@ -3391,13 +3391,14 @@ nomad_higher_tier_title_decision = { #Transition from Gurkhan to GREATEST KHAN EVER ### Become the Greatest of All Khans ### -mpo_become_greatest_of_khans_decision = { - picture = { - reference = "gfx/interface/illustrations/decisions/mpo_decision_great_khan.dds" - } +# NEOW 2555: historical Mongol/Great Khan decision disabled. +#mpo_become_greatest_of_khans_decision = { +# picture = { +# reference = "gfx/interface/illustrations/decisions/mpo_decision_great_khan.dds" +# } - desc = { - desc = mpo_become_greatest_of_khans_decision_desc +# desc = { +# desc = mpo_become_greatest_of_khans_decision_desc # triggered_desc = { # trigger = { # NOR = { @@ -3410,248 +3411,248 @@ mpo_become_greatest_of_khans_decision = { # } # desc = mpo_become_greatest_of_khans_decision_genghis_warning # } - } +# } - cooldown = { - years = 5 - } +# cooldown = { +# years = 5 +# } - ai_check_interval_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 12 - hegemony = 12 - } - sort_order = 200 +# ai_check_interval_by_tier = { +# barony = 0 +# county = 0 +# duchy = 0 +# kingdom = 0 +# empire = 12 +# hegemony = 12 +# } +# sort_order = 200 - decision_group_type = nomad_major +# decision_group_type = nomad_major - is_shown = { - government_has_flag = government_is_nomadic - any_character_situation = { - this = situation:the_great_steppe - } - NOR = { - has_trait = greatest_of_khans - any_owned_story = { - story_type = story_greatest_of_khans - } - } - is_playable_character = yes - exists = situation:the_great_steppe - } +# is_shown = { +# government_has_flag = government_is_nomadic +# any_character_situation = { +# this = situation:the_great_steppe +# } +# NOR = { +# has_trait = greatest_of_khans +# any_owned_story = { +# story_type = story_greatest_of_khans +# } +# } +# is_playable_character = yes +# exists = situation:the_great_steppe +# } - is_valid = { - custom_tooltip = { - text = gok_mongols_disable_warning_tt - NOT = { - has_global_variable = mongol_empire_has_spawned - } - } - custom_tooltip = { - text = greatest_of_khans_disable_warning_tt - NOT = { - is_target_in_global_variable_list = { - name = unavailable_unique_decisions - target = flag:mpo_become_greatest_of_khans_decision - } - } - } - custom_tooltip = { - text = greatest_of_khans_war_ongoing_tt - NOT = { - exists = global_var:mpo_gok_war_ongoing - } - } - government_has_flag = government_is_nomadic - custom_tooltip = { - text = in_great_steppe_tt - any_character_situation = { - this = situation:the_great_steppe - } - } - is_at_war = no - has_realm_law = nomadic_authority_5 - prestige_level >= 4 - highest_held_title_tier >= tier_empire - trigger_if = { # If you are player Temüjin we waive this requirements - limit = { - NOT = { this = character:125501 } - } - OR = { - sub_realm_size >= mpo_greatest_of_khans_target_counties - save_temporary_scope_value_as = { - name = temp_gok_tributaries - value = sub_realm_with_tributaries_size - } +# is_valid = { +# custom_tooltip = { +# text = gok_mongols_disable_warning_tt +# NOT = { +# has_global_variable = mongol_empire_has_spawned +# } +# } +# custom_tooltip = { +# text = greatest_of_khans_disable_warning_tt +# NOT = { +# is_target_in_global_variable_list = { +# name = unavailable_unique_decisions +# target = flag:mpo_become_greatest_of_khans_decision +# } +# } +# } +# custom_tooltip = { +# text = greatest_of_khans_war_ongoing_tt +# NOT = { +# exists = global_var:mpo_gok_war_ongoing +# } +# } +# government_has_flag = government_is_nomadic +# custom_tooltip = { +# text = in_great_steppe_tt +# any_character_situation = { +# this = situation:the_great_steppe +# } +# } +# is_at_war = no +# has_realm_law = nomadic_authority_5 +# prestige_level >= 4 +# highest_held_title_tier >= tier_empire +# trigger_if = { # If you are player Temüjin we waive this requirements +# limit = { +# NOT = { this = character:125501 } +# } +# OR = { +# sub_realm_size >= mpo_greatest_of_khans_target_counties +# save_temporary_scope_value_as = { +# name = temp_gok_tributaries +# value = sub_realm_with_tributaries_size +# } - custom_tooltip = { - text = greatest_of_khans_tributary_req - sub_realm_with_tributaries_size >= mpo_greatest_of_khans_target_counties_tributaries - } - } - custom_tooltip = { - text = greatest_of_khans_vassal_culture_req_tt - OR = { - any_vassal = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - culture = { - save_temporary_scope_as = culture_1 - } - } - any_tributary = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - culture = { - save_temporary_scope_as = culture_1 - } - } - } - OR = { - any_vassal = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOT = { - culture = scope:culture_1 - } - culture = { - save_temporary_scope_as = culture_2 - } - } - any_tributary = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOT = { - culture = scope:culture_1 - } - culture = { - save_temporary_scope_as = culture_2 - } - } - } - OR = { - any_vassal = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOR = { - culture = scope:culture_1 - culture = scope:culture_2 - } - culture = { - save_temporary_scope_as = culture_3 - } - } - any_tributary = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOR = { - culture = scope:culture_1 - culture = scope:culture_2 - } - culture = { - save_temporary_scope_as = culture_3 - } - } - } - trigger_if = { - limit = { - is_ai = no - } - OR = { - any_vassal = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOR = { - culture = scope:culture_1 - culture = scope:culture_2 - culture = scope:culture_3 - } - culture = { - save_temporary_scope_as = culture_4 - } - } - any_tributary = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOR = { - culture = scope:culture_1 - culture = scope:culture_2 - culture = scope:culture_3 - } - culture = { - save_temporary_scope_as = culture_4 - } - } - } - OR = { - any_vassal = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOR = { - culture = scope:culture_1 - culture = scope:culture_2 - culture = scope:culture_3 - culture = scope:culture_4 - } - culture = { - save_temporary_scope_as = culture_5 - } - } - any_tributary = { - highest_held_title_tier >= tier_duchy - government_has_flag = government_is_nomadic - NOR = { - culture = scope:culture_1 - culture = scope:culture_2 - culture = scope:culture_3 - culture = scope:culture_4 - } - } - } - } - } - } - #AI cheat a little because they lack intent - trigger_if = { - limit = { - is_ai = no - } - custom_tooltip = { - text = greatest_of_khans_obedience_req_tt - NOT = { - any_powerful_vassal = { - government_has_flag = government_is_nomadic - obedience_target = root - is_obedient = no - is_ai = yes - } - } - } - } - trigger_else = { - NOT = { - any_powerful_vassal = { - is_ai = yes - government_has_flag = government_is_nomadic - has_dread_level_towards = { - target = root - level < 1 - } - AND = { - obedience_target = root - is_obedient = no - is_ai = yes - } - opinion = { - target = root - value <= 50 - } - } - } - } +# custom_tooltip = { +# text = greatest_of_khans_tributary_req +# sub_realm_with_tributaries_size >= mpo_greatest_of_khans_target_counties_tributaries +# } +# } +# custom_tooltip = { +# text = greatest_of_khans_vassal_culture_req_tt +# OR = { +# any_vassal = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# culture = { +# save_temporary_scope_as = culture_1 +# } +# } +# any_tributary = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# culture = { +# save_temporary_scope_as = culture_1 +# } +# } +# } +# OR = { +# any_vassal = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOT = { +# culture = scope:culture_1 +# } +# culture = { +# save_temporary_scope_as = culture_2 +# } +# } +# any_tributary = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOT = { +# culture = scope:culture_1 +# } +# culture = { +# save_temporary_scope_as = culture_2 +# } +# } +# } +# OR = { +# any_vassal = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOR = { +# culture = scope:culture_1 +# culture = scope:culture_2 +# } +# culture = { +# save_temporary_scope_as = culture_3 +# } +# } +# any_tributary = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOR = { +# culture = scope:culture_1 +# culture = scope:culture_2 +# } +# culture = { +# save_temporary_scope_as = culture_3 +# } +# } +# } +# trigger_if = { +# limit = { +# is_ai = no +# } +# OR = { +# any_vassal = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOR = { +# culture = scope:culture_1 +# culture = scope:culture_2 +# culture = scope:culture_3 +# } +# culture = { +# save_temporary_scope_as = culture_4 +# } +# } +# any_tributary = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOR = { +# culture = scope:culture_1 +# culture = scope:culture_2 +# culture = scope:culture_3 +# } +# culture = { +# save_temporary_scope_as = culture_4 +# } +# } +# } +# OR = { +# any_vassal = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOR = { +# culture = scope:culture_1 +# culture = scope:culture_2 +# culture = scope:culture_3 +# culture = scope:culture_4 +# } +# culture = { +# save_temporary_scope_as = culture_5 +# } +# } +# any_tributary = { +# highest_held_title_tier >= tier_duchy +# government_has_flag = government_is_nomadic +# NOR = { +# culture = scope:culture_1 +# culture = scope:culture_2 +# culture = scope:culture_3 +# culture = scope:culture_4 +# } +# } +# } +# } +# } +# } +# #AI cheat a little because they lack intent +# trigger_if = { +# limit = { +# is_ai = no +# } +# custom_tooltip = { +# text = greatest_of_khans_obedience_req_tt +# NOT = { +# any_powerful_vassal = { +# government_has_flag = government_is_nomadic +# obedience_target = root +# is_obedient = no +# is_ai = yes +# } +# } +# } +# } +# trigger_else = { +# NOT = { +# any_powerful_vassal = { +# is_ai = yes +# government_has_flag = government_is_nomadic +# has_dread_level_towards = { +# target = root +# level < 1 +# } +# AND = { +# obedience_target = root +# is_obedient = no +# is_ai = yes +# } +# opinion = { +# target = root +# value <= 50 +# } +# } +# } +# } # trigger_if = { # limit = { # is_ai = no @@ -3665,942 +3666,943 @@ mpo_become_greatest_of_khans_decision = { # } # } # } - } +# } - is_valid_showing_failures_only = { - is_landed = yes - is_adult = yes - trigger_if = { - limit = { - is_ai = no - } - is_available = yes - } - trigger_else = { - is_imprisoned = no - is_incapable = no - is_alive = yes - NOT = { has_trait = infirm } - } - is_independent_ruler = yes - } +# is_valid_showing_failures_only = { +# is_landed = yes +# is_adult = yes +# trigger_if = { +# limit = { +# is_ai = no +# } +# is_available = yes +# } +# trigger_else = { +# is_imprisoned = no +# is_incapable = no +# is_alive = yes +# NOT = { has_trait = infirm } +# } +# is_independent_ruler = yes +# } - cost = { - gold = { - value = massive_gold_value - } - prestige = { - value = massive_prestige_value - } - } +# cost = { +# gold = { +# value = massive_gold_value +# } +# prestige = { +# value = massive_prestige_value +# } +# } - effect = { - custom_description_no_bullet = { text = mpo_gok_war_of_submission_will_happen_tt } - custom_tooltip = mpo_gok_cravens_wont_fight_tt - custom_tooltip = mpo_gok_obedient_vassals_join_war_tt - add_character_modifier = { - modifier = aspiring_great_khan_modifier - years = 5 - } +# effect = { +# custom_description_no_bullet = { text = mpo_gok_war_of_submission_will_happen_tt } +# custom_tooltip = mpo_gok_cravens_wont_fight_tt +# custom_tooltip = mpo_gok_obedient_vassals_join_war_tt +# add_character_modifier = { +# modifier = aspiring_great_khan_modifier +# years = 5 +# } - custom_description_no_bullet = { text = mpo_gok_war_of_submission_victory_tt } - custom_tooltip = greatest_of_khans_will_disable_warning_tt - show_as_tooltip = { - add_trait = greatest_of_khans - } - custom_tooltip = greatest_of_khans_prevents_mongol_invasion_tt - custom_tooltip = mpo_gok_war_of_submission_vassals_tt - custom_tooltip = mpo_gok_war_of_submission_truces_tt - gain_heroic_legend_seed_tooltip_effect = yes +# custom_description_no_bullet = { text = mpo_gok_war_of_submission_victory_tt } +# custom_tooltip = greatest_of_khans_will_disable_warning_tt +# show_as_tooltip = { +# add_trait = greatest_of_khans +# } +# custom_tooltip = greatest_of_khans_prevents_mongol_invasion_tt +# custom_tooltip = mpo_gok_war_of_submission_vassals_tt +# custom_tooltip = mpo_gok_war_of_submission_truces_tt +# gain_heroic_legend_seed_tooltip_effect = yes - show_as_tooltip = { - custom_tooltip = greatest_of_khans_nickname_tt - add_prestige = monumental_prestige_gain - add_legitimacy = monumental_legitimacy_gain +# show_as_tooltip = { +# custom_tooltip = greatest_of_khans_nickname_tt +# add_prestige = monumental_prestige_gain +# add_legitimacy = monumental_legitimacy_gain - custom_tooltip = become_greatest_of_khans_decision_enable_gok_invasion_cb - custom_tooltip = become_greatest_of_khans_decision_gok_armies_tt - if = { - limit = { - culture = culture:mongol - } - custom_tooltip = become_greatest_of_khans_decision_gain_mongol_empire - } - else = { - custom_tooltip = become_greatest_of_khans_decision_gain_gok_empire - } +# custom_tooltip = become_greatest_of_khans_decision_enable_gok_invasion_cb +# custom_tooltip = become_greatest_of_khans_decision_gok_armies_tt +# if = { +# limit = { +# culture = culture:mongol +# } +# custom_tooltip = become_greatest_of_khans_decision_gain_mongol_empire +# } +# else = { +# custom_tooltip = become_greatest_of_khans_decision_gain_gok_empire +# } - if = { - limit = { - NOT = { - has_realm_law = single_heir_succession_kurultai_law - } - } - add_realm_law_skip_effects = single_heir_succession_kurultai_law - } - } +# if = { +# limit = { +# NOT = { +# has_realm_law = single_heir_succession_kurultai_law +# } +# } +# add_realm_law_skip_effects = single_heir_succession_kurultai_law +# } +# } - custom_description_no_bullet = { text = mpo_gok_war_of_submission_defeat_tt } - custom_tooltip = mpo_gok_war_of_submission_defeat_imprisonment_tt - custom_tooltip = mpo_gok_war_of_submission_defeat_lose_titles_tt - custom_tooltip = mpo_gok_war_of_submission_defeat_lose_herd_tt - show_as_tooltip = { - add_legitimacy = monumental_legitimacy_loss - if = { - limit = { - government_has_flag = government_is_nomadic - has_realm_law = nomadic_authority_2 - NOT = { - has_realm_law = nomadic_authority_1 - } - } - add_realm_law = nomadic_authority_1 - } - else_if = { - limit = { - government_has_flag = government_is_nomadic - NOT = { - has_realm_law = nomadic_authority_1 - } - } - add_realm_law = nomadic_authority_2 - } - add_prestige_level = -1 - } +# custom_description_no_bullet = { text = mpo_gok_war_of_submission_defeat_tt } +# custom_tooltip = mpo_gok_war_of_submission_defeat_imprisonment_tt +# custom_tooltip = mpo_gok_war_of_submission_defeat_lose_titles_tt +# custom_tooltip = mpo_gok_war_of_submission_defeat_lose_herd_tt +# show_as_tooltip = { +# add_legitimacy = monumental_legitimacy_loss +# if = { +# limit = { +# government_has_flag = government_is_nomadic +# has_realm_law = nomadic_authority_2 +# NOT = { +# has_realm_law = nomadic_authority_1 +# } +# } +# add_realm_law = nomadic_authority_1 +# } +# else_if = { +# limit = { +# government_has_flag = government_is_nomadic +# NOT = { +# has_realm_law = nomadic_authority_1 +# } +# } +# add_realm_law = nomadic_authority_2 +# } +# add_prestige_level = -1 +# } - save_scope_as = genghis_khan +# save_scope_as = genghis_khan - hidden_effect = { - #Make list of rulers who are willing to fight - #All valid nomads in same steppes - situation:the_great_steppe ?= { - every_situation_sub_region = { - limit = { - any_situation_sub_region_participant = { - this = root - } - } - every_situation_sub_region_participant = { - limit = { - mpo_gok_coalition_member_trigger = yes - } - add_to_list = anti_gok_coalition_members - } - } - #Add neighbors one region over if in just one region - if = { - limit = { - any_situation_sub_region = { - count <= 1 - any_situation_sub_region_participant = { - this = root - } - } - } - root = { - every_land_neighboring_realm_with_tributaries_owner = { - limit = { - government_has_flag = government_is_nomadic - mpo_gok_coalition_member_trigger = yes - } - if = { - limit = { - government_has_flag = government_is_nomadic - } - add_to_list = anti_gok_coalition_members - } - if = { - limit = { - is_tributary = yes - top_suzerain = { - government_has_flag = government_is_nomadic - } - } - top_suzerain = { - add_to_list = anti_gok_coalition_members - } - } - if = { - limit = { - is_tributary = yes - suzerain = { - government_has_flag = government_is_nomadic - } - } - suzerain = { - add_to_list = anti_gok_coalition_members - } - } +# hidden_effect = { +# #Make list of rulers who are willing to fight +# #All valid nomads in same steppes +# situation:the_great_steppe ?= { +# every_situation_sub_region = { +# limit = { +# any_situation_sub_region_participant = { +# this = root +# } +# } +# every_situation_sub_region_participant = { +# limit = { +# mpo_gok_coalition_member_trigger = yes +# } +# add_to_list = anti_gok_coalition_members +# } +# } +# #Add neighbors one region over if in just one region +# if = { +# limit = { +# any_situation_sub_region = { +# count <= 1 +# any_situation_sub_region_participant = { +# this = root +# } +# } +# } +# root = { +# every_land_neighboring_realm_with_tributaries_owner = { +# limit = { +# government_has_flag = government_is_nomadic +# mpo_gok_coalition_member_trigger = yes +# } +# if = { +# limit = { +# government_has_flag = government_is_nomadic +# } +# add_to_list = anti_gok_coalition_members +# } +# if = { +# limit = { +# is_tributary = yes +# top_suzerain = { +# government_has_flag = government_is_nomadic +# } +# } +# top_suzerain = { +# add_to_list = anti_gok_coalition_members +# } +# } +# if = { +# limit = { +# is_tributary = yes +# suzerain = { +# government_has_flag = government_is_nomadic +# } +# } +# suzerain = { +# add_to_list = anti_gok_coalition_members +# } +# } - } - } - } +# } +# } +# } - } - #Find the most powerful ruler in your vicinity - mpo_find_powerful_opponent_for_gurkhan_effect = yes +# } +# #Find the most powerful ruler in your vicinity +# mpo_find_powerful_opponent_for_gurkhan_effect = yes - #People who hate you too, why not - every_relation = { - type = rival - limit = { - NOT = { - is_in_list = anti_gok_coalition_members - } - is_ruler = yes - mpo_gok_coalition_member_trigger = yes - } - add_to_list = anti_gok_coalition_members - } +# #People who hate you too, why not +# every_relation = { +# type = rival +# limit = { +# NOT = { +# is_in_list = anti_gok_coalition_members +# } +# is_ruler = yes +# mpo_gok_coalition_member_trigger = yes +# } +# add_to_list = anti_gok_coalition_members +# } - #Make list of neighbors that will submit - every_land_neighboring_realm_with_tributaries_owner = { - limit = { - mpo_gok_submitting_coward_trigger = yes - } - add_to_list = gok_submitters - if = { - limit = { - is_in_list = anti_gok_coalition_members - } - remove_from_list = anti_gok_coalition_members - } - } - } +# #Make list of neighbors that will submit +# every_land_neighboring_realm_with_tributaries_owner = { +# limit = { +# mpo_gok_submitting_coward_trigger = yes +# } +# add_to_list = gok_submitters +# if = { +# limit = { +# is_in_list = anti_gok_coalition_members +# } +# remove_from_list = anti_gok_coalition_members +# } +# } +# } - #add obedient vassals as war allies - hidden_effect = { +# #add obedient vassals as war allies +# hidden_effect = { - #Make list of obedient vassals that will join you - every_vassal = { - limit = { - is_obedient = yes - government_has_flag = government_is_nomadic - is_ai = yes - } - add_to_list = obedient_nomad_vassals - } - } +# #Make list of obedient vassals that will join you +# every_vassal = { +# limit = { +# is_obedient = yes +# government_has_flag = government_is_nomadic +# is_ai = yes +# } +# add_to_list = obedient_nomad_vassals +# } +# } - #Choose strongest coalition member - if = { - limit = { - any_in_list = { - list = anti_gok_coalition_members - current_military_strength > 0 - NOT = { - this = root - } - is_landed = yes - sub_realm_size >= 20 - government_has_flag = government_is_nomadic - is_independent_ruler = yes - } - } - ordered_in_list = { - list = anti_gok_coalition_members - order_by = current_military_strength - limit = { - NOT = { - this = root - } - is_landed = yes - sub_realm_size >= 20 - government_has_flag = government_is_nomadic - is_independent_ruler = yes - } - save_scope_as = primary_coalition_defender - } - } - else_if = { - limit = { - any_in_list = { - list = anti_gok_coalition_members - current_military_strength > 0 - is_landed = yes - sub_realm_size >= 12 - NOT = { - this = root - } - government_has_flag = government_is_nomadic - is_independent_ruler = yes - } - } - ordered_in_list = { - list = anti_gok_coalition_members - order_by = current_military_strength - limit = { - is_landed = yes - NOT = { - this = root - } - sub_realm_size >= 12 - government_has_flag = government_is_nomadic - is_independent_ruler = yes - } - save_scope_as = primary_coalition_defender - } - } - else = { - ordered_in_list = { - list = anti_gok_coalition_members - order_by = sub_realm_size - limit = { - highest_held_title_tier >= tier_duchy - NOT = { - this = root - } - is_independent_ruler = yes - } - save_scope_as = primary_coalition_defender - } - } - #It's possible no one is in list... need to find someone worthy - #In the WHOLE steppe - if = { - limit = { - NOT = { - exists = scope:primary_coalition_defender - } - } - situation:the_great_steppe ?= { - ordered_situation_participant = { - order_by = current_military_strength - limit = { - is_ai = yes - NOR = { - this = root - top_liege = root - } - highest_held_title_tier >= tier_duchy - is_independent_ruler = yes - } - save_scope_as = primary_coalition_defender - add_to_list = anti_gok_coalition_members - } - } - } - #And... root's strongest vassal, I guess - if = { - limit = { - NOT = { - exists = scope:primary_coalition_defender - } - } - ordered_vassal = { - order_by = current_military_strength - limit = { - is_ai = yes - NOT = { is_obedient_to = root } - NOR = { - government_has_flag = government_is_herder - is_imprisoned_by = root - } - is_allied_to = root - NOT = { - this = root - } - } - save_scope_as = primary_coalition_defender - } - } - #This great khan has been very thorough already - #Adding all members of all steppe regions - if = { - limit = { - NOT = { - any_in_list = { - count >= 4 - list = anti_gok_coalition_members - NOT = { - this = scope:primary_coalition_defender - } - } - } - } - situation:the_great_steppe ?= { - every_situation_participant = { - limit = { - is_ai = yes - NOT = { - government_has_flag = government_is_herder - } - NOR = { - is_allied_to = root - this = root - top_liege = root - has_relation_friend = root - has_relation_blood_brother = root - is_imprisoned_by = root - } - } - add_to_list = anti_gok_coalition_members - } - } - } - #Adding all non-loyal vassals - if = { - limit = { - NOT = { - any_in_list = { - count >= 4 - list = anti_gok_coalition_members - NOT = { - this = scope:primary_coalition_defender - } - } - } - } - every_vassal = { - limit = { - is_ai = yes - NOT = { is_obedient_to = root } - NOR = { - government_has_flag = government_is_herder - is_imprisoned_by = root - is_allied_to = root - } - NOT = { - this = root - } - } - add_to_list = anti_gok_coalition_members - } - } +# #Choose strongest coalition member +# if = { +# limit = { +# any_in_list = { +# list = anti_gok_coalition_members +# current_military_strength > 0 +# NOT = { +# this = root +# } +# is_landed = yes +# sub_realm_size >= 20 +# government_has_flag = government_is_nomadic +# is_independent_ruler = yes +# } +# } +# ordered_in_list = { +# list = anti_gok_coalition_members +# order_by = current_military_strength +# limit = { +# NOT = { +# this = root +# } +# is_landed = yes +# sub_realm_size >= 20 +# government_has_flag = government_is_nomadic +# is_independent_ruler = yes +# } +# save_scope_as = primary_coalition_defender +# } +# } +# else_if = { +# limit = { +# any_in_list = { +# list = anti_gok_coalition_members +# current_military_strength > 0 +# is_landed = yes +# sub_realm_size >= 12 +# NOT = { +# this = root +# } +# government_has_flag = government_is_nomadic +# is_independent_ruler = yes +# } +# } +# ordered_in_list = { +# list = anti_gok_coalition_members +# order_by = current_military_strength +# limit = { +# is_landed = yes +# NOT = { +# this = root +# } +# sub_realm_size >= 12 +# government_has_flag = government_is_nomadic +# is_independent_ruler = yes +# } +# save_scope_as = primary_coalition_defender +# } +# } +# else = { +# ordered_in_list = { +# list = anti_gok_coalition_members +# order_by = sub_realm_size +# limit = { +# highest_held_title_tier >= tier_duchy +# NOT = { +# this = root +# } +# is_independent_ruler = yes +# } +# save_scope_as = primary_coalition_defender +# } +# } +# #It's possible no one is in list... need to find someone worthy +# #In the WHOLE steppe +# if = { +# limit = { +# NOT = { +# exists = scope:primary_coalition_defender +# } +# } +# situation:the_great_steppe ?= { +# ordered_situation_participant = { +# order_by = current_military_strength +# limit = { +# is_ai = yes +# NOR = { +# this = root +# top_liege = root +# } +# highest_held_title_tier >= tier_duchy +# is_independent_ruler = yes +# } +# save_scope_as = primary_coalition_defender +# add_to_list = anti_gok_coalition_members +# } +# } +# } +# #And... root's strongest vassal, I guess +# if = { +# limit = { +# NOT = { +# exists = scope:primary_coalition_defender +# } +# } +# ordered_vassal = { +# order_by = current_military_strength +# limit = { +# is_ai = yes +# NOT = { is_obedient_to = root } +# NOR = { +# government_has_flag = government_is_herder +# is_imprisoned_by = root +# } +# is_allied_to = root +# NOT = { +# this = root +# } +# } +# save_scope_as = primary_coalition_defender +# } +# } +# #This great khan has been very thorough already +# #Adding all members of all steppe regions +# if = { +# limit = { +# NOT = { +# any_in_list = { +# count >= 4 +# list = anti_gok_coalition_members +# NOT = { +# this = scope:primary_coalition_defender +# } +# } +# } +# } +# situation:the_great_steppe ?= { +# every_situation_participant = { +# limit = { +# is_ai = yes +# NOT = { +# government_has_flag = government_is_herder +# } +# NOR = { +# is_allied_to = root +# this = root +# top_liege = root +# has_relation_friend = root +# has_relation_blood_brother = root +# is_imprisoned_by = root +# } +# } +# add_to_list = anti_gok_coalition_members +# } +# } +# } +# #Adding all non-loyal vassals +# if = { +# limit = { +# NOT = { +# any_in_list = { +# count >= 4 +# list = anti_gok_coalition_members +# NOT = { +# this = scope:primary_coalition_defender +# } +# } +# } +# } +# every_vassal = { +# limit = { +# is_ai = yes +# NOT = { is_obedient_to = root } +# NOR = { +# government_has_flag = government_is_herder +# is_imprisoned_by = root +# is_allied_to = root +# } +# NOT = { +# this = root +# } +# } +# add_to_list = anti_gok_coalition_members +# } +# } - #Ok... hopefully now there DEFINITELY is a leader for root's enemies and at least a couple enemies to fight +# #Ok... hopefully now there DEFINITELY is a leader for root's enemies and at least a couple enemies to fight - #hidden setup event - trigger_event = mpo_greatest_of_khans.0100 - } +# #hidden setup event +# trigger_event = mpo_greatest_of_khans.0100 +# } - ai_potential = { - has_realm_law = nomadic_authority_5 - is_independent_ruler = yes - government_has_flag = government_is_nomadic - #Stronger than all neighbors - NOT = { - any_land_neighboring_realm_with_tributaries_owner = { - mpo_gok_coalition_member_trigger = yes - current_military_strength >= root.current_military_strength - } - } - OR = { - realm_size >= 70 - sub_realm_with_tributaries_size >= 120 - #Has an ally that can seriously help - any_ally = { - count >= 1 - OR = { - highest_held_title_tier >= tier_empire - current_military_strength >= root.current_military_strength - } - is_at_war = no - } - #Has strong allies - any_ally = { - count >= 2 - highest_held_title_tier >= tier_kingdom - is_at_war = no - } - any_ally = { - count >= 3 - highest_held_title_tier >= tier_duchy - is_at_war = no - } - #is conqueror already - has_trait = conqueror - #Is ballsy - OR = { - ai_boldness >= high_positive_ai_value - ai_energy >= high_positive_ai_value - ai_greed >= high_positive_ai_value - } - } - health >= poor_health - age <= 50 - } +# ai_potential = { +# has_realm_law = nomadic_authority_5 +# is_independent_ruler = yes +# government_has_flag = government_is_nomadic +# #Stronger than all neighbors +# NOT = { +# any_land_neighboring_realm_with_tributaries_owner = { +# mpo_gok_coalition_member_trigger = yes +# current_military_strength >= root.current_military_strength +# } +# } +# OR = { +# realm_size >= 70 +# sub_realm_with_tributaries_size >= 120 +# #Has an ally that can seriously help +# any_ally = { +# count >= 1 +# OR = { +# highest_held_title_tier >= tier_empire +# current_military_strength >= root.current_military_strength +# } +# is_at_war = no +# } +# #Has strong allies +# any_ally = { +# count >= 2 +# highest_held_title_tier >= tier_kingdom +# is_at_war = no +# } +# any_ally = { +# count >= 3 +# highest_held_title_tier >= tier_duchy +# is_at_war = no +# } +# #is conqueror already +# has_trait = conqueror +# #Is ballsy +# OR = { +# ai_boldness >= high_positive_ai_value +# ai_energy >= high_positive_ai_value +# ai_greed >= high_positive_ai_value +# } +# } +# health >= poor_health +# age <= 50 +# } - ai_will_do = { - base = 0 - #NOT twice as strong as any neighbor or char in steppe region - modifier = { - add = -25 - OR = { - any_land_neighboring_realm_with_tributaries_owner = { - mpo_gok_coalition_member_trigger = yes - #THIS SHOULD CHECK THEIR STRENGTH IS MORE THAN HALF ROOT'S - confederation_worthy_foe_strength_ratio_value_root < 2 - } - situation:the_great_steppe ?= { - any_situation_sub_region = { - any_situation_sub_region_participant = { - this = root - } - any_situation_sub_region_participant = { - NOT = { this = root } - #THIS SHOULD CHECK ROOT'S STRENGTH IS DOUBLE THEIRS - confederation_worthy_foe_strength_ratio_value_root < 2 - } - } - } - } - } - #Three times as strong as any neighbor or char in steppe region - modifier = { - add = 75 - NOR = { - any_land_neighboring_realm_with_tributaries_owner = { - mpo_gok_coalition_member_trigger = yes - #THIS SHOULD CHECK ROOT'S STRENGTH IS TRIPLE THEIRS - confederation_worthy_foe_strength_ratio_value_root < 3 - } - situation:the_great_steppe ?= { - any_situation_sub_region = { - any_situation_sub_region_participant = { - this = root - } - any_situation_sub_region_participant = { - NOT = { this = root } - #THIS SHOULD CHECK ROOT'S STRENGTH IS TRIPLE THEIRS - confederation_worthy_foe_strength_ratio_value_root < 3 - } - } - } - } - } - modifier = { - add = 25 - OR = { - ai_boldness > 0 - ai_energy > 0 - ai_greed > 0 - } - } - modifier = { - add = 25 - ai_boldness > 0 - ai_energy > 0 - ai_greed > 0 - } - modifier = { - add = -50 - OR = { - ai_boldness <= medium_negative_ai_value - ai_energy <= medium_negative_ai_value - ai_greed <= medium_negative_ai_value - } - } - modifier = { - add = 25 - OR = { - ai_boldness >= medium_positive_ai_value - ai_energy >= medium_positive_ai_value - ai_greed >= medium_positive_ai_value - } - } - modifier = { - add = 10 - culture = { - has_cultural_pillar = ethos_bellicose - } - } - modifier = { - add = -10 - culture = { - OR = { - has_cultural_tradition = tradition_isolationist - has_cultural_tradition = tradition_hereditary_hierarchy - has_cultural_tradition = tradition_legalistic - } - } - } - # If young - go for it!!!! - modifier = { - add = 20 - age <= 35 - } - #Want to make it less likely this happens early - modifier = { - add = -25 - current_date <= 1000 - } - #Want to make it more likely this happens if game is getting late and Genghis didn't happen somehow - modifier = { - add = 100 - current_date >= 1250 - } - } -} +# ai_will_do = { +# base = 0 +# #NOT twice as strong as any neighbor or char in steppe region +# modifier = { +# add = -25 +# OR = { +# any_land_neighboring_realm_with_tributaries_owner = { +# mpo_gok_coalition_member_trigger = yes +# #THIS SHOULD CHECK THEIR STRENGTH IS MORE THAN HALF ROOT'S +# confederation_worthy_foe_strength_ratio_value_root < 2 +# } +# situation:the_great_steppe ?= { +# any_situation_sub_region = { +# any_situation_sub_region_participant = { +# this = root +# } +# any_situation_sub_region_participant = { +# NOT = { this = root } +# #THIS SHOULD CHECK ROOT'S STRENGTH IS DOUBLE THEIRS +# confederation_worthy_foe_strength_ratio_value_root < 2 +# } +# } +# } +# } +# } +# #Three times as strong as any neighbor or char in steppe region +# modifier = { +# add = 75 +# NOR = { +# any_land_neighboring_realm_with_tributaries_owner = { +# mpo_gok_coalition_member_trigger = yes +# #THIS SHOULD CHECK ROOT'S STRENGTH IS TRIPLE THEIRS +# confederation_worthy_foe_strength_ratio_value_root < 3 +# } +# situation:the_great_steppe ?= { +# any_situation_sub_region = { +# any_situation_sub_region_participant = { +# this = root +# } +# any_situation_sub_region_participant = { +# NOT = { this = root } +# #THIS SHOULD CHECK ROOT'S STRENGTH IS TRIPLE THEIRS +# confederation_worthy_foe_strength_ratio_value_root < 3 +# } +# } +# } +# } +# } +# modifier = { +# add = 25 +# OR = { +# ai_boldness > 0 +# ai_energy > 0 +# ai_greed > 0 +# } +# } +# modifier = { +# add = 25 +# ai_boldness > 0 +# ai_energy > 0 +# ai_greed > 0 +# } +# modifier = { +# add = -50 +# OR = { +# ai_boldness <= medium_negative_ai_value +# ai_energy <= medium_negative_ai_value +# ai_greed <= medium_negative_ai_value +# } +# } +# modifier = { +# add = 25 +# OR = { +# ai_boldness >= medium_positive_ai_value +# ai_energy >= medium_positive_ai_value +# ai_greed >= medium_positive_ai_value +# } +# } +# modifier = { +# add = 10 +# culture = { +# has_cultural_pillar = ethos_bellicose +# } +# } +# modifier = { +# add = -10 +# culture = { +# OR = { +# has_cultural_tradition = tradition_isolationist +# has_cultural_tradition = tradition_hereditary_hierarchy +# has_cultural_tradition = tradition_legalistic +# } +# } +# } +# # If young - go for it!!!! +# modifier = { +# add = 20 +# age <= 35 +# } +# #Want to make it less likely this happens early +# modifier = { +# add = -25 +# current_date <= 1000 +# } +# #Want to make it more likely this happens if game is getting late and Genghis didn't happen somehow +# modifier = { +# add = 100 +# current_date >= 1250 +# } +# } +#} #GREATEST OF KHANS HAS BECOME LORD OF ALL ### Reform the Great Khaganate ### -mpo_gok_world_conquest_decision = { - picture = { - reference = "gfx/interface/illustrations/decisions/mpo_decision_great_khan.dds" - } - decision_group_type = nomad_major - desc = mpo_gok_world_conquest_decision_desc +# NEOW 2555: historical Mongol/Great Khan decision disabled. +#mpo_gok_world_conquest_decision = { +# picture = { +# reference = "gfx/interface/illustrations/decisions/mpo_decision_great_khan.dds" +# } +# decision_group_type = nomad_major +# desc = mpo_gok_world_conquest_decision_desc - cooldown = { years = 5 } +# cooldown = { years = 5 } - ai_check_interval_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 36 - hegemony = 36 - } - sort_order = 300 +# ai_check_interval_by_tier = { +# barony = 0 +# county = 0 +# duchy = 0 +# kingdom = 0 +# empire = 36 +# hegemony = 36 +# } +# sort_order = 300 - is_shown = { - any_owned_story = { - story_type = story_greatest_of_khans - } - is_playable_character = yes - has_mpo_dlc_trigger = yes - exists = global_var:greatest_of_khans_title - exists = global_var:first_gok.dynasty - } +# is_shown = { +# any_owned_story = { +# story_type = story_greatest_of_khans +# } +# is_playable_character = yes +# has_mpo_dlc_trigger = yes +# exists = global_var:greatest_of_khans_title +# exists = global_var:first_gok.dynasty +# } - is_valid = { - NOT = { - current_year >= global_var:gok_empire_crumble_date - } - dynasty = global_var:first_gok.dynasty - global_var:greatest_of_khans_title = { - holder = root - } - is_independent_ruler = yes - government_has_flag = government_is_nomadic - has_realm_law = nomadic_authority_5 - #Legitimace is hamstrung a bit if you don't own legends - trigger_if = { - limit = { - has_dlc_feature = legends - is_ai = no - } - legitimacy_level >= 5 - } - trigger_else_if = { - limit = { - NOT = { has_dlc_feature = legends } - is_ai = yes - } - legitimacy_level >= 3 - } - trigger_else = { - legitimacy_level >= 4 - } +# is_valid = { +# NOT = { +# current_year >= global_var:gok_empire_crumble_date +# } +# dynasty = global_var:first_gok.dynasty +# global_var:greatest_of_khans_title = { +# holder = root +# } +# is_independent_ruler = yes +# government_has_flag = government_is_nomadic +# has_realm_law = nomadic_authority_5 +# #Legitimace is hamstrung a bit if you don't own legends +# trigger_if = { +# limit = { +# has_dlc_feature = legends +# is_ai = no +# } +# legitimacy_level >= 5 +# } +# trigger_else_if = { +# limit = { +# NOT = { has_dlc_feature = legends } +# is_ai = yes +# } +# legitimacy_level >= 3 +# } +# trigger_else = { +# legitimacy_level >= 4 +# } - trigger_if = { - limit = { - is_ai = no - } - prestige_level >= 5 - } - trigger_else = { - prestige_level >= 4 - } +# trigger_if = { +# limit = { +# is_ai = no +# } +# prestige_level >= 5 +# } +# trigger_else = { +# prestige_level >= 4 +# } - highest_held_title_tier >= tier_empire +# highest_held_title_tier >= tier_empire - OR = { - sub_realm_size >= mpo_gok_world_conquest_target_counties - save_temporary_scope_value_as = { - name = temp_gok_tributaries - value = sub_realm_with_tributaries_size - } +# OR = { +# sub_realm_size >= mpo_gok_world_conquest_target_counties +# save_temporary_scope_value_as = { +# name = temp_gok_tributaries +# value = sub_realm_with_tributaries_size +# } - custom_tooltip = { - text = gok_world_conquest_tributary_req - sub_realm_with_tributaries_size >= mpo_gok_world_conquest_target_counties_tributaries - } - } +# custom_tooltip = { +# text = gok_world_conquest_tributary_req +# sub_realm_with_tributaries_size >= mpo_gok_world_conquest_target_counties_tributaries +# } +# } - #AI cheat a little because they lack intent - trigger_if = { - limit = { - is_ai = no - } - custom_tooltip = { - text = greatest_of_khans_obedience_req_tt - NOT = { - any_powerful_vassal = { - government_has_flag = government_is_nomadic - obedience_target = root - is_obedient = no - is_ai = yes - } - } - } - } - trigger_else = { - NOT = { - any_powerful_vassal = { - is_ai = yes - government_has_flag = government_is_nomadic - has_dread_level_towards = { - target = root - level < 1 - } - AND = { - obedience_target = root - is_obedient = no - is_ai = yes - } - opinion = { - target = root - value <= 50 - } - } - } - } - } +# #AI cheat a little because they lack intent +# trigger_if = { +# limit = { +# is_ai = no +# } +# custom_tooltip = { +# text = greatest_of_khans_obedience_req_tt +# NOT = { +# any_powerful_vassal = { +# government_has_flag = government_is_nomadic +# obedience_target = root +# is_obedient = no +# is_ai = yes +# } +# } +# } +# } +# trigger_else = { +# NOT = { +# any_powerful_vassal = { +# is_ai = yes +# government_has_flag = government_is_nomadic +# has_dread_level_towards = { +# target = root +# level < 1 +# } +# AND = { +# obedience_target = root +# is_obedient = no +# is_ai = yes +# } +# opinion = { +# target = root +# value <= 50 +# } +# } +# } +# } +# } - is_valid_showing_failures_only = { - is_at_war = no - is_landed = yes - is_adult = yes - trigger_if = { - limit = { - is_ai = no - } - is_available = yes - } - trigger_else = { - is_imprisoned = no - is_incapable = no - is_alive = yes - NOT = { has_trait = infirm } - } - } +# is_valid_showing_failures_only = { +# is_at_war = no +# is_landed = yes +# is_adult = yes +# trigger_if = { +# limit = { +# is_ai = no +# } +# is_available = yes +# } +# trigger_else = { +# is_imprisoned = no +# is_incapable = no +# is_alive = yes +# NOT = { has_trait = infirm } +# } +# } - cost = { - prestige = { - value = 5000 - } - gold = { - value = 5000 - if = { - limit = { is_ai = no } - #Realm size - if = { - limit = { root.realm_size >= 3000 } - multiply = 3 - } - else_if = { - limit = { root.realm_size >= 2500 } - multiply = 2.5 - } - else_if = { - limit = { root.realm_size >= 2000 } - multiply = 2 - } - else_if = { - limit = { root.realm_size >= 1500 } - multiply = 1.5 - } - } - } - } +# cost = { +# prestige = { +# value = 5000 +# } +# gold = { +# value = 5000 +# if = { +# limit = { is_ai = no } +# #Realm size +# if = { +# limit = { root.realm_size >= 3000 } +# multiply = 3 +# } +# else_if = { +# limit = { root.realm_size >= 2500 } +# multiply = 2.5 +# } +# else_if = { +# limit = { root.realm_size >= 2000 } +# multiply = 2 +# } +# else_if = { +# limit = { root.realm_size >= 1500 } +# multiply = 1.5 +# } +# } +# } +# } - effect = { - save_scope_value_as = { - name = gok_empire_crumble_date - value = global_var:gok_empire_crumble_date - } - save_scope_as = actor - save_scope_as = gok +# effect = { +# save_scope_value_as = { +# name = gok_empire_crumble_date +# value = global_var:gok_empire_crumble_date +# } +# save_scope_as = actor +# save_scope_as = gok - gok_final_decision_list_setup = yes +# gok_final_decision_list_setup = yes - #SHOW GENERAL EFFECTS THAT HAPPEN REGARDLESS OF OPTION CHOICE +# #SHOW GENERAL EFFECTS THAT HAPPEN REGARDLESS OF OPTION CHOICE - custom_tooltip = gok_reform_never_available_again_tt +# custom_tooltip = gok_reform_never_available_again_tt - custom_tooltip = gok_reform_invalides_gok_stuff_tt - custom_tooltip = gok_lose_succession_protection_tt - custom_tooltip = gok_avoid_timing_out_tt +# custom_tooltip = gok_reform_invalides_gok_stuff_tt +# custom_tooltip = gok_lose_succession_protection_tt +# custom_tooltip = gok_avoid_timing_out_tt - show_as_tooltip = { - gok_world_conquest_generic_rewards_effect = yes - } - custom_tooltip = gok_remain_nomadic_tt - if = { - limit = { - has_dlc_feature = admin_gov - } - custom_tooltip = gok_choose_government_switch_tt - } - else = { - custom_tooltip = gok_choose_government_switch_no_admin_tt - } - #SHOW SUPER NOMADIC EFFECTS - custom_description_no_bullet = { - text = gok_gov_if_super_nomadic_tt - } - custom_tooltip = gok_super_nomad_dread_and_gold_tt - custom_tooltip = gok_counties_become_nomad_counties_tt - custom_tooltip = gok_new_nomad_counties_lose_development_tt - custom_tooltip = gok_other_counties_lose_development_tt - custom_tooltip = gok_non_nomads_become_nomad_tt - custom_tooltip = gok_city_state_creation +# show_as_tooltip = { +# gok_world_conquest_generic_rewards_effect = yes +# } +# custom_tooltip = gok_remain_nomadic_tt +# if = { +# limit = { +# has_dlc_feature = admin_gov +# } +# custom_tooltip = gok_choose_government_switch_tt +# } +# else = { +# custom_tooltip = gok_choose_government_switch_no_admin_tt +# } +# #SHOW SUPER NOMADIC EFFECTS +# custom_description_no_bullet = { +# text = gok_gov_if_super_nomadic_tt +# } +# custom_tooltip = gok_super_nomad_dread_and_gold_tt +# custom_tooltip = gok_counties_become_nomad_counties_tt +# custom_tooltip = gok_new_nomad_counties_lose_development_tt +# custom_tooltip = gok_other_counties_lose_development_tt +# custom_tooltip = gok_non_nomads_become_nomad_tt +# custom_tooltip = gok_city_state_creation - #SHOW GOVERNMENT CHANGE EFFECTS - custom_description_no_bullet = { - text = gok_gov_switch_options_tt - } - show_as_tooltip = { - nomad_domicile_refund_effect = yes - nomad_convert_herds_to_gold_special_troops_effect = yes - gok_upgrade_realm_and_government_effect = yes - } - #Gain innovations if ya need em - if = { - limit = { - culture = { - NOT = { - has_cultural_era_or_later = culture_era_early_medieval - } - } - } - ordered_realm_county = { - order_by = development_level - limit = { - culture = { - has_cultural_era_or_later = culture_era_early_medieval - save_temporary_scope_as = realm_culture - NOT = { - this = root.culture - } - } - root.culture = { - can_get_innovation_from = scope:realm_culture +# #SHOW GOVERNMENT CHANGE EFFECTS +# custom_description_no_bullet = { +# text = gok_gov_switch_options_tt +# } +# show_as_tooltip = { +# nomad_domicile_refund_effect = yes +# nomad_convert_herds_to_gold_special_troops_effect = yes +# gok_upgrade_realm_and_government_effect = yes +# } +# #Gain innovations if ya need em +# if = { +# limit = { +# culture = { +# NOT = { +# has_cultural_era_or_later = culture_era_early_medieval +# } +# } +# } +# ordered_realm_county = { +# order_by = development_level +# limit = { +# culture = { +# has_cultural_era_or_later = culture_era_early_medieval +# save_temporary_scope_as = realm_culture +# NOT = { +# this = root.culture +# } +# } +# root.culture = { +# can_get_innovation_from = scope:realm_culture - } - } - culture = {save_scope_as = realm_culture_1 } - } - } - if = { - limit = { - culture = { - NOT = { - has_cultural_era_or_later = culture_era_high_medieval - } - } - } - ordered_realm_county = { - order_by = development_level - limit = { - trigger_if = { - limit = { - exists = scope:realm_culture_1 - } - NOT = { - culture = scope:realm_culture_1 - } - } +# } +# } +# culture = {save_scope_as = realm_culture_1 } +# } +# } +# if = { +# limit = { +# culture = { +# NOT = { +# has_cultural_era_or_later = culture_era_high_medieval +# } +# } +# } +# ordered_realm_county = { +# order_by = development_level +# limit = { +# trigger_if = { +# limit = { +# exists = scope:realm_culture_1 +# } +# NOT = { +# culture = scope:realm_culture_1 +# } +# } - culture = { - NOT = { - this = root.culture - } - has_cultural_era_or_later = culture_era_high_medieval - save_temporary_scope_as = realm_culture - } - root.culture = { - can_get_innovation_from = scope:realm_culture +# culture = { +# NOT = { +# this = root.culture +# } +# has_cultural_era_or_later = culture_era_high_medieval +# save_temporary_scope_as = realm_culture +# } +# root.culture = { +# can_get_innovation_from = scope:realm_culture - } - } - culture = { save_scope_as = realm_culture_2 } - } - } - if = { - limit = { - culture = { - NOT = { - has_cultural_era_or_later = culture_era_late_medieval - } - } - } - ordered_realm_county = { - order_by = development_level - limit = { - culture = { - trigger_if = { - limit = { - exists = scope:realm_culture_1 - } - NOT = { - this = scope:realm_culture_1 - } - } - trigger_if = { - limit = { - exists = scope:realm_culture_2 - } - NOT = { - this = scope:realm_culture_2 - } - } - NOT = { - this = root.culture - } - has_cultural_era_or_later = culture_era_late_medieval - save_temporary_scope_as = realm_culture - } - root.culture = { - can_get_innovation_from = scope:realm_culture +# } +# } +# culture = { save_scope_as = realm_culture_2 } +# } +# } +# if = { +# limit = { +# culture = { +# NOT = { +# has_cultural_era_or_later = culture_era_late_medieval +# } +# } +# } +# ordered_realm_county = { +# order_by = development_level +# limit = { +# culture = { +# trigger_if = { +# limit = { +# exists = scope:realm_culture_1 +# } +# NOT = { +# this = scope:realm_culture_1 +# } +# } +# trigger_if = { +# limit = { +# exists = scope:realm_culture_2 +# } +# NOT = { +# this = scope:realm_culture_2 +# } +# } +# NOT = { +# this = root.culture +# } +# has_cultural_era_or_later = culture_era_late_medieval +# save_temporary_scope_as = realm_culture +# } +# root.culture = { +# can_get_innovation_from = scope:realm_culture - } - } - culture = { save_scope_as = realm_culture_3 } - } - } - if = { - limit = { - exists = scope:realm_culture_1 - exists = scope:realm_culture_2 - exists = scope:realm_culture_3 - } - custom_tooltip = gok_3_innovation_gain - } - else_if = { - limit = { - exists = scope:realm_culture_1 - exists = scope:realm_culture_2 - } - custom_tooltip = gok_2_innovation_gain - } - else_if = { - limit = { - exists = scope:realm_culture_1 - } - custom_tooltip = gok_1_innovation_gain - } - #Fires event that lets you choose new government type - trigger_event = { - id = mpo_greatest_of_khans.0030 - days = 1 - } - } +# } +# } +# culture = { save_scope_as = realm_culture_3 } +# } +# } +# if = { +# limit = { +# exists = scope:realm_culture_1 +# exists = scope:realm_culture_2 +# exists = scope:realm_culture_3 +# } +# custom_tooltip = gok_3_innovation_gain +# } +# else_if = { +# limit = { +# exists = scope:realm_culture_1 +# exists = scope:realm_culture_2 +# } +# custom_tooltip = gok_2_innovation_gain +# } +# else_if = { +# limit = { +# exists = scope:realm_culture_1 +# } +# custom_tooltip = gok_1_innovation_gain +# } +# #Fires event that lets you choose new government type +# trigger_event = { +# id = mpo_greatest_of_khans.0030 +# days = 1 +# } +# } - ai_potential = { - any_owned_story = { - story_type = story_greatest_of_khans - } - sub_realm_size >= mpo_gok_world_conquest_target_counties - is_independent_ruler = yes - } +# ai_potential = { +# any_owned_story = { +# story_type = story_greatest_of_khans +# } +# sub_realm_size >= mpo_gok_world_conquest_target_counties +# is_independent_ruler = yes +# } - ai_will_do = { - base = 100 - } -} +# ai_will_do = { +# base = 100 +# } +#} ### Move into Conquered Lands ### settle_people_decision = { diff --git a/common/decisions/dlc_decisions/mpo/mpo_pax_mongolica_decision.txt b/common/decisions/dlc_decisions/mpo/mpo_pax_mongolica_decision.txt index ab266ee2a..9fd67e8a8 100644 --- a/common/decisions/dlc_decisions/mpo/mpo_pax_mongolica_decision.txt +++ b/common/decisions/dlc_decisions/mpo/mpo_pax_mongolica_decision.txt @@ -1,136 +1,137 @@ -##Pax Mongolica -### Peace of the Great Khan ### -mpo_pax_mongolica_decision = { - picture = { - reference = "gfx/interface/illustrations/event_scenes/mpo_city_steppe.dds" - } - decision_group_type = nomad_major - sort_order = 120 +# NEOW 2555: historical Pax Mongolica decision disabled. +###Pax Mongolica +#### Peace of the Great Khan ### +#mpo_pax_mongolica_decision = { +# picture = { +# reference = "gfx/interface/illustrations/event_scenes/mpo_city_steppe.dds" +# } +# decision_group_type = nomad_major +# sort_order = 120 - is_shown = { - government_has_flag = government_is_nomadic - any_character_situation = { - this = situation:the_great_steppe - } - NOT = { has_variable = pax_mongolica_var } - exists = situation:the_great_steppe - } +# is_shown = { +# government_has_flag = government_is_nomadic +# any_character_situation = { +# this = situation:the_great_steppe +# } +# NOT = { has_variable = pax_mongolica_var } +# exists = situation:the_great_steppe +# } - is_valid = { - dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_5 } - OR = { - has_realm_law = nomadic_authority_4 - has_realm_law = nomadic_authority_5 - } - } +# is_valid = { +# dynasty ?= { has_dynasty_perk = mpo_nomad_legacy_5 } +# OR = { +# has_realm_law = nomadic_authority_4 +# has_realm_law = nomadic_authority_5 +# } +# } - is_valid_showing_failures_only = { - is_available_adult = yes - } +# is_valid_showing_failures_only = { +# is_available_adult = yes +# } - cost = { - gold = { - value = 0 - if = { - limit = { - has_treasury = no - } - add = monumental_gold_value - } - } - treasury = { - value = 0 - if = { - limit = { - has_treasury = yes - } - add = monumental_gold_value - } - } - prestige = { - value = massive_prestige_value - } - } +# cost = { +# gold = { +# value = 0 +# if = { +# limit = { +# has_treasury = no +# } +# add = monumental_gold_value +# } +# } +# treasury = { +# value = 0 +# if = { +# limit = { +# has_treasury = yes +# } +# add = monumental_gold_value +# } +# } +# prestige = { +# value = massive_prestige_value +# } +# } - effect = { - set_variable = pax_mongolica_var - # Rewards given out in the event - show_as_tooltip = { - add_character_modifier = { - modifier = pax_mongolica_ruler_modifier # Forever - } - custom_tooltip = pax_mongolica_every_county_in_steppe_tt - every_realm_county = { - limit = { - is_landless_type_title = no - any_county_situation = { this = situation:the_great_steppe } - holder.dynasty = root.dynasty - } - random_county_province = { - limit = { has_holding = no } - set_holding_type = city_holding - } - } - if = { - limit = { - NOT = { - culture = { has_innovation = innovation_city_planning } - } - } - culture = { add_innovation = innovation_city_planning } - } - else_if = { - limit = { - NOT = { - culture = { has_innovation = innovation_development_01 } - } - } - culture = { add_innovation = innovation_development_01 } - } - else = { - culture = { add_random_innovation = culture_group_civic } - } - } - trigger_event = mpo_decisions_events.0400 - } +# effect = { +# set_variable = pax_mongolica_var +# # Rewards given out in the event +# show_as_tooltip = { +# add_character_modifier = { +# modifier = pax_mongolica_ruler_modifier # Forever +# } +# custom_tooltip = pax_mongolica_every_county_in_steppe_tt +# every_realm_county = { +# limit = { +# is_landless_type_title = no +# any_county_situation = { this = situation:the_great_steppe } +# holder.dynasty = root.dynasty +# } +# random_county_province = { +# limit = { has_holding = no } +# set_holding_type = city_holding +# } +# } +# if = { +# limit = { +# NOT = { +# culture = { has_innovation = innovation_city_planning } +# } +# } +# culture = { add_innovation = innovation_city_planning } +# } +# else_if = { +# limit = { +# NOT = { +# culture = { has_innovation = innovation_development_01 } +# } +# } +# culture = { add_innovation = innovation_development_01 } +# } +# else = { +# culture = { add_random_innovation = culture_group_civic } +# } +# } +# trigger_event = mpo_decisions_events.0400 +# } - ai_check_interval_by_tier = { - barony = 0 - county = 0 - duchy = 0 - kingdom = 0 - empire = 24 - hegemony = 24 - } +# ai_check_interval_by_tier = { +# barony = 0 +# county = 0 +# duchy = 0 +# kingdom = 0 +# empire = 24 +# hegemony = 24 +# } - ai_potential = { - prestige >= massive_prestige_value - } +# ai_potential = { +# prestige >= massive_prestige_value +# } - ai_will_do = { - base = 30 - modifier = { - add = -100 - NOT = { - prestige >= { - value = monumental_gold_value - multiply = 2 - } - } - } - modifier = { - add = -100 - NOT = { - prestige >= { - value = massive_prestige_value - multiply = 2 - } - } - } - modifier = { - add = 50 - highest_held_title_tier >= tier_empire - } - } -} +# ai_will_do = { +# base = 30 +# modifier = { +# add = -100 +# NOT = { +# prestige >= { +# value = monumental_gold_value +# multiply = 2 +# } +# } +# } +# modifier = { +# add = -100 +# NOT = { +# prestige >= { +# value = massive_prestige_value +# multiply = 2 +# } +# } +# } +# modifier = { +# add = 50 +# highest_held_title_tier >= tier_empire +# } +# } +#} diff --git a/common/decisions/dlc_decisions/pam/bulls_decisions.txt b/common/decisions/dlc_decisions/pam/bulls_decisions.txt index 39ae15843..ff783b078 100644 --- a/common/decisions/dlc_decisions/pam/bulls_decisions.txt +++ b/common/decisions/dlc_decisions/pam/bulls_decisions.txt @@ -606,6 +606,25 @@ pam_permit_tenet_bull_decision = { save_scope_as = selected_item } } + else_if = { # A tenet intrinsic to the faith is restored before anything else is sanctioned + limit = { + any_character_tenet = { + knowledge_filter = known + pam_tenet_can_be_permitted_trigger = yes + pam_tenet_ai_should_permit_intrinsic_trigger = { CHARACTER = scope:actor } + } + } + ordered_character_tenet = { + knowledge_filter = known + limit = { + pam_tenet_can_be_permitted_trigger = yes + pam_tenet_ai_should_permit_intrinsic_trigger = { CHARACTER = scope:actor } + } + order_by = pam_raw_tenet_popularity_value + position = 0 + save_scope_as = selected_item + } + } else_if = { # A tenet the faith adores gets sanctioned whether or not the Pope cares for it limit = { any_character_tenet = { @@ -649,6 +668,10 @@ pam_permit_tenet_bull_decision = { this = tenet:tenet_love_under_will } } + modifier = { + factor = anathema_to_faith_ai_weight_factor + tenet_is_anathema_to_faith_trigger = { FAITH = scope:actor.faith } + } } save_scope_as = selected_item } @@ -674,6 +697,10 @@ pam_permit_tenet_bull_decision = { this = tenet:tenet_love_under_will } } + modifier = { + factor = anathema_to_faith_ai_weight_factor + tenet_is_anathema_to_faith_trigger = { FAITH = scope:actor.faith } + } } save_scope_as = selected_item } @@ -710,6 +737,10 @@ pam_permit_tenet_bull_decision = { pam_tenet_can_be_permitted_no_actor_trigger = yes pam_tenet_is_overwhelmingly_popular_trigger = { CHARACTER = root } } + any_character_tenet = { + knowledge_filter = known + pam_tenet_ai_should_permit_intrinsic_trigger = { CHARACTER = root } + } } } @@ -876,6 +907,31 @@ pam_prohibit_tenet_bull_decision = { save_scope_as = selected_item } } + else_if = { # An anathema the faith permits is struck down next + limit = { + any_character_tenet = { + knowledge_filter = known + pam_tenet_can_be_prohibited_trigger = yes + scope:actor = { + NOT = { has_personal_tenet = scope:pam_tenet_candidate } + } + pam_tenet_ai_should_prohibit_anathema_trigger = { CHARACTER = scope:actor } + } + } + ordered_character_tenet = { + knowledge_filter = known + limit = { + pam_tenet_can_be_prohibited_trigger = yes + scope:actor = { + NOT = { has_personal_tenet = scope:pam_tenet_candidate } + } + pam_tenet_ai_should_prohibit_anathema_trigger = { CHARACTER = scope:actor } + } + order_by = pam_raw_tenet_popularity_value + position = 0 + save_scope_as = selected_item + } + } else = { random_undesired_tenet = { limit = { @@ -916,6 +972,14 @@ pam_prohibit_tenet_bull_decision = { } pam_tenet_ai_should_purge_trigger = { CHARACTER = root } } + any_character_tenet = { + knowledge_filter = known + pam_tenet_can_be_prohibited_no_actor_trigger = yes + root = { + NOT = { has_personal_tenet = scope:pam_tenet_candidate } + } + pam_tenet_ai_should_prohibit_anathema_trigger = { CHARACTER = root } + } any_undesired_tenet = { known_tenets = yes only_negative = yes diff --git a/common/decisions/dlc_decisions/pam/pam_antipope_decisions.txt b/common/decisions/dlc_decisions/pam/pam_antipope_decisions.txt index 18787f527..03cafa75f 100644 --- a/common/decisions/dlc_decisions/pam/pam_antipope_decisions.txt +++ b/common/decisions/dlc_decisions/pam/pam_antipope_decisions.txt @@ -102,6 +102,10 @@ declare_antipope_decision = { limit = { pam_antipope_declaration_discounted_trigger = yes } multiply = 0.67 } + if = { + limit = { gg_excommunicated_ghibelline_leader_in_dictatus_papae_trigger = yes } + multiply = 0.5 + } } } treasury = { @@ -119,6 +123,10 @@ declare_antipope_decision = { limit = { pam_antipope_declaration_discounted_trigger = yes } multiply = 0.67 } + if = { + limit = { gg_excommunicated_ghibelline_leader_in_dictatus_papae_trigger = yes } + multiply = 0.5 + } } } piety = { @@ -131,6 +139,10 @@ declare_antipope_decision = { limit = { pam_antipope_declaration_discounted_trigger = yes } multiply = 0.67 } + if = { + limit = { gg_excommunicated_ghibelline_leader_in_dictatus_papae_trigger = yes } + multiply = 0 + } if = { limit = { has_variable = antipope_squabble_unlock @@ -226,7 +238,10 @@ declare_antipope_decision = { ai_potential = { is_adult = yes - ai_zeal >= 0 + OR = { + ai_zeal >= 0 + gg_excommunicated_ghibelline_leader_in_dictatus_papae_trigger = yes + } any_vassal_or_below = { pam_valid_antipope_clergy_vassal_trigger = { LIEGE = root } } @@ -260,23 +275,22 @@ declare_antipope_decision = { step = 5 max = 25 } + modifier = { + add = 25 + gg_excommunicated_ghibelline_leader_in_dictatus_papae_trigger = yes + } modifier = { factor = 2 - OR = { - has_relation_rival = faith.religious_head - has_relation_nemesis = faith.religious_head - } + has_relation_rival = faith.religious_head } modifier = { # AI shouldn't usually do this if they're main rite factor = 0.15 rite = faith.main_rite + gg_excommunicated_ghibelline_leader_in_dictatus_papae_trigger = no } modifier = { factor = 0 - OR = { - has_relation_friend = faith.religious_head - has_relation_best_friend = faith.religious_head - } + has_relation_friend = faith.religious_head } } } @@ -558,17 +572,11 @@ declare_yourself_antipope_decision = { } modifier = { factor = 2 - OR = { - has_relation_rival = faith.religious_head - has_relation_nemesis = faith.religious_head - } + has_relation_rival = faith.religious_head } modifier = { factor = 0 - OR = { - has_relation_friend = faith.religious_head - has_relation_best_friend = faith.religious_head - } + has_relation_friend = faith.religious_head } } } diff --git a/common/decisions/dlc_decisions/pam/pam_decisions.txt b/common/decisions/dlc_decisions/pam/pam_decisions.txt index 76e0249c9..fbc21e85f 100644 --- a/common/decisions/dlc_decisions/pam/pam_decisions.txt +++ b/common/decisions/dlc_decisions/pam/pam_decisions.txt @@ -55,6 +55,8 @@ pam_decision_confession = { sort_order = 110 is_shown = { + is_landless_adventurer = no + is_landless_merchant = no has_spiritual_fulfillment_type = christian_fulfillment root.rite ?= { has_at_least_tenet_status = { @@ -135,17 +137,18 @@ pam_decision_act_of_devotion = { ai_check_interval_by_tier = { barony = 0 - county = 60 - duchy = 60 - kingdom = 48 + county = 120 + duchy = 120 + kingdom = 60 empire = 48 - hegemony = 24 + hegemony = 12 } sort_order = 80 is_shown = { has_spiritual_fulfillment_type = christian_fulfillment + has_fulfillment_parameter = sp_act_of_devotion_decision has_pam_dlc_trigger = yes is_landless_adventurer = no } @@ -228,10 +231,10 @@ pam_mentor_sp_decision = { ai_check_interval_by_tier = { barony = 0 - county = 24 - duchy = 24 - kingdom = 12 - empire = 12 + county = 120 + duchy = 120 + kingdom = 60 + empire = 24 hegemony = 12 } @@ -239,6 +242,7 @@ pam_mentor_sp_decision = { is_shown = { has_spiritual_fulfillment_type = christian_fulfillment + has_fulfillment_parameter = sp_mentor_in_sp has_pam_dlc_trigger = yes } @@ -362,8 +366,8 @@ pam_establish_theocratic_dynasty_decision = { ai_check_interval_by_tier = { barony = 0 county = 0 - duchy = 48 - kingdom = 24 + duchy = 120 + kingdom = 60 empire = 12 hegemony = 12 } @@ -429,6 +433,7 @@ pam_convert_to_theocracy_decision = { reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds" } decision_group_type = realm + sort_order = 40 desc = pam_convert_to_theocracy_decision_desc selection_tooltip = pam_convert_to_theocracy_decision_tooltip @@ -635,6 +640,7 @@ pam_convert_theocracy_to_feudal_decision = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } decision_group_type = realm + sort_order = 40 desc = pam_convert_theocracy_to_feudal_decision_desc selection_tooltip = pam_convert_theocracy_to_feudal_decision_tooltip @@ -683,7 +689,7 @@ pam_convert_theocracy_to_feudal_decision = { culture = { has_cultural_pillar = ethos_stoic } culture = { has_cultural_tradition = tradition_legalistic } has_realm_law = church_authority_3 - capital_county = { development_level > medium_development_level } + capital_county = { prosperity_level > medium_prosperity_level } dynasty ?= { has_dynasty_perk = law_legacy_5 } dynasty ?= { has_dynasty_perk = erudition_legacy_5 } NOT = { has_trait = zealous } @@ -792,9 +798,7 @@ pam_kowtow_to_pope_decision = { is_shown = { exists = top_participant_group:the_christian_church - situation:the_christian_church ?= { - situation_current_phase = investiture_crisis - } + situation:the_christian_church ?= { situation_current_phase = investiture_crisis } government_is_religious_trigger = no is_christian_trigger = yes has_pam_dlc_trigger = yes @@ -836,6 +840,20 @@ pam_kowtow_to_pope_decision = { modifier = grateful_opinion opinion = 20 } + if = { + limit = { + is_ghibelline_leader_trigger = yes + faith = { religious_head_title ?= title:k_papal_state } + NOT = { has_trait = excommunicated } + pam_is_antipope_sponsor_trigger = no + } + gg_reconciliation_catalyst_effect = { + ACTOR = root + RECIPIENT = faith.religious_head + CATALYST = catalyst_gg_submission_to_pope + ONCE_A_YEAR = no + } + } } send_interface_toast = { type = event_toast_effect_good @@ -848,6 +866,8 @@ pam_kowtow_to_pope_decision = { } ai_potential = { + situation:the_christian_church ?= { situation_current_phase = investiture_crisis } + religion ?= religion:christianity_religion has_pam_dlc_trigger = yes government_is_religious_trigger = no } @@ -883,6 +903,7 @@ pam_determine_patron_saint_decision = { # Christian specific is_christian_trigger = yes NOT = { has_variable = pam_chose_patron_saint_var } + has_personal_tenet_flag = tenet_dulia_can_select_patron_saint has_pam_dlc_trigger = yes } @@ -998,8 +1019,8 @@ pam_determine_patron_saint_decision = { ai_check_interval_by_tier = { barony = 0 - county = 96 - duchy = 96 + county = 120 + duchy = 120 kingdom = 96 empire = 96 hegemony = 96 @@ -1216,15 +1237,15 @@ create_hof_decision = { } ai_potential = { + faith ?= { + NOT = { exists = religious_head } + OR = { has_doctrine_parameter = spiritual_head_of_faith has_doctrine_parameter = temporal_head_of_faith } + } is_adult = yes # Defer to a same-faith liege; they should be the one establishing the HoF OR = { top_liege = this - NOT = { - any_liege_or_above = { - faith = root.faith - } - } + NOT = { any_liege_or_above = { faith = root.faith } } } } @@ -1233,6 +1254,337 @@ create_hof_decision = { } } +#TODO_PAM: Test debug decision, remove if no longer needed as demo +start_test_select_rite = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds" + } + + decision_group_type = debug + + ai_check_interval_by_tier = { + barony = 0 + county = 0 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + + sort_order = 110 + + is_shown = { + always = no # Disabled from GDP onwards + } + + is_valid = { + scope:selected_item ?= { exists = this } + } + + is_valid_showing_failures_only = { + always = yes + } + + cooldown = { years = 0 } + + effect = { + scope:actor = { + set_character_rite = scope:selected_item + } + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 1000 + } + + widget = { + gui = "decision_view_widget_select_rite" + controller = select_scope_object + show_from_start = no + + setup_items = { + scope:actor = { + every_available_rite = { + limit = { + scope:actor.rite != this + } + add_to_list = item_list + } + } + } + + default_item = { + scope:actor = { + rite = { + save_scope_as = selected_item + } + } + } + + ai_item_will_do = { + value = 100 + if = { + limit = { + "divergence(faith.main_rite)" >= minor_rite_divergence_value + } + add = 50 + } + } + } +} + +#TODO_PAM: Test debug decision, remove if no longer needed as demo +start_test_select_tenet = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds" + } + + decision_group_type = debug + + ai_check_interval_by_tier = { + barony = 0 + county = 0 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + + sort_order = 110 + + is_shown = { + always = no # Disabled from GDP onwards + } + + is_valid = { + always = yes + } + + is_valid_showing_failures_only = { + exists = scope:selected_item + } + + cooldown = { years = 0 } + + effect = { + scope:actor = { + every_personal_tenet = { + scope:actor = { + remove_personal_tenet = prev + } + } + set_personal_tenet = scope:selected_item + pam_remove_forbidden_personal_tenet_secret_if_invalid_effect = yes + } + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 1000 + } + + widget = { + gui = "decision_view_widget_select_tenet" + controller = select_scope_object + show_from_start = yes + decision_to_second_step_button = "SELECT" + + setup_items = { + scope:actor = { + every_character_tenet = { + knowledge_filter = known + add_to_list = item_list + } + } + } + + default_item = { + scope:actor = { + random_personal_tenet = { + save_scope_as = selected_item + } + } + } + + is_item_valid = { + this != tenet:tenet_confession + } + + ai_select_item = { + scope:actor = { + random_personal_tenet = { + save_scope_as = selected_item + } + } + } + } +} +#TODO_PAM: Test debug decision, remove if no longer needed as demo +start_test_select_character = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds" + } + + decision_group_type = debug + + is_shown = { + debug_only = yes + } + + ai_check_interval_by_tier = { + barony = 0 + county = 0 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + + sort_order = 110 + + is_valid = { + always = yes + } + + is_valid_showing_failures_only = { + exists = scope:selected_item + } + + cooldown = { years = 0 } + + effect = { + scope:selected_item = { + add_trait = saint + } + } + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 1000 + } + + widget = { + gui = "decision_view_widget_select_character" + controller = select_scope_object + show_from_start = yes + decision_to_second_step_button = "SELECT" + + setup_items = { + scope:actor = { + every_ancestor = { + even_if_dead = yes + limit = { + is_alive = no + NOT = { has_trait = saint } + } + add_to_list = item_list + } + } + } + + default_item = { + scope:actor = { + random_ancestor = { + even_if_dead = yes + limit = { + is_alive = no + NOT = { has_trait = saint } + } + save_scope_as = selected_item + } + } + } + + is_item_valid = { + is_alive = no + } + + ai_select_item = { + scope:actor = { + random_ancestor = { + even_if_dead = yes + limit = { + is_alive = no + NOT = { has_trait = saint } + } + save_scope_as = selected_item + } + } + } + } +} + +#TODO_PAM: Test debug decision, remove if no longer needed as demo +start_test_select_kingdom = { + picture = { + reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds" + } + + decision_group_type = debug + + ai_check_interval_by_tier = { + barony = 0 + county = 0 + duchy = 0 + kingdom = 0 + empire = 0 + hegemony = 0 + } + + sort_order = 110 + + is_shown = { + always = no # Disabled from GDP onwards + } + + is_valid = { + always = yes + } + + is_valid_showing_failures_only = { + always = yes + } + + cooldown = { years = 0 } + + effect = {} + + ai_potential = { + always = yes + } + + ai_will_do = { + base = 1000 + } + + widget = { + controller = select_kingdom_title + title_valid = { + # Title must have real land under it + exists = capital_vassal.capital_vassal + # At least 5 de-jure counties must be hostile to our faith + any_in_de_jure_hierarchy = { + continue = { tier > tier_county } + tier = tier_county + count >= 5 + scope:ruler.faith.main_rite = { + is_hostile_enough_for_holy_war_trigger = { RITE = prev.holder.top_liege.rite } + } + } + } + } +} + # Levy the Tithes pam_levy_the_tithes_decision = { picture = { @@ -1260,9 +1612,14 @@ pam_levy_the_tithes_decision = { } is_shown = { + is_landless_adventurer = no + is_landless_merchant = no any_character_situation = { # You are part of the Christian Situation situation_type = the_christian_church } + top_participant_group:the_christian_church ?= { + has_participant_group_parameter = the_christian_church_levy_the_tithes_decision + } has_pam_dlc_trigger = yes is_clergy = no is_ruler = yes @@ -1339,15 +1696,16 @@ pam_send_legatine_mission_decision = { barony = 0 county = 0 duchy = 0 - kingdom = 24 - empire = 12 + kingdom = 60 + empire = 24 hegemony = 12 } is_shown = { is_clergy = yes - any_sub_realm_county = { - always = yes + is_landed = yes + top_participant_group:the_christian_church ?= { + has_participant_group_parameter = the_christian_church_legatine_mission } has_pam_dlc_trigger = yes is_ruler = yes @@ -1420,13 +1778,13 @@ pam_send_legatine_mission_decision = { } if = { limit = { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level } add = 10 } if = { limit = { - county_control <= 50 + county_control < county_control_baseline } add = 50 } @@ -3109,9 +3467,9 @@ pam_promulgate_word_of_pious_deeds_decision = { ai_check_interval_by_tier = { barony = 0 - county = 24 - duchy = 24 - kingdom = 12 + county = 120 + duchy = 120 + kingdom = 24 empire = 12 hegemony = 12 } @@ -3119,6 +3477,7 @@ pam_promulgate_word_of_pious_deeds_decision = { sort_order = 110 is_shown = { + domicile ?= { has_domicile_parameter = unlocks_pam_propagate_word_of_my_piety_decision } pam_can_hold_cardinalate_trigger = yes is_clergy = yes has_spiritual_fulfillment_type = christian_fulfillment @@ -3425,7 +3784,7 @@ pam_declare_rite_heresy_decision = { selection_tooltip = pam_declare_rite_heresy_decision_tooltip confirm_text = pam_declare_rite_heresy_decision_confirm - sort_order = 108 + sort_order = 50 ai_check_interval_by_tier = { barony = 0 @@ -3640,7 +3999,7 @@ pam_permit_tenet_decision = { selection_tooltip = pam_permit_tenet_decision_tooltip confirm_text = pam_permit_tenet_decision_confirm - sort_order = 110 + sort_order = 50 ai_check_interval_by_tier = { barony = 0 @@ -3743,7 +4102,26 @@ pam_permit_tenet_decision = { ai_select_item = { scope:actor = { - if = { # A tenet the faith adores gets sanctioned whether or not the Head of Faith cares for it + if = { # A tenet intrinsic to the faith is restored before anything else is sanctioned + limit = { + any_character_tenet = { + knowledge_filter = known + pam_tenet_can_be_permitted_trigger = yes + pam_tenet_ai_should_permit_intrinsic_trigger = { CHARACTER = scope:actor } + } + } + ordered_character_tenet = { + knowledge_filter = known + limit = { + pam_tenet_can_be_permitted_trigger = yes + pam_tenet_ai_should_permit_intrinsic_trigger = { CHARACTER = scope:actor } + } + order_by = pam_raw_tenet_popularity_value + position = 0 + save_scope_as = selected_item + } + } + else_if = { # A tenet the faith adores gets sanctioned whether or not the Head of Faith cares for it limit = { any_character_tenet = { knowledge_filter = known @@ -3776,6 +4154,10 @@ pam_permit_tenet_decision = { modifier = { add = pam_tenet_popularity_impact_value } + modifier = { + factor = anathema_to_faith_ai_weight_factor + tenet_is_anathema_to_faith_trigger = { FAITH = scope:actor.faith } + } } save_scope_as = selected_item } @@ -3791,6 +4173,10 @@ pam_permit_tenet_decision = { religion = religion:eastern_orthodox_religion } OR = { + any_character_tenet = { + knowledge_filter = known + pam_tenet_ai_should_permit_intrinsic_trigger = { CHARACTER = root } + } any_desired_tenet = { only_positive = yes threshold = 1 @@ -3971,6 +4357,25 @@ pam_prohibit_tenet_decision = { save_scope_as = selected_item } } + else_if = { # An anathema the faith permits is struck down next + limit = { + any_character_tenet = { + knowledge_filter = known + pam_tenet_can_be_prohibited_trigger = yes + pam_tenet_ai_should_prohibit_anathema_trigger = { CHARACTER = scope:actor } + } + } + ordered_character_tenet = { + knowledge_filter = known + limit = { + pam_tenet_can_be_prohibited_trigger = yes + pam_tenet_ai_should_prohibit_anathema_trigger = { CHARACTER = scope:actor } + } + order_by = pam_raw_tenet_popularity_value + position = 0 + save_scope_as = selected_item + } + } else = { random_undesired_tenet = { limit = { @@ -4006,6 +4411,11 @@ pam_prohibit_tenet_decision = { pam_tenet_can_be_prohibited_no_actor_trigger = yes pam_tenet_ai_should_purge_trigger = { CHARACTER = root } } + any_character_tenet = { + knowledge_filter = known + pam_tenet_can_be_prohibited_no_actor_trigger = yes + pam_tenet_ai_should_prohibit_anathema_trigger = { CHARACTER = root } + } any_undesired_tenet = { known_tenets = yes only_negative = yes @@ -4827,6 +5237,8 @@ pam_persecute_tenet_decision = { } is_shown = { + is_landless_adventurer = no + is_landless_merchant = no has_tenet_popularity_trigger = yes is_playable_character = yes has_pam_dlc_trigger = yes @@ -5079,6 +5491,7 @@ consecrate_kingdom_decision = { } is_landed_or_landless_administrative = yes is_confederation_member = no + NOT = { government_has_flag = government_is_republic } OR = { exists = rite.head_of_rite exists = faith.religious_head @@ -6072,7 +6485,7 @@ pam_invite_syncretic_exiles_decision = { limit = { pam_personal_syncretism_exile_rite_trigger = yes } - order_by = var:converted_development + order_by = var:converted_prosperity save_scope_as = target_rite } } @@ -6306,7 +6719,7 @@ pam_personal_sacrifice_of_wealth_decision = { ai_item_will_do = { value = 10 if = { - limit = { development_level <= bad_development_level } + limit = { prosperity_level <= bad_prosperity_level } add = 50 } if = { @@ -6350,7 +6763,7 @@ pam_personal_sacrifice_of_wealth_decision = { } modifier = { factor = 0 - NOT = { any_sub_realm_county = { development_level <= bad_development_level } } + NOT = { any_sub_realm_county = { prosperity_level <= bad_prosperity_level } } } } } @@ -6420,8 +6833,10 @@ pam_develop_clerical_court_decision = { } ai_potential = { + is_available_adult = yes is_at_war = no pam_government_is_religious_playable_trigger = yes + short_term_treasury_or_gold >= minor_treasury_or_gold_value OR = { any_courtier = { pam_clerical_court_ordain_candidate_trigger = yes } any_courtier = { pam_clerical_court_pupil_trigger = yes } diff --git a/common/decisions/dlc_decisions/pam/pam_saint_decisions.txt b/common/decisions/dlc_decisions/pam/pam_saint_decisions.txt index f13b75b26..41731a210 100644 --- a/common/decisions/dlc_decisions/pam/pam_saint_decisions.txt +++ b/common/decisions/dlc_decisions/pam/pam_saint_decisions.txt @@ -635,7 +635,8 @@ pam_extract_relic_decision = { } ai_potential = { - always = yes + # Must stay at or below the lowest possible pam_extract_relic_piety_cost, or the AI cannot afford the decision + piety >= 1250 } ai_will_do = { diff --git a/common/decisions/dlc_decisions/tgp/tgp_dynastic_cycle_decisions.txt b/common/decisions/dlc_decisions/tgp/tgp_dynastic_cycle_decisions.txt index 616d61006..c33a9c96f 100644 --- a/common/decisions/dlc_decisions/tgp/tgp_dynastic_cycle_decisions.txt +++ b/common/decisions/dlc_decisions/tgp/tgp_dynastic_cycle_decisions.txt @@ -2095,11 +2095,16 @@ ai_movement_petition_change_laws_decision = { } } # Renounce Family Title -### Retire from Heading the [ROOT.Char.GetHouse.GetNameNoTooltip] House ### +### Retire from Heading House [ROOT.Char.GetHouse.GetNameNoTooltip] ### renounce_noble_family_title_decision = { picture = { + trigger = { tgp_retires_to_eastern_estate_trigger = yes } reference = "gfx/interface/illustrations/event_scenes/tgp_asia_estate.dds" } + picture = { + reference = "gfx/interface/illustrations/event_scenes/ep3_medi_estate.dds" + } + sort_order = 85 desc = { @@ -2121,8 +2126,11 @@ renounce_noble_family_title_decision = { is_shown = { any_held_title = { is_noble_family_title = yes } - NOT = { religion = religion:buddhism_religion } # Uses tgp_japan_become_a_monk_decision - NOT = { top_liege = root } #This is not a general abdication decision + NOR = { + religion = religion:buddhism_religion # Uses tgp_japan_become_a_monk_decision + top_liege = root # This is not a general abdication decision + government_has_flag = government_is_republic + } is_house_head = yes is_playable_character = yes has_tgp_dlc_trigger = yes @@ -2140,15 +2148,22 @@ renounce_noble_family_title_decision = { current_heir ?= { is_available_ai_adult = yes } } } + trigger_if = { + limit = { + OR = { + government_has_flag = government_is_republic + government_has_flag = government_is_administrative + } + } + is_landed = no + } } is_valid_showing_failures_only = { is_available_adult = yes is_at_war_with_liege = no trigger_if = { - limit = { - has_realm_law_flag = celestial_retirement_law - } + limit = { has_realm_law_flag = celestial_retirement_law } tgp_is_above_retirement_age_trigger = { REALM_OWNER = root } } } @@ -2162,7 +2177,13 @@ renounce_noble_family_title_decision = { } } show_as_tooltip = { - add_character_modifier = { modifier = ep3_renounced_estate } + if = { + limit = { tgp_retires_to_eastern_estate_trigger = yes } + add_character_modifier = { modifier = ep3_renounced_estate } + } + else = { + add_character_modifier = { modifier = tgp_western_renounced_estate } + } custom_tooltip = renounce_noble_family_title_decision_tt if = { limit = { exists = scope:new_player } diff --git a/common/decisions/dlc_decisions/tgp/tgp_east_asia_decisions.txt b/common/decisions/dlc_decisions/tgp/tgp_east_asia_decisions.txt index cb7070c32..2f61c6bb1 100644 --- a/common/decisions/dlc_decisions/tgp/tgp_east_asia_decisions.txt +++ b/common/decisions/dlc_decisions/tgp/tgp_east_asia_decisions.txt @@ -58,7 +58,8 @@ convert_to_mandala_government_decision = { picture = { reference = "gfx/interface/illustrations/decisions/tgp_decision_mandala.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = convert_to_mandala_government_decision_desc ai_check_interval_by_tier = { @@ -248,7 +249,8 @@ assimilate_to_mandala_decision = { picture = { reference = "gfx/interface/illustrations/decisions/tgp_decision_mandala.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = { first_valid = { triggered_desc = { @@ -273,6 +275,7 @@ assimilate_to_mandala_decision = { } is_shown = { + is_landed = yes highest_held_title_tier > tier_barony overlord ?= { government_has_flag = government_is_mandala } NAND = { @@ -436,6 +439,7 @@ assimilate_to_mandala_decision = { this != top_overlord overlord = { government_has_flag = government_is_mandala } primary_title.tier > tier_barony + NOT = { government_has_flag = government_is_republic } #Keep the tributaries Wanua trigger_if = { limit = { @@ -524,7 +528,8 @@ mandala_adopt_clan_government_decision = { picture = { reference = "gfx/interface/illustrations/decisions/decision_realm.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 desc = mandala_adopt_clan_government_decision_desc ai_check_interval_by_tier = { @@ -668,7 +673,7 @@ seize_mandala_capital_decision = { any_sub_realm_barony = { title_province ?= { has_building_with_flag = mandala_capital_building - has_ruined_great_building = no + has_ruined_great_district = no } kingdom ?= root.capital_county.kingdom } @@ -689,7 +694,7 @@ seize_mandala_capital_decision = { kingdom = root.capital_county.kingdom title_province = { has_building_with_flag = mandala_capital_building - has_ruined_great_building = no + has_ruined_great_district = no } } } @@ -698,7 +703,7 @@ seize_mandala_capital_decision = { kingdom = root.capital_county.kingdom title_province = { has_building_with_flag = mandala_capital_building - has_ruined_great_building = no + has_ruined_great_district = no } } holder = { save_scope_as = previous_holder } diff --git a/common/decisions/dlc_decisions/tgp/tgp_silk_road_decisions.txt b/common/decisions/dlc_decisions/tgp/tgp_silk_road_decisions.txt index b55d0cf59..919c66352 100644 --- a/common/decisions/dlc_decisions/tgp/tgp_silk_road_decisions.txt +++ b/common/decisions/dlc_decisions/tgp/tgp_silk_road_decisions.txt @@ -21,9 +21,15 @@ visit_silk_road_market_decision = { is_shown = { exists = situation:silk_road_situation OR = { - any_character_situation = { situation_type = silk_road_situation } is_ai = no + any_character_situation = { situation_type = silk_road_situation } } + OR = { + has_tgp_dlc_trigger = yes # All Under Heaven + has_gdp_dlc_trigger = yes # Silk & Silver + } + is_playable_character = yes + #There is no point in showing this decision if you cannot benefit from going at all: OR = { silk_road_valid_market_to_visit_trigger = { SUB_REGION = china } @@ -33,14 +39,10 @@ visit_silk_road_market_decision = { silk_road_valid_market_to_visit_trigger = { SUB_REGION = transcaspia } silk_road_valid_market_to_visit_trigger = { SUB_REGION = occident } } - is_playable_character = yes - - has_tgp_dlc_trigger = yes } is_valid = { is_adult = yes - gold >= major_gold_value } is_valid_showing_failures_only = { @@ -49,6 +51,10 @@ visit_silk_road_market_decision = { is_incapable = no } + cost = { + gold = major_gold_value + } + widget = { gui = "decision_view_widget_option_list_generic" controller = decision_option_list_controller @@ -62,8 +68,8 @@ visit_silk_road_market_decision = { is_valid = { custom_tooltip = { text = no_building_at_silk_road_market_desc - title:c_jingzhao = { # Chang'an - any_county_province = { has_building_with_flag = silk_road_node } + title:b_zhouzhi.title_province = { # Chang'an + has_building_with_flag = silk_road_node } } custom_tooltip = { @@ -116,8 +122,8 @@ visit_silk_road_market_decision = { is_valid = { custom_tooltip = { text = no_building_at_silk_road_market_desc - title:c_lhasa = { - any_county_province = { has_building_with_flag = silk_road_node } + title:b_potala.title_province = { # Lhasa + has_building_with_flag = silk_road_node } } custom_tooltip = { @@ -170,8 +176,8 @@ visit_silk_road_market_decision = { is_valid = { custom_tooltip = { text = no_building_at_silk_road_market_desc - title:c_lahur = { - any_county_province = { has_building_with_flag = silk_road_node } + title:b_lahur.title_province = { # Lahur + has_building_with_flag = silk_road_node } } custom_tooltip = { @@ -224,8 +230,8 @@ visit_silk_road_market_decision = { is_valid = { custom_tooltip = { text = no_building_at_silk_road_market_desc - title:c_shazhou = { # Dunhuang - any_county_province = { has_building_with_flag = silk_road_node } + title:b_dunhuang_2.title_province = { # Dunhuang + has_building_with_flag = silk_road_node } } custom_tooltip = { @@ -272,14 +278,14 @@ visit_silk_road_market_decision = { } } } - item = { # Khiva - value = c_khiva + item = { # Gurganj + value = c_gurganj is_shown = { always = yes } is_valid = { custom_tooltip = { text = no_building_at_silk_road_market_desc - title:c_khiva = { - any_county_province = { has_building_with_flag = silk_road_node } + title:b_gurganj.title_province = { # Gurganj + has_building_with_flag = silk_road_node } } custom_tooltip = { @@ -287,7 +293,7 @@ visit_silk_road_market_decision = { silk_road_valid_market_to_visit_trigger = { SUB_REGION = transcaspia } } } - localization = visit_silk_road_market_decision_khiva + localization = visit_silk_road_market_decision_gurganj icon = "gfx/interface/icons/travel/icon_travel_silk_road_marketplace.dds" ai_chance = { value = 1 @@ -295,7 +301,7 @@ visit_silk_road_market_decision = { limit = { root.location = { squared_distance = { - target = title:c_khiva.title_province + target = title:c_gurganj.title_province value <= squared_distance_small } } @@ -306,7 +312,7 @@ visit_silk_road_market_decision = { limit = { root.location = { squared_distance = { - target = title:c_khiva.title_province + target = title:c_gurganj.title_province value <= squared_distance_large } } @@ -317,7 +323,7 @@ visit_silk_road_market_decision = { limit = { root.location = { squared_distance = { - target = title:c_khiva.title_province + target = title:c_gurganj.title_province value > squared_distance_huge } } @@ -326,14 +332,14 @@ visit_silk_road_market_decision = { } } } - item = { # Dvin - value = c_dvin + item = { # Tabriz + value = c_tabriz is_shown = { always = yes } is_valid = { custom_tooltip = { text = no_building_at_silk_road_market_desc - title:c_dvin = { - any_county_province = { has_building_with_flag = silk_road_node } + title:b_tabriz.title_province = { # Tabriz + has_building_with_flag = silk_road_node } } custom_tooltip = { @@ -341,7 +347,7 @@ visit_silk_road_market_decision = { silk_road_valid_market_to_visit_trigger = { SUB_REGION = occident } } } - localization = visit_silk_road_market_decision_dvin + localization = visit_silk_road_market_decision_tabriz icon = "gfx/interface/icons/travel/icon_travel_silk_road_marketplace.dds" ai_chance = { value = 1 @@ -349,7 +355,7 @@ visit_silk_road_market_decision = { limit = { root.location = { squared_distance = { - target = title:c_dvin.title_province + target = title:c_tabriz.title_province value <= squared_distance_small } } @@ -360,7 +366,7 @@ visit_silk_road_market_decision = { limit = { root.location = { squared_distance = { - target = title:c_dvin.title_province + target = title:c_tabriz.title_province value <= squared_distance_large } } @@ -371,7 +377,7 @@ visit_silk_road_market_decision = { limit = { root.location = { squared_distance = { - target = title:c_dvin.title_province + target = title:c_tabriz.title_province value > squared_distance_huge } } @@ -383,11 +389,10 @@ visit_silk_road_market_decision = { } effect = { - remove_short_term_gold = major_gold_value switch = { trigger = yes - scope:c_dvin = { # Dvin - title:c_dvin = { tgp_silk_road_decision_scope_effect = yes } + scope:c_tabriz = { # Tabriz + title:c_tabriz = { tgp_silk_road_decision_scope_effect = yes } } scope:c_jingzhao = { # Chang'an title:c_jingzhao = { tgp_silk_road_decision_scope_effect = yes } @@ -401,8 +406,8 @@ visit_silk_road_market_decision = { scope:c_lhasa = { # Lhasa title:c_lhasa = { tgp_silk_road_decision_scope_effect = yes } } - scope:c_khiva = { # Khiva - title:c_khiva = { tgp_silk_road_decision_scope_effect = yes } + scope:c_gurganj = { # Gurganj + title:c_gurganj = { tgp_silk_road_decision_scope_effect = yes } } } if = { @@ -419,16 +424,22 @@ visit_silk_road_market_decision = { on_arrival_event = tgp_silk_road_events.0010 travel_with_domicile = no return_trip = yes - on_travel_planner_cancel_on_action = silk_road_market_visit_travel_planner_cancel_on_action # here comes the refund! + on_travel_planner_cancel_event = tgp_silk_road_events.0011 players_use_planner = yes #on_arrival_destinations = last } } if = { - limit = { exists = scope:innovation_temp } - custom_tooltip = potential_innovation_at_silk_road_market_desc + limit = { government_has_flag = government_is_merchant } + custom_tooltip = visit_silk_road_market_merchant_rewards_tt + } + else = { + if = { + limit = { exists = scope:innovation_temp } + custom_tooltip = potential_innovation_at_silk_road_market_desc + } + custom_tooltip = travel_silk_road_market_innovation_warning_tt } - custom_tooltip = travel_silk_road_market_innovation_warning_tt if = { limit = { root.location = { diff --git a/common/decisions/dlc_decisions/tgp/tgp_steppe_decisions.txt b/common/decisions/dlc_decisions/tgp/tgp_steppe_decisions.txt index 2db8cd9e8..89d34117b 100644 --- a/common/decisions/dlc_decisions/tgp/tgp_steppe_decisions.txt +++ b/common/decisions/dlc_decisions/tgp/tgp_steppe_decisions.txt @@ -382,7 +382,8 @@ convert_to_meritocratic_decision = { picture = { reference = "gfx/interface/illustrations/event_story/tgp_dynastic_cycle_stability.dds" } - decision_group_type = major + decision_group_type = realm + sort_order = 40 ai_check_interval_by_tier = { barony = 0 diff --git a/common/decisions/dlc_decisions/tgp/tgp_tribute_mission_decisions.txt b/common/decisions/dlc_decisions/tgp/tgp_tribute_mission_decisions.txt index 87ef67bf6..148d953aa 100644 --- a/common/decisions/dlc_decisions/tgp/tgp_tribute_mission_decisions.txt +++ b/common/decisions/dlc_decisions/tgp/tgp_tribute_mission_decisions.txt @@ -5,6 +5,7 @@ tribute_mission_decision_mandala = { reference = "gfx/interface/illustrations/decisions/tgp_projects_mandala_capital.dds" } decision_group_type = realm + sort_order = 10 should_create_alert = { always = yes } @@ -13,6 +14,7 @@ tribute_mission_decision_mandala = { cooldown = { years = 5 } is_shown = { + NOT = { government_has_flag = government_is_merchant } is_tributary = yes suzerain ?= { government_has_flag = government_is_mandala } } @@ -126,6 +128,8 @@ tribute_mission_decision_mandala = { } ai_potential = { + is_tributary = yes + suzerain ?= { government_has_flag = government_is_mandala } tribute_mission_decision_ai_potential_trigger = { TARGET = suzerain } } @@ -140,6 +144,7 @@ tribute_mission_decision_china = { reference = "gfx/interface/illustrations/decisions/tgp_kowtow.dds" } decision_group_type = realm + sort_order = 10 should_create_alert = { always = yes } @@ -148,8 +153,9 @@ tribute_mission_decision_china = { cooldown = { years = 5 } is_shown = { - is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_china } + NOT = { government_has_flag = government_is_merchant } title:h_china ?= { is_title_created = yes } + is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_china } } is_valid_showing_failures_only = { @@ -253,7 +259,8 @@ tribute_mission_decision_china = { } ai_potential = { - exists = title:h_china.holder + NOT = { government_has_flag = government_is_merchant } + is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_china } tribute_mission_decision_ai_potential_trigger = { TARGET = title:h_china.holder } } @@ -274,6 +281,7 @@ tribute_mission_decision_roman_empire = { reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds" } decision_group_type = realm + sort_order = 10 should_create_alert = { always = yes } @@ -282,6 +290,7 @@ tribute_mission_decision_roman_empire = { cooldown = { years = 5 } is_shown = { + NOT = { government_has_flag = government_is_merchant } title:h_roman_empire ?= { is_title_created = yes } is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_roman_empire } } @@ -408,6 +417,7 @@ tribute_mission_decision_eastern_roman_empire = { reference = "gfx/interface/illustrations/decisions/ep3_decision_roman_restoration.dds" } decision_group_type = realm + sort_order = 10 should_create_alert = { always = yes } @@ -416,6 +426,7 @@ tribute_mission_decision_eastern_roman_empire = { cooldown = { years = 5 } is_shown = { + NOT = { government_has_flag = government_is_merchant } title:h_eastern_roman_empire ?= { is_title_created = yes } is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_eastern_roman_empire } } @@ -542,6 +553,7 @@ tribute_mission_decision_dar_al_islam = { reference = "gfx/interface/illustrations/decisions/decision_golden_age.dds" } decision_group_type = realm + sort_order = 10 should_create_alert = { always = yes } @@ -550,6 +562,7 @@ tribute_mission_decision_dar_al_islam = { cooldown = { years = 5 } is_shown = { + NOT = { government_has_flag = government_is_merchant } title:h_dar_al_islam ?= { is_title_created = yes } is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_dar_al_islam } } @@ -676,6 +689,7 @@ tribute_mission_decision_india = { reference = "gfx/interface/illustrations/decisions/decision_golden_age.dds" } decision_group_type = realm + sort_order = 10 should_create_alert = { always = yes } @@ -684,6 +698,7 @@ tribute_mission_decision_india = { cooldown = { years = 5 } is_shown = { + NOT = { government_has_flag = government_is_merchant } title:h_india ?= { is_title_created = yes } is_tributary_or_independent_neighbor_of_hegemon_trigger = { HEGEMON = h_india } } diff --git a/common/domiciles/buildings/NEOW_minority_community_buildings.txt b/common/domiciles/buildings/NEOW_minority_community_buildings.txt index 37857ba6e..ad63271f8 100644 --- a/common/domiciles/buildings/NEOW_minority_community_buildings.txt +++ b/common/domiciles/buildings/NEOW_minority_community_buildings.txt @@ -1,4 +1,12 @@ - +@camp_building_internal_slot_construction_duration_t2 = 240 +@camp_building_main_slot_construction_duration_t1 = 180 +@camp_building_main_slot_construction_duration_t2 = 210 +@camp_building_main_slot_construction_duration_t3 = 240 +@camp_building_main_slot_construction_duration_t4 = 300 +@camp_building_main_slot_construction_duration_t5 = 360 +@camp_building_main_slot_construction_duration_t6 = 420 + + minority_community_main_01 = { slot_type = main internal_slots = 2 diff --git a/common/factions/00_peasant_faction_new.txt b/common/factions/00_peasant_faction_new.txt index f18d780bc..8cb1d662b 100644 --- a/common/factions/00_peasant_faction_new.txt +++ b/common/factions/00_peasant_faction_new.txt @@ -773,7 +773,7 @@ peasant_faction = { war_keep_on_attacker_victory = yes } } - } +# } # NEOW: closes a disabled historical Roman-restoration conditional } leader_leaves = { diff --git a/common/game_concepts/00_game_concepts.txt b/common/game_concepts/00_game_concepts.txt index 71f03cdc0..2bc5d17dc 100644 --- a/common/game_concepts/00_game_concepts.txt +++ b/common/game_concepts/00_game_concepts.txt @@ -1249,20 +1249,20 @@ loot = { barter = { texture = "gfx/interface/icons/icon_barter.dds" - alias = { bartering bartered barter_i barters trading traded trades trade } + alias = { bartering bartered barter_i barters } requires_dlc_flag = all_under_heaven } barterer = { texture = "gfx/interface/icons/icon_barter.dds" parent = barter - alias = { barterers traders trader } + alias = { barterers } } barter_goods = { texture = "gfx/interface/icons/icon_barter.dds" parent = barter - alias = { barter_goods_i trade_goods } + alias = { barter_goods_i } } army_commander = { diff --git a/common/landed_titles/caucasus.txt b/common/landed_titles/caucasus.txt index 24c461dd4..7b654bcad 100644 --- a/common/landed_titles/caucasus.txt +++ b/common/landed_titles/caucasus.txt @@ -249,7 +249,7 @@ e_caucasia = { b_ashtarak = { # Ashtarak province = 8958 color = { 148 124 23 } - color2 = { 255 255 255 } + # color2 removed: invalid CK3 landed-title property in 1.21 } } c_gegharkunik = { # Gegharkunik diff --git a/common/landed_titles/finland.txt b/common/landed_titles/finland.txt index f8f55b45a..4a0dcb65d 100644 --- a/common/landed_titles/finland.txt +++ b/common/landed_titles/finland.txt @@ -1031,7 +1031,7 @@ e_finland = { } b_uusikaupunki = { # Uusikaupunki province = 180 - ccolor = { 235 245 245 } + color = { 235 245 245 } cultural_names = { name_list_NEOW_norwegian=cn_nystad diff --git a/common/landed_titles/religious_titles.txt b/common/landed_titles/religious_titles.txt index d07085e1b..6693ce7c6 100644 --- a/common/landed_titles/religious_titles.txt +++ b/common/landed_titles/religious_titles.txt @@ -356,7 +356,7 @@ k_compostelan_papacy = { no_automatic_claims = yes always_follows_primary_heir = yes de_jure_drift_disabled = yes - male_names = { Agapetus Alexander Anastasius Benedictus Caelestinus Callistus Clemens Dionysius Eleutherius Eutychianus Evaristus Fabianus Felix Gabriel Gelasius Gregorius Hadrianus Hilarius Honorius Innocentius Ioannes Iulius Landus Liberius Lucius Marcellus Marinus Martinus Nicolaus Pelagius Petrus Pius Raphael Sergius Silverius Silvester Stephanus Urbanus Valentinus Victor } + # 1.21: removed unsupported male_names title property; stored original in audit } d_united_grand_lodge = { diff --git a/common/laws/00_realm_laws.txt b/common/laws/00_realm_laws.txt index 92a99c13e..48af52517 100644 --- a/common/laws/00_realm_laws.txt +++ b/common/laws/00_realm_laws.txt @@ -1,4 +1,13 @@ -@crown_authority_cooldown_years = 20 +@company_size_prestige_cost = 300 +@company_size_cooldown_years = 5 +@company_purpose_prestige_cost = 500 +@company_purpose_cooldown_years = 5 +@company_purpose_ai_will_do_malus_t3 = -30 +@company_purpose_ai_will_do_malus_t2 = -20 +@company_purpose_ai_will_do_bonus_t3 = 30 +@company_purpose_ai_will_do_bonus_t2 = 20 +@company_purpose_ai_will_do_bonus_t1 = 10 +@crown_authority_cooldown_years = 20 @tribal_authority_cooldown_years = 10 @nomadic_authority_cooldown_years = 5 @church_authority_cooldown_years = 20 @@ -3559,3 +3568,699 @@ crowned_emperor = { } } } + + +company_purpose_artisan = { + law_group_type = company_purpose + index = 1 + + pass_phrase = company_purpose_pass_phrase + confirmation_title = company_purpose_pass_phrase + confirmation_button_text = company_purpose_confirmation_button_text + + flag = uses_company_purpose + flag = can_change_succession_laws + flag = learning_company_purpose + + can_keep = { realm_law_use_company_purpose = yes } + + can_pass = { + custom_description = { + subject = root + text = has_company_purpose_cooldown + NOT = { has_variable = company_purpose_cooldown } + } + custom_tooltip = { + text = company_purpose_child_blocker_tt + is_adult = yes + } + } + + pass_cost = { + prestige = { + if = { + limit = { + NOR = { + has_realm_law_flag = can_change_purpose_for_free + has_character_flag = free_starting_merchant_purpose_change + } + } + value = @company_purpose_prestige_cost + } + } + } + + modifier = { + trait_track_artisan_xp_gain_mult = 0.15 + trade_category_luxury_items_xp_gain_mult = 0.2 + trade_category_books_xp_gain_mult = 0.2 + trade_category_fabrics_xp_gain_mult = 0.2 + trade_category_clothes_xp_gain_mult = 0.2 + trade_category_dyes_xp_gain_mult = 0.2 + trade_category_alum_xp_gain_mult = 0.2 + trade_category_stone_xp_gain_mult = 0.2 + domicile_build_gold_cost = -0.2 + } + + on_pass = { + set_variable = { + name = company_purpose_cooldown + years = @company_purpose_cooldown_years + } + remove_character_flag = free_starting_merchant_purpose_change + # Remove modifiers. + remove_law_related_modifiers_effect = yes + merchant_company_law_purpose_effect = yes + } + + requires_approve = { + always = no + } + + ai_will_do = { + # If we've picked a purpose, don't change it. + if = { + limit = { + NOT = { has_realm_law = company_purpose_artisan } + } + value = 0 + } + else = { + # Traits. + ## Education + if = { + limit = { has_trait = education_learning } + add = @company_purpose_ai_will_do_bonus_t3 + } + ## Culture + if = { + limit = { + culture = { has_cultural_tradition = tradition_artisans } + } + add = @company_purpose_ai_will_do_bonus_t3 + } + ## Personality + ### Calm + if = { + limit = { has_trait = calm } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Diligent + if = { + limit = { has_trait = diligent } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Eccentric + if = { + limit = { has_trait = eccentric } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Patient + if = { + limit = { has_trait = patient } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Impatient + if = { + limit = { has_trait = impatient } + add = @company_purpose_ai_will_do_malus_t3 + } + ### Shy + if = { + limit = { has_trait = shy } + add = @company_purpose_ai_will_do_bonus_t1 + } + } + } +} + + +company_purpose_caravaneer = { + law_group_type = company_purpose + index = 3 + + pass_phrase = company_purpose_pass_phrase + confirmation_title = company_purpose_pass_phrase + confirmation_button_text = company_purpose_confirmation_button_text + + flag = uses_company_purpose + flag = can_change_succession_laws + flag = diplomacy_company_purpose + + can_keep = { realm_law_use_company_purpose = yes } + + can_pass = { + custom_description = { + subject = root + text = has_company_purpose_cooldown + NOT = { has_variable = company_purpose_cooldown } + } + custom_tooltip = { + text = company_purpose_child_blocker_tt + is_adult = yes + } + } + + pass_cost = { + prestige = { + if = { + limit = { + NOR = { + has_realm_law_flag = can_change_purpose_for_free + has_character_flag = free_starting_merchant_purpose_change + } + } + value = @company_purpose_prestige_cost + } + } + } + + on_pass = { + set_variable = { + name = company_purpose_cooldown + years = @company_purpose_cooldown_years + } + remove_character_flag = free_starting_merchant_purpose_change + # Remove modifiers. + remove_law_related_modifiers_effect = yes + merchant_company_law_purpose_effect = yes + } + + modifier = { + trade_category_luxury_consumption_xp_gain_mult = 0.2 + trade_category_incense_xp_gain_mult = 0.2 + trade_category_medicaments_xp_gain_mult = 0.2 + trade_category_comforts_xp_gain_mult = 0.2 + trade_category_alcohol_xp_gain_mult = 0.2 + trade_category_salt_xp_gain_mult = 0.2 + trade_category_beasts_of_burden_xp_gain_mult = 0.2 + trait_track_caravaneer_xp_gain_mult = 0.15 + ignore_negative_culture_opinion = yes + ignore_negative_opinion_of_culture = yes + } + + requires_approve = { + always = no + } + + ai_will_do = { + # If we've picked a purpose, don't change it. + if = { + limit = { + NOT = { has_realm_law = company_purpose_caravaneer } + } + value = 0 + } + else = { + # Traits. + ## Education + if = { + limit = { has_trait = education_diplomacy } + add = @company_purpose_ai_will_do_bonus_t3 + } + if = { + limit = { has_trait = education_stewardship } + add = @company_purpose_ai_will_do_bonus_t2 + } + ## Cultures + if = { + limit = { + culture = { has_cultural_tradition = tradition_caravaneers } + } + add = @company_purpose_ai_will_do_bonus_t3 + } + ## Personality + ### Lazy + if = { + limit = { has_trait = lazy } + add = @company_purpose_ai_will_do_malus_t2 + } + ### Athletic + if = { + limit = { has_trait = athletic } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Brave + if = { + limit = { has_trait = brave } + add = @company_purpose_ai_will_do_bonus_t2 + } + ### Craven + if = { + limit = { has_trait = craven } + add = @company_purpose_ai_will_do_malus_t2 + } + ### Stubborn + if = { + limit = { has_trait = stubborn } + add = @company_purpose_ai_will_do_bonus_t1 + } + ### Fickle + if = { + limit = { has_trait = fickle } + add = @company_purpose_ai_will_do_bonus_t2 + } + ### Humble + if = { + limit = { has_trait = humble } + add = @company_purpose_ai_will_do_bonus_t2 + } + ### Arrogant + if = { + limit = { has_trait = arrogant } + add = @company_purpose_ai_will_do_malus_t2 + } + } + } +} + + +company_purpose_creditor = { + law_group_type = company_purpose + index = 2 + + pass_phrase = company_purpose_pass_phrase + confirmation_title = company_purpose_pass_phrase + confirmation_button_text = company_purpose_confirmation_button_text + + flag = uses_company_purpose + flag = can_change_succession_laws + flag = intrigue_company_purpose + flag = unlock_military_merchant_patron_requests + + # Seize Land CB + flag = unlock_seize_realm_county_cb + + can_keep = { realm_law_use_company_purpose = yes } + + can_pass = { + custom_description = { + subject = root + text = has_company_purpose_cooldown + NOT = { has_variable = company_purpose_cooldown } + } + custom_tooltip = { + text = company_purpose_child_blocker_tt + is_adult = yes + } + } + + pass_cost = { + prestige = { + if = { + limit = { + NOR = { + has_realm_law_flag = can_change_purpose_for_free + has_character_flag = free_starting_merchant_purpose_change + } + } + value = @company_purpose_prestige_cost + } + } + } + + modifier = { + trade_category_precious_metals_xp_gain_mult = 0.2 + trade_category_jewelry_materials_xp_gain_mult = 0.2 + trade_category_base_metals_xp_gain_mult = 0.2 + trade_category_cereals_xp_gain_mult = 0.2 + trade_category_meat_xp_gain_mult = 0.2 + trade_category_carpentry_supplies_xp_gain_mult = 0.2 + trait_track_creditor_xp_gain_mult = 0.15 + } + + on_pass = { + set_variable = { + name = company_purpose_cooldown + years = @company_purpose_cooldown_years + } + remove_character_flag = free_starting_merchant_purpose_change + # Remove modifiers. + remove_law_related_modifiers_effect = yes + merchant_company_law_purpose_effect = yes + } + + requires_approve = { + always = no + } + + ai_will_do = { + # If we've picked a purpose, don't change it. + if = { + limit = { + NOT = { has_realm_law = company_purpose_creditor } + } + value = 0 + } + else = { + # Traits. + ## Education + if = { + limit = { has_trait = education_intrigue } + add = @company_purpose_ai_will_do_bonus_t3 + } + ## Personality. + ### Deceitful. + if = { + limit = { has_trait = deceitful } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Honest. + if = { + limit = { has_trait = honest } + add = @company_purpose_ai_will_do_malus_t3 + } + ### Arbitrary. + if = { + limit = { has_trait = arbitrary } + add = @company_purpose_ai_will_do_bonus_t3 + } + ### Just, + if = { + limit = { has_trait = just } + add = @company_purpose_ai_will_do_malus_t3 + } + ### Generous. + if = { + limit = { has_trait = generous } + add = @company_purpose_ai_will_do_malus_t2 + } + ### Arrogant. + if = { + limit = { has_trait = arrogant } + add = @company_purpose_ai_will_do_bonus_t2 + } + ### Wrathful. + if = { + limit = { has_trait = wrathful } + add = @company_purpose_ai_will_do_bonus_t1 + } + ### Callous. + if = { + limit = { has_trait = callous } + add = @company_purpose_ai_will_do_bonus_t2 + } + ### Compassionate. + if = { + limit = { has_trait = compassionate } + add = @company_purpose_ai_will_do_malus_t2 + } + } + } +} + + +company_purpose_family = { + law_group_type = company_purpose + index = 0 + + pass_phrase = company_purpose_pass_phrase + confirmation_title = company_purpose_pass_phrase + confirmation_button_text = company_purpose_confirmation_button_text + + flag = uses_company_purpose + flag = can_change_succession_laws + flag = can_change_purpose_for_free + + can_keep = { realm_law_use_company_purpose = yes } + + can_pass = { + custom_description = { + subject = root + text = has_company_purpose_cooldown + NOT = { has_variable = company_purpose_cooldown } + } + custom_tooltip = { + text = company_purpose_child_blocker_tt + is_adult = yes + } + } + + pass_cost = { + prestige = { + if = { + limit = { + NOR = { + has_realm_law_flag = can_change_purpose_for_free + has_character_flag = free_starting_merchant_purpose_change + } + } + value = @company_purpose_prestige_cost + } + } + } + + modifier = { + close_relative_opinion = 10 + suzerain_opinion = 30 + trade_expertise_growth_mult = 0.1 + } + + on_pass = { + set_variable = { + name = company_purpose_cooldown + years = @company_purpose_cooldown_years + } + remove_character_flag = free_starting_merchant_purpose_change + # Remove modifiers. + remove_law_related_modifiers_effect = yes + merchant_company_law_purpose_effect = yes + } + + requires_approve = { + always = no + } + + ai_will_do = { value = 0 } +} + + +company_size_huge = { + law_group_type = company_size + index = 3 + + pass_phrase = company_size_pass_phrase + confirmation_title = company_size_confirmation_title + confirmation_button_text = company_size_confirmation_button_text + + can_pass = { + has_realm_law = company_size_large + custom_description = { + subject = root + text = "has_company_size_cooldown" + NAND = { + has_variable = company_size_cooldown + NOT = { + culture = { has_innovation = innovation_all_things } + } + } + } + domicile ?= { + domicile_uses_acumen = yes + acumen >= define:NDomicile|MERCHANT_ACUMEN_LEVEL_4_THRESHOLD + } + } + + can_keep = { realm_law_use_company_purpose = yes } + + pass_cost = { + prestige = { + if = { + limit = { + is_ai = no + has_realm_law = company_size_large + } + add = @company_size_prestige_cost + } + } + } + + modifier = { + trade_competitiveness_add = 40 + trade_route_length_add = 10 + monthly_dynasty_prestige = 0.75 + } + + on_pass = { + set_variable = { + name = company_size_cooldown + years = @company_size_cooldown_years + } + # Remove modifiers. + remove_law_related_modifiers_effect = yes + play_sound_effect = "event:/DLC/EP5/SFX/Stingers/ep5_mx_sting_company_size_increase" + } + + requires_approve = { always = no } + + ai_will_do = { + if = { + limit = { has_realm_law = company_size_large } + value = 1 + } + } +} + + +company_size_large = { + law_group_type = company_size + index = 2 + + pass_phrase = company_size_pass_phrase + confirmation_title = company_size_confirmation_title + confirmation_button_text = company_size_confirmation_button_text + + can_pass = { + has_realm_law = company_size_medium + custom_description = { + subject = root + text = "has_company_size_cooldown" + NAND = { + has_variable = company_size_cooldown + NOT = { + culture = { has_innovation = innovation_all_things } + } + } + } + domicile ?= { + domicile_uses_acumen = yes + acumen >= define:NDomicile|MERCHANT_ACUMEN_LEVEL_3_THRESHOLD + } + } + + can_keep = { realm_law_use_company_purpose = yes } + + pass_cost = { + prestige = { + if = { + limit = { + is_ai = no + has_realm_law = company_size_medium + } + add = @company_size_prestige_cost + } + } + } + + modifier = { + trade_competitiveness_add = 30 + trade_route_length_add = 8 + monthly_dynasty_prestige = 0.5 + } + + on_pass = { + set_variable = { + name = company_size_cooldown + years = @company_size_cooldown_years + } + # Remove modifiers. + remove_law_related_modifiers_effect = yes + play_sound_effect = "event:/DLC/EP5/SFX/Stingers/ep5_mx_sting_company_size_increase" + } + + requires_approve = { always = no } + + ai_will_do = { + if = { + limit = { has_realm_law = company_size_medium } + value = 1 + } + } +} + + +company_size_medium = { + law_group_type = company_size + index = 1 + + pass_phrase = company_size_pass_phrase + confirmation_title = company_size_confirmation_title + confirmation_button_text = company_size_confirmation_button_text + + can_pass = { + has_realm_law = company_size_small + custom_description = { + subject = root + text = "has_company_size_cooldown" + NAND = { + has_variable = company_size_cooldown + NOT = { + culture = { has_innovation = innovation_all_things } + } + } + } + domicile ?= { + domicile_uses_acumen = yes + acumen >= define:NDomicile|MERCHANT_ACUMEN_LEVEL_2_THRESHOLD + } + } + + can_keep = { realm_law_use_company_purpose = yes } + + pass_cost = { + prestige = { + if = { + limit = { + is_ai = no + has_realm_law = company_size_small + } + add = @company_size_prestige_cost + } + } + } + + modifier = { + trade_competitiveness_add = 20 + trade_route_length_add = 4 + monthly_dynasty_prestige = 0.25 + } + + on_pass = { + set_variable = { + name = company_size_cooldown + years = @company_size_cooldown_years + } + # Remove modifiers. + remove_law_related_modifiers_effect = yes + play_sound_effect = "event:/DLC/EP5/SFX/Stingers/ep5_mx_sting_company_size_increase" + } + + requires_approve = { always = no } + + ai_will_do = { + if = { + limit = { has_realm_law = company_size_small } + value = 1 + } + } +} + + +company_size_small = { + law_group_type = company_size + index = 0 + + pass_phrase = company_size_pass_phrase + confirmation_title = company_size_confirmation_title + confirmation_button_text = company_size_confirmation_button_text + + can_pass = { + NOR = { + has_realm_law = company_size_medium + has_realm_law = company_size_large + has_realm_law = company_size_huge + } + } + + can_keep = { realm_law_use_company_purpose = yes } + + modifier = { + } + + on_pass = { + # Remove modifiers. + remove_law_related_modifiers_effect = yes + } + + requires_approve = { always = no } +} diff --git a/common/laws/00_succession_laws.txt b/common/laws/00_succession_laws.txt index bb5461d81..ef7f00f0f 100644 --- a/common/laws/00_succession_laws.txt +++ b/common/laws/00_succession_laws.txt @@ -2491,3 +2491,290 @@ same_faith_succession_law = { faith = same_faith } } + + +# CK3 1.21 Silk & Silver: required succession law retained from vanilla. +republican_despot_succession_law = { + law_group_type = succession_order_laws + index = 20 + + modifier = { + character_capital_popular_opinion_add = -25 + } + + can_have = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + liege = { + OR = { + this = root + NOT = { government_has_flag = government_is_republic } + } + } + } + can_pass = { + government_has_flag = government_is_republic + capital_county = { + county_control >= county_control_baseline + } + has_realm_law = republic_assembly_authority_legislative + has_realm_law = republic_assembly_term_length_indefinite + has_realm_law = republic_end_term_law_1 + has_realm_law = republic_vassal_refusal_2_treason + has_realm_law = republic_title_revocation_2_allowed + has_realm_law = republic_retract_vassal_2_allowed + has_realm_law = republic_banishment_3_unrestricted + has_realm_law = republic_execution_3_unrestricted + } + + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = single_heir + } + + flag = advanced_succession_law + flag = can_designate_heirs + + modifier = { + player_heir_opinion = 20 + close_relative_opinion = 10 + republic_government_opinion = -20 + } + + revoke_cost = { + prestige = change_hre_title_succession_law_prestige_cost + } + pass_cost = { + prestige = gdp_republican_despot_law_prestige_cost + } + + requires_approve = { government_has_flag = government_is_republic } + voting_session = { government_has_flag = government_is_republic } + + on_pass = { + capital_county = { add_popular_opinion = -25 } + } + + ai_approval = { + value = { + value = -100 + desc = LAW_BASE_RELUCTANCE_DESC + } + } + + ai_will_do = { + value = 0 + if = { + limit = { + house ?= { + has_house_aspiration_parameter = republic_signorial + } + } + add = 2 + } + if = { + limit = { + OR = { + has_trait = ambitious + has_trait = arrogant + } + } + add = 1 + } + # Grace period + multiply = ai_law_grace_period_value + } + + potential = { + government_has_flag = government_is_republic + gdp_is_assembly_head_trigger = yes + } +} + + +# CK3 1.21 Silk & Silver: required succession law retained from vanilla. +merchant_succession_law = { + law_group_type = succession_order_laws + index = 36 + + can_keep = { + government_has_flag = government_is_merchant + } + can_have = { + government_has_flag = government_is_merchant + } + can_pass = { + government_has_flag = government_is_merchant + } + should_start_with = { + government_has_flag = government_is_merchant + } + should_show_for_title = { # Never show this in the UI, just apply it through script + always = no + } + can_remove_from_title = { + always = no + } + succession = { + order_of_succession = inheritance + traversal_order = children + rank = oldest + title_division = single_heir + exclude_rulers = yes + limit_to_courtiers = yes + } + flag = can_designate_heirs + + potential = { + government_has_flag = government_is_merchant + } +} + + +# CK3 1.21 Silk & Silver: required succession law retained from vanilla. +republican_elective_succession_law = { + law_group_type = succession_order_laws + index = 37 + + can_keep = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + liege = { + OR = { + this = root + NOT = { government_has_flag = government_is_republic } + } + } + } + can_have = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + } + can_pass = { + government_has_flag = government_is_republic + } + should_start_with = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + } + + succession = { + allow_same_successor = yes + order_of_succession = election + election_type = republican_elective + use_term_length = yes + } + + modifier = { + short_reign_duration_mult = -2 + } + + flag = elective_succession_law + flag = succession_uses_term_length + + revoke_cost = { + prestige = { + value = change_title_succession_law_prestige_cost + multiply = gdp_republic_revoke_title_law_cost_scale_value + } + gold = { + add = { + value = 1000 + desc = BASE + } + value = gdp_republic_revoke_title_law_monetary_cost_value + multiply = gdp_republic_revoke_title_law_cost_scale_value + } + } + pass_cost = { + prestige = change_title_succession_law_prestige_cost + treasury_or_gold = gdp_republic_pass_title_law_monetary_cost_value + } + + requires_approve = { government_has_flag = government_is_republic } + voting_session = { government_has_flag = government_is_republic } + + ai_approval = { + value = { + value = 100 + desc = LAW_BASE_WILLINGNESS_DESC + } + } + + ai_will_do = { + value = 10 # TODO_GDP - Add proper AI values and weights + } + + potential = { + government_has_flag = government_is_republic + gdp_is_assembly_head_trigger = yes + } +} + + +# CK3 1.21 Silk & Silver: required succession law retained from vanilla. +republican_appointment_succession_law = { + law_group_type = succession_order_laws + index = 38 + + can_keep = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + liege = { + this != root + government_has_flag = government_is_republic + } + } + can_have = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + liege = { + this != root + government_has_flag = government_is_republic + } + } + can_pass = { + } + should_start_with = { + government_has_flag = government_is_republic + highest_held_title_tier >= tier_county + liege = { + this != root + government_has_flag = government_is_republic + } + } + succession = { + order_of_succession = appointment + appointment_type = republic_governor + } + flag = advanced_succession_law + flag = appointment_type_succession + modifier = { + } + pass_cost = { + prestige = change_succession_law_prestige_cost + } + revoke_cost = { + prestige = change_succession_law_prestige_cost + } + + ai_will_do = { + if = { + limit = { + OR = { + has_realm_law = confederate_partition_succession_law + has_realm_law = partition_succession_law + has_realm_law = high_partition_succession_law + } + } + value = 3 + } + } + + potential = { + government_has_flag = government_is_republic + gdp_is_assembly_head_trigger = no + } +} diff --git a/common/on_action/army_on_actions.txt b/common/on_action/army_on_actions.txt index e1926f2c9..95ccfd66b 100644 --- a/common/on_action/army_on_actions.txt +++ b/common/on_action/army_on_actions.txt @@ -228,16 +228,16 @@ on_county_occupied = { change_county_control = county_control_loss_value random_list = { 25 = { - change_development_progress_with_overflow = -10 + change_prosperity_progress_with_overflow = -10 } 25 = { - change_development_progress_with_overflow = -15 + change_prosperity_progress_with_overflow = -15 } 25 = { - change_development_progress_with_overflow = -20 + change_prosperity_progress_with_overflow = -20 } 25 = { - change_development_progress_with_overflow = -25 + change_prosperity_progress_with_overflow = -25 } } } @@ -396,6 +396,7 @@ on_siege_completion = { siege.0032 # Chance to steal an artifact from holy site faction_demand.1010 #Reinforce populist rebels faction_demand.1110 #Reinforce peasant rebels + gdp_burgher.0030 siege.1001 #Someone I care about was immured here... intrigue_scheming.1804 # I had genuine/fake info about the defenses. Follows up intrigue_scheming.1801 so this won't actually trigger after every siege } @@ -421,7 +422,7 @@ on_siege_completion = { title = successful_sieges_give_piety_toast left_icon = root add_piety = minor_piety_gain - scope:barony.county = { change_development_progress_with_overflow = -2 } + scope:barony.county = { change_prosperity_progress_with_overflow = -2 } } } @@ -435,7 +436,7 @@ on_siege_completion = { title = tenet_aniconism_siege_destruction_toast left_icon = root add_piety = minor_piety_gain - scope:barony.county = { change_development_progress_with_overflow = -3 } + scope:barony.county = { change_prosperity_progress_with_overflow = -3 } } } @@ -453,7 +454,7 @@ on_siege_completion = { title = extinction_of_dharma_siege_toast left_icon = root add_piety = minor_piety_gain - scope:barony.county = { change_development_progress_with_overflow = -3 } + scope:barony.county = { change_prosperity_progress_with_overflow = -3 } } } @@ -477,7 +478,7 @@ on_siege_completion = { if = { limit = { has_legend_chapter_trigger = { CHAPTER = extra_deed } - scope:barony.county.development_level >= good_development_level + scope:barony.county.prosperity_level >= good_prosperity_level NOT = { promoted_legend ?= { has_legend_chapter = { @@ -687,9 +688,21 @@ on_siege_looting = { domicile ?= { change_provisions = adventurer_siege_provisions_amount } } } - add_province_modifier = { - modifier = recently_looted_modifier - years = 5 + trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_recently_sieged_capacity_modifier + years = 5 + } + } + county = { + if = { + limit = { + holder = { + NOT = { has_perk = a_mans_home_perk } + } + } + change_county_control = -5 + } } } @@ -710,6 +723,26 @@ on_siege_looting = { tgp_treasury_raided_effect = yes } } + scope:barony.trade_market = { + every_character_in_market = { + limit = { government_allows = profit_trade_routes } + send_interface_message = { + type = msg_raid_lost + title = msg_army_siege_affects_trade_title + left_icon = root + right_icon = scope:barony + desc = msg_army_siege_affects_trade_desc + show_as_tooltip = { + scope:barony.trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_recently_sieged_capacity_modifier + years = 5 + } + } + } + } + } + } } } @@ -762,6 +795,134 @@ on_army_enter_province = { } } } + # Army movement damages Trade + if = { + limit = { + # Prevent same army owner affecting many markets in quick succession + NOT = { exists = var:army_movement_trade_market_cooldown } + scope:army ?= { + # Prevent same army affecting many markets in quick succession + NOT = { exists = var:army_movement_trade_market_cooldown } + # Ensure tiny armies are not messing up trade + army_size > 250 + location = { + barony ?= { + # Prevent same market being affected too often + NOT = { exists = trade_market.var:army_movement_trade_market_cooldown } + # Ignore occupied land + barony_controller != scope:army_owner + } + # Prevent damaging own or allied markets directly (overlapping is fine) + county.holder ?= { + save_temporary_scope_as = county_holder + OR = { + root = { is_causing_raid_hostility_towards = scope:county_holder } + is_at_war_with = root + } + } + } + } + } + random = { + chance = 1 + modifier = { + add = { + value = scope:army.army_size + multiply = 0.005 + max = 10 + } + } + modifier = { + factor = 0.5 + scope:army.location.barony.trade_market = { has_trade_market_modifier = gdp_market_army_movement_capacity_modifier } + } + scope:army = { + location = { + save_scope_as = army_province + barony.trade_market = { + save_scope_as = trade_market + random_list = { + 1 = { + trigger = { + any_trade_good_with_surplus = {} + } + random_trade_good_with_surplus = { save_scope_as = trade_good } + } + 1 = {} + } + if = { # Increase price of a locally traded good + limit = { exists = scope:trade_good } + add_trade_good_price_modifier = { + type = buy_add + trade_good_type = scope:trade_good + value = 0.01 + years = 5 + } + every_character_in_market = { + limit = { government_allows = profit_trade_routes } + send_interface_message = { + type = msg_army_affects_trade + title = msg_army_movement_affects_trade_title + left_icon = root + right_icon = scope:army.location.barony + desc = msg_army_movement_affects_trade_desc + show_as_tooltip = { + scope:trade_market = { + add_trade_good_price_modifier = { + type = buy_add + trade_good_type = scope:trade_good + value = 0.01 + years = 5 + } + } + } + } + } + } + else = { # Disrupt local prices across the market + add_trade_market_modifier = { + modifier = gdp_market_army_movement_capacity_modifier + years = 5 + } + every_character_in_market = { + limit = { government_allows = profit_trade_routes } + send_interface_message = { + type = msg_army_affects_trade + title = msg_army_movement_affects_trade_title + left_icon = root + right_icon = scope:army.location.barony + desc = msg_army_movement_affects_trade_desc + show_as_tooltip = { + scope:trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_army_movement_capacity_modifier + years = 5 + } + } + } + } + } + } + # Prevent same trade market being affected too often + set_variable = { + name = army_movement_trade_market_cooldown + months = 6 + } + } + # Prevent same army affecting trade markets too often + set_variable = { + name = army_movement_trade_market_cooldown + months = 6 + } + } + } + # Prevent same army owner affecting trade markets too often + set_variable = { + name = army_movement_trade_market_cooldown + months = 6 + } + } + } } } @@ -839,6 +1000,15 @@ on_raid_action_completion = { type = msg_raid_completed left_icon = scope:county.holder right_icon = scope:barony + desc = msg_raid_completed_desc + show_as_tooltip = { + scope:barony.trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_recently_raided_capacity_modifier + years = 5 + } + } + } } if = { limit = { @@ -880,10 +1050,18 @@ on_raid_action_completion = { } } } - scope:barony.title_province = { - add_province_modifier = { - modifier = recently_looted_modifier - years = 5 + scope:barony = { + title_province = { + add_province_modifier = { + modifier = recently_looted_modifier + years = 5 + } + } + trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_recently_raided_capacity_modifier + years = 5 + } } county = { if = { @@ -895,16 +1073,16 @@ on_raid_action_completion = { change_county_control = raid_county_control_loss_value random_list = { 25 = { - change_development_progress_with_overflow = -2 + change_prosperity_progress_with_overflow = -2 } 25 = { - change_development_progress_with_overflow = -3 + change_prosperity_progress_with_overflow = -3 } 25 = { - change_development_progress_with_overflow = -4 + change_prosperity_progress_with_overflow = -4 } 25 = { - change_development_progress_with_overflow = -5 + change_prosperity_progress_with_overflow = -5 } } } @@ -922,6 +1100,15 @@ on_raid_action_completion = { type = msg_raid_lost left_icon = scope:raider right_icon = scope:barony + desc = msg_raid_lost_desc + show_as_tooltip = { + scope:barony.trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_recently_raided_capacity_modifier + years = 5 + } + } + } } } diff --git a/common/on_action/barter_on_actions.txt b/common/on_action/barter_on_actions.txt index 4c0142fea..ec88d4d64 100644 --- a/common/on_action/barter_on_actions.txt +++ b/common/on_action/barter_on_actions.txt @@ -37,10 +37,18 @@ on_barter_action_completion = { show_as_tooltip = { add_loot = scope:value - scope:barony.title_province = { - add_province_modifier = { - modifier = recently_bartered_modifier - years = 5 + scope:barony = { + title_province = { + add_province_modifier = { + modifier = recently_bartered_modifier + years = 5 + } + } + trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_bartering_trade_modifier + years = 5 + } } } } @@ -81,11 +89,18 @@ on_barter_action_completion = { desc = msg_barter_completed_holder_desc left_icon = scope:barterer right_icon = scope:barony - - scope:barony.title_province = { - add_province_modifier = { - modifier = recently_bartered_modifier - years = 5 + scope:barony = { + title_province = { + add_province_modifier = { + modifier = recently_bartered_modifier + years = 5 + } + } + trade_market = { + add_trade_market_modifier = { + modifier = gdp_market_bartering_trade_modifier + years = 5 + } } } } diff --git a/common/on_action/combat_on_actions.txt b/common/on_action/combat_on_actions.txt index 7a9c5466f..76ad063e9 100644 --- a/common/on_action/combat_on_actions.txt +++ b/common/on_action/combat_on_actions.txt @@ -183,44 +183,45 @@ on_combat_end_winner = { any_character_artifact = { is_equipped = yes artifact_slot_type = primary_armament - NOT = { has_variable = artifact_battles_won_var } } } } - every_side_knight = { - random_character_artifact = { - limit = { - is_equipped = yes - artifact_slot_type = primary_armament - NOT = { has_variable = artifact_battles_won_var } + if = { + limit = { + any_side_knight = { + any_character_artifact = { + is_equipped = yes + artifact_slot_type = primary_armament + NOT = { has_variable = artifact_battles_won_var } + } } - set_variable = { - name = artifact_battles_won_var - value = 1 + } + every_side_knight = { + random_character_artifact = { + limit = { + is_equipped = yes + artifact_slot_type = primary_armament + NOT = { has_variable = artifact_battles_won_var } + } + set_variable = { + name = artifact_battles_won_var + value = 1 + } } } } - } - else_if = { - limit = { - any_side_knight = { - any_character_artifact = { - is_equipped = yes - artifact_slot_type = primary_armament - has_variable = artifact_battles_won_var - } - } - } - every_side_knight = { - random_character_artifact = { - limit = { - is_equipped = yes - artifact_slot_type = primary_armament - has_variable = artifact_battles_won_var - } - change_variable = { - name = artifact_battles_won_var - add = 1 + else = { + every_side_knight = { + random_character_artifact = { + limit = { + is_equipped = yes + artifact_slot_type = primary_armament + has_variable = artifact_battles_won_var + } + change_variable = { + name = artifact_battles_won_var + add = 1 + } } } } @@ -280,44 +281,45 @@ on_combat_end_winner = { any_character_artifact = { is_equipped = yes artifact_slot_type = armor - NOT = { has_variable = artifact_battles_won_var } } } } - every_side_knight = { - random_character_artifact = { - limit = { - is_equipped = yes - artifact_slot_type = armor - NOT = { has_variable = artifact_battles_won_var } + if = { + limit = { + any_side_knight = { + any_character_artifact = { + is_equipped = yes + artifact_slot_type = armor + NOT = { has_variable = artifact_battles_won_var } + } } - set_variable = { - name = artifact_battles_won_var - value = 1 + } + every_side_knight = { + random_character_artifact = { + limit = { + is_equipped = yes + artifact_slot_type = armor + NOT = { has_variable = artifact_battles_won_var } + } + set_variable = { + name = artifact_battles_won_var + value = 1 + } } } } - } - else_if = { - limit = { - any_side_knight = { - any_character_artifact = { - is_equipped = yes - artifact_slot_type = armor - has_variable = artifact_battles_won_var - } - } - } - every_side_knight = { - random_character_artifact = { - limit = { - is_equipped = yes - artifact_slot_type = armor - has_variable = artifact_battles_won_var - } - change_variable = { - name = artifact_battles_won_var - add = 1 + else = { + every_side_knight = { + random_character_artifact = { + limit = { + is_equipped = yes + artifact_slot_type = armor + has_variable = artifact_battles_won_var + } + change_variable = { + name = artifact_battles_won_var + add = 1 + } } } } @@ -431,7 +433,7 @@ on_combat_end_winner = { value = { value = 0 add = root.enemy_side.side_max_army_size - divide = 100 + divide = 400 min = 5 } } @@ -465,7 +467,7 @@ on_combat_end_winner = { value = { value = 0 add = root.enemy_side.side_max_army_size - divide = 100 + divide = 400 min = 5 } } @@ -482,6 +484,20 @@ on_combat_end_winner = { every_side_commander = { commander_trait_leveling_leveling_effect = { XP = 1 } pam_miles_christi_fulfillment_from_combat_effect = yes + if = { + limit = { can_gain_military_career_merit_trigger = yes } + send_interface_message = { + type = msg_military_merit_gain + title = msg_military_merit_battle_won + left_icon = this + right_icon = root.enemy_side.side_primary_participant + change_merit = military_career_battle_commander_merit_value + } + } + } + every_side_knight = { + limit = { can_gain_military_career_merit_trigger = yes } + change_merit = military_career_battle_knight_merit_value } # Miles Christi holy weapon victories @@ -525,7 +541,7 @@ on_combat_end_winner = { on_combat_end_loser = { events = { combat_event.0002 # Defeated commander loses shot at getting 'The Undefeated' nickname. - almohad.0003 # Check whether Ibn Tumert should die + # NEOW 2555: event not loaded. almohad.0003 # Check whether Ibn Tumert should die fp1_shieldmaiden.0031 # Track shieldmaiden levelling. combat_event.2111 # Battle Lost: glory goes down. } @@ -696,8 +712,8 @@ on_combat_end_loser = { modifier = { factor = accolade_progress # scales with accolade progress } - modifier = { # must have an eligible knight - NOT = { + if = { + limit = { # must have an eligible knight root = { any_side_knight = { can_unlock_accolade_attribute_trigger = { @@ -706,42 +722,41 @@ on_combat_end_loser = { } } } - factor = 0 - } - save_scope_as = accolade_liege - set_variable = { - name = accolade_progress - value = 0 - } - root = { - random_side_knight = { - limit = { - can_unlock_accolade_attribute_trigger = { - ATTRIBUTE = disciplinarian - } - } - weight = { - base = 1 - modifier = { - add = 50 - is_acclaimed = yes - } - } - save_scope_as = accolade_knight + save_scope_as = accolade_liege + set_variable = { + name = accolade_progress + value = 0 } - } - send_interface_message = { - type = msg_accolade_eligibility - title = accolade_disciplinarian_unlock.t - left_icon = scope:accolade_knight - right_icon = scope:accolade_liege - custom_tooltip = accolade_disciplinarian_unlock.tt - scope:accolade_knight = { - set_variable = { - name = disciplinarian_attribute_unlock - value = yes + root = { + random_side_knight = { + limit = { + can_unlock_accolade_attribute_trigger = { + ATTRIBUTE = disciplinarian + } + } + weight = { + base = 1 + modifier = { + add = 50 + is_acclaimed = yes + } + } + save_scope_as = accolade_knight } - } + } + send_interface_message = { + type = msg_accolade_eligibility + title = accolade_disciplinarian_unlock.t + left_icon = scope:accolade_knight + right_icon = scope:accolade_liege + custom_tooltip = accolade_disciplinarian_unlock.tt + scope:accolade_knight = { + set_variable = { + name = disciplinarian_attribute_unlock + value = yes + } + } + } } } } diff --git a/common/on_action/death.txt b/common/on_action/death.txt index b1db4be43..7c8f323b5 100644 --- a/common/on_action/death.txt +++ b/common/on_action/death.txt @@ -10,6 +10,10 @@ on_death = { add_character_flag = { flag = about_to_die_but_not_dead_yet_flag } # Used in perk calc + merchant_inspector_clear_specialized_market_effect = yes + + burgher_clear_sponsor_links_effect = yes + # Legend inheritance if = { limit = { @@ -2414,9 +2418,39 @@ on_death = { if = { limit = { is_valid_for_legitimacy_change = yes } add_legitimacy = massive_legitimacy_loss + } + } + + ### GDP ### + gdp_merchant_charter_patron_death_effect = yes + # NEOW 2555: historical Italian Guelph/Ghibelline succession disabled. + #Sort out the next Guelph & Ghibelline leader +# if = { +# limit = { +# exists = situation:guelph_ghibelline +# OR = { +# exists = var:guelph_leader +# exists = var:ghibelline_leader +# } +# } +# try_set_up_new_gg_leader_effect = yes +# } + + # Allow the player to pick great schism stance when dying and becoming an heir that already has one + if = { + limit = { + is_ai = no + player_heir ?= { + has_variable = pam_schism_stance + } + } + player_heir = { + remove_variable = pam_schism_stance } } -# # PAM - Catalysts + + # NEOW 2555: previously disabled PAM short-reign catalyst kept disabled. + # PAM - Catalysts # if = { # limit = { # pam_head_of_rite_had_short_reign_trigger = yes diff --git a/common/on_action/dlc/fp2/fp2_other_decision_on_actions.txt b/common/on_action/dlc/fp2/fp2_other_decision_on_actions.txt new file mode 100644 index 000000000..4c6dbf629 --- /dev/null +++ b/common/on_action/dlc/fp2/fp2_other_decision_on_actions.txt @@ -0,0 +1,29 @@ +#On actions relating to maintenance and effects of Inspirations. + +fp2_struggle_council_toledo_organize = { + random_events = { + 100 = fp2_other_decisions.0700 + } + fallback = fp2_struggle_council_toledo_fallback +} + +fp2_struggle_council_toledo_attend = { + random_events = { + 100 = fp2_other_decisions.0701 + } + fallback = fp2_struggle_council_toledo_fallback +} + +fp2_struggle_council_toledo_debate = { + random_events = { + 100 = fp2_other_decisions.0702 + } + fallback = fp2_struggle_council_toledo_fallback +} + +fp2_struggle_council_toledo_fallback = { + events = { + # NEOW 2555: event not loaded. fp2_other_decisions.0703 + } +} + diff --git a/common/on_action/game_start.txt b/common/on_action/game_start.txt index e29f396a7..211880f0c 100644 --- a/common/on_action/game_start.txt +++ b/common/on_action/game_start.txt @@ -1016,6 +1016,151 @@ on_game_start = { } + + + # Silk & Silver: initialize NEOW merchant and republic rulers. + every_independent_ruler = { + if = { + limit = { has_gdp_dlc_trigger = yes } + ### GDP MERCHANT SETUP ### + if = { + limit = { government_has_flag = government_is_merchant } + # add_gold cannot be negative, so wipe then grant instead of (50 - gold). + if = { + limit = { gold > 0 } + remove_short_term_gold = gold + } + add_gold = 50 + if = { + limit = { prestige > 25 } + add_prestige = { + value = 25 + subtract = prestige + } + } + save_temporary_scope_as = merchant_scope + # Set CoA + primary_title = { + set_coa = scope:merchant_scope.house + set_variable = { name = merchant_creation_reason value = flag:historical } + set_variable = gdp_starting_merchant_company + } + random_held_title = { + limit = { is_noble_family_title = yes } + set_coa = holder.top_liege.house + } + # And tally our numbers for performance purposes. + add_to_global_variable_list = { + name = merchants_tally + target = this.primary_title + } + # Ruler-designer merchants spawn on the selected county; snap them to that market's capital. + if = { + limit = { + is_from_ruler_designer = yes + exists = location.barony.trade_market.trade_market_owner.title_province + } + location.barony.trade_market.trade_market_owner.title_province = { save_temporary_scope_as = merchant_market_capital } + random_held_title = { + limit = { is_noble_family_title = yes } + set_capital_county = scope:merchant_market_capital.county + } + domicile ?= { move_domicile = scope:merchant_market_capital } + set_location = scope:merchant_market_capital + } + start_tributary_interaction_effect = { + TRIBUTARY = this + SUZERAIN = domicile.domicile_location.county.holder # county holder + } + # Players start with a clean slate and build their company from the ground up. + if = { + limit = { + is_ai = no + } + add_character_flag = free_starting_merchant_purpose_change + if = { + limit = { + OR = { + has_realm_law = company_purpose_artisan + has_realm_law = company_purpose_caravaneer + has_realm_law = company_purpose_creditor + } + } + add_realm_law_skip_effects = company_purpose_family + merchant_company_law_remove_purpose_effect = yes + } + if = { + limit = { + OR = { + has_realm_law = company_size_medium + has_realm_law = company_size_large + has_realm_law = company_size_huge + } + } + add_realm_law_skip_effects = company_size_small + } + } + # Starting company purposes. + if = { + limit = { + is_ai = yes + NOR = { + has_realm_law = company_purpose_artisan + has_realm_law = company_purpose_caravaneer + has_realm_law = company_purpose_creditor + } + } + # Set some starting Company purposes + switch = { + trigger = highest_skill + learning = { add_realm_law_skip_effects = company_purpose_artisan } + diplomacy = { add_realm_law_skip_effects = company_purpose_caravaneer } + martial = { add_realm_law_skip_effects = company_purpose_creditor } + intrigue = { add_realm_law_skip_effects = company_purpose_creditor } + } + # Courtiers. + trigger_event = gdp_merchant.1001 + } + gdp_update_usury_reputation_effect = yes + trigger_event = gdp_merchant.1003 + + if = { + limit = { is_ai = yes } + set_starting_company_size_effect = yes + set_starting_company_acumen_effect = yes + } + } + ### GDP REPUBLIC SETUP ### + else_if = { + limit = { government_has_flag = government_is_republic } + every_noble_family = { + # Ensure Noble Family CoA match House + set_coa = holder.house + holder ?= { + # Consistent starting cash + if = { + limit = { gold > 0 } + remove_short_term_gold = gold + } + add_gold = 50 + save_scope_as = nf_holder + if = { + limit = { is_landed = yes } + capital_province = { save_scope_as = domicile_location } + } + # Ensure holders of historical noble family titles are the default house heads + house ?= { + if = { + limit = { house_head != scope:nf_holder } + set_house_head = scope:nf_holder + } + } + } + } + } + } + } + # To prevent the Season Changes event from triggering on game start situation:the_great_steppe ?= { every_participant_group = { @@ -1033,246 +1178,54 @@ on_game_start = { limit = { has_cp3_dlc_trigger = yes } - title:b_barcelona.title_province = { add_special_building_slot = drassanes_01 } #1892 - title:b_merv.title_province = { add_special_building = kyz_kala_01 } #4238 - if = { limit = { game_start_date >= 1178.10.1 } title:b_cluny.title_province = { add_special_building = cluny_abbey_02 } } #2304 - else_if = { limit = { game_start_date >= 1066.9.15 } title:b_cluny.title_province = { add_special_building = cluny_abbey_01 } } - else = { title:b_cluny.title_province = { add_special_building_slot = cluny_abbey_01 } } - title:b_york.title_province = { add_special_building = york_walls_01 } #1595 - title:b_damascus.title_province = { add_special_building = damascus_mosque_01 } #5924 - title:b_lhasa.title_province = { add_special_building = jokhang_01 } #9237 - if = { limit = { game_start_date >= 1178.10.1 } title:b_schmalkalden.title_province = { add_special_building = wartburg_01 } } #3010 - else = { title:b_schmalkalden.title_province = { add_special_building_slot = wartburg_01 } } - title:b_lalibela.title_province = { add_special_building_slot = beta_giyorgis_01 } #8301 - if = { limit = { game_start_date >= 1066.9.15 } title:b_novgorod.title_province = { add_special_building = holy_wisdom_01 } } #5137 - else = { title:b_novgorod.title_province = { add_special_building_slot = holy_wisdom_01 } } - title:b_kano.title_province = { add_special_building_slot = kano_walls_01 } #6519 - title:b_somapur.title_province = { add_special_building = somapura_university_01 } #848 - if = { limit = { game_start_date >= 1178.10.1 } title:b_firenze.title_province = { add_special_building = duomo_florence_02 } } #2543 - else = { title:b_firenze.title_province = { add_special_building = duomo_florence_01 } } - title:b_konarak.title_province = { add_special_building_slot = konark_temple_01 } #928 - title:b_fes.title_province = { add_special_building = al_qarawiyyin_university_01 } #4694 - title:b_kairouan.title_province = { add_special_building = kairouan_basins_01 } #4594 - title:b_al-ghaba.title_province = { add_special_building = ghana_palace_01 } #6628 #NOTE: likely existed since the 8th, but earliest (only) source on palace is from 1068 - title:b_visegrad_hun.title_province = { add_special_building_slot = visegrad_castle_01 } #3803 - if = { limit = { game_start_date >= 1161.9.15 } title:b_leczyca.title_province = { add_special_building = wawel_cathedral_01 } } #4924 #Date of consecreation of Archcollegiate Church of St. Mary and St. Alexius in Tum - else = { title:b_leczyca.title_province = { add_special_building_slot = wawel_cathedral_01 } } - title:b_vatapi.title_province = { add_special_building = vatapi_caves_01 } #1198 - if = { limit = { game_start_date >= 1178.10.1 } title:b_jaisalmer.title_province = { add_special_building = jaisalmer_fort_01 } } #3387 - else = { title:b_jaisalmer.title_province = { add_special_building_slot = jaisalmer_fort_01 } } #3387 + title:b_barcelona.title_province = { add_special_district_slot = drassanes_01_district } #1892 + title:b_merv.title_province = { add_special_district = kyz_kala_01_district } #4238 + if = { limit = { game_start_date >= 1178.10.1 } title:b_cluny.title_province = { add_special_district = cluny_abbey_01_district special_district = { add_building = cluny_abbey_02 } } } #2304 + else_if = { limit = { game_start_date >= 1066.9.15 } title:b_cluny.title_province = { add_special_district = cluny_abbey_01_district } } + else = { title:b_cluny.title_province = { add_special_district_slot = cluny_abbey_01_district } } + title:b_york.title_province = { add_special_district = york_walls_01_district } #1595 + title:b_damascus.title_province = { add_special_district = damascus_mosque_01_district } #5924 + title:b_lhasa.title_province = { add_special_district = jokhang_01_district } #9237 + if = { limit = { game_start_date >= 1178.10.1 } title:b_schmalkalden.title_province = { add_special_district = wartburg_01_district } } #3010 + else = { title:b_schmalkalden.title_province = { add_special_district_slot = wartburg_01_district } } + title:b_lalibela.title_province = { add_special_district_slot = beta_giyorgis_01_district } #8301 + if = { limit = { game_start_date >= 1066.9.15 } title:b_novgorod.title_province = { add_special_district = holy_wisdom_01_district } } #5137 + else = { title:b_novgorod.title_province = { add_special_district_slot = holy_wisdom_01_district } } + title:b_kano.title_province = { add_special_district_slot = kano_walls_01_district } #6519 + title:b_somapur.title_province = { add_special_district = somapura_university_01_district } #848 + if = { limit = { game_start_date >= 1178.10.1 } title:b_firenze.title_province = { add_special_district = duomo_florence_01_district } } #2543 + else = { title:b_firenze.title_province = { add_special_district = duomo_florence_01_district } } + title:b_konarak.title_province = { add_special_district_slot = konark_temple_01_district } #928 + title:b_fes.title_province = { add_special_district = al_qarawiyyin_university_01_district } #4694 + title:b_kairouan.title_province = { add_special_district = kairouan_basins_01_district } #4594 + title:b_al-ghaba.title_province = { add_special_district = ghana_palace_01_district } #6628 #NOTE: likely existed since the 8th, but earliest (only) source on palace is from 1068 + title:b_visegrad_hun.title_province = { add_special_district_slot = visegrad_castle_01_district } #3803 + if = { limit = { game_start_date >= 1161.9.15 } title:b_leczyca.title_province = { add_special_district = wawel_cathedral_01_district } } #4924 #Date of consecreation of Archcollegiate Church of St. Mary and St. Alexius in Tum + else = { title:b_leczyca.title_province = { add_special_district_slot = wawel_cathedral_01_district } } + title:b_vatapi.title_province = { add_special_district = vatapi_caves_01_district } #1198 + if = { limit = { game_start_date >= 1178.10.1 } title:b_jaisalmer.title_province = { add_special_district = jaisalmer_fort_01_district } } #3387 + else = { title:b_jaisalmer.title_province = { add_special_district_slot = jaisalmer_fort_01_district } } #3387 } ### RELIGIOUS THINGS ### # Set up Holy Site Buildings to be buildable in Holy Sites - religion:islam_religion = { - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_mosque_01 - } - } - } - - } - religion:eastern_orthodox_religion = { - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_cathedral_01 - } - } - } - } - religion:catholic_religion = { - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_cathedral_01 - } - } - } - } - religion:protestant_religion = { - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_cathedral_01 - } - } - } - } - religion:zoroastrianism_religion = { - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_fire_temple_01 - } - } - } - } - religion:buddhism_religion = { - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_buddhist_grand_temple_01 - } - } - } - } -# religion:shintoism_religion = { -# every_faith = { -# every_holy_site = { -# limit = { -# title_province = { -# has_special_building_slot = no -# } -# } -# title_province = { -# add_special_building_slot = holy_site_japanese_temple_01 -# } -# } -# } -# } -# religion:taoism_religion = { -# every_faith = { -# every_holy_site = { -# limit = { -# title_province = { -# has_special_building_slot = no -# } -# } -# title_province = { -# add_special_building_slot = holy_site_chinese_temple_01 -# } -# } -# } -# } -# religion:confucianism_religion = { -# every_faith = { -# every_holy_site = { -# limit = { -# title_province = { -# has_special_building_slot = no -# } -# } -# title_province = { -# add_special_building_slot = holy_site_chinese_temple_01 -# } -# } -# } -# } -# every_religion_global = { -# limit = { -# OR = { -# this = religion:hinduism_religion -# this = religion:jainism_religion -# this = religion:tani_religion -# this = religion:bon_religion -# } -# } -# every_faith = { -# every_holy_site = { -# limit = { -# title_province = { -# has_special_building_slot = no -# } -# } -# title_province = { -# add_special_building_slot = holy_site_indian_grand_temple_01 -# } -# } -# } -# } -# every_religion_global = { -# limit = { -# OR = { -# this = religion:satsana_phi_religion -# this = religion:dayawism_religion -# this = religion:hantuism_religion -# this = religion:satsana_phi_religion -# this = religion:kaharingan_religion -# this = religion:tolotang_religion -# this = religion:aluk_religion -# this = religion:dab_qhuas_religion -# this = religion:biliku_religion -# } -# } -# every_faith = { -# every_holy_site = { -# limit = { -# title_province = { -# has_special_building_slot = no -# } -# } -# title_province = { -# add_special_building_slot = holy_site_se_asia_pagan_temple_01 -# } -# } -# } -# } - every_religion_global = { - limit = { - is_in_family = rf_pagan - } - every_faith = { - every_holy_site = { - limit = { - title_province = { - has_special_building_slot = no - } - } - title_province = { - add_special_building_slot = holy_site_pagan_grand_temple_01 - } - } - } - } every_religion_global = { every_faith = { - every_holy_site = { + save_scope_as = holy_site_faith + every_holy_site_barony = { limit = { title_province = { - has_special_building_slot = no + has_special_district_slot = no } } title_province = { - add_special_building_slot = holy_site_other_grand_temple_01 + add_holy_site_fallback_special_district_slot_effect = { FAITH = scope:holy_site_faith } } } } } -# # If your capital on game start is Mecca, you get the Hajjaj trait (since you can't Hajj to your capital) + # If your capital on game start is Mecca, you get the Hajjaj trait (since you can't Hajj to your capital) # title:b_makka.county.holder = { # if = { # limit = { @@ -1372,59 +1325,59 @@ on_game_start = { title:b_fes.title_province = { if = { limit = { - has_special_building_slot = no #Depends on DLC + has_special_district_slot = no #Depends on DLC } - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district } } title:b_somapur.title_province = { if = { limit = { - has_special_building_slot = no #Depends on DLC + has_special_district_slot = no #Depends on DLC } - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district } } - #title:b_bologna.title_province = { add_special_building_slot = generic_university } # Added in province history - title:b_salamanca.title_province = { add_special_building_slot = generic_university } - title:b_madrid.title_province = { add_special_building_slot = generic_university } - #title:b_oxford.title_province = { add_special_building_slot = generic_university } # Added in province history - title:b_cambridge.title_province = { add_special_building_slot = generic_university } - title:b_padua.title_province = { add_special_building_slot = generic_university } - title:b_coimbra.title_province = { add_special_building_slot = generic_university } - title:b_napoli.title_province = { add_special_building_slot = generic_university } - title:b_milano.title_province = { add_special_building_slot = generic_university } - title:b_vienna.title_province = { add_special_building_slot = generic_university } - title:b_praha.title_province = { add_special_building_slot = generic_university } - title:b_perugia.title_province = { add_special_building_slot = generic_university } - title:b_malappuram.title_province = { add_special_building_slot = generic_university } - title:b_janakpur.title_province = { add_special_building_slot = generic_university } - title:b_uppsala.title_province = { add_special_building_slot = generic_university } - title:b_montlhery.title_province = { add_special_building_slot = generic_university } # Technically should be Paris, but that's occupied by Notre Dame - title:b_qartajana.title_province = { add_special_building_slot = generic_university } # Technically should be Tunis, but that's occupied by a cathedral - title:b_wazwan.title_province = { add_special_building_slot = generic_university } # Technically should be Isfahan, but that's occupied by the Friday Mosque - title:b_sarsar.title_province = { add_special_building_slot = generic_university } # Technically should be Baghdad, but that's occupied by the House of Wisdom - title:b_speyer.title_province = { add_special_building_slot = generic_university } # 1350ish, should be in Heidelberg but that's a church - title:b_krakow.title_province = { add_special_building_slot = generic_university } # 1364 - title:b_pisa.title_province = { add_special_building_slot = generic_university } # 1350ish - title:b_rostock.title_province = { add_special_building_slot = generic_university } # 1400ish - title:b_turin.title_province = { add_special_building_slot = generic_university } # 1400ish - title:b_ferrara.title_province = { add_special_building_slot = generic_university } # 1400ish - title:b_leipzig.title_province = { add_special_building_slot = generic_university } # 1400ish, a city holding - title:b_messina.title_province = { add_special_building_slot = generic_university } # 1400ish, should be in Catania but that's a church + #title:b_bologna.title_province = { add_special_district_slot = generic_university_district } # Added in province history + title:b_salamanca.title_province = { add_special_district_slot = generic_university_district } + title:b_madrid.title_province = { add_special_district_slot = generic_university_district } + #title:b_oxford.title_province = { add_special_district_slot = generic_university_district } # Added in province history + title:b_cambridge.title_province = { add_special_district_slot = generic_university_district } + title:b_padua.title_province = { add_special_district_slot = generic_university_district } + title:b_coimbra.title_province = { add_special_district_slot = generic_university_district } + title:b_napoli.title_province = { add_special_district_slot = generic_university_district } + title:b_milano.title_province = { add_special_district_slot = generic_university_district } + title:b_vienna.title_province = { add_special_district_slot = generic_university_district } + title:b_praha.title_province = { add_special_district_slot = generic_university_district } + title:b_perugia.title_province = { add_special_district_slot = generic_university_district } + title:b_malappuram.title_province = { add_special_district_slot = generic_university_district } + title:b_janakpur.title_province = { add_special_district_slot = generic_university_district } + title:b_uppsala.title_province = { add_special_district_slot = generic_university_district } + title:b_montlhery.title_province = { add_special_district_slot = generic_university_district } # Technically should be Paris, but that's occupied by Notre Dame + title:b_qartajana.title_province = { add_special_district_slot = generic_university_district } # Technically should be Tunis, but that's occupied by a cathedral + title:b_wazwan.title_province = { add_special_district_slot = generic_university_district } # Technically should be Isfahan, but that's occupied by the Friday Mosque + title:b_sarsar.title_province = { add_special_district_slot = generic_university_district } # Technically should be Baghdad, but that's occupied by the House of Wisdom + title:b_speyer.title_province = { add_special_district_slot = generic_university_district } # 1350ish, should be in Heidelberg but that's a church + title:b_krakow.title_province = { add_special_district_slot = generic_university_district } # 1364 + title:b_pisa.title_province = { add_special_district_slot = generic_university_district } # 1350ish + title:b_rostock.title_province = { add_special_district_slot = generic_university_district } # 1400ish + title:b_turin.title_province = { add_special_district_slot = generic_university_district } # 1400ish + title:b_ferrara.title_province = { add_special_district_slot = generic_university_district } # 1400ish + title:b_leipzig.title_province = { add_special_district_slot = generic_university_district } # 1400ish, a city holding + title:b_messina.title_province = { add_special_district_slot = generic_university_district } # 1400ish, should be in Catania but that's a church if = { limit = { has_cp3_dlc_trigger = yes } - title:b_sitges.title_province = { add_special_building_slot = generic_university } # Should be Barcelona but that location has another building now + title:b_sitges.title_province = { add_special_district_slot = generic_university_district } # Should be Barcelona but that location has another building now } else = { - title:b_barcelona.title_province = { add_special_building_slot = generic_university } # 1450ish, but still fun to build + title:b_barcelona.title_province = { add_special_district_slot = generic_university_district } # 1450ish, but still fun to build } - title:b_dumbarton.title_province = { add_special_building_slot = generic_university } # 1450ish, but still fun to build - title:b_bidar.title_province = { add_special_building_slot = generic_university } # 1450ish, but still fun to build + title:b_dumbarton.title_province = { add_special_district_slot = generic_university_district } # 1450ish, but still fun to build + title:b_bidar.title_province = { add_special_district_slot = generic_university_district } # 1450ish, but still fun to build title:b_changsha.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district } ### GREAT WALL OF CHINA ### @@ -2755,7 +2708,7 @@ on_game_start = { add_to_global_variable_list = { name = earthquake_region_list target = geographical_region:sichuan_myanmar_earthquake_region } add_to_global_variable_list = { name = earthquake_region_list target = geographical_region:south_china_coastaline_earthquake_region } add_to_global_variable_list = { name = earthquake_region_list target = geographical_region:north_china_earthquake_region } - add_to_global_variable_list = { name = earthquake_region_list target = geographical_region:mongolia_baikal_earthquake_region } + # add_to_global_variable_list = { name = earthquake_region_list target = geographical_region:mongolia_baikal_earthquake_region } # NEOW 2555: Mongolian region not in mod map add_to_global_variable_list = { name = earthquake_region_list target = geographical_region:central_asian_earthquake_region } ### TGP Flood Regions @@ -2792,7 +2745,7 @@ on_game_start = { add_to_global_variable_list = { name = flood_region_list target = geographical_region:yangtze_river_region } add_to_global_variable_list = { name = flood_region_list target = geographical_region:yellow_river_region } ##### HISTORICAL HOUSE RELATIONS - deliberately placed above blocs - tgp_setup_historical_house_relation_effect = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. tgp_setup_historical_house_relation_effect = yes ##### TGP JAPAN ##### if = { limit = { has_tgp_dlc_trigger = yes } @@ -2847,6 +2800,12 @@ on_game_start = { on_game_start_after_lobby = { effect = { disable_succession_calculation = yes + + # Silk & Silver: spawn compatible merchants around NEOW player realms. + if = { + limit = { has_gdp_dlc_trigger = yes } + every_player = { gdp_create_starting_merchants_near_player_effect = yes } + } # To prevent the Season Changes event from triggering on game start situation:the_great_steppe ?= { @@ -3670,7 +3629,7 @@ on_game_start_after_lobby = { # has_trait = dull # has_trait = intellect_bad # location.county ?= { -# development_level <= bad_development_level +# prosperity_level <= bad_prosperity_level # } # } # } @@ -15811,7 +15770,7 @@ on_game_start_after_lobby = { } ### DYNASTY TRACKING SETUP - japan_dynasty_tracker_setup_effect = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. japan_dynasty_tracker_setup_effect = yes ### TGP NOBLE FAMILIES & DOMICILE SETUP ### @@ -16144,15 +16103,15 @@ on_game_start_after_lobby = { # } every_in_list = { list = holder_to_learn_chinese - tgp_learn_chinese_effect_game_start = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. tgp_learn_chinese_effect_game_start = yes if = { limit = { is_independent_ruler = yes } every_noble_family = { holder ?= { - tgp_learn_chinese_effect_game_start = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. tgp_learn_chinese_effect_game_start = yes house = { every_house_member = { - tgp_learn_chinese_effect_game_start = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. tgp_learn_chinese_effect_game_start = yes } } } @@ -16176,7 +16135,7 @@ on_game_start_after_lobby = { has_holding = yes } generate_building = yes - brewery_counter_start_effect = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. brewery_counter_start_effect = yes } every_domicile = { limit = { exists = owner } @@ -16200,9 +16159,9 @@ on_game_start_after_lobby = { owner.culture ?= { has_innovation = innovation_city_planning } } add_domicile_building = japanese_manor_main_02 - add_random_internal_japanese_manor_building = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. add_random_internal_japanese_manor_building = yes } - fill_external_japanese_manor_building_effect = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. fill_external_japanese_manor_building_effect = yes } east_asian_estate = { if = { @@ -16238,57 +16197,57 @@ on_game_start_after_lobby = { generate_building = yes if = { limit = { - county.development_level >= 8 + county.prosperity_level >= 8 } generate_building = yes generate_building = yes } if = { limit = { - county.development_level >= 10 + county.prosperity_level >= 10 } generate_building = yes } if = { limit = { - county.development_level >= 12 + county.prosperity_level >= 12 } generate_building = yes } if = { limit = { - county.development_level >= 14 + county.prosperity_level >= 14 } generate_building = yes generate_building = yes } if = { limit = { - county.development_level >= 16 + county.prosperity_level >= 16 } generate_building = yes } if = { limit = { - county.development_level >= 18 + county.prosperity_level >= 18 } generate_building = yes } if = { limit = { - county.development_level >= 20 + county.prosperity_level >= 20 } generate_building = yes } if = { limit = { - county.development_level >= 25 + county.prosperity_level >= 25 } generate_building = yes generate_building = yes generate_building = yes } - brewery_counter_start_effect = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. brewery_counter_start_effect = yes } every_domicile = { #if = { # Left in if we want adventurers to spawn with stuff @@ -16444,7 +16403,7 @@ on_game_start_after_lobby = { owner.culture ?= { has_innovation = innovation_city_planning } } add_domicile_building = japanese_manor_main_02 - add_random_internal_japanese_manor_building = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. add_random_internal_japanese_manor_building = yes } if = { limit = { @@ -16455,10 +16414,10 @@ on_game_start_after_lobby = { add_domicile_building = japanese_manor_main_03 while = { count = 2 - add_random_internal_japanese_manor_building = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. add_random_internal_japanese_manor_building = yes } } - fill_external_japanese_manor_building_effect = yes + # NEOW 2555: inactive; corresponding historical scripted effect was disabled. fill_external_japanese_manor_building_effect = yes } east_asian_estate = { if = { @@ -16781,6 +16740,40 @@ on_game_start_after_lobby = { } set_global_variable = game_has_started + # Silk & Silver: finish merchant and republic setup after NEOW world initialization. + if = { + limit = { has_gdp_dlc_trigger = yes } + every_domicile = { + limit = { + is_domicile_type = merchant_company + owner ?= { + OR = { + has_realm_law = company_size_large + has_realm_law = company_size_huge + } + } + } + gdp_raise_starting_company_buildings_effect = { FROM = 01 TO = 02 } + if = { + limit = { + owner = { has_realm_law = company_size_huge } + } + gdp_raise_starting_company_buildings_effect = { FROM = 02 TO = 03 } + } + } + every_player = { + if = { + limit = { + government_has_flag = government_is_republic + } + house = { + set_house_aspiration = { type = republic_no_ambition } + } + } + gdp_trade_envoys_resume_idle_traders_effect = yes + } + } + enable_and_run_succession_calculation = yes } @@ -16789,6 +16782,8 @@ on_game_start_after_lobby = { historical_artifacts.0050 historical_artifacts.0023 # Historical Artifacts Generator coronation_events.0302 # ACH crown giveaway + + } } diff --git a/common/on_action/inventory_on_actions.txt b/common/on_action/inventory_on_actions.txt index 95e5df116..bb4c871ad 100644 --- a/common/on_action/inventory_on_actions.txt +++ b/common/on_action/inventory_on_actions.txt @@ -24,6 +24,49 @@ on_artifact_changed_owner = { on_action = on_artifact_claim_gained } } + if = { + limit = { + gdp_menagerie_artifact_has_active_story_trigger = { CHARACTER = scope:old_owner ARTIFACT = scope:artifact } + } + scope:old_owner = { + random_owned_story = { + limit = { + story_type = story_cycle_menagerie + var:artifact_type ?= scope:artifact + } + if = { + limit = { + scope:artifact = { artifact_type = creature } + scope:owner = { + domicile ?= { is_domicile_type = merchant_company } + } + } + make_story_owner = scope:owner + } + else = { + end_story = yes + } + } + } + } + # GDP Associate promise + scope:owner = { + if = { + limit = { + var:associate_request_type ?= flag:artifact + var:associate_request_merchant ?= scope:old_owner + scope:old_owner = { + any_in_list = { + variable = associate_requests + this = scope:owner + } + } + } + scope:old_owner = { + gdp_merchant_associate_promise_completed_merchant_effect = { ASSOCIATE = scope:owner } + } + } + } } # Re-identify the Chad/Ironside skull whenever it changes hands. diff --git a/common/on_action/prison_on_actions.txt b/common/on_action/prison_on_actions.txt new file mode 100644 index 000000000..402cc0153 --- /dev/null +++ b/common/on_action/prison_on_actions.txt @@ -0,0 +1,537 @@ +#On actions directing prison-related events +#Note that prison stress events are handled through the Stress on-actions. + + +# Code on-action: character being imprisoned in root scope +# imprisoning character set as scope:imprisoner +on_imprison = { + effect = { # You no longer make such decisions over your life :( + # EP2: Cancel associated activity and travel plan if they exist + if = { + limit = { + exists = involved_activity + involved_activity.activity_host = root + } + invalidate_activity = root.involved_activity + } + else_if = { + limit = { + exists = involved_activity + } + remove_from_activity = involved_activity + } + + current_travel_plan ?= { + if = { + limit = { + travel_plan_owner = root + } + abort_travel_plan = yes + } + else = { + remove_character = root + } + } + + if = { + limit = { + has_character_flag = travel_option_added_character + } + remove_character_flag = travel_option_added_character + } + + if = { + limit = { has_character_modifier = gaining_weight_modifier } + remove_character_modifier = gaining_weight_modifier + } + if = { + limit = { has_character_modifier = losing_weight_modifier } + remove_character_modifier = losing_weight_modifier + } + if = { # from event hold_court.6140 + limit = { + scope:imprisoner = { + has_character_modifier = 6140_pet_modifier + OR = { + has_trait = torturer + has_trait = callous + has_trait = sadistic + } + } + } + add_character_modifier = 6140_animal_guardian_modifier + } + + # Struggle Catalysts + if = { + limit = { + is_important_or_vip_struggle_character = yes + any_character_struggle = { + involvement = involved + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_imprison_important + CHAR = scope:imprisoner + } + } + } + every_character_struggle = { + involvement = involved + limit = { + activate_struggle_catalyst_secondary_character_involvement_involved_trigger = { + CATALYST = catalyst_imprison_important + CHAR = scope:imprisoner + } + } + activate_struggle_catalyst = { + catalyst = catalyst_imprison_important + character = scope:imprisoner + } + } + } + if = { + limit = { + has_trait = fp3_struggle_supporter + any_character_struggle = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_imprison_supporter + CHAR = scope:imprisoner + } + } + } + every_character_struggle = { + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_imprison_supporter + CHAR = scope:imprisoner + } + } + activate_struggle_catalyst = { + catalyst = catalyst_imprison_supporter + character = scope:imprisoner + } + log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_imprison_supporter } + } + } + if = { + limit = { + has_trait = fp3_struggle_detractor + any_character_struggle = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_imprison_detractor + CHAR = scope:imprisoner + } + } + } + every_character_struggle = { + limit = { + activate_struggle_catalyst_secondary_character_involvement_either_trigger = { + CATALYST = catalyst_imprison_detractor + CHAR = scope:imprisoner + } + } + activate_struggle_catalyst = { + catalyst = catalyst_imprison_detractor + character = scope:imprisoner + } + log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_imprison_detractor } + } + } + if = { + limit = { + has_pam_dlc_trigger = yes + any_held_title = { is_head_of_faith = yes } + scope:imprisoner = { + religion = religion:christianity_religion + any_character_situation = { + situation_type = the_christian_church + situation_top_has_catalyst = catalyst_the_christian_church_ruler_imprisons_head_of_faith + } + } + } + situation:the_christian_church = { + trigger_situation_catalyst = catalyst_the_christian_church_ruler_imprisons_head_of_faith + } + } + #Guelphs & Ghibellines + if = { + limit = { + OR = { + is_guelph_leader_trigger = yes + is_ghibelline_leader_trigger = yes + } + } + gg_triggered_catalyst_effect = { + ACTOR = scope:imprisoner + RECIPIENT = root + CATALYST = catalyst_gg_leader_imprisoned + } + } + + # Memory system + create_character_memory = { + type = imprisoned + participants = { imprisoner = scope:imprisoner } + } + if = { + limit = { + is_adult = no + } + scope:new_memory = { + set_variable = childhood_memory + } + } + + if = { + limit = { + has_bp2_dlc_trigger = yes + is_adult = yes + any_memory = { + memory_type = imprisoned + has_variable = childhood_memory + } + } + trigger_event = { + id = bp2_yearly.4031 + days = 10 + } + } #You were imprisoned as a child, and guess what? You are imprisoned as an adult. Congratulations! + + if = { + limit = { + OR = { + is_of_major_interest_trigger = { CHARACTER = scope:imprisoner } + AND = { + exists = scope:imprisoner.primary_title.tier + highest_held_title_tier >= scope:imprisoner.primary_title.tier + } + highest_held_title_tier >= tier_kingdom + } + } + root = { save_scope_as = prisoner_memory } + scope:imprisoner = { # We must buffer this memory via events, otherwise the imprisonment shows up before tyranny/faction wars end + trigger_event = error_suppression.0003 + } + } + if = { # Set up so you can't banish realm priests, and so that they transfer their gold to the next realm priest if possible + limit = { + is_theocratic_lessee = yes + } + add_character_flag = realm_priest + save_scope_as = realm_priest_transfer + if = { + limit = { + exists = liege + } + liege = { + trigger_event = { + days = 2 # Queued, so we can check the pulse in parallel + id = prison.8000 + } + } + } + } + if = { + limit = { + has_bp2_dlc_trigger = yes + scope:imprisoner = { + any_memory = { + memory_type = relative_died + any_memory_participant = { + exists = this.killer + killer = { + is_imprisoned_by = root + } + } + has_variable = childhood_memory + } + } + } + scope:imprisoner = { + trigger_event = { + id = bp2_yearly.4001 + days = 1 + } + } + } + + house ?= { + change_house_relation_effect = { + HOUSE = scope:imprisoner.house + VALUE = house_relation_damage_medium_value + REASON = imprisonment + CHAR = scope:imprisoner + TARGET_CHAR = root + TITLE = scope:dummy_gender + } + } + + # Paiza + if = { + limit = { + reverse_has_opinion_modifier = { + target = scope:imprisoner + modifier = gravely_abused_paiza_authority + } + } + scope:imprisoner = { + add_character_flag = { + flag = paiza_abuse_punished + years = 15 + } + } + } + + # Charter + if = { + limit = { government_has_flag = government_is_merchant } + if = { + limit = { + reverse_has_opinion_modifier = { + target = scope:imprisoner + modifier = gravely_abused_charter_authority_opinion + } + } + scope:imprisoner = { + add_character_flag = { + flag = merchant_charter_abuse_punished + years = 50 + } + } + } + if = { + limit = { + suzerain ?= scope:imprisoner + } + # Destroy charters of imprisoned merchants + merchant_charter_destroy_held_charters_effect = { + MERCHANT = this + PATRON = scope:imprisoner + } + } + } + + # Partner contracts + if = { + limit = { exists = var:partner_contract } + trade_opportunity_partner_invalidated_effect = { PARTNER = this } + } + } + events = { + prison_notification.0001 + stewardship_duty.1066 # You imprison your client and prevent them from working for you. + # NEOW 2555: event not loaded. bookmark.0003 # King Aella gets imprisoned by one of Ragnarr Lodbrok's sons + martial_authority.2052 # Right-Hand Person Imprisoned (by you) + martial_authority.2053 # Right-Hand Person Imprisoned (by someone else) + diarchy.0001 # You're forced into a regency + delay = { + days = { 1 180 } + } + diarchy.8021 # The AI captures their co-emperor. + } +} + +# Code on-action: character released from prison in root scope. Does not fire when "released" due to dying +# imprisoning character set as scope:imprisoner +on_release_from_prison = { + effect = { + # We give you a cool chapter if you escaped from prison lol + if = { + limit = { + has_legend_chapter_trigger = { CHAPTER = extra_deed } + NOT = { + promoted_legend ?= { + has_legend_chapter = { + name = extra_deed + localization_key = legend_chapter_extra_deed_recent_imprisonment + } + } + } + } + random = { + chance = 75 + send_interface_toast = { + title = legend_chapter_change_toast + left_icon = root + promoted_legend = { + set_legend_chapter = { + name = extra_deed + localization_key = legend_chapter_extra_deed_recent_imprisonment + } + } + } + } + } + if = { + limit = { # Uses flag to stop escape + release memories being created at same time + NOT = { has_character_flag = escaped_from_prison_flag } + } + create_character_memory = { + type = released_from_prison_memory + + participants = { + imprisoner = scope:imprisoner + } + } + } + # No prison, no problem. + if = { + limit = { has_character_modifier = gruesome_festivals_designated_sacrifice_fp1_modifier } + remove_character_modifier = gruesome_festivals_designated_sacrifice_fp1_modifier + } + if = { #from event hold_court.6140 + limit = { has_character_modifier = 6140_animal_guardian_modifier } + remove_character_modifier = 6140_animal_guardian_modifier + } + if = { + limit = { has_character_flag = realm_priest } + remove_character_flag = realm_priest + } + if = { + limit = { has_character_flag = rival_on_exit_prison } + remove_character_flag = rival_on_exit_prison + + # imprisoner has to still be valid and alive + if = { + limit = { + scope:imprisoner ?= { is_alive = yes } + } + set_relation_rival_effect = { + TARGET = scope:imprisoner + REASON = rival_was_kept_in_jail + } + } + } + if = { + limit = { has_variable = imprisoned_by_diarch } + remove_variable = imprisoned_by_diarch + } + if = { + limit = { has_character_flag = being_prisonbroken_by_laamp } + remove_character_flag = being_prisonbroken_by_laamp + } + scope:imprisoner ?= { + gdp_clear_indicted_character_effect = { TARGET = root } + } + # Struggle bonus + } + + events = { + prison.0001 # Remove imprisoned_me modifier, consume imprisonment reasons the imprisoner had + prison_notification.2001 + intrigue_dread.4010 # Interrupts this event chain for the imprisoner when their prisoner is freed. + human_sacrifice.0003 # Is the character marked for human sacrifice? + martial_authority.2054 # Right-hand wo/man released + } +} + + + +################ +# MAINTENANCE +################ +quarterly_prison_maintenance_pulse = { + trigger = { + any_prisoner = { } + } + effect = { #Fire the correct events for all prisoners + every_prisoner = { + limit = { + is_in_prison_type = house_arrest + } + trigger_event = { + days = 1 # Queued, so we can check the pulse in parallel + on_action = house_arrest_ongoing + } + } + every_prisoner = { + limit = { + is_in_prison_type = dungeon + } + trigger_event = { + days = 1 # Queued, so we can check the pulse in parallel + on_action = dungeon_ongoing + } + } + } +} + +######## +#Dungeon on_actions +######## +dungeon_ongoing = { + trigger = { + exists = imprisoner #Don't fire if we've been released since the on_action was called. + } + + random_events = { + chance_to_happen = 50 + 500 = 0 + 100 = dungeon_ongoing.0001 #Crazy neighbor bothers you + 200 = dungeon_ongoing.0002 #Wait patiently - or not + 100 = dungeon_ongoing.0003 #Guards threaten you with violence + 200 = dungeon_ongoing.0004 #A wound becomes infected + 50 = dungeon_ongoing.0005 #Infection passes + 200 = dungeon_ongoing.0006 #Prison has low standards - unless you are Content + 100 = dungeon_ongoing.0007 #It is terrible to be Ambitious and in prison + 100 = dungeon_ongoing.0008 #Impatient, and have stayed in the dungeon "forever" + 100 = dungeon_ongoing.0009 #You prison pet is there to comfort you + 100 = dungeon_ongoing.0010 #Write to a relative asking for help + 100 = dungeon_ongoing.0015 #A friend or relative pays your ransom + 100 = dungeon_ongoing.9006 #You can't afford ransom and barter for release + + #Long-term imprisonment events: + 500 = dungeon_ongoing.9001 #Become ill + 500 = dungeon_ongoing.9002 #Become pneumonic + 500 = dungeon_ongoing.9003 #Gain stress + 500 = dungeon_ongoing.9004 #Gain stress + 500 = dungeon_ongoing.9005 #Prison Pet Dies + } +} + + +####### +# House Arrest on_actions +####### +house_arrest_ongoing = { + trigger = { + exists = imprisoner #Don't fire if we've been released since the on_action was called. + } + + random_events = { + 100 = house_arrest_ongoing.0001 #To be ambitious is terrible + 100 = house_arrest_ongoing.0002 #To be arrogant is terrible + 100 = house_arrest_ongoing.0003 #Missing love ones + 100 = house_arrest_ongoing.0004 #Friend at court helps you + 100 = house_arrest_ongoing.0005 #Rival at court is a nuisance + 100 = dungeon_ongoing.0010 #Write to a relative asking for help + 100 = dungeon_ongoing.0015 #A friend or relative pays your ransom + } +} + +######### +# Escape from prison (attempt) +######### +escape_from_prison = { + events = { + prison.9000 + } +} + +escape_from_prison_success = { + random_events = { + 1 = prison.9001 #You escaped! + 100 = prison.9002 #You escaped thanks to your prison pet + 100 = prison.9003 #You escape with friend or close family member + } +} + +escape_from_prison_failure = { + random_events = { + 10 = prison.9501 #You're still stuck, buttercup... :( + 100 = prison.9502 #You and your prison pet failed + 100 = prison.9503 #Your friend or close family member leave you behind + 200 = fp1_shieldmaiden.0011 #Your imprisoner's shieldmaiden stymies your escape. + 50 = prison.9504 #Rival sabotages escape + 5 = prison.9505 #Become wounded + } +} diff --git a/common/on_action/province_on_actions.txt b/common/on_action/province_on_actions.txt index f117887a5..fdd6fe645 100644 --- a/common/on_action/province_on_actions.txt +++ b/common/on_action/province_on_actions.txt @@ -2,6 +2,32 @@ # scope:character: The character that paid for the construction, if available on_building_completed = { effect = { + # Notify the merchant who sponsored this construction, if any + if = { + limit = { has_variable = merchant_construction_sponsor } + if = { + limit = { + var:merchant_construction_sponsor ?= { is_alive = yes } + } + barony = { save_scope_as = barony } + var:merchant_construction_sponsor = { + send_interface_message = { + type = msg_sponsored_building_done + title = merchant_sponsor_construction_complete_title + desc = merchant_sponsor_construction_complete_desc + right_icon = scope:barony + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = merchant_sponsor_construction_xp_value + } + } + } + } + remove_variable = merchant_construction_sponsor + remove_variable = merchant_construction_cost + } + # Bonus only come with buildings acctually constructed by you scope:character ?= { if = { @@ -50,7 +76,7 @@ on_building_completed = { title = building_temples_gives_development_toast left_icon = root.county root.county = { - change_development_progress_with_overflow = minor_development_progress_gain + change_prosperity_progress_with_overflow = minor_prosperity_progress_gain set_variable = { name = dev_gain_cooldown value = yes @@ -73,7 +99,7 @@ on_building_completed = { title = tenet_pentarchy_development_growth_in_holy_sites_toast left_icon = scope:character root.county = { - change_development_progress_with_overflow = medium_development_progress_gain + change_prosperity_progress_with_overflow = medium_prosperity_progress_gain set_variable = { name = dev_gain_cooldown value = yes @@ -91,7 +117,7 @@ on_building_completed = { NOT = { county = { has_variable = dev_gain_cooldown } } } county = { - change_development_progress_with_overflow = 25 + change_prosperity_progress_with_overflow = 25 set_variable = { name = dev_gain_cooldown value = yes @@ -244,14 +270,14 @@ on_building_completed = { random = { chance = 10 modifier = { - add = county.development_level + add = county.prosperity_level } set_variable = { name = number_prestigious_new_guests value = 1 } if = { - limit = { county.development_level >= max_development_level } + limit = { county.prosperity_level >= max_prosperity_level } set_variable = { name = holding_quality @@ -259,28 +285,28 @@ on_building_completed = { } } else_if = { - limit = { county.development_level >= great_development_level } + limit = { county.prosperity_level >= great_prosperity_level } set_variable = { name = holding_quality value = 3 } } else_if = { - limit = { county.development_level >= good_development_level } + limit = { county.prosperity_level >= good_prosperity_level } set_variable = { name = holding_quality value = 2 } } else_if = { - limit = { county.development_level >= medium_development_level } + limit = { county.prosperity_level >= medium_prosperity_level } set_variable = { name = holding_quality value = 2 } } else_if = { - limit = { county.development_level >= bad_development_level } + limit = { county.prosperity_level >= bad_prosperity_level } set_variable = { name = holding_quality value = 1 @@ -317,7 +343,7 @@ on_building_completed = { } } } - county = { change_development_progress_with_overflow = 10 } + county = { change_prosperity_progress_with_overflow = 10 } } if = { @@ -552,7 +578,7 @@ on_building_completed = { } } } - county = { change_development_progress = minor_development_progress_gain } + county = { change_prosperity_progress = minor_prosperity_progress_gain } if = { limit = { scope:character ?= { has_character_modifier = the_city_builder_modifier } @@ -903,6 +929,21 @@ on_building_cancelled = { limit = { has_variable = pam_temple_holding_under_construction } remove_variable = pam_temple_holding_under_construction } + if = { + limit = { has_variable = merchant_construction_sponsor } + barony = { save_scope_as = barony } + var:merchant_construction_sponsor = { + send_interface_toast = { + type = event_toast_effect_neutral + title = merchant_sponsor_construction_cancel_title + left_icon = scope:character + right_icon = scope:barony + add_short_term_gold = root.var:merchant_construction_cost + } + } + remove_variable = merchant_construction_sponsor + remove_variable = merchant_construction_cost + } } } @@ -916,17 +957,17 @@ on_holding_razed = { left_icon = scope:province.barony add_gold = { value = minor_gold_value - add = scope:province.county.development_level + add = scope:province.county.prosperity_level } scope:province = { if = { limit = { this = county.title_province - county.development_level >= 1 + county.prosperity_level >= 1 } county = { - change_development_progress_with_overflow = { - value = scope:province.county.development_level + change_prosperity_progress_with_overflow = { + value = scope:province.county.prosperity_level multiply = 10 multiply = -1 } diff --git a/common/on_action/religion_on_actions.txt b/common/on_action/religion_on_actions.txt index 0fe2cfed1..60bbf0078 100644 --- a/common/on_action/religion_on_actions.txt +++ b/common/on_action/religion_on_actions.txt @@ -58,6 +58,7 @@ on_faith_created = { limit = { faith = root } pam_on_conversion_effect = yes remove_character_modifier = religious_reformer_modifier + gdp_update_usury_reputation_effect = yes # If you have a legend maybe we change it? if = { limit = { @@ -260,7 +261,7 @@ on_faith_created = { # if = { # limit = { # exists = situation:the_christian_church -# religion = religion:christianity_religion +# OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # } # root.main_rite.head_of_rite ?= { recalculate_participant_group = situation:the_christian_church } # } @@ -777,6 +778,7 @@ on_faith_conversion = { pam_on_conversion_effect = yes pam_remove_forbidden_personal_tenet_secret_if_invalid_effect = yes update_syncretism_personal_tenet_effect = yes + gdp_update_usury_reputation_effect = yes # EP3 - State Faith if = { limit = { @@ -1144,9 +1146,9 @@ on_rite_change = { # limit = { # highest_held_title_tier >= tier_county # scope:old_faith ?= { -# religion = religion:christianity_religion +# OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # } -# religion != religion:christianity_religion +# NOR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # situation:the_christian_church ?= { # situation_top_has_catalyst = catalyst_the_christian_church_ruler_converted_from_christianity # } @@ -1159,9 +1161,9 @@ on_rite_change = { # limit = { # highest_held_title_tier >= tier_county # scope:old_faith ?= { -# religion != religion:christianity_religion +# NOR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # } -# religion = religion:christianity_religion +# OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # situation:the_christian_church ?= { # situation_top_has_catalyst = catalyst_the_christian_church_ruler_converted_to_christianity # } @@ -1590,7 +1592,7 @@ pagan_conversion_pulse = { } } capital_province.county = { - development_level >= 7 #lower than the regular requirement to make sure some rulers can convert + prosperity_level >= 7 #lower than the regular requirement to make sure some rulers can convert } } trigger_else_if = { @@ -1598,12 +1600,12 @@ pagan_conversion_pulse = { current_date <= 1000.1.1 } capital_province.county = { - development_level >= 6 #lower than the regular requirement to make sure some rulers can convert + prosperity_level >= 6 #lower than the regular requirement to make sure some rulers can convert } } trigger_else = { capital_province.county = { - development_level >= 5 #lower than the regular requirement to make sure some rulers can convert + prosperity_level >= 5 #lower than the regular requirement to make sure some rulers can convert } } @@ -1629,7 +1631,7 @@ pagan_conversion_pulse = { } events = { - global_religion.0001 #Pagan reformed by neighbor, spouse, soulmate, friend, or geographic location + # NEOW 2555: event not loaded. global_religion.0001 #Pagan reformed by neighbor, spouse, soulmate, friend, or geographic location } } @@ -2027,3 +2029,156 @@ on_character_holy_site_created = { } } } + + +on_rite_updated = { + events = { + } + + effect = { + root = { + save_scope_as = rite + } + every_in_global_list = { + variable = merchants_tally + limit = { + holder ?= { + rite = scope:rite + } + } + holder = { + gdp_update_usury_reputation_effect = yes + } + } + + if = { # slient it for EC since EC has unique event to inform + limit = { + exists = scope:changed_tenets_or_doctrines + OR = { + NOT = { + faith = { has_variable = ecumenical_council_ongoing } + } + exists = scope:consume_rite_edit_token + } + } + + # The message icon slot must never be left unset, hence the fall-through to the rite itself + if = { + limit = { any_in_list = { list = added_tenets count >= 1 } } + every_in_list = { + list = added_tenets + save_scope_as = rite_change_icon + } + } + else_if = { + limit = { any_in_list = { list = added_doctrines count >= 1 } } + every_in_list = { + list = added_doctrines + save_scope_as = rite_change_icon + } + } + else_if = { + limit = { any_in_list = { list = removed_tenets count >= 1 } } + every_in_list = { + list = removed_tenets + save_scope_as = rite_change_icon + } + } + else_if = { + limit = { any_in_list = { list = removed_doctrines count >= 1 } } + every_in_list = { + list = removed_doctrines + save_scope_as = rite_change_icon + } + } + else_if = { + limit = { any_in_list = { list = changed_tenet_status count >= 1 } } + every_in_list = { + list = changed_tenet_status + save_scope_as = rite_change_icon + } + } + else = { + root = { save_scope_as = rite_change_icon } + } + + every_player = { + limit = { + OR = { + rite = root + AND = { + faith = root.faith + root.faith.main_rite = root + } + } + } + send_interface_message = { + type = msg_rite_updated + title = msg_rite_updated + left_icon = scope:rite_change_icon + + show_as_tooltip = { + every_in_list = { + list = removed_doctrines + root = { remove_rite_doctrine = prev } + } + every_in_list = { + list = added_doctrines + root = { add_rite_doctrine = prev } + } + every_in_list = { + list = removed_tenets + root = { remove_rite_tenet = prev } + } + every_in_list = { + list = added_tenets + root = { add_rite_tenet = prev } + } + every_in_list = { + list = changed_tenet_status + save_temporary_scope_as = tenet + root = { + if = { + limit = { has_tenet_status = { tenet = scope:tenet status = permitted } } + faith = { set_tenet_status = { tenet = scope:tenet status = permitted } } + } + else_if = { + limit = { has_tenet_status = { tenet = scope:tenet status = prohibited } } + faith = { set_tenet_status = { tenet = scope:tenet status = prohibited } } + } + else_if = { + limit = { has_tenet_status = { tenet = scope:tenet status = known } } + faith = { set_tenet_status = { tenet = scope:tenet status = known } } + } + else_if = { + limit = { has_tenet_status = { tenet = scope:tenet status = unknown } } + faith = { set_tenet_status = { tenet = scope:tenet status = unknown } } + } + } + } + pam_personal_tenet_rite_update_fulfillment_effect = yes + } + } + } + } + + head_of_rite ?= { + trigger_event = faith_creation.0004 # Update HoF succession law + trigger_event = faith_creation.0001 # Temporal rel head setup + trigger_event = faith_creation.0002 # Spiritual rel head setup + trigger_event = faith_creation.0011 # Restore Temporal rel head + trigger_event = faith_creation.0012 # Restore Spiritual rel head + trigger_event = faith_creation.1100 # Destroy HoF title if no longer valid + + if = { + limit = { + exists = scope:changed_tenets_or_doctrines + exists = scope:consume_rite_edit_token + } + set_variable = { + name = has_edited_a_rite + } + } + } + } +} diff --git a/common/on_action/story_cycles/story_cycle_roman_restoration_on_actions.txt b/common/on_action/story_cycles/story_cycle_roman_restoration_on_actions.txt new file mode 100644 index 000000000..e34e8ddac --- /dev/null +++ b/common/on_action/story_cycles/story_cycle_roman_restoration_on_actions.txt @@ -0,0 +1,39 @@ +#On actions handling the Roman Restoration notification events. + +on_action_roman_restoration_pulse = { + trigger = { + roman_restoration_is_valid_roman_empire_trigger = yes + NOT = { has_ep3_dlc_trigger = yes } + } + events = { + #Restored Roman Provinces events. + # NEOW 2555: event not loaded. roman_restoration.0010 + # NEOW 2555: event not loaded. roman_restoration.0011 + # NEOW 2555: event not loaded. roman_restoration.0012 + # NEOW 2555: event not loaded. roman_restoration.0013 + # NEOW 2555: event not loaded. roman_restoration.0014 + # NEOW 2555: event not loaded. roman_restoration.0015 + # NEOW 2555: event not loaded. roman_restoration.0016 + # NEOW 2555: event not loaded. roman_restoration.0017 + # NEOW 2555: event not loaded. roman_restoration.0018 + # NEOW 2555: event not loaded. roman_restoration.0019 + # NEOW 2555: event not loaded. roman_restoration.0020 + # NEOW 2555: event not loaded. roman_restoration.0021 + # NEOW 2555: event not loaded. roman_restoration.0022 + # NEOW 2555: event not loaded. roman_restoration.0023 + # NEOW 2555: event not loaded. roman_restoration.0024 + } +} + +on_action_orthodox_pentarchy_pulse = { + trigger = { + NOT = { has_ep3_dlc_trigger = yes } + } + events = { + #Byzantines restoring the Pentarchy. + # NEOW 2555: event not loaded. roman_restoration.0104 + # NEOW 2555: event not loaded. roman_restoration.0105 + # NEOW 2555: event not loaded. roman_restoration.0106 + # NEOW 2555: event not loaded. roman_restoration.0107 + } +} diff --git a/common/on_action/title_on_actions.txt b/common/on_action/title_on_actions.txt index 42e3ad0b4..0f3637720 100644 --- a/common/on_action/title_on_actions.txt +++ b/common/on_action/title_on_actions.txt @@ -239,7 +239,7 @@ on_title_destroyed = { # limit = { # scope:landed_title = { # has_clerical_region = yes -# root = { religion = religion:christianity_religion } +# root = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } # } # } # situation:the_christian_church.situation_sub_region:core = { @@ -254,6 +254,10 @@ on_title_destroyed = { # scope:title = the title that changes hands # scope:previous_holder = previous holder. Might be dead on_title_gain = { + on_actions = { + gdp_league_focus_on_title_gain + } + effect = { if = { limit = { @@ -305,23 +309,48 @@ on_title_gain = { if = { limit = { clerical_elector_title ?= scope:title } pam_strip_illegal_cardinalate_effect = yes + if = { + limit = { clerical_elector_title ?= scope:title } + add_character_flag = cardinal_flag + situation:the_christian_church ?= { + add_manual_participant = prev + } + } + # Also catches a sitting Head of Faith who is handed a cardinalate + pam_vacate_head_of_faith_cardinalate_effect = yes + } + # A cardinal handed the Church seat must vacate the cardinalate + else_if = { + limit = { + scope:title = { + OR = { + is_head_of_faith = yes + this = title:k_papal_state + } + } + } + pam_vacate_head_of_faith_cardinalate_effect = yes } if = { - limit = { - exists = clerical_elector_title - scope:title = clerical_elector_title - } - add_character_flag = cardinal_flag - situation:the_christian_church ?= { - add_manual_participant = prev - } - } - # Unconditional: also catches a sitting Head of Faith who is handed a cardinalate - pam_vacate_head_of_faith_cardinalate_effect = yes + limit = { + scope:transfer_type = flag:election + government_has_flag = government_is_republic + } + scope:title = { + every_full_assembly_member = { + if = { + limit = { + has_character_modifier = gdp_popular_mandate_modifier + } + remove_character_modifier = gdp_popular_mandate_modifier + } + } + } + } if = { limit = { scope:title = { has_clerical_region = yes } - religion = religion:christianity_religion + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } situation:the_christian_church ?= { add_manual_participant = prev @@ -334,7 +363,7 @@ on_title_gain = { scope:transfer_type = flag:inheritance scope:transfer_type = flag:appointment_succession } - religion = religion:christianity_religion + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } OR = { scope:title = { has_clerical_region = yes } scope:title = { has_title_law = clerical_appointment_law } @@ -359,7 +388,7 @@ on_title_gain = { if = { limit = { pam_government_is_religious_playable_trigger = yes - religion != religion:christianity_religion + NOR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } NOT = { exists = primary_heir } } pam_seed_monk_courtiers_effect = yes @@ -443,7 +472,7 @@ on_title_gain = { # The challenger registers only after the title change if = { limit = { - religion = religion:christianity_religion + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } pam_title_is_church_seat_trigger = { TITLE = scope:title } } pam_family_becomes_prelate_effect = { @@ -453,7 +482,7 @@ on_title_gain = { } else_if = { limit = { - religion = religion:christianity_religion + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } scope:title = { has_clerical_region = yes } NOT = { any_held_title = { @@ -472,7 +501,7 @@ on_title_gain = { pam_the_christian_church_clergy_gained_landed_title_catalyst_effect = yes #if = { # limit = { - # religion = religion:christianity_religion + # OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # scope:title = { has_clerical_region = yes } # exists = scope:previous_holder # } @@ -2489,7 +2518,10 @@ on_title_gain = { if = { limit = { is_governor = yes - NOT = { has_trait = governor } + NOR = { + has_trait = governor + has_character_flag = gdp_founding_republic + } scope:title = { tier >= root.main_administrative_tier } @@ -2919,6 +2951,41 @@ on_title_gain = { scope:title = { update_dynamic_coa = yes } ### MEMORIES - SHOULD STAY AT BOTTOM ### + # Creation effects stash these on the character, as on_title_gain fires before they can set them on the title + if = { + limit = { + exists = var:pending_adventurer_flavor_char + scope:title = { is_landless_type_title = yes } + NOT = { exists = scope:title.var:adventurer_flavor_char } + } + scope:title = { + set_variable = { + name = adventurer_creation_reason + value = root.var:pending_adventurer_creation_reason + } + set_variable = { + name = adventurer_flavor_char + value = root.var:pending_adventurer_flavor_char + } + } + } + else_if = { + limit = { + exists = var:pending_merchant_flavor_char + scope:title = { gdp_merchant_company_title_trigger = yes } + NOT = { exists = scope:title.var:merchant_flavor_char } + } + scope:title = { + set_variable = { + name = merchant_creation_reason + value = root.var:pending_merchant_creation_reason + } + set_variable = { + name = merchant_flavor_char + value = root.var:pending_merchant_flavor_char + } + } + } # Ascended to the throne if = { limit = { @@ -2968,6 +3035,45 @@ on_title_gain = { } } } + else_if = { + limit = { exists = scope:title.var:merchant_flavor_char } + create_character_memory = { + type = became_merchant_memory + participants = { + flavor_character = scope:title.var:merchant_flavor_char + } + } + #Only children should get childhood memories + if = { + limit = { is_adult = no } + scope:new_memory = { set_variable = childhood_memory } + } + scope:new_memory = { + save_scope_as = became_merchant_memory + set_variable = { + name = landless_title + value = scope:title + } + set_variable = { + name = reason + value = scope:transfer_type + } + set_variable = { + name = merchant_creation_reason + value = scope:title.var:merchant_creation_reason + } + if = { + limit = { exists = scope:lost_primary_title } + set_variable = { + name = old_primary_title + value = scope:lost_primary_title + } + } + if = { # Error suppression + limit = { exists = var:landless_title } + } + } + } else = { # Overwrite if there is a more specific Reason root = { @@ -3324,9 +3430,9 @@ on_title_gain = { # if = { # limit = { # scope:title = title:c_jerusalem -# religion = religion:christianity_religion +# OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # scope:previous_holder ?= { -# NOT = { religion = religion:christianity_religion } +# NOT = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } # } # NOR = { # scope:transfer_type = flag:created @@ -3345,9 +3451,9 @@ on_title_gain = { # limit = { # scope:title.tier = tier_county # NOT = { scope:title = title:c_jerusalem } -# religion = religion:christianity_religion +# OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } # scope:previous_holder ?= { -# NOT = { religion = religion:christianity_religion } +# NOT = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } # } # NOR = { # scope:transfer_type = flag:created @@ -3409,22 +3515,72 @@ on_title_gain = { } } } + + ######### + # GDP # + ######### + + if = { + limit = { + scope:title = { gdp_merchant_company_title_trigger = yes } + NOT = { has_trait = lifestyle_merchant } + government_has_flag = government_is_merchant # exclude patricians + } + add_trait = lifestyle_merchant + } + + if = { + limit = { + has_gdp_dlc_trigger = yes + } + if = { + limit = { scope:title = { is_noble_family_title = yes } } + hanseatic_sync_family_head_benefits_effect = { CHARACTER = root } + scope:previous_holder ?= { + hanseatic_sync_family_head_benefits_effect = { CHARACTER = this } + } + } + if = { + limit = { + scope:title = { + tier = tier_county + is_noble_family_title = no + } + } + hanseatic_sync_county_benefits_effect = { COUNTY = scope:title } + } + + if = { + limit = { + scope:title = { is_landless_type_title = no } + } + if = { + limit = { has_trait = dealbreaker } + remove_trait = dealbreaker + } + every_secret = { + type = secret_dealbreaker + remove_secret = yes + } + } + } } events = { - roman_restoration.0005 #New Roman Emperor gets Augustus trait. (old holder, if still alive, loses it) - roman_restoration.0199 #Restoring the Pentarchy. - title_event.0021 # Rename/recolor Britannia based on founder's culture; applied immediately on creation + # NEOW 2555: event not loaded. roman_restoration.0005 #New Roman Emperor gets Augustus trait. (old holder, if still alive, loses it) + # NEOW 2555: event not loaded. roman_restoration.0199 #Restoring the Pentarchy. + # NEOW 2555: event not loaded. title_event.0021 # Rename/recolor Britannia based on founder's culture; applied immediately on creation delay = { days = 1 } - NEOW_grant_title.001 + # NEOW 2555: event not loaded. NEOW_grant_title.001 realm_maintenance.2001 #Big notification about inheriting emperor tier title - british_isles.1032 # Danelaw-England partition calc. - title_event.0001 # Rename West Francia to France - title_event.0002 # Rename East Francia to Germany - title_event.0011 # Asturias becomes Leon upon emergence of Castille + # NEOW 2555: event not loaded. british_isles.1032 # Danelaw-England partition calc. + # NEOW 2555: event not loaded. title_event.0001 # Rename West Francia to France + # NEOW 2555: event not loaded. title_event.0002 # Rename East Francia to Germany + # NEOW 2555: event not loaded. title_event.0011 # Asturias becomes Leon upon emergence of Castille # If we weren't already in a diarchy but should be, put us in one. diarchy.0011 ep3_emperor_yearly.2020 # EP3: The Patriarch refuses to crown you as new emperor because you have a criminal trait empire_faith_gate.0001 # Empire Faith Gate: contested-empire legitimacy on empire gain + gdp_merchant_family.9010 # Merhcant child } } @@ -3475,30 +3631,22 @@ on_title_gain_inheritance = { becomes_independent = { change = scope:change } } } -# if = { -# limit = { -# scope:title = { -# OR = { -# this = title:e_mongol_empire -# AND = { -# exists = global_var:greatest_of_khans_title -# this = global_var:greatest_of_khans_title -# } -# } -# } -# has_character_flag = gain_mongol_succession_dread -# } -# add_dread = 50 -# } -# else_if = { -# limit = { -# OR = { -# scope:title = title:h_roman_empire -# scope:title = title:h_eastern_roman_empire -# } -# } -# set_variable = uses_custom_caesar_flavourization -# } + + ######### + # GDP # + ######### + gdp_merchant_patron_change_on_title_transfer_effect = yes + # CE3 achievement: Where There's a Will — inherited from the murdered cleric + if = { + limit = { + exists = var:ce3_will_victim + scope:previous_holder ?= var:ce3_will_victim + } + add_achievement_global_variable_effect = { + VARIABLE = ce3_13_where_theres_a_will_achievement_unlocked + VALUE = yes + } + } } } @@ -3622,7 +3770,11 @@ on_title_gain_usurpation = { # scope:new_holder = new holder. on_title_lost = { events = { - british_isles.1033 # Danelaw-England partition calc. + # NEOW 2555: event not loaded. british_isles.1033 # Danelaw-England partition calc. + } + + on_actions = { + gdp_league_focus_on_title_lost } effect = { @@ -3874,6 +4026,31 @@ on_title_lost = { # EP3 LAAMP SUPPORTER INVALIDATION ep3_laamp_supporter_invalidated_effect = yes + # GDP REPUBLIC DESTRUCTION - last landed county lost + if = { + limit = { + gdp_holds_republic_title_trigger = yes # title loser is a republic leader + scope:title = { # lost title is landed county + tier = tier_county + is_landless_type_title = no + is_noble_family_title = no + } + NOT = { # lost title is last held landed county + any_held_county = { + is_landless_type_title = no + is_noble_family_title = no + NOT = { this = scope:title } + } + } + } + random_held_title = { + limit = { gdp_is_republic_title_trigger = yes } + save_scope_as = republic_title + } + # Destroy title - this triggers on_title_destroyed and on_vassal_change + scope:new_holder = { destroy_title = scope:republic_title } + } + # EP3 - Handle admin estates when they end up outside the realm if = { limit = { @@ -4198,61 +4375,62 @@ on_title_lost = { # BP3 - Inspector perks cleanup effect landless_inspector_cleanup_modifier = yes - #End Greatest of Khans story if title was lost - if = { - limit = { - any_owned_story = { - story_type = story_greatest_of_khans - } - global_var:greatest_of_khans_title ?= { - this = scope:title - } - OR = { - NOT = { - exists = scope:new_holder - } - scope:new_holder = { - NOR = { - AND = { - exists = dynasty - dynasty ?= root.dynasty - } - is_grandchild_of = root - is_child_of = root - } - } - } - } - if = { - limit = { - is_alive = yes - } - trigger_event = { - id = mpo_greatest_of_khans.0040 - days = 1 - } - } - else_if = { - limit = { - exists = root.player_heir - exists = root.dynasty - player_heir.dynasty ?= root.dynasty - } - player_heir ?= { - trigger_event = { - id = mpo_greatest_of_khans.0040 - days = 1 - } - } - } - else = { - every_owned_story = { - limit = { story_type = story_greatest_of_khans } - end_story = yes - } - remove_character_modifier = the_great_khan_modifier - } - } + # NEOW 2555: disabled Great Khan event has no live title-transfer hook. +#End Greatest of Khans story if title was lost +# if = { +# limit = { +# any_owned_story = { +# story_type = story_greatest_of_khans +# } +# global_var:greatest_of_khans_title ?= { +# this = scope:title +# } +# OR = { +# NOT = { +# exists = scope:new_holder +# } +# scope:new_holder = { +# NOR = { +# AND = { +# exists = dynasty +# dynasty ?= root.dynasty +# } +# is_grandchild_of = root +# is_child_of = root +# } +# } +# } +# } +# if = { +# limit = { +# is_alive = yes +# } +# trigger_event = { +# id = mpo_greatest_of_khans.0040 +# days = 1 +# } +# } +# else_if = { +# limit = { +# exists = root.player_heir +# exists = root.dynasty +# player_heir.dynasty ?= root.dynasty +# } +# player_heir ?= { +# trigger_event = { +# id = mpo_greatest_of_khans.0040 +# days = 1 +# } +# } +# } +# else = { +# every_owned_story = { +# limit = { story_type = story_greatest_of_khans } +# end_story = yes +# } +# remove_character_modifier = the_great_khan_modifier +# } +# } #Coronation loyalty modifier if = { limit = { @@ -4402,6 +4580,26 @@ on_title_lost = { } } } + else_if = { # Liegeless Patricians become Merchants or go to the pool + limit = { + government_has_flag = government_is_republic + NOT = { has_character_flag = government_republic_conversion_protection } + } + if = { + limit = { exists = var:republic_destroyer } + var:republic_destroyer = { save_scope_as = destroyer } + } + else = { + # due to effect order we cannot be sure this is the destroyer + scope:new_holder = { save_scope_as = destroyer } + set_variable = { + name = republic_destroyer + value = scope:destroyer + weeks = 1 + } + } + gdp_destroyed_republic_patrician_effect = { DESTROYER = scope:destroyer } + } } else_if = { limit = { @@ -4440,18 +4638,79 @@ on_title_lost = { ######### # PAM # ######### + if = { + limit = { + scope:title = { + has_clerical_region = yes + root = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } + scope:new_holder = { NOT = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } } + } + } + situation:the_christian_church.situation_sub_region:core = { + remove_clerical_realm_from_sub_region = scope:title + } + } + + ######### + # GDP # + ######### + # NEOW 2555: 1178 Guelph/Ghibelline title changes remain disabled. + #GG: Account for custom-made HRE and Popes in 1178 # if = { # limit = { -# scope:title = { -# has_clerical_region = yes -# root = { religion = religion:christianity_religion } -# scope:new_holder = { NOT = { religion = religion:christianity_religion } } -# } +# game_start_date = 1178.10.1 +# scope:new_holder = { is_from_ruler_designer = yes } # } -# situation:the_christian_church.situation_sub_region:core = { -# remove_clerical_realm_from_sub_region = scope:landed_title +# #Ghibellines/HRE +# if = { +# limit = { +# scope:title = { this = title:e_hre } +# } +# remove_variable = ghibelline_leader +# scope:new_holder = { set_variable = ghibelline_leader } +# recalculate_participant_group = situation:guelph_ghibelline +# } +# #Guelphs +# if = { +# limit = { +# scope:title = { this = title:d_commune_verona } +# } +# remove_variable = guelph_leader +# scope:new_holder = { set_variable = guelph_leader } +# recalculate_participant_group = situation:guelph_ghibelline # } # } +# #GG: You don't get to be a leader as landless, sorry +# if = { +# limit = { +# exists = situation:guelph_ghibelline +# OR = { +# has_variable = guelph_leader +# has_variable = ghibelline_leader +# } +# is_landed = no +# } +# try_set_up_new_gg_leader_effect = yes +# } + + gdp_merchant_patron_change_on_title_transfer_effect = yes + burgher_broken_charter_effect = yes + if = { + limit = { scope:title = { is_noble_family_title = yes } } + hanseatic_sync_family_head_benefits_effect = { CHARACTER = root } + scope:new_holder ?= { + hanseatic_sync_family_head_benefits_effect = { CHARACTER = this } + } + } + if = { + limit = { + scope:title = { + tier = tier_county + is_noble_family_title = no + } + } + hanseatic_sync_county_benefits_effect = { COUNTY = scope:title } + } } } @@ -5180,6 +5439,54 @@ on_vassal_change = { resolve_title_and_vassal_change = scope:change } } + ### If a republic family becomes independent or part of a non-Republic... + if = { + limit = { + government_has_flag = government_is_republic + NOT = { has_character_flag = gdp_becoming_patrician } + NOT = { has_character_flag = government_republic_conversion_protection } + is_landed = no + any_held_title = { is_noble_family_title = yes } + liege = { + OR = { + this = root # independent + NOT = { government_has_flag = government_is_republic } + } + } + } + # Become a Merchant or go to the pool + if = { + limit = { exists = var:republic_destroyer } + var:republic_destroyer = { save_scope_as = destroyer } + } + else = { + # due to effect order we cannot be sure this is the destroyer + scope:old_liege = { save_scope_as = destroyer } + set_variable = { + name = republic_destroyer + value = scope:destroyer + weeks = 1 + } + } + gdp_destroyed_republic_patrician_effect = { DESTROYER = scope:destroyer } + } + ### A landed republic governor becomes independent to form a new republic + if = { + limit = { + government_has_flag = government_is_republic + is_landed = yes + this = highest_liege_matching_rule:uses_assembly + NOT = { has_character_flag = gdp_recently_founded_republic } + scope:old_liege = { + government_has_flag = government_is_republic + is_alive = yes + is_landed = yes + this = highest_liege_matching_rule:uses_assembly + this != root + } + } + gdp_found_a_republic_effect = yes + } # Empire Faith Gate: sync the empire-holders list when an empire-tier ruler gains or loses independence. if = { limit = { @@ -5530,9 +5837,58 @@ on_realm_capital_change = { if = { limit = { is_landed = no - is_in_army = no - is_travelling = no - NOT = { exists = involved_activity } + should_in_default_location_trigger = yes + } + set_location_to_default = yes + } + } + } + + # In republics - move patricians to realm capital + if = { + limit = { gdp_is_assembly_head_trigger = yes } + capital_province = { save_scope_as = capital_province } + # Move the ruler's capital and domicile + if = { + limit = { + any_held_title = { is_noble_family_title = yes } + } + every_held_title = { + limit = { + is_noble_family_title = yes + } + set_capital_county = scope:capital_province.county + } + domicile ?= { + move_domicile = scope:capital_province + } + if = { + limit = { + is_landed = no + should_in_default_location_trigger = yes + } + set_location_to_default = yes + } + } + # And the same for all patrician vassals + every_vassal = { + limit = { + exists = domicile + domicile = { is_domicile_type = merchant_company } + } + every_held_title = { + limit = { + is_noble_family_title = yes + } + set_capital_county = scope:capital_province.county + } + domicile ?= { + move_domicile = scope:capital_province + } + if = { + limit = { + is_landed = no + should_in_default_location_trigger = yes } set_location_to_default = yes } @@ -5548,3 +5904,68 @@ on_realm_capital_change = { # Not called if new primary title is the same as the previous primary title on_primary_title_change = { } + + +on_term_ended_events = { + effect = { + if = { + limit = { scope:previous_holder = scope:new_holder } + # Re-elected (root) + scope:title ?= { + every_full_assembly_member = { + limit = { + is_ai = no + } + trigger_event = republic_event.0051 + } + } + } + else = { + # Elected (root = winner) + scope:title ?= { + every_full_assembly_member = { + limit = { + is_ai = no + } + trigger_event = republic_event.0050 + } + } + } + } +} + + +on_term_ended = { + on_actions = { on_term_ended_events } + effect = { + if = { + limit = { scope:previous_holder = scope:new_holder } + every_player = { + limit = { + OR = { + this = root + is_vassal_or_below_of = root + } + } + if = { + limit = { this = root } + send_interface_toast = { + type = event_toast_effect_good + title = term_ended_reelected_toast_self + left_icon = scope:title + custom_tooltip = term_ended_reelected_toast_self.desc + } + } + else = { + send_interface_toast = { + type = event_toast_effect_neutral + title = term_ended_reelected_toast + left_icon = scope:new_holder + right_icon = scope:title + custom_tooltip = term_ended_reelected_toast.desc + } + } + } + } + } +} diff --git a/common/on_action/travel_on_actions.txt b/common/on_action/travel_on_actions.txt index d53d29cf5..343c70030 100644 --- a/common/on_action/travel_on_actions.txt +++ b/common/on_action/travel_on_actions.txt @@ -22,6 +22,7 @@ on_travel_plan_movement = { events = { mpo_special_flavor_events.0001 + gdp_travel_events.2000 } # Increment the count of how many provinces the character has passed through @@ -32,6 +33,12 @@ on_travel_plan_movement = { passive_rite_learning_travel_province_effect = yes # Wandering Lifestyle XP wandering_lifestyle_exp_post_travel_effect = yes + # Merchant Power at Home replacement + merchant_market_familiarity_travel_effect = yes + # Merchant Souvenirs Aplenty replacement + merchant_souvenirs_aplenty_travel_effect = yes + # Merchant Travel Logs bonus + merchant_travel_logs_danger_xp_effect = yes # Increase xp for traveler trait traveler_progress_point_gain_effect = { CHANGE = 1 RANDOM_CHANGE = 1 } # Increment the count of how many provinces the character has passed through @@ -595,6 +602,41 @@ on_travel_plan_movement = { } trigger_event = travel_events.2310 } + # Merchant capstone + if = { + limit = { + current_travel_plan.current_location = { + any_province_domicile = { + has_domicile_parameter = company_curiosity_visitors + owner = { + NOT = { + is_target_in_variable_list = { + name = gdp_merchant_8020_cooldown + target = root + } + } + } + } + } + } + save_scope_as = visitor + current_travel_plan.current_location = { + random_province_domicile = { + limit = { + has_domicile_parameter = company_curiosity_visitors + owner = { + NOT = { + is_target_in_variable_list = { + name = gdp_merchant_8020_cooldown + target = root + } + } + } + } + owner = { trigger_event = gdp_merchant.8021 } + } + } + } } } @@ -751,6 +793,12 @@ travel_danger_events_on_action = { # TGP Travel Danger Events 100 = tgp_travel_danger_events.0001 # Encounter an orphan in an area struck by natural disaster. + # GDP Travel Danger Events + 100 = gdp_travel_events.1000 # Your Caravan is stuck in the desert during a heatwave + 100 = gdp_travel_events.1040 # Unmaintained Well - Party stops at an icky well + 100 = gdp_travel_events.1050 # Toppled Timber - The road is blocked by fallen trees + 100 = gdp_travel_events.1060 # Rats in the Hold - The hold of the ship is filled with rats + # Simple Danger Events 100 = travel_danger_events.9030 # Rain: delay 100 = travel_danger_events.9040 # Rainstorm, someone is lost & gone forever! @@ -1001,6 +1049,10 @@ travel_events_on_action = { 50 = tgp_japan_yearly_events.1120 # 1120 - You meet a warrior monk 50 = tgp_japan_yearly_events.1140 # 1140 - You are stopped in Soryo lands as a Ritsuryo ruler + #GDP Travel Events + 100 = gdp_travel_events.1010 # 1010 - Lost Travelers - A family of travelers is asking to shelter with you. + 100 = gdp_travel_events.1020 # 1020 - Tidbits on the Road - Your associate has something interesting to share + 100 = gdp_travel_events.1030 # 1030 - Vile Whispers - An associate has a secret to share concerning you partner # PAM Travel Events 100 = pam_theocratic_ruler_events.0012 # Theocratic ruler: sacred grove in the forest while traveling through realm @@ -1104,6 +1156,9 @@ on_travel_plan_arrival = { 100 = 0 100 = travel_events.3020 #A warm welcome } + events = { + gdp_travel_events.2000 + } effect = { # Achievements. if = { @@ -1167,6 +1222,8 @@ on_travel_plan_arrival = { # Visited Points of Interest tracker, currently only for Adventurers points_of_interest_tracker_effect = yes + + gdp_merchant_legacy_4_visit_entrepot_effect = yes } } @@ -1217,6 +1274,29 @@ on_travel_plan_start = { value = 1 } } + if = { + limit = { + government_has_flag = government_is_merchant + has_perk = travel_logs_perk + has_variable_list = merchant_travel_logs_markets + } + clear_variable_list = merchant_travel_logs_markets + } + if = { + limit = { + government_has_flag = government_is_merchant + has_perk = know_your_land_know_your_people_perk + current_travel_plan = { + has_travel_option = tutor_child_option + } + player_heir ?= { + has_variable_list = reading_the_market_markets + } + } + player_heir = { + clear_variable_list = reading_the_market_markets + } + } # Add Court Physician and Bodyguard if they aren't already in the entourage if = { limit = { @@ -1460,6 +1540,8 @@ on_travel_plan_start = { diarchy.0002 # Do we need to enter a regency or not? ep3_laamp_flavour_ewan.1102 #Adventurer's child helps them pack ep3_laamp_flavour_ewan.1103 #Follow-up events for adventurer's child helping with packing + + gdp_travel_events.0001 #Merchants travel with their associates, household and potential contract agents } } @@ -1470,14 +1552,15 @@ on_travel_plan_complete = { is_ruler = yes } first_valid = { - pilgrimage.9010 #Bury the old host after finishing the Pilgrimage - pilgrimage.9001 #Nice Spiritual Journey + # NEOW 2555: event not loaded. pilgrimage.9010 #Bury the old host after finishing the Pilgrimage + # NEOW 2555: event not loaded. pilgrimage.9001 #Nice Spiritual Journey ep3_laamps.8000 # You arrive at a place you have a claim on tgp_east_asia_mandala_events.8496 #You are due for a Mandala Succession? travel_completion_event.1000 } events = { ep3_laamps.9971 + gdp_travel_events.2000 } effect = { @@ -1578,6 +1661,13 @@ on_travel_plan_complete = { # Roaming flag remove_character_flag = roaming_character + if = { + limit = { + has_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + } + remove_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + } + # Give us fresh contracts if necessary. if = { limit = { @@ -1589,6 +1679,30 @@ on_travel_plan_complete = { left_icon = root right_icon = root.location.barony } + if = { + limit = { has_government = merchant_government } + if = { + limit = { exists = location.county.holder } + suzerain ?= { save_scope_as = old_patron } + location.county.holder = { save_scope_as = new_patron } + start_tributary_interaction_effect = { + TRIBUTARY = root + SUZERAIN = scope:new_patron + } + # Mingle with Patron only when a player move assigns a different patron. + if = { + limit = { + is_ai = no + trigger_if = { + limit = { exists = scope:old_patron } + NOT = { scope:old_patron = scope:new_patron } + } + trigger_else = { always = yes } + } + trigger_event = { on_action = gdp_patron_hobnob } + } + } + } # Set up additional firing contracts. player_adventurer_contract_generation_on_wait_in_place_effect = yes # Generate contracts if you are far away from your previous location. @@ -1814,6 +1928,8 @@ on_travel_plan_abort = { of_the_people_effect = yes # Wayfarer Stress Loss wayfarer_the_home_away_from_home_modifier_effect = yes + # Merchant Souvenirs Aplenty cleanup + merchant_souvenirs_aplenty_clear_effect = yes # Remove Excursion modifier destination_remove_excursion_modifier_effect = yes # Roaming flag @@ -1822,6 +1938,13 @@ on_travel_plan_abort = { remove_character_flag = roaming_character } + if = { + limit = { + has_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + } + remove_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + } + if = { limit = { current_travel_plan = { is_travel_with_domicile = yes } @@ -1883,6 +2006,9 @@ on_travel_plan_abort = { #Invalidate Mandala Contracts mandala_invalidate_contracts_effect = yes + #Invalidate merchant trade opportunities the trip never reached + merchant_trade_opportunity_travel_cancelled_effect = yes + #Hit absentee Tributary with Tribute Mission penalty requested_tribute_mission_penalty_effect = yes tribute_mission_clean_up_variables_effect = yes @@ -1908,6 +2034,7 @@ on_travel_plan_abort = { # People in the travel plan were removed from associated activities. on_travel_plan_cancel = { effect = { + merchant_souvenirs_aplenty_clear_effect = yes if = { limit = { has_variable = ep3_laamp_decision_1000_is_excavating } remove_variable = ep3_laamp_decision_1000_is_excavating @@ -2053,6 +2180,9 @@ on_travel_plan_cancel = { #Invalidate Mandala Contracts mandala_invalidate_contracts_effect = yes + #Invalidate merchant trade opportunities the trip never reached + merchant_trade_opportunity_travel_cancelled_effect = yes + #Hit absentee Tributary with Tribute Mission penalty requested_tribute_mission_penalty_effect = yes tribute_mission_clean_up_variables_effect = yes diff --git a/common/on_action/war_on_actions.txt b/common/on_action/war_on_actions.txt index c08d46b83..22815299d 100644 --- a/common/on_action/war_on_actions.txt +++ b/common/on_action/war_on_actions.txt @@ -1162,7 +1162,7 @@ on_war_started = { scope:attacker = { has_pam_dlc_trigger = yes highest_held_title_tier >= tier_kingdom - religion = religion:christianity_religion + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } faith = scope:defender.faith } scope:war = { # They have their own catalysts @@ -1208,7 +1208,7 @@ on_war_started = { } } scope:attacker = { - NOT = { religion = religion:christianity_religion } + NOT = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } } scope:defender = { has_pam_dlc_trigger = yes @@ -1973,6 +1973,8 @@ on_war_won_attacker = { # As in, won BY attacker. Only one of the two on_actions mpo_save_potential_blood_brother_war_allies_effect = yes pam_pursuit_of_power_war_victory_fulfillment_effect = yes + + burgher_resume_pending_leaders_on_war_end_effect = yes } } @@ -2388,6 +2390,8 @@ on_war_won_defender = { #Save variables for blood brothers mpo_save_potential_blood_brother_war_allies_effect = yes + + burgher_resume_pending_leaders_on_war_end_effect = yes } } @@ -2526,6 +2530,8 @@ on_war_white_peace = { mpo_save_potential_blood_brother_war_allies_effect = yes pam_miles_christi_white_peace_effect = yes + + burgher_resume_pending_leaders_on_war_end_effect = yes } } @@ -2587,5 +2593,7 @@ on_war_invalidated = { #Save variables for blood brothers mpo_save_potential_blood_brother_war_allies_effect = yes + + burgher_resume_pending_leaders_on_war_end_effect = yes } } diff --git a/common/on_action/yearly_groups_on_actions.txt b/common/on_action/yearly_groups_on_actions.txt index e1fad6694..6b77cb0cd 100644 --- a/common/on_action/yearly_groups_on_actions.txt +++ b/common/on_action/yearly_groups_on_actions.txt @@ -434,6 +434,7 @@ pam_christian_yearly_events = { religion = religion:protestant_religion } NOT = { has_character_flag = recently_got_pam_christian_event } + pam_secular_faith_clergy_ok_actor_trigger = yes } weight_multiplier = { base = 1 diff --git a/common/on_action/yearly_on_actions.txt b/common/on_action/yearly_on_actions.txt index 6a504340a..bcf9496ba 100644 --- a/common/on_action/yearly_on_actions.txt +++ b/common/on_action/yearly_on_actions.txt @@ -298,6 +298,7 @@ yearly_global_pulse = { on_actions = { inspiration_maintenance_global_pulse natural_disaster_maintenance_global_pulse + gdp_merchant_population_global_pulse } } @@ -556,6 +557,8 @@ yearly_playable_pulse = { if = { limit = { has_treasury = yes + # We exclude republics here - they are a bit different and require separate handling (see republic_event.0020) + NOT = { government_has_flag = government_is_republic } } trigger_event = tgp_china_ministry.0100 } @@ -916,6 +919,127 @@ yearly_playable_pulse = { } ai_attempt_to_host_activity = activity_imperial_examination } + + # MERCHANTS + if = { + limit = { government_has_flag = government_is_merchant } + # AI Associate handling + if = { + limit = { + is_available_quick = { + ai = yes + adult = yes + imprisoned = no + alive = yes + } + is_house_head = yes + exists = location.county + NOT = { has_character_flag = gdp_merchant_ai_market_recruit_cooldown } + short_term_gold >= gdp_merchant_ai_market_recruit_gold_value + any_courtier = { + gdp_can_be_trader_trigger = yes + count < root.num_trade_routes + } + } + gdp_merchant_ai_market_recruit_effect = yes + } + # Contracts + if = { + limit = { + house ?= { # Trade opportunities only spawn yearly with high unity + OR = { + has_house_unity_stage = grasping_cs + has_house_unity_stage = ennobled_cs + } + } + trigger_if = { + limit = { is_ai = yes } + is_available = yes + } + } + # Trade opportunities + random = { + chance = { + value = 50 + if = { + limit = { has_character_flag = trade_opportunity_frequency_cooldown } + subtract = 35 + } + else_if = { + limit = { + house ?= { has_house_unity_stage = ennobled_cs } + } + add = 25 + } + } + trigger_event = { + on_action = spawn_trade_opportunity_contract_on_action + } + } + # Luxury contracts + random = { + chance = { + value = 70 + if = { + limit = { has_character_flag = luxury_contract_frequency_cooldown } + subtract = 50 + } + if = { + limit = { + NOT = { has_realm_law = company_purpose_caravaneer } + } + subtract = 50 + } + } + trigger_event = { + on_action = spawn_luxury_contract_on_action + } + } + # Unity contracts + if = { + limit = { + house ?= { # Unity contracts do not spawn yearly with high unity + OR = { + has_house_unity_stage = rapacious_cs + has_house_unity_stage = opportunistic_cs + } + } + } + random = { + chance = { + value = 25 + if = { + limit = { + house ?= { has_house_unity_stage = opportunistic_cs } + } + add = 25 + } + if = { + limit = { has_character_flag = unity_contract_frequency_cooldown } + multiply = 0 + } + } + trigger_event = { on_action = spawn_unity_contract_on_action } + } + } + } + # Passive XP + if = { + limit = { + is_adult = yes # children never learn anything + any_trade_route = { gdp_merchant_trade_route_grants_caravaneer_xp_trigger = yes } + } + send_interface_message = { + type = event_trade_good + title = caravaneer_passive_xp_title + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = gdp_merchant_yearly_caravaneer_xp_value + } + } + } + } # Scalable Modifiers which needs to be reapplied hidden_effect = { @@ -1936,7 +2060,7 @@ yearly_playable_pulse = { weight = { base = 1 modifier = { - divide = development_level + divide = prosperity_level } modifier = { divide = county_control @@ -1977,12 +2101,22 @@ yearly_playable_pulse = { events = { court_maintenance.0012 # Dynasty banner improves with renown court_maintenance.0013 # Remove duplicate dynasty banners + gdp_purpose_events.0001 # You're in debt, a merchant offers a way out + gdp_merchant.9020 # Commission trade route + gdp_merchant.1200 # Merchant associate promise + vassal.2205 # Loan reminder } on_actions = { ai_character_pulse delay = { days = 75 } pagan_conversion_pulse + + # GDP + gdp_republic_popular_opinion_pulse + gdp_merchant_ai_trade_monopoly_pulse + gdp_republic_ai_trade_monopoly_pulse + gdp_trade_league_ai_trade_monopoly_pulse } } @@ -1991,6 +2125,11 @@ yearly_playable_pulse = { three_year_playable_pulse = { events = { adultery.0001 #Suspected spouse/soulmate of cheating (increased chance when there is a lover, but can also trigger otherwise) + gdp_merchant.8020 # Domicile visitor + ep2_accolade_events.0100 + ep2_accolade_events.0200 + ep2_accolade_events.0300 + ach_maintenance_events.0002 } # random_events = { # 800 = 0 @@ -2277,6 +2416,31 @@ three_year_playable_pulse = { } } pam_christian_situation_hof_incite_holy_war_effect = yes + # Republic maintenance + if = { + limit = { + gdp_is_assembly_head_trigger = yes + } + # Effect to add more patricians as needed + gdp_adjust_number_of_patrician_families_effect = yes + # Update the treasury budget + trigger_event = republic_event.0020 + # Read by gdp_merchant_company_keep_trigger if the republic falls + add_character_flag = { + flag = gdp_notable_republic_family + years = 4 + } + if = { + limit = { highest_held_title_tier >= tier_kingdom } + every_vassal = { + limit = { government_has_flag = government_is_republic } + add_character_flag = { + flag = gdp_notable_republic_family + years = 4 + } + } + } + } } } @@ -2537,6 +2701,13 @@ quarterly_playable_pulse = { # MPO mpo_tributary_check_pulse + + # GDP + gdp_merchant_company_debt_pulse + gdp_trade_route_maturity_pulse + gdp_trade_envoys_resume_pulse + ep5_09_wearer_of_many_hats_achievement_pulse + } random_on_action = { chance_to_happen = 50 @@ -2591,11 +2762,12 @@ random_yearly_playable_pulse = { #2 = bp1_yearly_events # Retired on purpose; contents are all in on_yearly_events 6 = ep3_yearly_events_admin 6 = NEOW_yearly_flavor_events - 6 = tgp_japan_yearly_events - 6 = tgp_china_yearly_events - 3 = tgp_mandala_yearly_events + # 6 = tgp_japan_yearly_events # NEOW 2555: removed East/South Asian regions + # 6 = tgp_china_yearly_events # NEOW 2555: removed East/South Asian regions + # 3 = tgp_mandala_yearly_events # NEOW 2555: removed East/South Asian regions 6 = ongoing_house_feud_events 10 = mpo_yearly_events_nomads + 6 = gdp_merchant_yearly_events } effect = { # Special Holy Seeds drops @@ -2729,9 +2901,9 @@ random_yearly_everyone_pulse = { house_feud_ai_scheme_pulse } events = { - holy_order.0206 #To increment the years passed since loan + # NEOW 2555: event not loaded. holy_order.0206 #To increment the years passed since loan marriage_interaction.0007 #One of the betrothed became part of clergy that doesn't allow marriage - tgp_silk_road_events.0100 #Culture adopts controlled Silk Road market innovation + # NEOW 2555: event not loaded. tgp_silk_road_events.0100 #Culture adopts controlled Silk Road market innovation } random_events = { 500 = 0 @@ -2912,6 +3084,10 @@ three_year_pool_pulse = { } 100 = courtier_guest_management.4001 # Wanderer becomes an adventurer } + on_actions = { + gdp_merchant_pool_pulse + gdp_minority_merchant_pool_pulse + } } #Only triggered if you actually have prisoners @@ -2980,14 +3156,7 @@ on_yearly_common_events = { } # Accolades yearly events -three_year_playable_pulse = { - events = { - ep2_accolade_events.0100 #Huntsmaster gives you or heir Hunter trait event - ep2_accolade_events.0200 #Blademaster gives you or heir Blademaster trait event - ep2_accolade_events.0300 #Master of Revels gives you or heir Reveler trait event - ach_maintenance_events.0002 # ACH Oath synergy culture rewards - } -} + on_yearly_invisible_events = { random_events = { @@ -3833,43 +4002,43 @@ on_yearly_events = { # 200 = tgp_dynastic_cycle_events.0050 # Debate the Favoured Movement and get ahead of them # TGP - Confucianism Events - 250 = tgp_china_yearly.0001 # Charitable Acts - 250 = tgp_china_yearly.0005 # Child mourns the loss of a father - 250 = tgp_china_yearly.0010 # Hack poet peddles "lucky" poems - 250 = tgp_china_yearly.0015 # Settle merchant dispute - 250 = tgp_china_yearly.0020 # County has unpaid back-taxes +# 250 = tgp_china_yearly.0001 # Charitable Acts +# 250 = tgp_china_yearly.0005 # Child mourns the loss of a father +# 250 = tgp_china_yearly.0010 # Hack poet peddles "lucky" poems +# 250 = tgp_china_yearly.0015 # Settle merchant dispute +# 250 = tgp_china_yearly.0020 # County has unpaid back-taxes - 100 = tgp_japan_yearly_events.0001 # 0001 - Spreading Joy - furoshiki - 10 = tgp_japan_yearly_events.0021 # 0021 - Among the Blossoms - Hanami (Cherry Blossoms) - 20 = tgp_japan_yearly_events.0026 # 0026 - Tales of the Tengu - Tengu - 10 = tgp_japan_yearly_events.0036 # 0036 - Green Thumb - 50 = tgp_japan_yearly_events.1010 # 1010 - Two buddhist sects are fighting, and ask you to pick a side - 5 = tgp_japan_yearly_events.1020 # 1020 - Your senses are playing tricks on you, and you encounter a new Yokai - 100 = tgp_japan_yearly_events.1030 # 1030 - You pray at a shrine for future success - 20 = tgp_japan_yearly_events.1050 # 1050 - You are accused of violating a dumb rule - 5 = tgp_japan_yearly_events.1060 # 1060 - A prisoner requests to be mercy killed - 20 = tgp_japan_yearly_events.1070 # 1070 - A temple in your realm has burned down - 100 = tgp_japan_yearly_events.1080 # 1080 - Someone is fishing in the tsuri-dono - 10 = tgp_japan_yearly_events.1090 # 1090 - Growing old with no heir - 20 = tgp_japan_yearly_events.1100 # 1100 - You contract Guilt Fever - 100 = tgp_japan_yearly_events.1110 # 1110 - An animal is seen near the shrine of a God +# 100 = tgp_japan_yearly_events.0001 # 0001 - Spreading Joy - furoshiki +# 10 = tgp_japan_yearly_events.0021 # 0021 - Among the Blossoms - Hanami (Cherry Blossoms) +# 20 = tgp_japan_yearly_events.0026 # 0026 - Tales of the Tengu - Tengu +# 10 = tgp_japan_yearly_events.0036 # 0036 - Green Thumb +# 50 = tgp_japan_yearly_events.1010 # 1010 - Two buddhist sects are fighting, and ask you to pick a side +# 5 = tgp_japan_yearly_events.1020 # 1020 - Your senses are playing tricks on you, and you encounter a new Yokai +# 100 = tgp_japan_yearly_events.1030 # 1030 - You pray at a shrine for future success +# 20 = tgp_japan_yearly_events.1050 # 1050 - You are accused of violating a dumb rule +# 5 = tgp_japan_yearly_events.1060 # 1060 - A prisoner requests to be mercy killed +# 20 = tgp_japan_yearly_events.1070 # 1070 - A temple in your realm has burned down +# 100 = tgp_japan_yearly_events.1080 # 1080 - Someone is fishing in the tsuri-dono +# 10 = tgp_japan_yearly_events.1090 # 1090 - Growing old with no heir +# 20 = tgp_japan_yearly_events.1100 # 1100 - You contract Guilt Fever +# 100 = tgp_japan_yearly_events.1110 # 1110 - An animal is seen near the shrine of a God #5 = tgp_japan_yearly_events.1070 # 1070 A temple in your realm has burned down - 10 = tgp_japan_yearly_events.1090 # 1090 - Growing old with no heir - 20 = tgp_japan_yearly_events.1100 # 1100 - You contract Guilt Fever - 100 = tgp_japan_yearly_events.1110 # 1110 - An animal is seen near the shrine of a God - 50 = tgp_japan_yearly_events.1130 # 1130 - Your daughter expresses an interest in poetry - 50 = tgp_japan_yearly_events.1150 # 1150 - The emperor is passing in your lands - 100 = tgp_japan_yearly_events.1160 # 1160 - You are offered a concubine from a rival house - 100 = tgp_japan_yearly_events.1170 # 1170 - The prose that you're reading is of an unknown language - 50 = tgp_japan_yearly_events.1180 # 1180 - You've been gifted a Bonsai tree for your garden - 20 = tgp_japan_yearly_events.1190 # 1190 - You have a bad trait and you're making some decisions at night - 200 = tgp_japan_yearly_events.1200 # 1200 - Congestion in the Capital - 200 = tgp_japan_yearly_events.1210 # 1210 - Fit to Lead - 200 = tgp_japan_yearly_events.1225 # 1225 - A Poetic Life - 25 = tgp_japan_yearly_events.1220 # 1220 - You've witnessed a miracle made by a Buddhist monk - 25 = tgp_japan_yearly_events.1230 # 1230 - Fear of a low durability artifact coming to life (Yokai) - 100 = tgp_japan_yearly_events.1240 # 1240 - A traveler poet visits court and can't read from right to left - 100 = tgp_japan_yearly_events.1260 #1260 - Begin a journey of poetic discovery +# 10 = tgp_japan_yearly_events.1090 # 1090 - Growing old with no heir +# 20 = tgp_japan_yearly_events.1100 # 1100 - You contract Guilt Fever +# 100 = tgp_japan_yearly_events.1110 # 1110 - An animal is seen near the shrine of a God +# 50 = tgp_japan_yearly_events.1130 # 1130 - Your daughter expresses an interest in poetry +# 50 = tgp_japan_yearly_events.1150 # 1150 - The emperor is passing in your lands +# 100 = tgp_japan_yearly_events.1160 # 1160 - You are offered a concubine from a rival house +# 100 = tgp_japan_yearly_events.1170 # 1170 - The prose that you're reading is of an unknown language +# 50 = tgp_japan_yearly_events.1180 # 1180 - You've been gifted a Bonsai tree for your garden +# 20 = tgp_japan_yearly_events.1190 # 1190 - You have a bad trait and you're making some decisions at night +# 200 = tgp_japan_yearly_events.1200 # 1200 - Congestion in the Capital +# 200 = tgp_japan_yearly_events.1210 # 1210 - Fit to Lead +# 200 = tgp_japan_yearly_events.1225 # 1225 - A Poetic Life +# 25 = tgp_japan_yearly_events.1220 # 1220 - You've witnessed a miracle made by a Buddhist monk +# 25 = tgp_japan_yearly_events.1230 # 1230 - Fear of a low durability artifact coming to life (Yokai) +# 100 = tgp_japan_yearly_events.1240 # 1240 - A traveler poet visits court and can't read from right to left +# 100 = tgp_japan_yearly_events.1260 #1260 - Begin a journey of poetic discovery # TGP- Mandala Events 10000 = tgp_east_asia_mandala_events.9000 #Freak accident makes you seem inclined to divinity @@ -3907,6 +4076,41 @@ on_yearly_events = { 1200 = elder_events.1500 # Faltering heart - Chance to kill your spouse if you're young and they are old 1600 = elder_events.1600 # Faltering heart/Fragile bones/Infirm - Lose athletic + # GDP - Merchant Events + 300 = gdp_merchant.0010 #Associate asks to be adopted + 300 = gdp_merchant.0020 #Associates struggle for empty/ineffectual Partner position + 300 = gdp_merchant.1100 # Merchant overcrowded + 300 = gdp_merchant.0025 # Artisan Purpose Recruitment Opportunity + 300 = gdp_merchant.0030 # Creditor Purpose Recruitment Opportunity + 300 = gdp_merchant.0035 # Caravaneer Purpose Recruitment Opportunity + 300 = gdp_merchant.3000 # Translator court position boon + 300 = gdp_merchant.3010 # Fixer court position boon + 300 = gdp_merchant.3020 # Bailiff court position boon + 300 = gdp_merchant.3030 # Market Agent court position boon + 300 = gdp_merchant.3040 # Antiquarian court position boon + 300 = gdp_merchant.4000 # You are a Silk Road Merchant in China/Korea who isn't Confucian + 300 = gdp_merchant.4010 # You're a Merchant in China/Korea who hasn't taken the exam + 300 = gdp_merchant.4030 # You're a Merchant outside of the Silk Road hearing about it + + # GDP - Republic Events + 300 = yearly_republic.1001 #Spouse ask you to stop working late and come to bed. + 300 = yearly_republic.1002 #Spouse's bad opinion of you cause friction with her house. + 300 = yearly_republic.1003 #Young relative has been in a fight that might cause friction with another house. + 300 = yearly_republic.1005 #The masses have grown tired of the feud between two houses and demand change. + 300 = yearly_republic.1008 # A patrician has hired a bandit for ill-deeds. + 300 = yearly_republic.1009 # A spouse has set up a salon to spy on her peers. + 300 = yearly_republic.1010 # An ambassador will report secrets in the palace and you can spy on them from the roof. + 300 = yearly_republic.1011 # A summons from the council gives opportunity to shirk your duties. + 10000 = yearly_republic.1012 #Doge's procession (Once Per life. Blocked by Character Flag) + 1000 = yearly_republic.1013 #Marriage to the sea (Once Per life. Blocked by Character Flag) +# 300 = yearly_republic.1014 #Patrician with the same house ambition meet to align their interests. + 300 = yearly_republic.1015 #A patrician offers to sell you their vote at the next assembly + 300 = yearly_republic.1016 #You get the chance to threaten a patrician to have them give you their next vote. + 300 = yearly_republic.1017 #Three wise patricians have gathered for a debate. Influence them for the next vote using logic and reason! + 400 = yearly_republic.1018 #Get an artifact from a friend. + 300 = yearly_republic.1019 #Get some trade category experience. + 300 = yearly_republic.1020 #Get a modifier from a friendly house. + # BFJ 300 = blotsven.0001 # Blot-Sven starter event, gives you a chance at getting a claim for the kingdom of Sweden. @@ -4007,3 +4211,41 @@ on_yearly_tutorial_events = { 1 = tutorial.1001 } } + + +gdp_minority_merchant_pool_pulse = { + trigger = { + exists = global_var:gdp_minority_merchant_spawn_quota + global_var:gdp_minority_merchant_spawn_quota > 0 + is_pool_character = yes + is_ai = yes + gdp_minority_merchant_candidate_trigger = yes + } + events = { + gdp_merchant.4002 + } +} + + +gdp_merchant_pool_pulse = { + trigger = { + is_pool_character = yes + gdp_should_spawn_new_merchant_company_trigger = yes + } + random_events = { + chance_to_happen = 25 + 100 = gdp_merchant.4001 # Pool character becomes a merchant company + } +} + + +lifestyle_progress_pulse = { + first_valid_on_action = { + stewardship_lifestyle_progress_pulse + intrigue_lifestyle_progress_pulse + diplomacy_lifestyle_progress_pulse + martial_lifestyle_progress_pulse + learning_lifestyle_progress_pulse + wanderer_lifestyle_progress_pulse + } +} diff --git a/common/script_values/00_building_values.txt b/common/script_values/00_building_values.txt index 91b63b2aa..128e1ce21 100644 --- a/common/script_values/00_building_values.txt +++ b/common/script_values/00_building_values.txt @@ -334,6 +334,7 @@ @cheap_cost_base = 30 @normal_cost_base = 60 @expensive_cost_base = 90 +@very_expensive_cost_base = @[expensive_cost_base * 2] @main_cost_base = 100 @main_cost_new_holding = 200 @tribal_cost_base = 15 @@ -346,6 +347,7 @@ @cheap_cost_scale_addition_per_tier = 15 @normal_cost_scale_addition_per_tier = 30 @expensive_cost_scale_addition_per_tier = 45 +@very_expensive_cost_scale_addition_per_tier = @[expensive_cost_scale_addition_per_tier * 2] @main_cost_scale_addition_per_tier = 50 @tribal_cost_scale_addition_per_tier = 5 diff --git a/common/script_values/00_travel_values.txt b/common/script_values/00_travel_values.txt index 5ecb1a621..5aef0d3a3 100644 --- a/common/script_values/00_travel_values.txt +++ b/common/script_values/00_travel_values.txt @@ -1,4 +1,7 @@ -traveler_rank_up_1_threshold = 10 +terrain_sell_price_mult = 0.001 +terrain_buy_price_mult = -0.001 + +traveler_rank_up_1_threshold = 10 traveler_rank_up_2_threshold = 20 traveler_rank_up_3_threshold = 30 traveler_rank_up_4_threshold = 40 diff --git a/common/script_values/00_war_values.txt b/common/script_values/00_war_values.txt index b87e99bad..1fcb0822e 100644 --- a/common/script_values/00_war_values.txt +++ b/common/script_values/00_war_values.txt @@ -1058,4 +1058,168 @@ ai_overlord_defensive_power_impact = { add = -0.2 } else = {} -} \ No newline at end of file +} + +reparations_max_debt_years_value = 1 + + +aggressive_cb_ai_score_mult = { + value = 1 + if = { + limit = { + # other govs are ignored intentionally: you might be able to hold tribal as merits but that is not a good idea + scope:attacker = { + NOR = { + government_has_flag = government_is_tribal + government_has_flag = government_is_nomadic + government_has_flag = government_is_landless_adventurer # you change to those govs when you get land anyway + } + } + any_in_list = { + list = target_titles + feudal_clan_tribal_conquest_constraints = yes + } + } + multiply = 0 + } + multiply = zealous_war_on_head_of_faith_ai_score_value + multiply = struggle_wars_prioritise_struggle_targets_value + multiply = byzantium_conquests_ai_score_value + multiply = muslim_invasions_prefer_nonmuslims_ai_score_value + multiply = pam_peace_of_god_coreligionist_war_ai_score_value +} + + +common_cb_ai_score_mult = { + value = 1 + multiply = frankokratia_leader_protection_value + multiply = mongol_invader_regular_cb_ai_score_value +} + + +common_cb_ai_score_mult_additive = { + add = house_relation_ai_score_value +} + + +# NEOW 2555: no historical Mongol invasion story cycle. Neutralise legacy CB exception. +mongol_invader_regular_cb_ai_score_value = 1 + + +religious_cb_ai_score_mult = { + value = 1 + # Increase odds if the character is a vassal with Ghazi Contract + if = { + limit = { + scope:attacker = { + top_liege != this + vassal_contract_has_flag = vassal_contract_cheaper_religious_war + } + } + add = 1 + } + # Holy Wars are limited to connected neighbours to limit big empire expansions over weak realms. + if = { + limit = { religious_war_vassals_constraints = yes } + multiply = 0 + } +} + + +reparations_gold_debt_divisor_value = { + value = 1 + if = { + limit = { + gold < 0 + yearly_character_income > 0 + } + add = { + value = gold + multiply = -1 + divide = yearly_character_income + } + } +} + + +reparations_max_gold_payment_value = { + value = yearly_character_income + multiply = reparations_max_debt_years_value + if = { + limit = { gold > 0 } + add = gold + } + else = { + divide = reparations_gold_debt_divisor_value + } + min = 1 +} + + +reparations_max_payment_value = { + value = yearly_character_income + multiply = reparations_max_debt_years_value + if = { + limit = { + has_treasury = yes + government_allows = replace_gold_cost_by_treasury + } + if = { + limit = { treasury > 0 } + add = treasury + } + else = { + divide = reparations_treasury_debt_divisor_value + } + } + else_if = { + limit = { gold > 0 } + add = gold + } + else = { + divide = reparations_gold_debt_divisor_value + } + min = 1 +} + + +reparations_treasury_debt_divisor_value = { + value = 1 + if = { + limit = { + treasury < 0 + yearly_character_income > 0 + } + add = { + value = treasury + multiply = -1 + divide = yearly_character_income + } + } +} + + +vassalization_cb_ai_score_mult = { + if = { + limit = { + OR = { + AND = { + scope:attacker = { + NOT = { government_has_flag = government_is_tribal } + } + scope:defender = { + government_has_flag = government_is_tribal + } + } + scope:attacker = { + government_has_flag = government_is_mandala + vassal_limit_available < 1 + } + } + } + value = 0 + } + else = { + value = 1 + } +} diff --git a/common/script_values/06_ce1_epidemics_values.txt b/common/script_values/06_ce1_epidemics_values.txt index 74a583a95..a34ef5e6c 100644 --- a/common/script_values/06_ce1_epidemics_values.txt +++ b/common/script_values/06_ce1_epidemics_values.txt @@ -1826,3 +1826,55 @@ former_infected_county_count = { add = 0.1 } } + + +epidemic_prosperity_loss_value = { + subtract = scope:base_loss + + #This feeds into change_prosperity_progress in 00_epidemics + #minimal_prosperity_progress_loss is 10 and massive_prosperity_progress_loss is 100, so aim between them (as a negative value) + + #Modifiers cover widespread loss, so we hit high-prosperity counties harder here + + scope:epidemic = { + switch = { + trigger = outbreak_intensity + minor = { subtract = 2.5 } + major = { subtract = 5 } + apocalyptic = { subtract = 7.5 } + } + } + + # Prosperity + subtract = { + value = prosperity_level + multiply = 0.3 + } + + multiply = { + value = 6 + divide = num_county_holdings + } + + multiply = { + value = 100 + subtract = title_province.epidemic_resistance + multiply = 0.005 + add = 1 + } +} + + +spread_settlement_size_mult_value = { + value = 1 + if = { + limit = { + province_size_level > spread_settlement_size_level_threshold + } + add = { + value = province_size_level + subtract = spread_settlement_size_level_threshold + multiply = spread_increase_mult_per_settlement_size_level + } + } +} diff --git a/common/script_values/NEOW_custom_values.txt b/common/script_values/NEOW_custom_values.txt index 6a28f50d7..27fb7c005 100644 --- a/common/script_values/NEOW_custom_values.txt +++ b/common/script_values/NEOW_custom_values.txt @@ -2,4 +2,8 @@ value = highest_held_title_tier subtract = 2 min = tier_barony -} \ No newline at end of file +} + +# CK3 1.21: the old AI estate modifier value is no longer defined by vanilla. +# Retain its neutral weighting in NEOW palace/minority buildings. +estate_building_ai_modifier_value = 0 diff --git a/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt b/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt new file mode 100644 index 000000000..0682ad10f --- /dev/null +++ b/common/scripted_effects/00_gdp_guelph_ghibelline_scripted_effects.txt @@ -0,0 +1,2700 @@ +############################### +# Guelph & Ghibelline Effects +############################### + +gg_invalidation_missing_leader_message_effect = { + situation:guelph_ghibelline ?= { + #All players + every_situation_participant = { + limit = { + is_ai = no + } + send_interface_toast = { + type = event_toast_effect_neutral + title = gg_invalidation_title + if = { + limit = { $MISSING_LEADER$ = flag:guelph } + custom_tooltip = gg_invalidation_missing_guelph_leader_tt + debug_log = "Guelphs are missing a leader! Invalidating GG" + debug_log_scopes = yes + } + else_if = { + limit = { $MISSING_LEADER$ = flag:ghibelline } + custom_tooltip = gg_invalidation_missing_ghibelline_leader_tt + debug_log = "Ghibellines are missing a leader! Invalidating GG" + debug_log_scopes = yes + } + else_if = { + limit = { $MISSING_LEADER$ = flag:hre } + custom_tooltip = gg_invalidation_missing_hre_leader_tt + debug_log = "There is no HRE holder! Invalidating GG" + debug_log_scopes = yes + } + else_if = { + limit = { $MISSING_LEADER$ = flag:1066_hre_not_leader } + custom_tooltip = gg_invalidation_missing_hre_leader_dictatus_tt + debug_log = "The HRE is not Ghibelline leader in Prelude! Invalidating GG" + debug_log_scopes = yes + } + else_if = { + limit = { $MISSING_LEADER$ = flag:1066_pope_not_leader } + custom_tooltip = gg_invalidation_missing_pope_leader_dictatus_tt + debug_log = "The Pope is not Guelph leader in Prelude! Invalidating GG" + debug_log_scopes = yes + } + else_if = { + limit = { $MISSING_LEADER$ = flag:pope_is_emperor } + custom_tooltip = gg_invalidation_pope_is_emperor_tt + debug_log = "The Pope and the Emperor are the same character! Invalidating GG" + debug_log_scopes = yes + } + else = { + custom_tooltip = gg_invalidation_missing_pope_leader_tt + debug_log = "There is no Pope! Invalidating GG" + debug_log_scopes = yes + } + show_as_tooltip = { + situation:guelph_ghibelline = { end_situation = yes } + } + } + } + } +} + +try_set_up_new_gg_leader_effect = { + save_temporary_scope_as = gg_departing_leader + #Special handling to make sure Pope stays Guelph leader, and HRE inheritor stays Ghibelline leader + if = { + limit = { + gg_phase_is_pre_gg_trigger = yes + exists = var:guelph_leader + } + if = { + limit = { + exists = title:k_papal_state + this != title:k_papal_state.holder + title:k_papal_state.holder = { + NOT = { exists = var:guelph_leader } + } + } + title:k_papal_state.holder = { + set_variable = guelph_leader + recalculate_participant_group = situation:guelph_ghibelline + if = { + limit = { NOT = { exists = var:gg_involvement } } + set_variable = { + name = gg_involvement + value = gg_involvement_base_value + } + } + } + remove_variable = guelph_leader + recalculate_participant_group = situation:guelph_ghibelline + } + } + else_if = { + limit = { + gg_phase_is_pre_gg_trigger = yes + exists = var:ghibelline_leader + } + if = { + limit = { + exists = title:e_hre + this != title:e_hre.holder + title:e_hre.holder = { + NOT = { exists = var:ghibelline_leader } + } + } + title:e_hre.holder = { + set_variable = ghibelline_leader + recalculate_participant_group = situation:guelph_ghibelline + if = { + limit = { NOT = { exists = var:gg_involvement } } + set_variable = { + name = gg_involvement + value = gg_involvement_base_value + } + } + } + remove_variable = ghibelline_leader + recalculate_participant_group = situation:guelph_ghibelline + } + } + else = { + if = { + limit = { has_variable = guelph_leader } + if = { + limit = { + primary_heir ?= { + this != scope:gg_departing_leader # Republics can re-elect, so the primary heir may be this dead ruler + save_temporary_scope_as = heir_check + situation:guelph_ghibelline ?= { + any_situation_participant = { this = scope:heir_check } + } + NOR = { + has_variable = ghibelline_leader + any_held_title = { this = title:k_papal_state } + } + top_liege = scope:gg_departing_leader + } + } + primary_heir = { + set_variable = guelph_leader + save_scope_as = new_gg_leader + } + } + else_if = { + limit = { + situation:guelph_ghibelline = { + situation_participant_group:guelph_member = { + any_situation_group_participant = { + count >= 1 + NOT = { + any_held_title = { this = title:k_papal_state } + } + } + } + } + } + situation:guelph_ghibelline = { + situation_participant_group:guelph_member = { + ordered_situation_group_participant = { + limit = { + NOT = { + any_held_title = { this = title:k_papal_state } + } + } + order_by = primary_title.tier + set_variable = guelph_leader + save_scope_as = new_gg_leader + } + } + } + } + else = { + save_scope_value_as = { + name = missing_leader + value = flag:guelph + } + gg_invalidation_missing_leader_message_effect = { MISSING_LEADER = scope:missing_leader } + situation:guelph_ghibelline = { end_situation = yes } + } + remove_variable = guelph_leader + } + if = { + limit = { has_variable = ghibelline_leader } + if = { + limit = { + primary_heir ?= { + this != scope:gg_departing_leader + save_temporary_scope_as = heir_check + situation:guelph_ghibelline ?= { + any_situation_participant = { this = scope:heir_check } + } + NOT = { has_variable = guelph_leader } + top_liege = scope:gg_departing_leader + } + } + primary_heir = { + set_variable = ghibelline_leader + save_scope_as = new_gg_leader + } + } + else_if = { + limit = { + situation:guelph_ghibelline = { + situation_participant_group:ghibelline_member = { + any_situation_group_participant = { count >= 1 } + } + } + } + situation:guelph_ghibelline = { + situation_participant_group:ghibelline_member = { + ordered_situation_group_participant = { + order_by = primary_title.tier + set_variable = ghibelline_leader + save_scope_as = new_gg_leader + } + } + } + } + else = { + save_scope_value_as = { + name = missing_leader + value = flag:ghibelline + } + gg_invalidation_missing_leader_message_effect = { MISSING_LEADER = scope:missing_leader } + situation:guelph_ghibelline = { end_situation = yes } + } + remove_variable = ghibelline_leader + } + if = { + limit = { exists = situation:guelph_ghibelline } + custom_tooltip = { + text = new_gg_leader_tt + scope:new_gg_leader = { recalculate_participant_group = situation:guelph_ghibelline } + recalculate_participant_group = situation:guelph_ghibelline + } + } + } +} + + +gg_gather_claim_leadership_schemes_effect = { + hidden_effect = { + every_targeting_scheme = { + limit = { scheme_type = gg_claim_leadership } + add_to_temporary_list = gg_claim_leadership_schemes_to_invalidate + } + } +} + +gg_become_new_leader_effect = { + save_scope_as = root_scope + save_scope_value_as = { + name = gg_leadership_change_source + value = $VIA_SCHEME$ + } + if = { + limit = { is_guelph_trigger = yes } + situation:guelph_ghibelline ?= { + every_situation_participant = { + limit = { is_guelph_leader_trigger = yes } + gg_gather_claim_leadership_schemes_effect = yes + if = { + limit = { + NOR = { + has_relation_friend = scope:root_scope + opinion = { + target = scope:root_scope + value >= 80 + } + } + } + progress_towards_rival_effect = { + REASON = rival_overthrown_guelph_leader + CHARACTER = scope:root_scope + OPINION = 0 + } + add_opinion = { + target = scope:root_scope + modifier = seized_guelph_leadership_opinion + opinion = -40 + } + } + remove_variable = guelph_leader + save_scope_as = affected_character #For the tooltip + create_character_memory = { + type = lost_guelph_leadership_memory + participants = { usurper = scope:root_scope } + } + if = { + limit = { scope:gg_leadership_change_source = flag:scheme } + scope:new_memory = { set_variable = via_scheme } + } + custom_tooltip = { + text = change_to_guelph_tt + recalculate_participant_group = situation:guelph_ghibelline + } + set_variable = { + name = recently_overthrown_gg_leader + years = 5 + } + } + } + custom_tooltip = { + text = become_new_guelph_leader_tt + set_variable = guelph_leader + recalculate_participant_group = situation:guelph_ghibelline + } + create_character_memory = { type = became_guelph_leader_memory } + } + else = { + situation:guelph_ghibelline ?= { + every_situation_participant = { + limit = { is_ghibelline_leader_trigger = yes } + gg_gather_claim_leadership_schemes_effect = yes + if = { + limit = { + NOR = { + has_relation_friend = scope:root_scope + opinion = { + target = scope:root_scope + value >= 80 + } + } + } + progress_towards_rival_effect = { + REASON = rival_overthrown_ghibelline_leader + CHARACTER = scope:root_scope + OPINION = 0 + } + add_opinion = { + target = scope:root_scope + modifier = seized_ghibelline_leadership_opinion + opinion = -40 + } + } + remove_variable = ghibelline_leader + save_scope_as = affected_character #For the tooltip + create_character_memory = { + type = lost_ghibelline_leadership_memory + participants = { usurper = scope:root_scope } + } + if = { + limit = { scope:gg_leadership_change_source = flag:scheme } + scope:new_memory = { set_variable = via_scheme } + } + custom_tooltip = { + text = change_to_ghibelline_tt + recalculate_participant_group = situation:guelph_ghibelline + } + set_variable = { + name = recently_overthrown_gg_leader + years = 5 + } + } + } + custom_tooltip = { + text = become_new_ghibelline_leader_tt + set_variable = ghibelline_leader + recalculate_participant_group = situation:guelph_ghibelline + } + create_character_memory = { type = became_ghibelline_leader_memory } + } + hidden_effect = { + every_in_list = { + list = gg_claim_leadership_schemes_to_invalidate + invalidate_scheme = yes + } + } +} + +gg_claim_leadership_exposed_failure_effect = { + scope:target = { + if = { + limit = { is_guelph_trigger = yes } + progress_towards_rival_effect = { + REASON = rival_attempted_to_replace_guelph_leader + CHARACTER = scope:owner + OPINION = -20 + } + } + else = { + progress_towards_rival_effect = { + REASON = rival_attempted_to_replace_ghibelline_leader + CHARACTER = scope:owner + OPINION = -20 + } + } + } + scope:owner = { add_prestige = medium_prestige_loss } +} + + +gg_clean_up_participant_groups_effect = { + remove_variable = recruited_guelphs_num + remove_variable = recruited_ghibelline_num +} + +gg_clean_up_swap_variables_effect = { + remove_variable = guelph_member_override + remove_variable = ghibelline_member_override +} + +gg_clean_up_pope_modifiers_effect = { + #Remove Pope-specific GG modifiers + if = { + limit = { + faith = { + OR = { + religion != religion:christianity_religion + has_doctrine_parameter = no_head_of_faith + } + } + } + if = { + limit = { has_character_modifier = favored_by_pope_modifier } + remove_character_modifier = favored_by_pope_modifier + } + if = { + limit = { has_character_modifier = scorned_pope_modifier } + remove_character_modifier = scorned_pope_modifier + } + } +} + + + +gg_swap_to_undecided_effect = { + if = { + limit = { is_guelph_or_ghibelline_trigger = yes } + if = { + limit = { + OR = { + has_variable = guelph_leader + has_variable = ghibelline_leader + } + } + try_set_up_new_gg_leader_effect = yes + } + save_scope_as = affected_character + if = { + limit = { $USE_MODIFIERS$ = flag:yes } + if = { + limit = { is_guelph_trigger = yes } + add_character_modifier = { + modifier = left_guelphs_modifier + years = 10 + } + } + if = { + limit = { is_ghibelline_trigger = yes } + add_character_modifier = { + modifier = left_ghibellines_modifier + years = 10 + } + } + } + custom_tooltip = { + text = change_to_undecided_tt + gg_clean_up_participant_groups_effect = yes + gg_clean_up_swap_variables_effect = yes + set_variable = undecided_override + recalculate_participant_group = situation:guelph_ghibelline + } + } +} + +gg_swap_to_undecided_forced_effect = { + gg_swap_to_undecided_effect = { USE_MODIFIERS = $USE_MODIFIERS$ } + set_variable = { + name = force_undecided + years = 10 + } +} + +gg_change_side_to_ghibelline_effect = { + save_scope_as = affected_character + + if = { + limit = { $REASON$ = flag:schemed } + if = { + limit = { is_guelph_trigger = yes } + gg_untargeted_catalyst_effect = { CATALYST = catalyst_gg_partisan_poached } + } + else_if = { + limit = { is_gg_undecided_trigger = yes } + gg_untargeted_catalyst_effect = { CATALYST = catalyst_gg_undecided_aligned } + } + } + + remove_variable = guelph_member_override + remove_variable = undecided_override #Remember to account for force_undecided + set_variable = ghibelline_member_override + + custom_tooltip = { + text = change_to_ghibelline_tt + recalculate_participant_group = situation:guelph_ghibelline + } + + if = { + limit = { $REASON$ = flag:decision } + set_variable = { + name = changed_to_ghibelline + years = 40 + } + situation:guelph_ghibelline ?= { + every_situation_participant = { + custom = custom.every_guelph_member + limit = { + is_guelph_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_ghibellines_opinion + opinion = -40 + } + } + every_situation_participant = { + custom = custom.every_ghibelline_member + limit = { + is_ghibelline_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_ghibellines_opinion + opinion = 20 + } + } + #To make the tooltip more sensible + every_situation_participant = { + limit = { + is_guelph_trigger = yes + NOT = { this = scope:affected_character } + } + if = { + limit = { has_relation_potential_rival = scope:affected_character } + progress_towards_rival_effect = { + REASON = rival_swapped_to_ghibellines + CHARACTER = scope:affected_character + OPINION = 0 + } + } + } + } + } + if = { + limit = { $REASON$ = flag:schemed } + set_variable = { + name = schemed_to_ghibelline + years = 15 + } + situation:guelph_ghibelline ?= { + every_situation_participant = { + custom = custom.every_guelph_member + limit = { + is_guelph_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_ghibellines_opinion + opinion = -20 + } + } + every_situation_participant = { + custom = custom.every_ghibelline_member + limit = { + is_ghibelline_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_ghibellines_opinion + opinion = 10 + } + } + } + } +} + +gg_change_side_to_guelph_effect = { + save_scope_as = affected_character + + if = { + limit = { $REASON$ = flag:schemed } + if = { + limit = { is_ghibelline_trigger = yes } + gg_untargeted_catalyst_effect = { CATALYST = catalyst_gg_partisan_poached } + } + else_if = { + limit = { is_gg_undecided_trigger = yes } + gg_untargeted_catalyst_effect = { CATALYST = catalyst_gg_undecided_aligned } + } + } + + remove_variable = ghibelline_member_override + remove_variable = undecided_override #Remember to account for force_undecided + set_variable = guelph_member_override + + custom_tooltip = { + text = change_to_guelph_tt + recalculate_participant_group = situation:guelph_ghibelline + } + + if = { + limit = { $REASON$ = flag:decision } + set_variable = { + name = changed_to_guelph + years = 40 + } + situation:guelph_ghibelline ?= { + every_situation_participant = { + custom = custom.every_ghibelline_member + limit = { + is_ghibelline_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_guelphs_opinion + opinion = -40 + } + } + every_situation_participant = { + custom = custom.every_guelph_member + limit = { + is_guelph_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_guelphs_opinion + opinion = 20 + } + } + #To make the tooltip more sensible + every_situation_participant = { + limit = { + is_ghibelline_trigger = yes + NOT = { this = scope:affected_character } + } + if = { + limit = { has_relation_potential_rival = scope:affected_character } + progress_towards_rival_effect = { + REASON = rival_swapped_to_guelphs + CHARACTER = scope:affected_character + OPINION = 0 + } + } + } + } + } + + if = { + limit = { $REASON$ = flag:schemed } + set_variable = { + name = schemed_to_guelph + years = 15 + } + situation:guelph_ghibelline ?= { + every_situation_participant = { + custom = custom.every_ghibelline_member + limit = { + is_ghibelline_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_guelphs_opinion + opinion = -20 + } + } + every_situation_participant = { + custom = custom.every_guelph_member + limit = { + is_guelph_trigger = yes + NOT = { this = scope:affected_character } + } + add_opinion = { + target = scope:affected_character + modifier = joined_guelphs_opinion + opinion = 20 + } + } + } + } +} + +gg_increment_recruitment_var_effect = { + if = { + limit = { is_guelph_trigger = yes } + increment_variable_effect = { + VAR = recruited_guelphs_num + VAL = 1 + } + } + else = { + increment_variable_effect = { + VAR = recruited_ghibelline_num + VAL = 1 + } + } +} + + +#Endings +gg_guelph_situation_victory_effect = { + #if = { + # limit = { has_dlc_feature = legends } + # legend_seed_struggle_ending_effect = { + # ENDER = root + # STRUGGLE = iberian_struggle + # } + #} + save_scope_as = root_scope + + ##### Major Effects ##### + situation:guelph_ghibelline ?= { + #Guelph Leader + every_situation_participant = { + custom = custom.every_guelph_leader + limit = { has_variable = guelph_leader } + dynasty ?= { add_dynasty_prestige = prev.gg_leader_victory_renown } + save_scope_as = current_guelph_leader + } + #Guelph Members + every_situation_participant = { + custom = custom.every_guelph_only_member + limit = { + is_guelph_trigger = yes + NOR = { + has_variable = guelph_leader + dynasty ?= scope:current_guelph_leader.dynasty + } + } + dynasty ?= { add_dynasty_prestige = prev.gg_supporter_victory_renown } + } + #Guelphs + every_situation_participant = { + custom = custom.every_guelph_member + limit = { is_guelph_trigger = yes } + add_character_modifier = guelph_victor_modifier + if = { + limit = { + NOT = { this = title:k_papal_state.holder } + } + add_character_modifier = { + modifier = favored_by_pope_modifier + years = 30 + } + custom_tooltip = { + text = every_guelph_favored_by_pope_tt + title:k_papal_state.holder ?= { + add_opinion = { + modifier = favored_by_pope_opinion + target = prev + opinion = gg_pope_opinion_value + } + } + } + } + } + #Ghibellines + every_situation_participant = { + custom = custom.every_ghibelline_member + limit = { is_ghibelline_trigger = yes } + dynasty ?= { + add_dynasty_modifier = { + modifier = ghibelline_defeat_dynasty_modifier + years = 50 + } + } + add_character_modifier = { + modifier = ghibelline_loser_modifier + years = 30 + } + } + } + #The Italians disrespect the Germans slightly more now + culture:italian = { + change_cultural_acceptance = { + target = title:e_hre.holder.culture + value = -20 + desc = guelph_victory_cultural_acceptance_decline + } + } + #Any HRE vassal in Northern Italy becomes independent + title:e_hre.holder ?= { + every_vassal = { + custom = custom.every_hre_vassal_northern_italy + limit = { + primary_title = { + title_province = { geographical_region = gdp_guelph_ghibelline_northern_italy_region } + } + } + create_title_and_vassal_change = { + type = independency + save_scope_as = change + } + becomes_independent = { change = scope:change } + resolve_title_and_vassal_change = scope:change + } + } + + #Your involvement score + if = { + limit = { + is_guelph_trigger = yes + has_variable = guelph_leader + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_victory_leader_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_leader_involvement_renown } + } + } + else_if = { + limit = { + is_guelph_trigger = yes + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_victory_member_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_supporter_involvement_renown } + } + } + else_if = { + limit = { + is_guelph_or_ghibelline_trigger = no + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_victory_predicted_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_supporter_involvement_renown } + } + } + + custom_description_no_bullet = { + text = guelph_victory_hre_effects + #HRE may not declare wars on Northern Italians for a good while + set_global_variable = { + name = gg_hre_no_cb_northern_italy + years = gg_hre_no_cb_northern_italy_years_value + } + #HRE aren't allowed to declare wars on their Theocratic vassals anymore + set_global_variable = gg_ended_in_guelph_victory_no_hre_wars_on_theocratic_vassals + } + + if = { + limit = { + exists = title:k_papal_state.holder + title:k_papal_state.holder = { realm_law_use_church_authority = yes } + } + title:k_papal_state.holder = { + custom_tooltip = { + text = gg_guelph_victory_pope_church_authority_tt + change_authority_effect = { CHANGE = 1 } + } + } + } + + + #fp2_struggle_hostility_ender_effect = yes + + # Hispania is available! + #custom_tooltip = fp2_struggle_can_create_empire_of_hispania_tt + #custom_description_no_bullet = { text = fp2_struggle_house_tt } + + # Keep the Struggle Clash for your House + #custom_tooltip = fp2_struggle_can_keep_using_struggle_clash_tt + + # Damage opinion with other culture/faiths + #custom_tooltip = fp2_struggle_hostility_opinion_tt + #custom_tooltip = fp2_struggle_hostility_opinion_negative_tt + + # Choose Holy War boost, Culture War boost, or both + #custom_description_no_bullet = { text = fp2_struggle_hostility_list_tt } + + stress_and_fulfillment_impact = { + zealous = medium_stress_impact_loss + } + + # Achievements + #add_achievement_global_variable_effect = { + # VARIABLE = fp2_iberian_hostilities_achievement_unlocked + # VALUE = yes + #} +} + +gg_ghibelline_situation_victory_effect = { + save_scope_as = root_scope + ##### Major Effects ##### + situation:guelph_ghibelline ?= { + #Ghibelline Leader + every_situation_participant = { + custom = custom.every_ghibelline_leader + limit = { has_variable = ghibelline_leader } + dynasty ?= { add_dynasty_prestige = prev.gg_leader_victory_renown } + save_scope_as = current_ghibelline_leader + } + #Ghibelline Members + every_situation_participant = { + custom = custom.every_ghibelline_only_member + limit = { + is_ghibelline_trigger = yes + NOR = { + has_variable = ghibelline_leader + dynasty ?= scope:current_ghibelline_leader.dynasty + } + } + dynasty ?= { add_dynasty_prestige = prev.gg_supporter_victory_renown } + } + #Ghibellines + every_situation_participant = { + custom = custom.every_ghibelline_member + limit = { is_ghibelline_trigger = yes } + dynasty ?= { + add_dynasty_modifier = { + modifier = ghibelline_victory_dynasty_modifier + years = 50 + } + } + add_character_modifier = ghibelline_victor_modifier + if = { + limit = { + NOT = { this = title:k_papal_state.holder } + } + add_character_modifier = { + modifier = scorned_pope_modifier + years = 30 + } + custom_tooltip = { + text = every_ghibelline_scorned_with_pope_tt + title:k_papal_state.holder = { + add_opinion = { + modifier = scorned_pope_opinion + target = prev + opinion = gg_pope_opinion_negative_value + } + } + } + } + } + #Guelphs + every_situation_participant = { + custom = custom.every_guelph_member + limit = { is_guelph_trigger = yes } + add_character_modifier = { + modifier = guelph_loser_modifier + years = 30 + } + } + } + + #Your involvement score + if = { + limit = { + is_ghibelline_trigger = yes + has_variable = ghibelline_leader + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_victory_leader_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_leader_involvement_renown } + } + } + else_if = { + limit = { + is_ghibelline_trigger = yes + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_victory_member_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_supporter_involvement_renown } + } + } + else_if = { + limit = { + is_guelph_or_ghibelline_trigger = no + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_victory_predicted_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_supporter_involvement_renown } + } + } + + #It's all HRE from here + custom_description_no_bullet = { #This looks better :colbert: + text = ghibelline_victory_hre_effects + title:k_italy = { set_de_jure_liege_title = title:e_hre } + title:k_romagna = { set_de_jure_liege_title = title:e_hre } + } + + if = { + limit = { + exists = title:k_papal_state.holder + title:k_papal_state.holder = { realm_law_use_church_authority = yes } + } + title:k_papal_state.holder = { + custom_tooltip = { + text = gg_ghibelline_victory_pope_church_authority_tt + change_authority_effect = { CHANGE = -1 } + } + } + } + + stress_and_fulfillment_impact = { + cynical = medium_stress_impact_loss + } + +} + + +#FOR THE INTERACTION. We use gg_situation_compromise_effect here and in gg_situation_compromise_actual_effect +gg_situation_compromise_display_effect = { + ##### Major Effects ##### + $GUELPH_LEADER$ = { save_scope_as = current_guelph_leader } + $GHIBELLINE_LEADER$ = { save_scope_as = current_ghibelline_leader } + #Leaders + scope:actor = { + custom_tooltip = { + text = actor_compromise_renown_tt + dynasty ?= { + add_dynasty_prestige = { + add = prev.gg_leader_compromise_renown + multiply = gg_compromise_factor + } + } + } + if = { + limit = { is_guelph_trigger = yes } + custom_description_no_bullet = { text = gg_increased_by_independent_guelph_supporters } + } + else = { + custom_description_no_bullet = { text = gg_increased_by_independent_ghibelline_supporters } + } + add_character_modifier = { + modifier = compromising_leader_modifier + years = 25 + } + } + scope:recipient = { + custom_tooltip = { + text = recipient_compromise_renown_tt + dynasty ?= { + add_dynasty_prestige = { + add = prev.gg_leader_compromise_renown + multiply = gg_compromise_factor + } + } + } + if = { + limit = { is_guelph_trigger = yes } + custom_description_no_bullet = { text = gg_increased_by_independent_guelph_supporters } + } + else = { + custom_description_no_bullet = { text = gg_increased_by_independent_ghibelline_supporters } + } + add_character_modifier = { + modifier = compromising_leader_modifier + years = 25 + } + } + #Let's be friends + custom_tooltip = { + text = italian_hre_culture_acceptance_tt + culture:italian = { + change_cultural_acceptance = { + target = title:e_hre.holder.culture + value = gg_compromise_cultural_acceptance_increase + desc = guelph_victory_cultural_acceptance_growth + } + } + } + #Lose some control + custom_tooltip = { + text = every_county_in_every_hre_vassal_northern_italy + title:e_hre.holder ?= { + every_vassal = { + custom = custom.every_hre_vassal_northern_italy + limit = { + primary_title = { + title_province = { geographical_region = gdp_guelph_ghibelline_northern_italy_region } + } + } + every_realm_county = { + custom = every_county + change_county_control = 10 + add_county_modifier = ghibelline_compromise_county_modifier + } + } + } + } + + gg_situation_compromise_effect = yes +} + +#FOR THE EVENT +gg_situation_compromise_actual_effect = { + ##### Major Effects ##### + $GUELPH_LEADER$ = { save_scope_as = current_guelph_leader } + $GHIBELLINE_LEADER$ = { save_scope_as = current_ghibelline_leader } + #Leaders + scope:current_guelph_leader = { + dynasty ?= { + add_dynasty_prestige = { + add = prev.gg_leader_compromise_renown + multiply = gg_compromise_factor + } + } + custom_description_no_bullet = { text = gg_increased_by_independent_guelph_supporters } + add_character_modifier = { + modifier = compromising_leader_modifier + years = 25 + } + } + scope:current_ghibelline_leader = { + dynasty ?= { + add_dynasty_prestige = { + add = prev.gg_leader_compromise_renown + multiply = gg_compromise_factor + } + } + custom_description_no_bullet = { text = gg_increased_by_independent_ghibelline_supporters } + add_character_modifier = { + modifier = compromising_leader_modifier + years = 25 + } + } + #Let's be friends + culture:italian = { + change_cultural_acceptance = { + target = title:e_hre.holder.culture + value = 5 + desc = guelph_victory_cultural_acceptance_growth + } + } + #Lose some control + title:e_hre.holder ?= { + every_vassal = { + custom = custom.every_hre_vassal_northern_italy + limit = { + primary_title = { + title_province = { geographical_region = gdp_guelph_ghibelline_northern_italy_region } + } + } + every_realm_county = { + custom = every_county + change_county_control = gg_ghibelline_compromise_control_negative_value + add_county_modifier = { + modifier = ghibelline_compromise_county_modifier + years = gg_ghibelline_compromise_modifier_length_years + } + } + } + } + gg_situation_compromise_effect = yes +} + +gg_situation_compromise_involvement_effect = { + save_scope_as = root_scope + if = { + limit = { + OR = { + AND = { + is_ghibelline_trigger = yes + has_variable = ghibelline_leader + } + AND = { + is_guelph_trigger = yes + has_variable = guelph_leader + } + } + has_variable = gg_involvement + var:gg_involvement > gg_involvement_base_value + } + custom_description_no_bullet = { + text = gg_compromise_leader_involvement_effect + dynasty ?= { add_dynasty_prestige = scope:root_scope.gg_compromise_leader_involvement_renown } + } + } +} + +gg_situation_compromise_effect = { + situation:guelph_ghibelline ?= { + #All members + every_situation_participant = { + custom = custom.every_ghibelline_or_guelph_member + limit = { + OR = { + is_guelph_trigger = yes + is_ghibelline_trigger = yes + } + NOR = { + has_variable = guelph_leader + has_variable = ghibelline_leader + dynasty ?= scope:current_guelph_leader.dynasty + dynasty ?= scope:current_ghibelline_leader.dynasty + } + } + dynasty ?= { + add_dynasty_prestige = { + add = prev.gg_supporter_compromise_renown + multiply = gg_compromise_factor + } + } + } + } + custom_description_no_bullet = { + text = gg_compromise_effects + #HRE may not declare wars on Northern Italians for a good while + set_global_variable = { + name = gg_hre_no_cb_northern_italy + years = gg_ghibelline_compromise_modifier_length_years + } + } + stress_and_fulfillment_impact = { + arbitrary = medium_stress_impact_loss + content = medium_stress_impact_loss + humble = medium_stress_impact_loss + } +} + + + +#Catalysts +#Situation scope. Holds off catalyst_hostility_decay for a year +gg_record_hostility_effect = { + set_variable = { + name = gg_recent_hostility + years = 1 + } +} + +gg_triggered_catalyst_effect = { + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = $ACTOR$ SECOND = $RECIPIENT$ } + gg_phase_has_catalysts_trigger = yes + situation:guelph_ghibelline ?= { situation_top_has_catalyst = $CATALYST$ } + } + custom_tooltip = { + text = $CATALYST$_triggered_tt + situation:guelph_ghibelline ?= { + trigger_situation_catalyst = $CATALYST$ + gg_record_hostility_effect = yes + } + } + } +} + +#With $ONCE_A_YEAR$ = yes, a catalyst between two AI rulers only counts once a year +#We do this so routine diplomacy cannot hold the struggle back +gg_reconciliation_catalyst_effect = { + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = $ACTOR$ SECOND = $RECIPIENT$ } + gg_phase_has_catalysts_trigger = yes + situation:guelph_ghibelline ?= { situation_top_has_catalyst = $CATALYST$ } + trigger_if = { + limit = { + always = $ONCE_A_YEAR$ + $ACTOR$ = { is_ai = yes } + $RECIPIENT$ = { is_ai = yes } + } + situation:guelph_ghibelline ?= { + NOT = { has_variable = gg_recent_$CATALYST$ } + } + } + } + custom_tooltip = { + text = $CATALYST$_triggered_tt + if = { + limit = { + always = $ONCE_A_YEAR$ + $ACTOR$ = { is_ai = yes } + $RECIPIENT$ = { is_ai = yes } + } + situation:guelph_ghibelline ?= { + set_variable = { + name = gg_recent_$CATALYST$ + years = 1 + } + } + } + situation:guelph_ghibelline ?= { trigger_situation_catalyst = $CATALYST$ } + } + } +} + +gg_untargeted_catalyst_effect = { + if = { + limit = { + situation:guelph_ghibelline ?= { + situation_top_has_catalyst = $CATALYST$ + } + } + custom_tooltip = { + text = $CATALYST$_triggered_tt + situation:guelph_ghibelline ?= { + trigger_situation_catalyst = $CATALYST$ + gg_record_hostility_effect = yes + } + } + } +} + +gg_untargeted_reconciliation_catalyst_effect = { + if = { + limit = { + situation:guelph_ghibelline ?= { + situation_top_has_catalyst = $CATALYST$ + } + } + custom_tooltip = { + text = $CATALYST$_triggered_tt + situation:guelph_ghibelline ?= { trigger_situation_catalyst = $CATALYST$ } + } + } +} + +gg_scheme_catalyst_warning_effect = { + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = scope:actor SECOND = scope:recipient } + gg_phase_has_catalysts_trigger = yes + situation:guelph_ghibelline ?= { situation_top_has_catalyst = catalyst_attempt_$SCHEME$_opposite_party } + } + custom_description_no_bullet = { text = gg_$SCHEME$_might_have_consequences_tt } + } +} + +#For the schemes that only feed a catalyst once they are discovered, rather than one catalyst per scheme type +gg_hostile_scheme_catalyst_warning_effect = { + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = scope:actor SECOND = scope:recipient } + gg_phase_has_catalysts_trigger = yes + situation:guelph_ghibelline ?= { situation_top_has_catalyst = catalyst_gg_hostile_scheme_discovered } + } + custom_description_no_bullet = { text = gg_hostile_scheme_might_have_consequences_tt } + } +} + +gg_potential_catalyst_tooltip_effect = { + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = $ACTOR$ SECOND = $RECIPIENT$ } + gg_phase_has_catalysts_trigger = yes + situation:guelph_ghibelline ?= { situation_top_has_catalyst = $CATALYST$ } + } + custom_tooltip = $CATALYST$_may_be_triggered_tt + } +} + +gg_potential_untargeted_catalyst_tooltip_effect = { + if = { + limit = { + situation:guelph_ghibelline ?= { situation_top_has_catalyst = $CATALYST$ } + } + custom_tooltip = $CATALYST$_may_be_triggered_tt + } +} + +gg_failed_scheme_effect = { + save_scope_as = root_scope + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = scope:root_scope SECOND = scope:target } + gg_phase_has_catalysts_trigger = yes + situation:guelph_ghibelline ?= { situation_top_has_catalyst = catalyst_attempt_$SCHEME$_opposite_party } + } + situation:guelph_ghibelline ?= { + trigger_situation_catalyst = catalyst_attempt_$SCHEME$_opposite_party + gg_record_hostility_effect = yes + } + gg_involvement_scheme_effect = { STATE = failure } + } +} + +gg_relation_catalyst_effect = { + $ACTOR$ = { save_scope_as = root_scope } + $RECIPIENT$ = { save_scope_as = target_scope } + scope:root_scope = { + if = { + limit = { + exists = situation:guelph_ghibelline + gg_phase_has_catalysts_trigger = yes + OR = { + AND = { + is_ghibelline_leader_trigger = yes + scope:target_scope = { is_guelph_leader_trigger = yes } + } + AND = { + is_guelph_leader_trigger = yes + scope:target_scope = { is_ghibelline_leader_trigger = yes } + } + } + } + gg_triggered_catalyst_effect = { ACTOR = scope:root_scope RECIPIENT = scope:target_scope CATALYST = $CATALYST$ } + gg_involvement_catalyst_effect = yes + } + } +} + + +#Involvement +gg_add_involvement_effect = { + change_variable = { + name = gg_involvement + add = $AMOUNT$ + } + if = { + limit = { has_character_modifier = gg_involvement_modifier } + remove_character_modifier = gg_involvement_modifier + } + if = { + limit = { var:gg_involvement >= gg_involvement_modifier_cap } + add_character_modifier = gg_involvement_modifier + } +} + +gg_involvement_scheme_unaligned_target_tooltip_effect = { + if = { + limit = { gg_phase_gives_involvement_trigger = yes } + custom_tooltip = gg_involvement_scheme_potential_success_outcome_tt + custom_tooltip = gg_involvement_scheme_potential_failure_outcome_tt + } +} + +gg_involvement_scheme_tooltip_effect = { + if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = scope:actor SECOND = scope:recipient } + gg_phase_gives_involvement_trigger = yes + } + custom_tooltip = gg_involvement_scheme_potential_success_outcome_tt + custom_tooltip = gg_involvement_scheme_potential_failure_outcome_tt + } +} + +gg_involvement_scheme_same_side_tooltip_effect = { + if = { + limit = { gg_phase_gives_involvement_trigger = yes } + custom_tooltip = gg_involvement_scheme_potential_success_outcome_tt + custom_tooltip = gg_involvement_scheme_potential_failure_outcome_tt + } +} + +gg_involvement_scheme_effect = { + if = { + limit = { should_get_involvement_trigger = yes } + custom_tooltip = { + text = gg_involvement_scheme_$STATE$_tt + gg_add_involvement_effect = { AMOUNT = gg_involvement_scheme_$STATE$_value } + } + } +} + + +gg_involvement_catalyst_would_invalidate_situation_tooltip_effect = { + if = { + limit = { + situation:guelph_ghibelline ?= { + OR = { + situation_current_phase = in_nomine_domini + situation_current_phase = dictatus_papae + } + } + scope:recipient = { + OR = { + has_variable = ghibelline_leader + has_variable = guelph_leader + } + } + } + custom_tooltip = gg_situation_is_invalidated_tt + } + else_if = { + limit = { + gg_first_and_second_are_opposite_sides_trigger = { FIRST = scope:actor SECOND = scope:recipient } + } + scope:actor = { gg_involvement_catalyst_effect = yes } + } +} + +gg_claim_unites_pope_and_emperor_tooltip_effect = { + if = { + limit = { + exists = situation:guelph_ghibelline + OR = { + AND = { + scope:claimant = { has_title = title:k_papal_state } + any_in_list = { + list = target_titles + this = title:e_hre + } + } + AND = { + scope:claimant = { has_title = title:e_hre } + any_in_list = { + list = target_titles + this = title:k_papal_state + } + } + } + } + custom_tooltip = gg_claim_unites_pope_and_emperor_tt + } +} + +gg_involvement_catalyst_effect = { + if = { + limit = { should_get_involvement_trigger = yes } + custom_tooltip = { + text = gg_involvement_triggered_catalyst_tt + gg_add_involvement_effect = { AMOUNT = gg_involvement_triggered_catalyst_value } + } + } +} + + +gg_involvement_interaction_effect = { + if = { + limit = { should_get_involvement_trigger = yes } + custom_tooltip = { + text = gg_involvement_interaction_tt + gg_add_involvement_effect = { AMOUNT = gg_involvement_interaction_value } + } + } +} + +gg_involvement_catalyst_interaction_effect = { + if = { + limit = { should_get_involvement_trigger = yes } + custom_tooltip = { + text = gg_involvement_catalyst_interaction_tt + gg_add_involvement_effect = { AMOUNT = gg_involvement_catalyst_interaction_value } + } + } +} + + +gg_involvement_cb_participant_effect = { + $WAR_OUTCOME$ = { save_scope_as = gg_outcome } + if = { + limit = { + scope:attacker = { is_$ATTACKER$_trigger = yes } + scope:defender = { is_$DEFENDER$_trigger = yes } + } + scope:war ?= { + every_war_participant = { + limit = { + is_$ATTACKER$_trigger = yes + is_attacker_in_war = scope:war + NOT = { this = scope:attacker } + } + save_scope_as = participant_temp + save_scope_value_as = { + name = participant_war_contribution_value + value = { + value = "scope:war.war_contribution(scope:participant_temp)" + divide = 1000 + round = yes + } + } + save_scope_value_as = { + name = participant_actual_involvement_gain + value = { + add = { + value = gg_involvement_base_addition_value + multiply = scope:participant_war_contribution_value + if = { + limit = { gg_phase_gives_half_involvement_trigger = yes } + multiply = 0.5 + } + if = { + limit = { gg_phase_gives_double_involvement_trigger = yes } + multiply = 2 + } + round = yes + if = { + limit = { scope:gg_outcome = flag:victory } + max = gg_involvement_cb_participant_value + } + else_if = { + limit = { scope:gg_outcome = flag:white_peace } + max = gg_involvement_cb_failure_value + } + else = { + max = { + value = gg_involvement_cb_failure_value + divide = 2 + } + } + } + } + } + if = { + limit = { + has_variable = gg_involvement + scope:participant_actual_involvement_gain > gg_involvement_base_value + } + custom_tooltip = { + text = gg_involvement_cb_participant_actual_tt + gg_add_involvement_effect = { AMOUNT = scope:participant_actual_involvement_gain } + } + } + } + } + } +} + +gg_involvement_cb_victory_effect = { + save_scope_value_as = { + name = gg_war_outcome + value = flag:victory + } + gg_involvement_cb_effect = { WAR_OUTCOME = scope:gg_war_outcome } +} + +gg_involvement_cb_white_peace_effect = { + save_scope_value_as = { + name = gg_war_outcome + value = flag:white_peace + } + gg_involvement_cb_effect = { WAR_OUTCOME = scope:gg_war_outcome } +} + +gg_involvement_cb_defeat_effect = { + save_scope_value_as = { + name = gg_war_outcome + value = flag:defeat + } + gg_involvement_cb_effect = { WAR_OUTCOME = scope:gg_war_outcome } +} + +gg_involvement_cb_effect = { + $WAR_OUTCOME$ = { save_scope_as = gg_outcome } + if = { + limit = { exists = scope:war } + scope:war ?= { + #Calculate the involvement for the leader + random_war_participant = { + limit = { this = scope:attacker } + save_scope_value_as = { + name = winner_war_contribution_value + value = { + value = "scope:war.war_contribution(scope:attacker)" + divide = 1000 + round = yes + } + } + save_scope_value_as = { + name = actual_involvement_gain + value = { + add = { + value = gg_involvement_base_addition_value + multiply = scope:winner_war_contribution_value + if = { + limit = { gg_phase_gives_half_involvement_trigger = yes } + multiply = 0.5 + } + if = { + limit = { gg_phase_gives_double_involvement_trigger = yes } + multiply = 2 + } + round = yes + if = { + limit = { scope:gg_outcome = flag:victory } + max = gg_involvement_cb_success_value + } + else_if = { + limit = { scope:gg_outcome = flag:white_peace } + max = gg_involvement_cb_participant_value + } + else = { + max = gg_involvement_cb_failure_value + } + } + } + } + if = { + limit = { has_variable = gg_involvement } + custom_tooltip = { + text = gg_involvement_cb_success_actual_tt + gg_add_involvement_effect = { AMOUNT = scope:actual_involvement_gain } + } + } + } + #Involvement for Guelph participant attackers + if = { + limit = { + scope:attacker = { is_guelph_trigger = yes } + scope:defender = { is_ghibelline_trigger = yes } + } + gg_involvement_cb_participant_effect = { + ATTACKER = guelph + DEFENDER = ghibelline + WAR_OUTCOME = scope:gg_outcome + } + } + #Involvement for Ghibelline participant attackers + if = { + limit = { + scope:attacker = { is_ghibelline_trigger = yes } + scope:defender = { is_guelph_trigger = yes } + } + gg_involvement_cb_participant_effect = { + ATTACKER = ghibelline + DEFENDER = guelph + WAR_OUTCOME = scope:gg_outcome + } + } + } + } + else = { + custom_tooltip = gg_involvement_cb_success_tt + custom_tooltip = gg_involvement_cb_participant_tt + } +} + + +gg_involvement_decision_effect = { + if = { + limit = { should_get_involvement_trigger = yes } + custom_tooltip = { + text = gg_involvement_change_phase_decision_tt + gg_add_involvement_effect = { AMOUNT = gg_involvement_change_phase_decision_value } + } + } +} + + +gdp_setup_historical_house_relation_effect = { + ### 1066 ### + if = { + limit = { game_start_date >= 1066.9.15 } + house:house_frangipani = { + tgp_set_historical_house_relation_effect = { + OTHER_HOUSE = dynasty:8723.dynasty_founder.house # Pierleoni + LEVEL = rivalry + } + } + dynasty:egyptian_awkalid.dynasty_founder.house = { + tgp_set_historical_house_relation_effect = { + OTHER_HOUSE = dynasty:maghrebi_taherti.dynasty_founder.house # Taherti + LEVEL = rivalry + } + } + } +} + + +#Situation History +save_gg_leaders_as_scopes_effect = { + situation:guelph_ghibelline ?= { + random_situation_participant = { + limit = { exists = var:guelph_leader } + save_scope_as = guelph_leader + } + random_situation_participant = { + limit = { exists = var:ghibelline_leader } + save_scope_as = ghibelline_leader + } + } +} + +fulfill_concordat_of_worms_effect = { + every_player = { + limit = { + any_character_situation = { this = situation:guelph_ghibelline } + } + send_interface_message = { + type = msg_guelph_ghibelline_neutral + title = concordat_of_worms_fulfilled.t + if = { + limit = { + situation:guelph_ghibelline = { + NOT = { situation_current_phase = $NEW_PHASE$ } + } + } + custom_tooltip = cow_phase_moves_to_$NEW_PHASE$.tt + } + } + } + if = { + limit = { flag:$NEW_PHASE$ = flag:repose } + save_gg_leaders_as_scopes_effect = yes + if = { + limit = { + exists = scope:guelph_leader + scope:ghibelline_leader ?= { + has_trait = excommunicated + faith.religious_head ?= scope:guelph_leader + } + } + lift_character_excommunication_effect = { + REQUESTING_CHARACTER = scope:guelph_leader + TARGET_CHARACTER = scope:ghibelline_leader + } + } + #Moving the start date back brings the investiture crisis council forward to next month + situation:the_christian_church ?= { + if = { + limit = { + has_situation_top_phase_parameter = the_christian_church_investiture_controversy + NOT = { has_variable = investiture_awaiting_council } + } + set_variable = { + name = investiture_crisis_start_date + value = { + value = current_date + subtract = pam_investiture_crisis_duration_days + } + } + } + } + } + situation:guelph_ghibelline = { + if = { + limit = { + NOT = { situation_current_phase = $NEW_PHASE$ } + } + situation_top_sub_region = { change_phase = $NEW_PHASE$ } + } + } +} + +actual_abandon_concordat_of_worms_effect = { + save_gg_leaders_as_scopes_effect = yes + scope:ghibelline_leader = { + if = { + limit = { + scope:guelph_leader = { is_independent_ruler = yes } + NOT = { + any_character_war = { + OR = { + is_attacker = scope:guelph_leader + is_defender = scope:guelph_leader + } + } + } + } + start_war = { + casus_belli = "vassalization_cb" + target = scope:guelph_leader + } + } + } + if = { + limit = { + NOT = { + scope:ghibelline_leader = { has_trait = excommunicated } + } + } + scope:guelph_leader = { + excommunicate_character = { + EXCOMMUNICATOR = scope:guelph_leader + REQUESTING_CHARACTER = scope:guelph_leader + TARGET_CHARACTER = scope:ghibelline_leader + } + } + } + situation:guelph_ghibelline = { + if = { + limit = { + situation:guelph_ghibelline = { + NOT = { situation_current_phase = agitation } + } + } + custom_tooltip = cow_phase_moves_to_agitation.tt + } + } +} + +abandon_concordat_of_worms_effect = { + save_gg_leaders_as_scopes_effect = yes + situation:guelph_ghibelline = { + every_situation_participant = { + limit = { + is_ai = no + NOR = { + this = scope:guelph_leader + this = scope:ghibelline_leader + } + } + send_interface_message = { + type = event_toast_effect_neutral + title = concordat_of_worms_abandoned.t + show_as_tooltip = { + actual_abandon_concordat_of_worms_effect = yes + } + } + } + if = { + limit = { + situation:guelph_ghibelline = { + NOT = { situation_current_phase = agitation } + } + } + situation_top_sub_region = { change_phase = agitation } + } + } +} + + +save_lombard_league_creator_scopes_effect = { + save_scope_as = league_creator + save_scope_value_as = { + name = league_creator_title + value = $FLAG$ + } +} + +try_to_set_up_lombard_league_with_effect = { + $TITLE$ = { save_scope_as = title_to_check } + if = { + limit = { + scope:title_to_check = { + holder ?= { + is_either_hre_vassal_or_independent_duke_or_less_trigger = yes + #This should be your primary title + primary_title = scope:title_to_check + is_ai = yes + } + } + } + #Save the scope + if = { + limit = { scope:title_to_check = title:c_verona } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:verona } + } + } + if = { + limit = { scope:title_to_check = title:c_padua } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:padua } + } + } + if = { + limit = { scope:title_to_check = title:c_treviso } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:treviso } + } + } + if = { + limit = { scope:title_to_check = title:c_bologna } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:bologna } + } + } + if = { + limit = { scope:title_to_check = title:c_ferrara } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:ferrara } + } + } + if = { + limit = { scope:title_to_check = title:c_modena } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:modena } + } + } + if = { + limit = { scope:title_to_check = title:c_mantua } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:mantua } + } + } + if = { + limit = { scope:title_to_check = title:c_cremona } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:cremona } + } + } + if = { + limit = { scope:title_to_check = title:c_brescia } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:brescia } + } + } + if = { + limit = { scope:title_to_check = title:c_novara } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:novara } + } + } + if = { + limit = { scope:title_to_check = title:c_tortona } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:tortona } + } + } + if = { + limit = { scope:title_to_check = title:c_piacenza } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:piacenza } + } + } + if = { + limit = { scope:title_to_check = title:c_parma } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:parma } + } + } + if = { + limit = { scope:title_to_check = title:c_genoa } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:genoa } + } + } + if = { + limit = { scope:title_to_check = title:c_guastalla } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:guastalla } + } + } + if = { + limit = { scope:title_to_check = title:c_polesine } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:polesine } + } + } + if = { + limit = { scope:title_to_check = title:c_lombardia } + scope:title_to_check.holder ?= { + save_lombard_league_creator_scopes_effect = { FLAG = flag:lombardia } + } + } + scope:title_to_check.holder ?= { create_lombard_league_effect = yes } + } +} + + +gg_become_independent_effect = { + $TITLE$ = { save_scope_as = independency_title } + #Is the title not the primary title of the holder? Invent someone to take over! + if = { + limit = { + #The title isn't the holder's primary title (i.e. it goes in under a duchy or similar) + scope:independency_title.holder.primary_title != scope:independency_title + #You shouldn't already be the count of a neighboring county (e.g. Friuli / Treviso) + scope:independency_title.holder.primary_title.tier > scope:independency_title.tier + } + create_title_and_vassal_change = { + type = independency + save_scope_as = change + add_claim_on_loss = yes + } + scope:independency_title = { save_scope_as = target_title } + #Create character + create_character = { + template = gg_ruler_template + location = scope:target_title.title_province + save_scope_as = new_holder + } + scope:independency_title = { + change_title_holder = { + holder = scope:new_holder + change = scope:change + } + } + scope:new_holder = { + becomes_independent = { change = scope:change } + save_scope_as = became_independent + } + resolve_title_and_vassal_change = scope:change + } + else = { + scope:independency_title.holder = { + #Otherwise just your regular independency + if = { + limit = { is_independent_ruler = no } + create_title_and_vassal_change = { + type = independency + save_scope_as = change + add_claim_on_loss = yes + } + becomes_independent = { change = scope:change } + resolve_title_and_vassal_change = scope:change + if = { + limit = { scope:league_creator ?= scope:independency_title.holder } + save_scope_as = became_independent + } + } + } + } +} + + +create_lombard_league_effect = { + #Ditch those shackles, man + if = { + limit = { is_independent_ruler = no } + custom_description_no_bullet = { + text = become_independent_effect + gg_become_independent_effect = { TITLE = scope:league_creator.primary_title } + } + } + #Create the Lombard League + custom_description_no_bullet = { + text = create_lombard_league_effect + create_confederation = { + name = lombard_league_name + type = confederation_type:lombard_league + } + } + if = { + limit = { is_ai = yes } + add_character_modifier = lombard_founder_modifier + } + #See who's available to join + scope:new_confederation ?= { + set_coa = lombard_league + if = { + limit = { + NOT = { scope:league_creator_title = flag:venice } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:k_venice } + } + #Would this ruler join the League? + title:k_venice.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:k_venice } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:verona } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_verona } + } + #Would this ruler join the League? + title:c_verona.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_verona } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:padua } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_padua } + } + #Would this ruler join the League? + title:c_padua.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_padua } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:treviso } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_treviso } + } + #Would this ruler join the League? + title:c_treviso.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_treviso } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:bologna } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_bologna } + } + #Would this ruler join the League? + title:c_bologna.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_bologna } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:ferrara } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_ferrara } + } + #Would this ruler join the League? + title:c_ferrara.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_ferrara } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:modena } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_modena } + } + #Would this ruler join the League? + title:c_modena.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_modena } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:mantua } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_mantua } + } + #Would this ruler join the League? + title:c_mantua.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_mantua } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:cremona } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_cremona } + } + #Would this ruler join the League? + title:c_cremona.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_cremona } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:brescia } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_brescia } + } + #Would this ruler join the League? + title:c_brescia.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_brescia } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:novara } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_novara } + } + #Would this ruler join the League? + title:c_novara.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_novara } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:tortona } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_tortona } + } + #Would this ruler join the League? + title:c_tortona.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_tortona } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:piacenza } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_piacenza } + } + #Would this ruler join the League? + title:c_piacenza.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_piacenza } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:parma } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_parma } + } + #Would this ruler join the League? + title:c_parma.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_parma } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:genoa } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_genoa } + } + #Would this ruler join the League? + title:c_genoa.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_genoa } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:guastalla } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_guastalla } + } + #Would this ruler join the League? + title:c_guastalla.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_guastalla } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:polesine } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_polesine } + } + #Would this ruler join the League? + title:c_polesine.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_polesine } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:lombardia } + trigger_if = { + limit = { + scope:league_creator = { is_ai = no } + title_is_able_to_join_lombard_league_via_decision_trigger = { TITLE = title:c_lombardia } + } + #Would this ruler join the League? + title:c_lombardia.holder ?= { holder_would_join_lombard_league_via_decision_trigger = yes } + } + } + try_to_add_to_lombard_league_effect = { TITLE = title:c_lombardia } + } + set_variable = is_lombard_league + } + #Notify the relevant people + situation:guelph_ghibelline = { + random_situation_participant = { + limit = { has_variable = ghibelline_leader } + save_scope_as = ghibelline_leader + } + every_situation_participant = { + limit = { + is_ai = no + save_temporary_scope_as = participant_check + scope:new_confederation ?= { + NOT = { + any_confederation_member = { this = scope:participant_check } + } + } + } + if = { + limit = { scope:became_independent ?= scope:league_creator } + send_interface_message = { + type = msg_guelph_ghibelline_neutral_text + title = gg_league_created.t + left_icon = scope:league_creator + desc = gg_league_created_and_independence.desc + } + } + else = { + send_interface_message = { + type = msg_guelph_ghibelline_neutral_text + title = gg_league_created.t + left_icon = scope:league_creator + desc = gg_league_created.desc + } + } + } + situation:guelph_ghibelline = { + if = { + limit = { + NOT = { situation_current_phase = agitation } + } + situation_top_sub_region = { change_phase = agitation } + } + } + } + #... and make the HRE angry + scope:ghibelline_leader = { + if = { + limit = { is_ai = no } + custom_tooltip = hre_is_a_player_and_may_start_war_against_you.tt + trigger_event = gdp_guelph_ghibelline.7010 + } + else = { + if = { + limit = { is_at_war = no } + custom_description_no_bullet = { + text = hre_starts_war_ll_effect + start_war = { + casus_belli = "dissolve_lombard_league_cb" + target = scope:league_creator + } + } + } + } + } + set_global_variable = { + name = lombard_league_created + value = scope:league_creator + } + situation:guelph_ghibelline = { + record_situation_special_event = { + key = gg_history_key_precursor_league_is_created + variables = { + league_creator = scope:league_creator + } + } + } +} + +#Still confederation scope +actual_add_to_lombard_league_effect = { + $TITLE$ = { save_scope_as = title_to_add } + gg_become_independent_effect = { TITLE = scope:title_to_add } + scope:title_to_add.holder = { + if = { + limit = { is_ghibelline_trigger = yes } + gg_swap_to_undecided_effect = { USE_MODIFIERS = flag:no } + } + if = { + limit = { + is_ai = yes + NOT = { government_has_flag = government_is_republic } + } + gdp_found_a_republic_effect = yes + gdp_republic_patricians_start_at_level_2_effect = yes + } + } + custom_tooltip = { + text = gg_join_league.tt + add_confederation_member = scope:title_to_add.holder + } +} + +#This is in the confederation scope +try_to_add_to_lombard_league_effect = { + $TITLE$ = { save_scope_as = title_to_check } + #First check that the title is still relevant for the HRE, whether the holder is the Count of Friuli or Matilda + if = { + limit = { + scope:title_to_check = { + trigger_if = { + limit = { this = title:k_venice } + holder ?= { is_either_hre_vassal_or_independent_king_trigger = yes } + } + trigger_else = { + holder ?= { is_either_hre_vassal_or_independent_duke_or_less_trigger = yes } + } + } + } + if = { + limit = { + OR = { + #Then check if the holder is AI + scope:title_to_check.holder = { is_ai = yes } + #If Matilda is a player, the counts leave regardless + trigger_if = { + limit = { scope:title_to_check.holder.primary_title != scope:title_to_check } + #We also account for counts who hold two counties, such as Friuli and Treviso + scope:title_to_check.holder.primary_title.tier > scope:title_to_check.tier + } + } + } + actual_add_to_lombard_league_effect = { TITLE = scope:title_to_check } + } + else = { + #For the tooltip + scope:title_to_check = { save_scope_as = potential_league_title } + custom_tooltip = { + text = potential_league_title_is_human.tt + # NEOW 2555: disabled historical Guelph/Ghibelline event, intentionally not triggered + } + } + } +} + +display_join_lombard_league_effect = { + $TITLE$ = { save_scope_as = potential_league_title } + scope:potential_league_title.holder ?= { + if = { + limit = { + is_ai = yes + OR = { + primary_title = scope:potential_league_title + primary_title.tier = scope:potential_league_title.tier + } + holder_would_join_lombard_league_via_decision_trigger = no + } + custom_tooltip = potential_league_title_holder_will_not_join.tt + } + else_if = { + limit = { is_ai = no } + custom_tooltip = potential_league_title_is_human.tt + } + } +} + +#We print this for the event so the player knows who will join the league +display_who_might_join_lombard_league_effect = { + custom_tooltip = all_counties_in_lombard_league_will_join.tt + + show_as_tooltip = { + if = { + limit = { + NOT = { scope:league_creator_title = flag:verona } + } + display_join_lombard_league_effect = { TITLE = title:c_verona } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:padua } + } + display_join_lombard_league_effect = { TITLE = title:c_padua } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:treviso } + } + display_join_lombard_league_effect = { TITLE = title:c_treviso } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:bologna } + } + display_join_lombard_league_effect = { TITLE = title:c_bologna } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:ferrara } + } + display_join_lombard_league_effect = { TITLE = title:c_ferrara } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:modena } + } + display_join_lombard_league_effect = { TITLE = title:c_modena } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:mantua } + } + display_join_lombard_league_effect = { TITLE = title:c_mantua } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:cremona } + } + display_join_lombard_league_effect = { TITLE = title:c_cremona } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:brescia } + } + display_join_lombard_league_effect = { TITLE = title:c_brescia } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:novara } + } + display_join_lombard_league_effect = { TITLE = title:c_novara } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:tortona } + } + display_join_lombard_league_effect = { TITLE = title:c_tortona } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:piacenza } + } + display_join_lombard_league_effect = { TITLE = title:c_piacenza } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:parma } + } + display_join_lombard_league_effect = { TITLE = title:c_parma } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:genoa } + } + display_join_lombard_league_effect = { TITLE = title:c_genoa } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:guastalla } + } + display_join_lombard_league_effect = { TITLE = title:c_guastalla } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:polesine } + } + display_join_lombard_league_effect = { TITLE = title:c_polesine } + } + if = { + limit = { + NOT = { scope:league_creator_title = flag:lombardia } + } + display_join_lombard_league_effect = { TITLE = title:c_lombardia } + } + } +} + + +#Wars +save_attacker_exiled_courtier_scope_effect = { + scope:attacker = { + random_courtier = { + limit = { + trigger_if = { + limit = { + scope:attacker = { is_guelph_trigger = yes } + } + exists = var:displaced_guelph_ruler + } + trigger_if = { + limit = { + scope:attacker = { is_ghibelline_trigger = yes } + } + exists = var:displaced_ghibelline_ruler + } + exists = var:displaced_gg_primary_title + save_temporary_scope_as = courtier_check + scope:defender.var:primary_gg_displacement_title ?= scope:courtier_check.var:displaced_gg_primary_title + save_temporary_scope_as = exiled_courtier_check + } + save_scope_as = exiled_courtier + } + } +} + + +gg_should_give_splash_screen_effect = { + if = { + limit = { + OR = { + AND = { + game_start_date = 1066.9.15 + current_date != 1066.9.15 + } + AND = { + game_start_date = 1178.10.1 + current_date != 1178.10.1 + } + } + } + trigger_event = gdp_guelph_ghibelline.0500 # Introduction to the Guelphs & Ghibellines + } +} diff --git a/common/scripted_effects/00_holy_order_effects.txt b/common/scripted_effects/00_holy_order_effects.txt index 34b141900..33a92ddaf 100644 --- a/common/scripted_effects/00_holy_order_effects.txt +++ b/common/scripted_effects/00_holy_order_effects.txt @@ -404,7 +404,7 @@ create_monastic_decision_effect = { } limit = { has_holding = no - has_ongoing_construction = no + has_ongoing_holding_construction = no } begin_create_holding = church_holding save_scope_as = province @@ -1044,9 +1044,9 @@ take_vows_demand_effect = { has_trait = bastard } } - set_relation_rival = { - target = scope:puppet_or_actor - reason = rival_forced_to_take_vows + set_relation_rival_effect = { + TARGET = scope:puppet_or_actor + REASON = rival_forced_to_take_vows } } else = { @@ -3794,6 +3794,10 @@ monastic_lease_swapping_effect = { } any_leased_title = { monastic_lease_can_be_suborned_trigger = { ORDER = scope:holy_order } + holder ?= { + primary_title.tier > tier_barony + domain_size > 1 + } } scope:holy_order_leader.var:old_order ?= this } @@ -3803,6 +3807,10 @@ monastic_lease_swapping_effect = { } any_leased_title = { monastic_lease_can_be_suborned_trigger = { ORDER = scope:holy_order } + holder ?= { + primary_title.tier > tier_barony + domain_size > 1 + } } } save_scope_as = target_order @@ -3813,6 +3821,10 @@ monastic_lease_swapping_effect = { } limit = { monastic_lease_can_be_suborned_trigger = { ORDER = scope:holy_order } + holder ?= { # A baron's title or someone's only title cannot be leased out again + primary_title.tier > tier_barony + domain_size > 1 + } NOT = { county = scope:target_order.leader.capital_county } @@ -3833,6 +3845,10 @@ monastic_lease_swapping_effect = { } limit = { monastic_lease_can_be_suborned_trigger = { ORDER = scope:holy_order } + holder ?= { + primary_title.tier > tier_barony + domain_size > 1 + } } save_scope_as = taken_monastery } diff --git a/common/scripted_effects/00_religion_effects.txt b/common/scripted_effects/00_religion_effects.txt index 3249c46e8..7be22515c 100644 --- a/common/scripted_effects/00_religion_effects.txt +++ b/common/scripted_effects/00_religion_effects.txt @@ -1403,7 +1403,7 @@ add_holy_site_fallback_special_district_slot_effect = { add_special_district_slot = holy_site_mosque_01_district } else_if = { - limit = { $FAITH$ = { religion = religion:christianity_religion } } + limit = { $FAITH$ = { OR = { religion = religion:christianity_religion religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } } add_special_district_slot = holy_site_cathedral_01_district } else_if = { diff --git a/common/scripted_effects/00_scheme_scripted_effects.txt b/common/scripted_effects/00_scheme_scripted_effects.txt index 9aea76dd1..6d81e8f75 100644 --- a/common/scripted_effects/00_scheme_scripted_effects.txt +++ b/common/scripted_effects/00_scheme_scripted_effects.txt @@ -14590,6 +14590,8 @@ abduct_outcome_roll_effect = { random = { chance = scope:discovery_chance custom_tooltip = abduct_become_discovered_roll_tt + #Guelphs & Ghibellines + gg_failed_scheme_effect = { SCHEME = abduct } save_scope_value_as = { name = scheme_discovered value = yes @@ -14675,6 +14677,13 @@ abduct_success_effect = { } abduct_failure_effect = { + #Guelphs & Ghibellines + gg_involvement_scheme_effect = { STATE = failure } + gg_triggered_catalyst_effect = { + ACTOR = scope:owner + RECIPIENT = scope:target + CATALYST = catalyst_attempt_abduct_opposite_party + } #Add Watchful Modifier to the target scope:target = { show_as_tooltip = { diff --git a/common/scripted_effects/07_dlc_ep3_scripted_effects.txt b/common/scripted_effects/07_dlc_ep3_scripted_effects.txt index dc3da2f8e..123cf03ee 100644 --- a/common/scripted_effects/07_dlc_ep3_scripted_effects.txt +++ b/common/scripted_effects/07_dlc_ep3_scripted_effects.txt @@ -1757,7 +1757,6 @@ purchase_land_interaction_shortened_effect = { if = { limit = { character:90028 ?= this } custom_tooltip = ep3_story_cycle_harrying.3053.b.tt - add_character_flag = hereward_settled_flag } show_as_tooltip = { if = { diff --git a/common/scripted_triggers/00_ai_value_triggers.txt b/common/scripted_triggers/00_ai_value_triggers.txt index bd9319d86..70d98df4a 100644 --- a/common/scripted_triggers/00_ai_value_triggers.txt +++ b/common/scripted_triggers/00_ai_value_triggers.txt @@ -94,6 +94,41 @@ ai_has_warlike_personality = { vassal_contract_has_flag = admin_ai_is_builder } } + AND = { + has_trait = despoiler_of_byzantium + any_held_title = { + OR = { + this = title:e_byzantium + this = title:e_latin_empire + AND = { + tier < tier_empire + OR = { + empire ?= title:e_byzantium + empire ?= title:e_latin_empire + } + } + } + } + } + vassal_contract_has_flag = admin_ai_is_warlike # Admin vassals with the "Frontier" administration consider it their job to expand + house ?= { # The unity decision "Organize House Members for War" forces AI house members to adopt this stance + has_house_modifier = unity_house_organized_for_war_modifier + } + AND = { # They are Detractors during the FP3 Struggle in the Unrest Phase + has_trait = fp3_struggle_detractor + any_character_struggle = { + trigger_if = { + limit = { is_struggle_type = persian_struggle } + is_struggle_phase = struggle_persia_phase_unrest + } + trigger_else = { always = no } + } + } + AND = { # Nomads are not 'unpredictable', they are Warlike instead + government_has_flag = government_is_nomadic + ai_has_cautious_personality = no + economical_ai_guts_trigger = no + } # Or we're on the warpath. has_variable = imperial_expedition_charged #Or our Devaraja decrees it diff --git a/common/scripted_triggers/00_clothing_triggers.txt b/common/scripted_triggers/00_clothing_triggers.txt index 80817386e..10aeb56d9 100644 --- a/common/scripted_triggers/00_clothing_triggers.txt +++ b/common/scripted_triggers/00_clothing_triggers.txt @@ -1657,6 +1657,16 @@ portrait_italian_clothing_spouse_trigger = { } } + + + + +### GDP ### + + + + + ### General clothing triggers ### portrait_era1_trigger = { # Intended to primarily cover the years 850 to 1000 diff --git a/common/scripted_triggers/00_coa_triggers.txt b/common/scripted_triggers/00_coa_triggers.txt index a69c9221b..201763692 100644 --- a/common/scripted_triggers/00_coa_triggers.txt +++ b/common/scripted_triggers/00_coa_triggers.txt @@ -145,6 +145,19 @@ coa_feudal_trigger = { government_has_flag = government_is_feudal } +coa_merchant_trigger = { + OR = { + AND = { + exists = root + government_has_flag = government_is_merchant + } + scope:title ?= { + exists = holder + holder = { government_has_flag = government_is_merchant } + } + } +} + coa_french_trigger = { OR = { scope:culture = { has_coa_gfx = french_coa_gfx } diff --git a/common/scripted_triggers/00_laamp_triggers.txt b/common/scripted_triggers/00_laamp_triggers.txt index 204b1ae30..2a094386f 100644 --- a/common/scripted_triggers/00_laamp_triggers.txt +++ b/common/scripted_triggers/00_laamp_triggers.txt @@ -423,13 +423,13 @@ employer_has_treasury_to_offer_job_trigger = { scope:employer = { OR = { treasury_or_gold >= { - value = 50 + value = 15 multiply = task_contract_employer_tier_gold_multiplier_value } trigger_if = { limit = { government_allows = barter } barter_goods >= { - value = 50 + value = 15 multiply = task_contract_employer_tier_gold_multiplier_value # wanua rulers start with lower than 100 barter goods # divide = define:NBarter|BARTER_GOODS_TO_LOOT_MULT diff --git a/common/scripted_triggers/00_weather_triggers.txt b/common/scripted_triggers/00_weather_triggers.txt index 316d46e97..013ead319 100644 --- a/common/scripted_triggers/00_weather_triggers.txt +++ b/common/scripted_triggers/00_weather_triggers.txt @@ -89,8 +89,6 @@ temperate_seasons_trigger = { geographical_region = world_europe geographical_region = world_asia_minor geographical_region = world_middle_east - geographical_region = world_india_rajastan - geographical_region = world_india_bengal geographical_region = world_africa_north geographical_region = world_steppe geographical_region = world_tibet diff --git a/common/scripted_triggers/03_fp2_scripted_triggers.txt b/common/scripted_triggers/03_fp2_scripted_triggers.txt index 31ffa142e..9443a8d36 100644 --- a/common/scripted_triggers/03_fp2_scripted_triggers.txt +++ b/common/scripted_triggers/03_fp2_scripted_triggers.txt @@ -22,6 +22,27 @@ fp2_character_uninvolved_in_struggle_trigger = { always = no } +# CK3 1.21: allow the new Urbanism legacy on compatible characters. +eligible_for_fp2_urbanism_legacy_trigger = { + has_fp2_dlc_trigger = yes + dynasty.dynast = { + OR = { + game_rule_unrestricted_dynasty_legacies_trigger = yes + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + } + culture = { + has_cultural_pillar = heritage_iberian + } + capital_province ?= { + geographical_region = world_europe_west_iberia + } + government_has_flag = government_is_republic # Republics also gain access to this legacy + } + } +} + eligible_for_fp2_dynasty_legacies_trigger = { has_fp2_dlc_trigger = yes dynasty.dynast = { @@ -42,7 +63,7 @@ eligible_for_fp2_dynasty_legacies_trigger = { } -#is_toledo_ownership_valid_trigger = { +is_toledo_ownership_valid_trigger = { always = no } diff --git a/common/scripted_triggers/07_frankokratia_triggers.txt b/common/scripted_triggers/07_frankokratia_triggers.txt index 6f3f8566b..e6cddce7f 100644 --- a/common/scripted_triggers/07_frankokratia_triggers.txt +++ b/common/scripted_triggers/07_frankokratia_triggers.txt @@ -403,3 +403,36 @@ ep3_orthodox_faith_trigger = { religion = religion:oriental_orthodox_religion } } + +#Byzantine vassal who swears to the new king of their de jure kingdom when Byzantium shatters +ep3_frankokratia_byz_vassal_joins_new_kingdom_trigger = { + is_in_list = byz_vassals + highest_held_title_tier <= tier_duchy + #Only the openly disloyal refuse + OR = { + has_trait = loyal + NOR = { + has_trait = disloyal + has_trait = ambitious + AND = { + ai_boldness >= medium_positive_ai_value + ai_honor <= medium_negative_ai_value + } + } + } + capital_county = { + save_temporary_scope_as = prime_title + kingdom.holder ?= { + is_in_list = byz_vassals + } + } + has_same_government = scope:prime_title.kingdom.holder + #One of their counties borders the king's realm + any_sub_realm_county = { + any_neighboring_county = { + holder = { + target_is_same_character_or_above = scope:prime_title.kingdom.holder + } + } + } +} diff --git a/common/scripted_triggers/pam_scripted_triggers.txt b/common/scripted_triggers/pam_scripted_triggers.txt index 20e01d515..ff4ba0260 100644 --- a/common/scripted_triggers/pam_scripted_triggers.txt +++ b/common/scripted_triggers/pam_scripted_triggers.txt @@ -183,6 +183,8 @@ pam_ecumenical_council_has_quorum_trigger = { pam_mass_rite_conversion_requirements_trigger = { has_pam_dlc_trigger = yes + is_landless_adventurer = no + is_landless_merchant = no highest_held_title_tier >= tier_duchy } @@ -640,10 +642,8 @@ pam_valid_investiture_council_host_trigger = { # True if TARGET, a county title, lies within a clerical region the scoped character holds. pam_sell_claim_target_in_own_clerical_region_trigger = { exists = $TARGET$.clerical_region_title - any_held_title = { - has_clerical_region = yes - this = $TARGET$.clerical_region_title - } + $TARGET$.clerical_region_title.holder ?= this + $TARGET$.clerical_region_title = { has_clerical_region = yes } } # Shared with has_valid_target_showing_failures_only: can_be_picked_title is not rechecked on send @@ -792,6 +792,8 @@ can_influence_clerical_appointment_trigger = { pam_cathedral_project_requirements_trigger = { has_pam_dlc_trigger = yes + is_landless_adventurer = no + is_landless_merchant = no highest_held_title_tier >= tier_duchy has_spiritual_fulfillment_type = christian_fulfillment } @@ -831,7 +833,7 @@ is_valid_cathedral_spot_in_province_trigger = { } } } - has_great_building = no + has_great_district = no } has_cathedral_great_project_building_trigger = { @@ -842,13 +844,10 @@ is_valid_cathedral_upgrade_spot_in_province_trigger = { custom_tooltip = { text = great_project_cathedral_01_required_for_upgrade_tt has_building = great_project_cathedral_01 - NOT = { has_building = great_project_cathedral_02 } - NOT = { has_building = great_project_cathedral_03 } } custom_tooltip = { text = no_cathedral_upgrade_in_progress_tt NOR = { - has_building = great_project_cathedral_under_construction any_great_project_in_province = { OR = { great_project_type = pam_cathedral_01 @@ -864,12 +863,10 @@ is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = { custom_tooltip = { text = great_project_cathedral_02_required_for_tier_3_upgrade_tt has_building = great_project_cathedral_02 - NOT = { has_building = great_project_cathedral_03 } } custom_tooltip = { text = no_cathedral_upgrade_in_progress_tt NOR = { - has_building = great_project_cathedral_under_construction any_great_project_in_province = { OR = { great_project_type = pam_cathedral_01 @@ -896,14 +893,20 @@ has_accessible_cathedral_tier_2_upgrade_site_trigger = { } } trigger_else = { + # Matches the actual clerical_region_theocracy_capitals province filter faith = { - any_faith_ruler = { - highest_held_title_tier >= tier_county - any_realm_county = { - any_county_province = { - is_valid_cathedral_upgrade_spot_in_province_trigger = yes + save_temporary_scope_as = cathedral_faith_temp + OR = { + any_clerical_region_title = { + holder ?= { + faith = scope:cathedral_faith_temp + capital_province ?= { is_valid_cathedral_upgrade_spot_in_province_trigger = yes } } } + any_faith_ruler = { + government_has_mechanic = theocracy + capital_province ?= { is_valid_cathedral_upgrade_spot_in_province_trigger = yes } + } } } } @@ -924,14 +927,20 @@ has_accessible_cathedral_tier_3_upgrade_site_trigger = { } } trigger_else = { + # Same as above faith = { - any_faith_ruler = { - highest_held_title_tier >= tier_county - any_realm_county = { - any_county_province = { - is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = yes + save_temporary_scope_as = cathedral_faith_temp + OR = { + any_clerical_region_title = { + holder ?= { + faith = scope:cathedral_faith_temp + capital_province ?= { is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = yes } } } + any_faith_ruler = { + government_has_mechanic = theocracy + capital_province ?= { is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = yes } + } } } } @@ -1138,12 +1147,12 @@ holy_order_range_trigger = { county = { save_temporary_scope_as = monastic_county OR = { + clerical_region_title.holder ?= $CHARACTER$ $CHARACTER$ = { any_sub_realm_county = { this = scope:monastic_county } } - clerical_region_title.holder ?= $CHARACTER$ } } county = { @@ -1273,13 +1282,23 @@ can_have_realm_priest_puppet_trigger = { rite = { rite_has_doctrine = doctrine_theocracy_temporal } is_clergy = no tgp_has_access_to_ministry_trigger = no - NOT = { government_has_flag = government_is_nomadic } + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_merchant + government_has_flag = government_is_landless_adventurer + gdp_use_patrician_council_trigger = yes + } } -# Ecclesiastical government is landless_playable, so do not filter these on is_landed +# Ecclesiastical government is landless_playable, but a landless one still needs a domicile or cardinalate to be playable pam_landless_playable_cleric_trigger = { has_pam_dlc_trigger = yes government_has_flag = government_is_ecclesiastical + OR = { + is_landed = yes + exists = clerical_elector_title + has_domicile = yes + } } # Archbishop (clerical region title holder) or above them in the hierarchy: Head of Rite or Head of Faith @@ -1366,7 +1385,7 @@ can_manage_faith_holy_sites_trigger = { } } -# Substitute authority for a faith with no head of faith: a realm priest puppet plus piety standing. +# Substitute authority for a faith with no head of faith: a clerical puppet plus piety standing. can_manage_faith_holy_sites_without_hof_trigger = { OR = { custom_tooltip = { @@ -1374,7 +1393,10 @@ can_manage_faith_holy_sites_without_hof_trigger = { # puppet: errors on non-playable characters, so we only check playable ones and tooltips never run it trigger_if = { limit = { is_playable_character = yes } - exists = puppet:theological_agent_puppet + OR = { + exists = puppet:theological_agent_puppet + exists = puppet:external_theological_agent_puppet + } } trigger_else = { always = no @@ -1457,11 +1479,11 @@ ecumenical_shareable_unknown_tenet_for_root_trigger = { pam_request_legitimacy_priest_trigger = { this != $CHARACTER$ - OR = { - $CHARACTER$.religious_head_or_challenger = this - government_has_flag = government_is_ecclesiastical - } faith = $CHARACTER$.faith + OR = { + government_has_flag = government_is_ecclesiastical + $CHARACTER$.religious_head_or_challenger = this + } } pam_ecclesiastical_superior_or_subordinate_trigger = { @@ -1656,6 +1678,27 @@ pam_grants_own_divorce_trigger = { pam_is_clergy_ruler_trigger = yes } +has_clergy_to_petition_for_divorce_trigger = { + OR = { + faith ?= { + has_doctrine = doctrine_spiritual_head + exists = religious_head + } + cp:councillor_court_chaplain ?= { + highest_held_title_tier >= tier_duchy + is_clergy = yes + } + AND = { + government_has_flag = government_is_theocracy + exists = superior + } + cp:councillor_court_chaplain.superior ?= { + highest_held_title_tier >= tier_duchy + is_clergy = yes + } + } +} + pam_clergy_continence_expected_trigger = { rite = { NOR = { @@ -1870,12 +1913,13 @@ pam_ai_deposable_cleric_trigger = { pam_beseech_claims_access_trigger = { has_pam_dlc_trigger = yes pam_clergy_interactions_faith_trigger = yes - NOT = { + NOR = { government_has_flag = government_is_ecclesiastical + government_has_flag = government_is_republic } } pam_actor_rite_has_core_simony_trigger = { - scope:actor = { + scope:puppet_or_actor = { rite = { rite_has_parameter = tenet_simony_gold_donations } @@ -1976,6 +2020,7 @@ pam_rite_sway_liege_lane_trigger = { # $ACTOR$ and $RECIPIENT$ dioceses border or are nearby, and the scan is bounded by the actor's diocese pam_rite_sway_adjacent_diocese_trigger = { + exists = $RECIPIENT$.capital_county.clerical_region_title # Both branches compare against it, and ?= only forgives the left side OR = { $ACTOR$.capital_county.clerical_region_title ?= { any_county_in_clerical_region = { @@ -2732,6 +2777,17 @@ pam_tenet_is_christian_dogma_trigger = { } } +# Tenet scope. $FAITH$ is the faith judging the tenet +tenet_is_anathema_to_faith_trigger = { + $FAITH$ = { save_temporary_scope_as = affinity_faith } + anathema_to_faith > 0 +} + +tenet_is_intrinsic_to_faith_trigger = { + $FAITH$ = { save_temporary_scope_as = affinity_faith } + intrinsic_to_faith > 0 +} + # $CHARACTER$ is the Head of Faith deciding, and the tenet is the scope # We only apply this to the AI, so players keep the full list pam_tenet_ai_may_permit_trigger = { @@ -2751,6 +2807,7 @@ pam_tenet_ai_may_permit_trigger = { OR = { pam_tenet_is_christological_heresy_trigger = yes pam_tenet_is_christian_abomination_trigger = yes + tenet_is_anathema_to_faith_trigger = { FAITH = $CHARACTER$.faith } } } pam_tenet_is_overwhelmingly_popular_trigger = { CHARACTER = $CHARACTER$ } @@ -2761,6 +2818,7 @@ pam_tenet_ai_may_permit_trigger = { } pam_tenet_ai_may_prohibit_trigger = { + NOT = { tenet_is_intrinsic_to_faith_trigger = { FAITH = $CHARACTER$.faith } } trigger_if = { limit = { $CHARACTER$.faith = { has_tenet_popularity_trigger = yes } @@ -2768,6 +2826,7 @@ pam_tenet_ai_may_prohibit_trigger = { } pam_tenet_is_unpopular_trigger = { CHARACTER = $CHARACTER$ } } + pam_tenet_ai_may_prohibit_rite_tenet_trigger = { CHARACTER = $CHARACTER$ } } # Phase first: this runs per candidate tenet, so outside Reform the global lookup ends it at once @@ -2778,6 +2837,68 @@ pam_tenet_ai_should_purge_trigger = { pam_tenet_is_christian_abomination_trigger = yes } $CHARACTER$.faith = { has_tenet_popularity_trigger = yes } + NOT = { tenet_is_intrinsic_to_faith_trigger = { FAITH = $CHARACTER$.faith } } + pam_tenet_ai_may_prohibit_rite_tenet_trigger = { CHARACTER = $CHARACTER$ } +} + +# Tenet scope. An anathema that $CHARACTER$'s rite permits +pam_tenet_ai_should_prohibit_anathema_trigger = { + save_temporary_scope_as = pam_anathema_candidate + $CHARACTER$.rite = { + has_tenet_status = { tenet = scope:pam_anathema_candidate status = permitted } + } + tenet_is_anathema_to_faith_trigger = { FAITH = $CHARACTER$.faith } + pam_tenet_ai_may_prohibit_trigger = { CHARACTER = $CHARACTER$ } +} + +# Tenet scope. An intrinsic tenet that $CHARACTER$'s rite prohibits +pam_tenet_ai_should_permit_intrinsic_trigger = { + save_temporary_scope_as = pam_intrinsic_candidate + $CHARACTER$.rite = { + has_tenet_status = { tenet = scope:pam_intrinsic_candidate status = prohibited } + } + tenet_is_intrinsic_to_faith_trigger = { FAITH = $CHARACTER$.faith } + pam_tenet_ai_may_permit_trigger = { CHARACTER = $CHARACTER$ } +} + +# Prohibiting a branched rite's core tenet drives that rite towards heresy, so only zealous AI Heads of Faith do it +# The bigger the largest rite holding the tenet, the more extreme they must also be +pam_tenet_ai_may_prohibit_rite_tenet_trigger = { + save_temporary_scope_as = pam_protected_tenet + $CHARACTER$.faith = { + save_temporary_scope_value_as = { + name = pam_protected_tenet_rite_counties + value = pam_largest_branched_rite_holding_tenet_counties_value + } + } + trigger_if = { + limit = { scope:pam_protected_tenet_rite_counties > 0 } + $CHARACTER$ = { has_trait = zealous } + trigger_if = { + limit = { scope:pam_protected_tenet_rite_counties >= pam_rite_tenet_protection_large_counties_value } + $CHARACTER$ = { + OR = { + has_trait = lunatic + has_trait = possessed + } + } + } + trigger_else_if = { + limit = { scope:pam_protected_tenet_rite_counties >= pam_rite_tenet_protection_medium_counties_value } + $CHARACTER$ = { + OR = { + has_trait = lunatic + has_trait = possessed + has_trait = wrathful + has_trait = arbitrary + has_trait = callous + has_trait = stubborn + } + } + } + trigger_else = { always = yes } + } + trigger_else = { always = yes } } pam_tenet_can_be_persecuted_trigger = { @@ -2836,11 +2957,54 @@ pam_faith_tenet_is_core_trigger = { } pam_faith_is_at_core_tenet_cap_trigger = { - main_rite = { + main_rite = { pam_rite_is_at_core_tenet_cap_trigger = yes } +} + +# Tenet scope. Unlike Asceticism, is_shown needs the PAM DLC and can_pick needs a Christian faith +pam_tenet_is_christian_exclusive_ascetic_tenet_trigger = { + OR = { + this = tenet:tenet_hesychasm + this = tenet:tenet_anachoresis + this = tenet:tenet_mortification_of_the_flesh + } +} + +# Tenet scope. The four tenets that exclude each other in can_pick. +pam_tenet_is_exclusive_ascetic_tenet_trigger = { + OR = { + pam_tenet_is_christian_exclusive_ascetic_tenet_trigger = yes + this = tenet:tenet_asceticism + } +} + +# Rite scope. $NEW$ and $DROPPED$ are tenet scopes. +# can_pick still sees $DROPPED$. This is that check once $DROPPED$ is set aside. +pam_rite_can_swap_exclusive_ascetic_tenet_trigger = { + $NEW$ = { pam_tenet_is_exclusive_ascetic_tenet_trigger = yes } + $DROPPED$ = { + pam_tenet_is_exclusive_ascetic_tenet_trigger = yes + NOT = { this = $NEW$ } + } + rite_has_tenet = $DROPPED$ + # any_rite_tenet already walks this rite's core tenets. status would filter by the main rite instead. + NOT = { any_rite_tenet = { - count >= pam_faith_core_tenets_cap_value + count >= 2 + pam_tenet_is_exclusive_ascetic_tenet_trigger = yes } } + trigger_if = { + limit = { $NEW$ = { pam_tenet_is_christian_exclusive_ascetic_tenet_trigger = yes } } + faith = { religion = religion:christianity_religion } + has_pam_dlc_trigger = yes + } +} + +# Rite scope +pam_rite_is_at_core_tenet_cap_trigger = { + any_rite_tenet = { + count >= pam_faith_core_tenets_cap_value + } } # $CHARACTER$'s faith supplies the popularity, from tenet scope @@ -3060,6 +3224,13 @@ pam_ai_mountain_capital_actor_trigger = { } } +is_proto_hof_trigger = { + OR = { + has_title = title:k_papal_state + has_title = title:k_orthodox + } +} + # title_preferred_capital_county is the de jure capital even if k_papal_state is uncreated pam_catholic_hof_weak_papal_state_control_trigger = { has_pam_dlc_trigger = yes @@ -3105,6 +3276,36 @@ pam_demand_child_recipient_cares_trigger = { } } +pam_demand_child_is_recipient_heir_trigger = { + scope:secondary_recipient = { + OR = { + is_primary_heir_of = scope:recipient + AND = { + is_child_of = scope:recipient + is_adult = no + OR = { + scope:recipient = { has_realm_law_flag = appointment_type_succession } + scope:recipient.primary_title ?= { has_title_law_flag = appointment_type_succession } + } + trigger_if = { + limit = { is_female = yes } + NOT = { scope:recipient = { has_realm_law = male_only_law } } + } + trigger_else = { + NOT = { scope:recipient = { has_realm_law = female_only_law } } + } + NOT = { + any_sibling = { + is_child_of = scope:recipient + sex_same_as = prev + age > prev.age + } + } + } + } + } +} + pam_has_forbidden_personal_tenet_trigger = { faith = { save_temporary_scope_as = temp_faith } any_personal_tenet = { @@ -3139,6 +3340,78 @@ pam_ai_can_consider_forbidden_personal_tenet_trigger = { pam_holds_college_elected_church_seat_trigger = no } +# Scope is a tenet, root is the character who would take it as a personal tenet +pam_ai_can_take_personal_tenet_trigger = { + root = { + NOT = { has_personal_tenet = prev } + can_pick_personal_tenet = prev + } + trigger_if = { + limit = { + root.faith.main_rite = { + has_tenet_status = { + tenet = prev + status = prohibited + } + } + } + root = { pam_ai_can_consider_forbidden_personal_tenet_trigger = yes } + } +} + +# Scope is a core tenet of root's rite, root is the character who would take it as a personal tenet +pam_ai_personal_tenet_fallback_trigger = { + pam_ai_can_take_personal_tenet_trigger = yes + save_temporary_scope_as = pam_personal_tenet_fallback + root = { + NOT = { + any_undesired_tenet = { + only_negative = yes + threshold = -1 + this = scope:pam_personal_tenet_fallback + } + } + } +} + +# Scope is a tenet, root is the character who would take it as a personal tenet +# A personal tenet only raises fulfillment if their rite approves it +pam_ai_personal_tenet_candidate_trigger = { + pam_ai_can_take_personal_tenet_trigger = yes + OR = { + AND = { + root.rite = { + has_at_least_tenet_status = { + tenet = prev + status = permitted + } + } + root = { + expected_tenet_fulfillment_change = { + target = prev + value >= 1 + } + } + } + root.faith.main_rite = { + has_tenet_status = { + tenet = prev + status = prohibited + } + } + } +} + +# Scope is a personal tenet, root is the character holding it +pam_personal_tenet_gives_no_fulfillment_trigger = { + root = { + expected_tenet_fulfillment_change = { + target = prev + value < 1 + } + } +} + pam_is_christian_clergy_trigger = { OR = { religion = religion:catholic_religion @@ -4658,7 +4931,7 @@ pam_valid_excommunication_target_trigger = { trigger_else = { custom_tooltip = { text = bishop_excommunication_target_wanderer_tt - location.county = { + location.county ?= { OR = { holder ?= { target_is_same_character_or_above = $EXCOMMUNICATOR$ @@ -4907,6 +5180,7 @@ valid_claim_war_incited_attacker_trigger = { claim_war_incited_attacker_can_be_picked_trigger = { custom_description = { text = incite_claim_war_attacker_must_share_faith_tt + object = scope:puppet_or_actor faith = scope:puppet_or_actor.faith } custom_description = { @@ -4929,6 +5203,7 @@ claim_war_incited_attacker_can_be_picked_trigger = { } custom_description = { text = incite_claim_war_attacker_must_be_strong_enough_tt + object = $RECIPIENT$ current_military_strength >= $RECIPIENT$.one_tenth_current_military_strength } custom_description = { @@ -4943,6 +5218,7 @@ claim_war_incited_attacker_can_be_picked_trigger = { } custom_description = { text = incite_claim_war_attacker_must_not_be_blocked_diplomacy_tt + object = $RECIPIENT$ NOR = { this = scope:puppet_or_actor this = $RECIPIENT$ @@ -4958,6 +5234,7 @@ claim_war_incited_attacker_can_be_picked_trigger = { } custom_description = { text = incite_claim_war_attacker_liege_not_at_war_tt + object = $RECIPIENT$ NOT = { any_liege_or_above = { is_at_war_with = $RECIPIENT$ @@ -4966,6 +5243,7 @@ claim_war_incited_attacker_can_be_picked_trigger = { } custom_description = { text = incite_claim_war_attacker_must_have_claim_on_recipient_tt + object = $RECIPIENT$ any_claim = { tier >= tier_county tier <= tier_kingdom @@ -4979,6 +5257,7 @@ claim_war_incited_attacker_can_be_picked_trigger = { limit = { exists = scope:target } custom_description = { text = incite_claim_war_attacker_must_have_claim_on_target_tt + object = scope:target has_claim_on = scope:target } } @@ -5694,7 +5973,13 @@ pam_college_election_title_has_electors_trigger = { faith.religious_head_title = { any_elector = {} } } trigger_else = { - title:k_papal_state = { any_elector = {} } + # A higher tier primary title takes over the realm election from the Papacy + title:k_papal_state = { + OR = { + any_elector = {} + holder ?= { primary_title = { any_elector = {} } } + } + } } } @@ -5725,12 +6010,19 @@ pam_is_college_election_candidate_trigger = { source = $SOURCE$ } } - trigger_else = { + trigger_else_if = { + limit = { title:k_papal_state = { any_elector = {} } } is_candidate_from_set = { title = title:k_papal_state source = $SOURCE$ } } + trigger_else = { + is_candidate_from_set = { + title = title:k_papal_state.holder.primary_title + source = $SOURCE$ + } + } } trigger_else = { # Error log suppressing always = no @@ -6253,10 +6545,36 @@ target_valid_request_unformed_title_trigger = { } pam_personal_pacifism_offensive_war_ban_trigger = { - custom_tooltip = { - text = pam_personal_pacifism_offensive_war_ban_tt - scope:attacker = { - NOT = { has_personal_tenet_flag = tenet_pacifism_no_offensive_war } + trigger_if = { + limit = { + scope:attacker = { + has_personal_tenet = tenet:tenet_pacifism + has_personal_tenet_flag = tenet_pacifism_no_offensive_war + } + } + custom_tooltip = { + text = pam_personal_tenet_pacifism_offensive_war_ban_tt + always = no + } + } + trigger_else_if = { + limit = { + scope:attacker = { + has_personal_tenet = tenet:tenet_dharmic_pacifism + has_personal_tenet_flag = tenet_pacifism_no_offensive_war + } + } + custom_tooltip = { + text = pam_personal_tenet_dharmic_pacifism_offensive_war_ban_tt + always = no + } + } + trigger_else = { + custom_tooltip = { + text = pam_personal_pacifism_offensive_war_ban_tt + scope:attacker = { + NOT = { has_personal_tenet_flag = tenet_pacifism_no_offensive_war } + } } } } @@ -7039,8 +7357,8 @@ pam_personal_syncretism_exile_rite_probe_trigger = { # Valid exile pool entry for the personal syncretism decision. pam_personal_syncretism_exile_rite_trigger = { - exists = var:converted_development - var:converted_development >= 1 + exists = var:converted_prosperity + var:converted_prosperity >= 1 NOT = { rite_has_parameter = unreformed } exists = var:associated_culture exists = var:associated_county @@ -7404,6 +7722,27 @@ can_send_make_external_ruler_puppet_trigger = { exists = $RECIPIENT$.rite.head_of_rite $RECIPIENT$.rite.head_of_rite = $ACTOR$ } + AND = { + $ACTOR$ = { + is_guelph_leader_trigger = yes + } + $RECIPIENT$ = { + is_guelph_trigger = yes + } + } + AND = { + $ACTOR$ = { + is_ghibelline_leader_trigger = yes + } + $RECIPIENT$ = { + is_ghibelline_trigger = yes + } + } + $ACTOR$ = { + government_has_flag = government_is_merchant + has_realm_law = company_purpose_creditor + has_hook = $RECIPIENT$ + } } } $ACTOR$ = { diff --git a/common/scripted_triggers/pam_secular_faith_triggers.txt b/common/scripted_triggers/pam_secular_faith_triggers.txt index abd10bf16..ce4a17727 100644 --- a/common/scripted_triggers/pam_secular_faith_triggers.txt +++ b/common/scripted_triggers/pam_secular_faith_triggers.txt @@ -28,6 +28,17 @@ pam_secular_faith_christian_actor_trigger = { } } +# Province scope: a church holding that also brews, whatever the local resource allows. +pam_sf_monastic_brewery_province_trigger = { + has_holding_type = church_holding + OR = { + has_building_or_higher = beer_brewery_1 + has_building_or_higher = mead_brewery_1 + has_building_or_higher = cider_brewery_1 + has_building_or_higher = brewers_guild_1 + } +} + pam_can_adopt_forbidden_personal_tenet_trigger = { any_desired_tenet = { only_positive = yes diff --git a/common/story_cycles/fp3_story_cycle_zanj_rebellion.txt b/common/story_cycles/fp3_story_cycle_zanj_rebellion.txt index 2fc43c4b9..5a31e5606 100644 --- a/common/story_cycles/fp3_story_cycle_zanj_rebellion.txt +++ b/common/story_cycles/fp3_story_cycle_zanj_rebellion.txt @@ -1,34 +1,35 @@ -### Exists so we can track Ali or any subsequent Zanj Leaders. -story_zanj_rebellion = { +# NEOW 2555: Historical Zanj rebellion story (original source retained as comments). +### Exists so we can track Ali or any subsequent Zanj Leaders. +#story_zanj_rebellion = { - on_setup = { - story_owner = { - set_variable = { - name = zanj_rebellion_strength_score - value = 7 - } - } - } - on_owner_death = { - inherit_zanj_rebellion_effect = yes - } - on_end = {} +# on_setup = { +# story_owner = { +# set_variable = { +# name = zanj_rebellion_strength_score +# value = 7 +# } +# } +# } +# on_owner_death = { +# inherit_zanj_rebellion_effect = yes +# } +# on_end = {} - #Maintenance group - effect_group = { - days = 1 - trigger = { - story_owner = { is_landed = no } - } - triggered_effect = { - trigger = { always = yes } - effect = { - #You became a landless adventurer/administrative! Ending story prematurely. - story_owner = { save_scope_as = story_owner } - debug_log = "Zanj invalidated" - debug_log_scopes = yes - end_story = yes - } - } - } -} \ No newline at end of file +# #Maintenance group +# effect_group = { +# days = 1 +# trigger = { +# story_owner = { is_landed = no } +# } +# triggered_effect = { +# trigger = { always = yes } +# effect = { +# #You became a landless adventurer/administrative! Ending story prematurely. +# story_owner = { save_scope_as = story_owner } +# debug_log = "Zanj invalidated" +# debug_log_scopes = yes +# end_story = yes +# } +# } +# } +#} \ No newline at end of file diff --git a/common/story_cycles/mpo_story_cycle_greatest_of_khans.txt b/common/story_cycles/mpo_story_cycle_greatest_of_khans.txt index 3979734e9..c344d4b2b 100644 --- a/common/story_cycles/mpo_story_cycle_greatest_of_khans.txt +++ b/common/story_cycles/mpo_story_cycle_greatest_of_khans.txt @@ -1,265 +1,266 @@ -story_greatest_of_khans = { - visible = yes - icon = { - trigger = { - always = yes - } - reference = "gfx/interface/icons/story_cycles/bow_steppe.dds" - } - background = { - reference = "gfx/interface/illustrations/event_scenes/mpo_steppe_evening.dds" - } - visualization = { - custom_string_key = "GREATEST_OF_KHANS_INFORMATION_STRING" - decisions = { mpo_gok_world_conquest_decision } - } +# NEOW 2555: Great Khan historical story that invokes Mongol event IDs (original source retained as comments). +#story_greatest_of_khans = { +# visible = yes +# icon = { +# trigger = { +# always = yes +# } +# reference = "gfx/interface/icons/story_cycles/bow_steppe.dds" +# } +# background = { +# reference = "gfx/interface/illustrations/event_scenes/mpo_steppe_evening.dds" +# } +# visualization = { +# custom_string_key = "GREATEST_OF_KHANS_INFORMATION_STRING" +# decisions = { mpo_gok_world_conquest_decision } +# } - on_setup = { - if = { - limit = { - NOT = { - has_mpo_dlc_trigger = yes - } - } - end_story = yes - } - else = { - set_global_variable = { - name = gok_empire_crumble_date - value = { - value = current_year - add = 75 - } - } - set_variable = { - name = gok_final_date - value = { - value = current_year - add = 75 - } - } - set_global_variable = { - name = first_gok - value = story_owner - } +# on_setup = { +# if = { +# limit = { +# NOT = { +# has_mpo_dlc_trigger = yes +# } +# } +# end_story = yes +# } +# else = { +# set_global_variable = { +# name = gok_empire_crumble_date +# value = { +# value = current_year +# add = 75 +# } +# } +# set_variable = { +# name = gok_final_date +# value = { +# value = current_year +# add = 75 +# } +# } +# set_global_variable = { +# name = first_gok +# value = story_owner +# } - set_global_variable = { - name = greatest_of_khans_title - value = story_owner.primary_title - } - global_var:greatest_of_khans_title = { - set_variable = { - name = chaotic_succession_protection - value = yes - } - } - } - } +# set_global_variable = { +# name = greatest_of_khans_title +# value = story_owner.primary_title +# } +# global_var:greatest_of_khans_title = { +# set_variable = { +# name = chaotic_succession_protection +# value = yes +# } +# } +# } +# } - on_end = { - if = { - limit = { - exists = global_var:active_conquerors - } - change_global_variable = { - name = active_conquerors - add = -1 - } - } - global_var:greatest_of_khans_title = { - remove_variable = chaotic_succession_protection - } - remove_global_variable = first_gok - remove_global_variable = gok_empire_crumble_date - } +# on_end = { +# if = { +# limit = { +# exists = global_var:active_conquerors +# } +# change_global_variable = { +# name = active_conquerors +# add = -1 +# } +# } +# global_var:greatest_of_khans_title = { +# remove_variable = chaotic_succession_protection +# } +# remove_global_variable = first_gok +# remove_global_variable = gok_empire_crumble_date +# } - on_owner_death = { - # Handle story succession - story_owner = { - save_scope_as = old_khan # for news events - if = { - limit = { - any_child = { # if the Khan has a reasonable heir... - is_primary_heir_of = scope:story.story_owner - } - } - random_child = { - limit = { - is_primary_heir_of = scope:story.story_owner - } - save_scope_as = new_khan # for news events - save_scope_as = new_story_owner # pass chain to appropriate target - add_character_flag = { - flag = gain_mongol_succession_dread - days = 2 - } - add_character_modifier = { - modifier = the_great_khan_modifier - } - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - else_if = { - limit = { - dynasty = { - any_dynasty_member = { # if the Khan has some other heir not family?) - is_primary_heir_of = scope:story.story_owner - } - } - } - dynasty = { - random_dynasty_member = { - limit = { - is_primary_heir_of = scope:story.story_owner - } - save_scope_as = new_khan # for news events - save_scope_as = new_story_owner # pass chain toappropriate target - add_character_flag = { - flag = gain_mongol_succession_dread - days = 2 - } - add_character_modifier = { - modifier = the_great_khan_modifier - } - } - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - else_if = { - limit = { - primary_heir = { - is_grandchild_of = scope:story.story_owner - } - } - primary_heir = { - save_scope_as = new_khan # for news events - save_scope_as = new_story_owner # pass chain to appropriate target - add_character_flag = { - flag = gain_mongol_succession_dread - days = 2 - } - add_character_modifier = { - modifier = the_great_khan_modifier - } - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - else_if = { # If the empire passes out of the original dynasty, the story will automatically end - limit = { - NOT = { - dynasty = { - any_dynasty_member = { # if the Khan has some otherheir (not family?) - is_primary_heir_of = scope:story.story_owner - } - } - } - } - scope:story.story_owner.primary_heir = { - save_scope_as = new_khan - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - } - if = { - limit = { exists = scope:new_story_owner } - make_story_owner = scope:new_story_owner - } - #Story end event - else = { - if = { - limit = { - exists = story_owner.player_heir - exists = story_owner.dynasty - story_owner.player_heir = { - dynasty ?= root.story_owner.dynasty - } - } - story_owner.player_heir ?= { - trigger_event = { - id = mpo_greatest_of_khans.0040 - days = 1 - } - } - } - else = { - end_story = yes - } - } - } +# on_owner_death = { +# # Handle story succession +# story_owner = { +# save_scope_as = old_khan # for news events +# if = { +# limit = { +# any_child = { # if the Khan has a reasonable heir... +# is_primary_heir_of = scope:story.story_owner +# } +# } +# random_child = { +# limit = { +# is_primary_heir_of = scope:story.story_owner +# } +# save_scope_as = new_khan # for news events +# save_scope_as = new_story_owner # pass chain to appropriate target +# add_character_flag = { +# flag = gain_mongol_succession_dread +# days = 2 +# } +# add_character_modifier = { +# modifier = the_great_khan_modifier +# } +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# else_if = { +# limit = { +# dynasty = { +# any_dynasty_member = { # if the Khan has some other heir not family?) +# is_primary_heir_of = scope:story.story_owner +# } +# } +# } +# dynasty = { +# random_dynasty_member = { +# limit = { +# is_primary_heir_of = scope:story.story_owner +# } +# save_scope_as = new_khan # for news events +# save_scope_as = new_story_owner # pass chain toappropriate target +# add_character_flag = { +# flag = gain_mongol_succession_dread +# days = 2 +# } +# add_character_modifier = { +# modifier = the_great_khan_modifier +# } +# } +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# else_if = { +# limit = { +# primary_heir = { +# is_grandchild_of = scope:story.story_owner +# } +# } +# primary_heir = { +# save_scope_as = new_khan # for news events +# save_scope_as = new_story_owner # pass chain to appropriate target +# add_character_flag = { +# flag = gain_mongol_succession_dread +# days = 2 +# } +# add_character_modifier = { +# modifier = the_great_khan_modifier +# } +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# else_if = { # If the empire passes out of the original dynasty, the story will automatically end +# limit = { +# NOT = { +# dynasty = { +# any_dynasty_member = { # if the Khan has some otherheir (not family?) +# is_primary_heir_of = scope:story.story_owner +# } +# } +# } +# } +# scope:story.story_owner.primary_heir = { +# save_scope_as = new_khan +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# } +# if = { +# limit = { exists = scope:new_story_owner } +# make_story_owner = scope:new_story_owner +# } +# #Story end event +# else = { +# if = { +# limit = { +# exists = story_owner.player_heir +# exists = story_owner.dynasty +# story_owner.player_heir = { +# dynasty ?= root.story_owner.dynasty +# } +# } +# story_owner.player_heir ?= { +# trigger_event = { +# id = mpo_greatest_of_khans.0040 +# days = 1 +# } +# } +# } +# else = { +# end_story = yes +# } +# } +# } - #Invalidation end! - effect_group = { - years = 75 +# #Invalidation end! +# effect_group = { +# years = 75 - triggered_effect = { - trigger = { - exists = story_owner - } - effect = { - story_owner = { - save_scope_as = timed_out - trigger_event = { - id = mpo_greatest_of_khans.0040 - days = 1 - } - } - } - } - } +# triggered_effect = { +# trigger = { +# exists = story_owner +# } +# effect = { +# story_owner = { +# save_scope_as = timed_out +# trigger_event = { +# id = mpo_greatest_of_khans.0040 +# days = 1 +# } +# } +# } +# } +# } - #Start a new war if none is ongoing - effect_group = { - days = { 30 60 } +# #Start a new war if none is ongoing +# effect_group = { +# days = { 30 60 } - trigger = { - story_owner = { - is_at_war = no - gold > 0 - exists = global_var:greatest_of_khans_title - any_held_title = { - this = global_var:greatest_of_khans_title - } - } - } +# trigger = { +# story_owner = { +# is_at_war = no +# gold > 0 +# exists = global_var:greatest_of_khans_title +# any_held_title = { +# this = global_var:greatest_of_khans_title +# } +# } +# } - triggered_effect = { - trigger = { - story_owner = { - is_ai = yes - } - } - effect = { - story_owner = { - gok_war_target_evaluation_and_declaration_effect = yes - } - debug_log = "The story started a new war for the Greatest of Khans" - debug_log_date = yes - story_owner = { - save_scope_as = owner - } - debug_log_scopes = yes - } - } - } +# triggered_effect = { +# trigger = { +# story_owner = { +# is_ai = yes +# } +# } +# effect = { +# story_owner = { +# gok_war_target_evaluation_and_declaration_effect = yes +# } +# debug_log = "The story started a new war for the Greatest of Khans" +# debug_log_date = yes +# story_owner = { +# save_scope_as = owner +# } +# debug_log_scopes = yes +# } +# } +# } -} +#} diff --git a/common/story_cycles/story_cycle_almohad_invasion.txt b/common/story_cycles/story_cycle_almohad_invasion.txt index fadf63cb2..0571e8b9e 100644 --- a/common/story_cycles/story_cycle_almohad_invasion.txt +++ b/common/story_cycles/story_cycle_almohad_invasion.txt @@ -1,168 +1,169 @@ - +# NEOW 2555: Historical Almohad invasion story (original source retained as comments). + # Story for the rise of the Almohads # by Petter Vilberg -story_almohad_invasion = { +#story_almohad_invasion = { - on_setup = { - set_global_variable = { - name = spawned_almohads - value = yes - } - } +# on_setup = { +# set_global_variable = { +# name = spawned_almohads +# value = yes +# } +# } - on_end = { - debug_log = "Almohad story ended on:" - debug_log_date = yes - } +# on_end = { +# debug_log = "Almohad story ended on:" +# debug_log_date = yes +# } - on_owner_death = { - if = { - limit = { NOT = { exists = var:had_ibn_tumart_succession } } - set_variable = { - name = had_ibn_tumart_succession - value = yes - } - if = { - limit = { exists = var:ibn_tumart_triggered_death } - if = { - limit = { - var:al_mumin = { - is_alive = yes - faith = faith:masmudi - } - } - if = { - limit = { var:al_mumin = { is_imprisoned = yes } } - var:al_mumin = { release_from_prison = yes } - } - if = { - limit = { - NOT = { var:ibn_tumart.primary_heir = var:al_mumin } - } - create_title_and_vassal_change = { - type = granted - save_scope_as = change - add_claim_on_loss = no - } - var:ibn_tumart = { - save_scope_as = ibn_tumart - every_held_title = { - limit = { is_capital_barony = no } - change_title_holder = { - holder = scope:story.var:al_mumin - change = scope:change - } - } - } - resolve_title_and_vassal_change = scope:change +# on_owner_death = { +# if = { +# limit = { NOT = { exists = var:had_ibn_tumart_succession } } +# set_variable = { +# name = had_ibn_tumart_succession +# value = yes +# } +# if = { +# limit = { exists = var:ibn_tumart_triggered_death } +# if = { +# limit = { +# var:al_mumin = { +# is_alive = yes +# faith = faith:masmudi +# } +# } +# if = { +# limit = { var:al_mumin = { is_imprisoned = yes } } +# var:al_mumin = { release_from_prison = yes } +# } +# if = { +# limit = { +# NOT = { var:ibn_tumart.primary_heir = var:al_mumin } +# } +# create_title_and_vassal_change = { +# type = granted +# save_scope_as = change +# add_claim_on_loss = no +# } +# var:ibn_tumart = { +# save_scope_as = ibn_tumart +# every_held_title = { +# limit = { is_capital_barony = no } +# change_title_holder = { +# holder = scope:story.var:al_mumin +# change = scope:change +# } +# } +# } +# resolve_title_and_vassal_change = scope:change - make_story_owner = var:al_mumin +# make_story_owner = var:al_mumin - var:almohad_county = { - save_scope_as = almohad_county - } +# var:almohad_county = { +# save_scope_as = almohad_county +# } - story_owner = { - if = { # Make sure they get back to warfare - limit = { is_at_war = no } - almohads_find_target_titles_effect = yes - almohads_declare_war_for_target_title_effect = yes - } - spawn_second_almohad_troops_effect = yes +# story_owner = { +# if = { # Make sure they get back to warfare +# limit = { is_at_war = no } +# almohads_find_target_titles_effect = yes +# almohads_declare_war_for_target_title_effect = yes +# } +# spawn_second_almohad_troops_effect = yes - save_scope_as = al_mumin +# save_scope_as = al_mumin - every_war_enemy = { - trigger_event = almohad.1003 - } - } - } - } - } - } - else = { - end_story = yes - } - } +# every_war_enemy = { +# trigger_event = almohad.1003 +# } +# } +# } +# } +# } +# } +# else = { +# end_story = yes +# } +# } - #Kill ibn Tumert if he suffers a defeat - effect_group = { - days = { 20 80 } +# #Kill ibn Tumert if he suffers a defeat +# effect_group = { +# days = { 20 80 } - trigger = { - story_owner = var:ibn_tumart - story_owner = { is_alive = yes } - exists = global_var:almohads_were_defeated - } +# trigger = { +# story_owner = var:ibn_tumart +# story_owner = { is_alive = yes } +# exists = global_var:almohads_were_defeated +# } - triggered_effect = { - trigger = { - always = yes - } - effect = { - debug_log = "Trying to kill Ibn Tumert!" - set_variable = { - name = ibn_tumart_triggered_death - value = yes - } - story_owner = { - death = natural - } - } - } - } +# triggered_effect = { +# trigger = { +# always = yes +# } +# effect = { +# debug_log = "Trying to kill Ibn Tumert!" +# set_variable = { +# name = ibn_tumart_triggered_death +# value = yes +# } +# story_owner = { +# death = natural +# } +# } +# } +# } - #Rebuild Marrakesh - effect_group = { - days = 180 +# #Rebuild Marrakesh +# effect_group = { +# days = 180 - trigger = { - NOT = { exists = var:fired_marrakesh_event } - story_owner = { - any_sub_realm_county = { - this = title:c_marrakesh - OR = { - holder = scope:story.story_owner - holder = { is_ai = no } - } - } - } - } +# trigger = { +# NOT = { exists = var:fired_marrakesh_event } +# story_owner = { +# any_sub_realm_county = { +# this = title:c_marrakesh +# OR = { +# holder = scope:story.story_owner +# holder = { is_ai = no } +# } +# } +# } +# } - triggered_effect = { - trigger = { - always = yes - } - effect = { - set_variable = { - name = fired_marrakesh_event - value = yes - } - story_owner = { - trigger_event = almohad.1004 - } - } - } - } +# triggered_effect = { +# trigger = { +# always = yes +# } +# effect = { +# set_variable = { +# name = fired_marrakesh_event +# value = yes +# } +# story_owner = { +# trigger_event = almohad.1004 +# } +# } +# } +# } - #Maintenance group - effect_group = { - days = 1 - trigger = { - story_owner = { is_landed = no } - } - triggered_effect = { - trigger = { always = yes } - effect = { - #You became a landless adventurer/administrative! Ending story prematurely. - story_owner = { save_scope_as = story_owner } - debug_log = "Almohads invalidated" - debug_log_scopes = yes - end_story = yes - } - } - } -} +# #Maintenance group +# effect_group = { +# days = 1 +# trigger = { +# story_owner = { is_landed = no } +# } +# triggered_effect = { +# trigger = { always = yes } +# effect = { +# #You became a landless adventurer/administrative! Ending story prematurely. +# story_owner = { save_scope_as = story_owner } +# debug_log = "Almohads invalidated" +# debug_log_scopes = yes +# end_story = yes +# } +# } +# } +#} diff --git a/common/story_cycles/story_cycle_mongol_invasion.txt b/common/story_cycles/story_cycle_mongol_invasion.txt index 1769f1c66..dacdd8c15 100644 --- a/common/story_cycles/story_cycle_mongol_invasion.txt +++ b/common/story_cycles/story_cycle_mongol_invasion.txt @@ -1,537 +1,538 @@ -story_mongol_invasion = { - # by Petter Vilberg +# NEOW 2555: Historical Mongol invasion story (original source retained as comments). +#story_mongol_invasion = { +# # by Petter Vilberg - on_setup = { - story_owner = { # Start conquest of all of Mongolia - start_wars_for_mongolia_effect = yes - } - set_variable = { - name = succession_counter - value = 0 - } - } +# on_setup = { +# story_owner = { # Start conquest of all of Mongolia +# start_wars_for_mongolia_effect = yes +# } +# set_variable = { +# name = succession_counter +# value = 0 +# } +# } # - on_end = { - debug_log = "Mongol story ended on:" - debug_log_date = yes - set_global_variable = { - name = mongol_story_has_ended - value = yes - } - } +# on_end = { +# debug_log = "Mongol story ended on:" +# debug_log_date = yes +# set_global_variable = { +# name = mongol_story_has_ended +# value = yes +# } +# } # - on_owner_death = { - story_owner = { - set_variable = { - name = special_mongol_empire_conquest_region_prio_1_alpha_var - value = 0 - } - set_variable = { - name = special_mongol_empire_conquest_region_prio_1_var - value = 0 - } - set_variable = { - name = special_mongol_empire_conquest_region_prio_2_var - value = 0 - } - set_variable = { - name = special_mongol_empire_conquest_region_prio_3_var - value = 0 - } - set_variable = { - name = special_mongol_empire_conquest_region_prio_4_var - value = 0 - } - set_variable = { - name = special_mongol_empire_conquest_region_prio_5_var - value = 0 - } - set_variable = { - name = outside_conquest_region_var - value = 0 - } - every_realm_county = { - if = { - limit = { - title_province = { - geographical_region = special_mongol_empire_conquest_region_prio_5 - } - } - root.story_owner = { - change_variable = { - name = special_mongol_empire_conquest_region_prio_5_var - add = 1 - } - } - } - else_if = { - limit = { - title_province = { - geographical_region = special_mongol_empire_conquest_region_prio_4 - } - } - root.story_owner = { - change_variable = { - name = special_mongol_empire_conquest_region_prio_4_var - add = 1 - } - } - } - else_if = { - limit = { - title_province = { - geographical_region = special_mongol_empire_conquest_region_prio_3 - } - } - root.story_owner = { - change_variable = { - name = special_mongol_empire_conquest_region_prio_3_var - add = 1 - } - } - } - else_if = { - limit = { - title_province = { - geographical_region = special_mongol_empire_conquest_region_prio_2 - } - } - root.story_owner = { - change_variable = { - name = special_mongol_empire_conquest_region_prio_2_var - add = 1 - } - } - } - else_if = { - limit = { - title_province = { - geographical_region = special_mongol_empire_conquest_region_prio_1 - } - } - root.story_owner = { - change_variable = { - name = special_mongol_empire_conquest_region_prio_1_var - add = 1 - } - } - } - else_if = { - limit = { - title_province = { - geographical_region = special_mongol_empire_conquest_region_prio_1_alpha - } - } - root.story_owner = { - change_variable = { - name = special_mongol_empire_conquest_region_prio_1_alpha_var - add = 1 - } - } - } - else = { - root.story_owner = { - change_variable = { - name = outside_conquest_region_var - add = 1 - } - } - } - } - } - # Weighted random chance to end the story/break up the Empire - random = { - chance = 0 - #Pure realm size - Mongol empire is historical breakup size - modifier = { - add = 20 - story_owner = { - realm_size >= 1087 - } - } - #Pure realm size - Mongol empire is max extent size - modifier = { - add = 20 - story_owner = { - realm_size >= 1474 - } - } - #Pure realm size - Mongol empire is at total bonus size - modifier = { - add = 30 - story_owner = { - realm_size >= 1725 - } - } - modifier = { # If the empire is very successful, increase the chance - add = 10 - story_owner = { - #Half of total county count - var:special_mongol_empire_conquest_region_prio_1_alpha_var >= 80 - var:special_mongol_empire_conquest_region_prio_1_var >= 60 - var:special_mongol_empire_conquest_region_prio_2_var >= 100 - #Just a third - var:special_mongol_empire_conquest_region_prio_3_var >= 30 - var:special_mongol_empire_conquest_region_prio_4_var >= 100 - var:special_mongol_empire_conquest_region_prio_5_var >= 120 - } - } - modifier = { # If the empire is EXTREMELY successful, increase the chance - add = 20 - story_owner = { - #Three quarters of total county count - var:special_mongol_empire_conquest_region_prio_1_alpha_var >= 120 - var:special_mongol_empire_conquest_region_prio_1_var >= 75 - var:special_mongol_empire_conquest_region_prio_2_var >= 200 - #Just half - var:special_mongol_empire_conquest_region_prio_3_var >= 45 - var:special_mongol_empire_conquest_region_prio_4_var >= 150 - var:special_mongol_empire_conquest_region_prio_5_var >= 180 - var:outside_conquest_region_var >= 100 - } - } - modifier = { - add = 20 - var:succession_counter > 1 - } - modifier = { - add = 30 - var:succession_counter > 2 - } - modifier = { # Historical point - add = 30 - var:succession_counter > 3 - } - modifier = { # Guaranteed if there have been five successions - add = 20 - var:succession_counter > 4 - } - set_variable = { - name = end_of_story - value = yes - } - } - if = { - limit = { - exists = var:end_of_story - } - # Do the breakup of the empire if possible - story_owner = { - if = { - limit = { - realm_size >= 50 - } - debug_log = "Trying to break up the Mongol Empire" - break_up_mongol_empire_effect = yes - } - else = { - save_scope_as = old_khan - player_heir = { - save_scope_as = new_khan - } - every_player = { - trigger_event = mongol_invasion.1005 # Small end to story - } - } - } - end_story = yes - } - else = { - change_variable = { - name = succession_counter - add = 1 - } - # Handle story succession - story_owner = { - save_scope_as = old_khan # for news events - if = { - limit = { - any_child = { # if the Khan has a reasonable heir... - is_primary_heir_of = scope:story.story_owner - } - } - random_child = { - limit = { - is_primary_heir_of = scope:story.story_owner - } - save_scope_as = new_khan # for news events - save_scope_as = new_story_owner # pass chain to appropriate target - add_character_flag = { - flag = gain_mongol_succession_dread - days = 2 - } - add_character_modifier = { - modifier = the_great_khan_modifier - } - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - else_if = { - limit = { - dynasty = { - any_dynasty_member = { # if the Khan has some other heir (not family?) - is_primary_heir_of = scope:story.story_owner - } - } - } - dynasty = { - random_dynasty_member = { - limit = { - is_primary_heir_of = scope:story.story_owner - } - save_scope_as = new_khan # for news events - save_scope_as = new_story_owner # pass chain to appropriate target - add_character_flag = { - flag = gain_mongol_succession_dread - days = 2 - } - add_character_modifier = { - modifier = the_great_khan_modifier - } - } - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - else_if = { # If the empire passes out of the original dynasty, the story will automatically end - limit = { - NOT = { - dynasty = { - any_dynasty_member = { # if the Khan has some other heir (not family?) - is_primary_heir_of = scope:story.story_owner - } - } - } - } - scope:story.story_owner.primary_heir = { - save_scope_as = new_khan - } - every_player = { - trigger_event = { - id = mongol_invasion.1001 - days = 1 - } - } - } - } - if = { - limit = { exists = scope:new_story_owner } - make_story_owner = scope:new_story_owner - scope:new_story_owner = { - # Delayed firing of spawning new event troops - trigger_event = { - id = mongol_invasion.0100 - days = 1 - } - } - debug_log = "Successfully replaced the Mongol Khan" - debug_log_date = yes - debug_log_scopes = yes - } - else = { - # Make sure the empire breaks up as best as possible - story_owner = { - if = { - limit = { - realm_size >= 50 - } - } - debug_log = "Due to failing to replace the Khan with a Temujin successor, now trying to break up the empire" - break_up_mongol_empire_effect = yes - } +# on_owner_death = { +# story_owner = { +# set_variable = { +# name = special_mongol_empire_conquest_region_prio_1_alpha_var +# value = 0 +# } +# set_variable = { +# name = special_mongol_empire_conquest_region_prio_1_var +# value = 0 +# } +# set_variable = { +# name = special_mongol_empire_conquest_region_prio_2_var +# value = 0 +# } +# set_variable = { +# name = special_mongol_empire_conquest_region_prio_3_var +# value = 0 +# } +# set_variable = { +# name = special_mongol_empire_conquest_region_prio_4_var +# value = 0 +# } +# set_variable = { +# name = special_mongol_empire_conquest_region_prio_5_var +# value = 0 +# } +# set_variable = { +# name = outside_conquest_region_var +# value = 0 +# } +# every_realm_county = { +# if = { +# limit = { +# title_province = { +# geographical_region = special_mongol_empire_conquest_region_prio_5 +# } +# } +# root.story_owner = { +# change_variable = { +# name = special_mongol_empire_conquest_region_prio_5_var +# add = 1 +# } +# } +# } +# else_if = { +# limit = { +# title_province = { +# geographical_region = special_mongol_empire_conquest_region_prio_4 +# } +# } +# root.story_owner = { +# change_variable = { +# name = special_mongol_empire_conquest_region_prio_4_var +# add = 1 +# } +# } +# } +# else_if = { +# limit = { +# title_province = { +# geographical_region = special_mongol_empire_conquest_region_prio_3 +# } +# } +# root.story_owner = { +# change_variable = { +# name = special_mongol_empire_conquest_region_prio_3_var +# add = 1 +# } +# } +# } +# else_if = { +# limit = { +# title_province = { +# geographical_region = special_mongol_empire_conquest_region_prio_2 +# } +# } +# root.story_owner = { +# change_variable = { +# name = special_mongol_empire_conquest_region_prio_2_var +# add = 1 +# } +# } +# } +# else_if = { +# limit = { +# title_province = { +# geographical_region = special_mongol_empire_conquest_region_prio_1 +# } +# } +# root.story_owner = { +# change_variable = { +# name = special_mongol_empire_conquest_region_prio_1_var +# add = 1 +# } +# } +# } +# else_if = { +# limit = { +# title_province = { +# geographical_region = special_mongol_empire_conquest_region_prio_1_alpha +# } +# } +# root.story_owner = { +# change_variable = { +# name = special_mongol_empire_conquest_region_prio_1_alpha_var +# add = 1 +# } +# } +# } +# else = { +# root.story_owner = { +# change_variable = { +# name = outside_conquest_region_var +# add = 1 +# } +# } +# } +# } +# } +# # Weighted random chance to end the story/break up the Empire +# random = { +# chance = 0 +# #Pure realm size - Mongol empire is historical breakup size +# modifier = { +# add = 20 +# story_owner = { +# realm_size >= 1087 +# } +# } +# #Pure realm size - Mongol empire is max extent size +# modifier = { +# add = 20 +# story_owner = { +# realm_size >= 1474 +# } +# } +# #Pure realm size - Mongol empire is at total bonus size +# modifier = { +# add = 30 +# story_owner = { +# realm_size >= 1725 +# } +# } +# modifier = { # If the empire is very successful, increase the chance +# add = 10 +# story_owner = { +# #Half of total county count +# var:special_mongol_empire_conquest_region_prio_1_alpha_var >= 80 +# var:special_mongol_empire_conquest_region_prio_1_var >= 60 +# var:special_mongol_empire_conquest_region_prio_2_var >= 100 +# #Just a third +# var:special_mongol_empire_conquest_region_prio_3_var >= 30 +# var:special_mongol_empire_conquest_region_prio_4_var >= 100 +# var:special_mongol_empire_conquest_region_prio_5_var >= 120 +# } +# } +# modifier = { # If the empire is EXTREMELY successful, increase the chance +# add = 20 +# story_owner = { +# #Three quarters of total county count +# var:special_mongol_empire_conquest_region_prio_1_alpha_var >= 120 +# var:special_mongol_empire_conquest_region_prio_1_var >= 75 +# var:special_mongol_empire_conquest_region_prio_2_var >= 200 +# #Just half +# var:special_mongol_empire_conquest_region_prio_3_var >= 45 +# var:special_mongol_empire_conquest_region_prio_4_var >= 150 +# var:special_mongol_empire_conquest_region_prio_5_var >= 180 +# var:outside_conquest_region_var >= 100 +# } +# } +# modifier = { +# add = 20 +# var:succession_counter > 1 +# } +# modifier = { +# add = 30 +# var:succession_counter > 2 +# } +# modifier = { # Historical point +# add = 30 +# var:succession_counter > 3 +# } +# modifier = { # Guaranteed if there have been five successions +# add = 20 +# var:succession_counter > 4 +# } +# set_variable = { +# name = end_of_story +# value = yes +# } +# } +# if = { +# limit = { +# exists = var:end_of_story +# } +# # Do the breakup of the empire if possible +# story_owner = { +# if = { +# limit = { +# realm_size >= 50 +# } +# debug_log = "Trying to break up the Mongol Empire" +# break_up_mongol_empire_effect = yes +# } +# else = { +# save_scope_as = old_khan +# player_heir = { +# save_scope_as = new_khan +# } +# every_player = { +# trigger_event = mongol_invasion.1005 # Small end to story +# } +# } +# } +# end_story = yes +# } +# else = { +# change_variable = { +# name = succession_counter +# add = 1 +# } +# # Handle story succession +# story_owner = { +# save_scope_as = old_khan # for news events +# if = { +# limit = { +# any_child = { # if the Khan has a reasonable heir... +# is_primary_heir_of = scope:story.story_owner +# } +# } +# random_child = { +# limit = { +# is_primary_heir_of = scope:story.story_owner +# } +# save_scope_as = new_khan # for news events +# save_scope_as = new_story_owner # pass chain to appropriate target +# add_character_flag = { +# flag = gain_mongol_succession_dread +# days = 2 +# } +# add_character_modifier = { +# modifier = the_great_khan_modifier +# } +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# else_if = { +# limit = { +# dynasty = { +# any_dynasty_member = { # if the Khan has some other heir (not family?) +# is_primary_heir_of = scope:story.story_owner +# } +# } +# } +# dynasty = { +# random_dynasty_member = { +# limit = { +# is_primary_heir_of = scope:story.story_owner +# } +# save_scope_as = new_khan # for news events +# save_scope_as = new_story_owner # pass chain to appropriate target +# add_character_flag = { +# flag = gain_mongol_succession_dread +# days = 2 +# } +# add_character_modifier = { +# modifier = the_great_khan_modifier +# } +# } +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# else_if = { # If the empire passes out of the original dynasty, the story will automatically end +# limit = { +# NOT = { +# dynasty = { +# any_dynasty_member = { # if the Khan has some other heir (not family?) +# is_primary_heir_of = scope:story.story_owner +# } +# } +# } +# } +# scope:story.story_owner.primary_heir = { +# save_scope_as = new_khan +# } +# every_player = { +# trigger_event = { +# id = mongol_invasion.1001 +# days = 1 +# } +# } +# } +# } +# if = { +# limit = { exists = scope:new_story_owner } +# make_story_owner = scope:new_story_owner +# scope:new_story_owner = { +# # Delayed firing of spawning new event troops +# trigger_event = { +# id = mongol_invasion.0100 +# days = 1 +# } +# } +# debug_log = "Successfully replaced the Mongol Khan" +# debug_log_date = yes +# debug_log_scopes = yes +# } +# else = { +# # Make sure the empire breaks up as best as possible +# story_owner = { +# if = { +# limit = { +# realm_size >= 50 +# } +# } +# debug_log = "Due to failing to replace the Khan with a Temujin successor, now trying to break up the empire" +# break_up_mongol_empire_effect = yes +# } - end_story = yes - debug_log = "Failed to replace the Mongol Khan" - debug_log_date = yes - debug_log_scopes = yes - } - } - story_owner = { - clear_variable_list = special_mongol_empire_conquest_region_prio_1_alpha_var - clear_variable_list = special_mongol_empire_conquest_region_prio_1_var - clear_variable_list = special_mongol_empire_conquest_region_prio_2_var - clear_variable_list = special_mongol_empire_conquest_region_prio_3_var - clear_variable_list = special_mongol_empire_conquest_region_prio_4_var - clear_variable_list = special_mongol_empire_conquest_region_prio_5_var - clear_variable_list = outside_conquest_region_var - } - } +# end_story = yes +# debug_log = "Failed to replace the Mongol Khan" +# debug_log_date = yes +# debug_log_scopes = yes +# } +# } +# story_owner = { +# clear_variable_list = special_mongol_empire_conquest_region_prio_1_alpha_var +# clear_variable_list = special_mongol_empire_conquest_region_prio_1_var +# clear_variable_list = special_mongol_empire_conquest_region_prio_2_var +# clear_variable_list = special_mongol_empire_conquest_region_prio_3_var +# clear_variable_list = special_mongol_empire_conquest_region_prio_4_var +# clear_variable_list = special_mongol_empire_conquest_region_prio_5_var +# clear_variable_list = outside_conquest_region_var +# } +# } - #Start a new war if none is ongoing - effect_group = { - days = { 30 50 } +# #Start a new war if none is ongoing +# effect_group = { +# days = { 30 50 } - trigger = { - story_owner = { - is_at_war = no - gold > 0 - any_held_title = { - this = title:e_mongol_empire - } - } - } +# trigger = { +# story_owner = { +# is_at_war = no +# gold > 0 +# any_held_title = { +# this = title:e_mongol_empire +# } +# } +# } - triggered_effect = { - trigger = { - story_owner = { - is_ai = yes - } - } - effect = { - if = { - limit = { - has_mpo_dlc_trigger = yes - } - story_owner = { - gok_war_target_evaluation_and_declaration_effect = yes - } - } - else = { - story_owner = { - mongol_war_target_evaluation_and_declaration_effect = yes - } - } - debug_log = "The story started a new war for the Mongols" - debug_log_date = yes - story_owner = { - save_scope_as = owner - } - debug_log_scopes = yes - } - } - } +# triggered_effect = { +# trigger = { +# story_owner = { +# is_ai = yes +# } +# } +# effect = { +# if = { +# limit = { +# has_mpo_dlc_trigger = yes +# } +# story_owner = { +# gok_war_target_evaluation_and_declaration_effect = yes +# } +# } +# else = { +# story_owner = { +# mongol_war_target_evaluation_and_declaration_effect = yes +# } +# } +# debug_log = "The story started a new war for the Mongols" +# debug_log_date = yes +# story_owner = { +# save_scope_as = owner +# } +# debug_log_scopes = yes +# } +# } +# } - # Story handling in case of succession weirdness - effect_group = { - days = 180 +# # Story handling in case of succession weirdness +# effect_group = { +# days = 180 - trigger = { - story_owner = { - NOT = { - any_held_title = { - this = title:e_mongol_empire - } - } - } - } +# trigger = { +# story_owner = { +# NOT = { +# any_held_title = { +# this = title:e_mongol_empire +# } +# } +# } +# } - triggered_effect = { - trigger = { exists = title:e_mongol_empire } - effect = { - if = { - limit = { - title:e_mongol_empire.holder = { - culture = culture:mongol - } - } - make_story_owner = title:e_mongol_empire.holder - } - else = { - end_story = yes - } - } - } +# triggered_effect = { +# trigger = { exists = title:e_mongol_empire } +# effect = { +# if = { +# limit = { +# title:e_mongol_empire.holder = { +# culture = culture:mongol +# } +# } +# make_story_owner = title:e_mongol_empire.holder +# } +# else = { +# end_story = yes +# } +# } +# } - triggered_effect = { - trigger = { NOT = { exists = title:e_mongol_empire } } - effect = { - end_story = yes - } - } - } +# triggered_effect = { +# trigger = { NOT = { exists = title:e_mongol_empire } } +# effect = { +# end_story = yes +# } +# } +# } - # Set up Mongol Empire de jure stuff - effect_group = { - days = 180 +# # Set up Mongol Empire de jure stuff +# effect_group = { +# days = 180 - trigger = { - NOT = { exists = var:has_updated_mongolia_de_jure } - trigger_if = { - limit = { - title:e_mongolia = { - any_de_jure_county = { - count >= 3 - } - } - } - title:e_mongolia = { - any_in_de_jure_hierarchy = { - continue = { tier > tier_county } - tier = tier_county - holder.top_liege = scope:story.story_owner - count > 3 - } - } - } - story_owner.capital_county.empire = { - any_in_de_jure_hierarchy = { - continue = { tier > tier_county } - tier = tier_county - holder.top_liege = scope:story.story_owner - count > 5 - } - } - } +# trigger = { +# NOT = { exists = var:has_updated_mongolia_de_jure } +# trigger_if = { +# limit = { +# title:e_mongolia = { +# any_de_jure_county = { +# count >= 3 +# } +# } +# } +# title:e_mongolia = { +# any_in_de_jure_hierarchy = { +# continue = { tier > tier_county } +# tier = tier_county +# holder.top_liege = scope:story.story_owner +# count > 3 +# } +# } +# } +# story_owner.capital_county.empire = { +# any_in_de_jure_hierarchy = { +# continue = { tier > tier_county } +# tier = tier_county +# holder.top_liege = scope:story.story_owner +# count > 5 +# } +# } +# } - triggered_effect = { - trigger = { - always = yes - } +# triggered_effect = { +# trigger = { +# always = yes +# } - effect = { - title:e_mongolia = { - every_in_de_jure_hierarchy = { - limit = { - tier = tier_kingdom - } - set_de_jure_liege_title = title:e_mongol_empire - } - } - if = { - limit = { - exists = title:e_mongolia.holder - } - title:e_mongolia.holder = { - destroy_title = title:e_mongolia - } - } - if = { - limit = { - story_owner.capital_county.empire = { - NOT = { - this = title:e_mongol_empire - } - } - } - story_owner.capital_county.empire = { - save_scope_as = new_de_jure - } - scope:new_de_jure = { - every_in_de_jure_hierarchy = { - limit = { - tier = tier_kingdom - } - set_de_jure_liege_title = title:e_mongol_empire - } - } - } +# effect = { +# title:e_mongolia = { +# every_in_de_jure_hierarchy = { +# limit = { +# tier = tier_kingdom +# } +# set_de_jure_liege_title = title:e_mongol_empire +# } +# } +# if = { +# limit = { +# exists = title:e_mongolia.holder +# } +# title:e_mongolia.holder = { +# destroy_title = title:e_mongolia +# } +# } +# if = { +# limit = { +# story_owner.capital_county.empire = { +# NOT = { +# this = title:e_mongol_empire +# } +# } +# } +# story_owner.capital_county.empire = { +# save_scope_as = new_de_jure +# } +# scope:new_de_jure = { +# every_in_de_jure_hierarchy = { +# limit = { +# tier = tier_kingdom +# } +# set_de_jure_liege_title = title:e_mongol_empire +# } +# } +# } - set_variable = { - name = has_updated_mongolia_de_jure - value = yes - } - } - } - } -} +# set_variable = { +# name = has_updated_mongolia_de_jure +# value = yes +# } +# } +# } +# } +#} diff --git a/common/story_cycles/story_cycle_seljuk_invasion.txt b/common/story_cycles/story_cycle_seljuk_invasion.txt index a17588cce..464ffee36 100644 --- a/common/story_cycles/story_cycle_seljuk_invasion.txt +++ b/common/story_cycles/story_cycle_seljuk_invasion.txt @@ -1,177 +1,178 @@ -story_seljuk_invasion = { +# NEOW 2555: Historical Seljuk invasion story (original source retained as comments). +#story_seljuk_invasion = { - on_setup = { - story_owner = { # Find a place for the Seljuks to settle - set_variable = { - name = seljuk_invasion_nomad_strength_score - value = 10 - } - try_to_settle_the_seljuk_effect = yes - } - set_variable = { - name = succession_counter - value = 0 - } - } +# on_setup = { +# story_owner = { # Find a place for the Seljuks to settle +# set_variable = { +# name = seljuk_invasion_nomad_strength_score +# value = 10 +# } +# try_to_settle_the_seljuk_effect = yes +# } +# set_variable = { +# name = succession_counter +# value = 0 +# } +# } - on_end = {} +# on_end = {} - on_owner_death = { - # Breakup of the empire should not happen until at least one succession has passed - random_list = { # Weighted chance to end the story - 10 = { - trigger = { var:succession_counter < 2 } - modifier = { - add = 10 - var:succession_counter > 1 - } - modifier = { # Historical point - add = 10 - var:succession_counter > 2 - } - modifier = { - add = 20 - var:succession_counter > 3 - } - end_story = yes - } - 90 = { - if = { - limit = { - exists = story_owner.primary_heir - } - make_story_owner = story_owner.primary_heir - change_variable = { - name = seljuk_invasion_nomad_strength_score - add = -5 - } - } - else = { - end_story = yes - } - } - } - } +# on_owner_death = { +# # Breakup of the empire should not happen until at least one succession has passed +# random_list = { # Weighted chance to end the story +# 10 = { +# trigger = { var:succession_counter < 2 } +# modifier = { +# add = 10 +# var:succession_counter > 1 +# } +# modifier = { # Historical point +# add = 10 +# var:succession_counter > 2 +# } +# modifier = { +# add = 20 +# var:succession_counter > 3 +# } +# end_story = yes +# } +# 90 = { +# if = { +# limit = { +# exists = story_owner.primary_heir +# } +# make_story_owner = story_owner.primary_heir +# change_variable = { +# name = seljuk_invasion_nomad_strength_score +# add = -5 +# } +# } +# else = { +# end_story = yes +# } +# } +# } +# } - # Start a new war if one is not ongoing - effect_group = { - days = { 30 60 } +# # Start a new war if one is not ongoing +# effect_group = { +# days = { 30 60 } - trigger = { - story_owner = { - is_at_war = no - gold > 0 - OR = { - NOT = { has_character_flag = settled_seljuk } - top_liege = this - } - } - } +# trigger = { +# story_owner = { +# is_at_war = no +# gold > 0 +# OR = { +# NOT = { has_character_flag = settled_seljuk } +# top_liege = this +# } +# } +# } - triggered_effect = { - trigger = { - story_owner = { - is_ai = yes - } - } - effect = { - story_owner = { - seljuk_war_target_evaluation_and_declaration_effect = yes - save_scope_as = owner - } - } - } - } +# triggered_effect = { +# trigger = { +# story_owner = { +# is_ai = yes +# } +# } +# effect = { +# story_owner = { +# seljuk_war_target_evaluation_and_declaration_effect = yes +# save_scope_as = owner +# } +# } +# } +# } - # Ask for independence if vassals - effect_group = { - years = { 1 2 } +# # Ask for independence if vassals +# effect_group = { +# years = { 1 2 } - trigger = { - story_owner = { - has_character_flag = settled_seljuk - top_liege != this - } - } +# trigger = { +# story_owner = { +# has_character_flag = settled_seljuk +# top_liege != this +# } +# } - triggered_effect = { - trigger = { - story_owner = { - is_ai = yes - } - } - effect = { - story_owner = { - seljuk_request_independence_from_liege_effect = yes - save_scope_as = owner - } - } - } - } +# triggered_effect = { +# trigger = { +# story_owner = { +# is_ai = yes +# } +# } +# effect = { +# story_owner = { +# seljuk_request_independence_from_liege_effect = yes +# save_scope_as = owner +# } +# } +# } +# } - # Create the empire and close the story - effect_group = { - days = { 30 60 } +# # Create the empire and close the story +# effect_group = { +# days = { 30 60 } - trigger = { - story_owner = { - save_temporary_scope_as = temp_seljuk - OR = { - any_county_in_region = { - region = world_persian_empire - percent >= 0.51 - holder.top_liege = scope:temp_seljuk - } - any_held_title = { - count = 2 - title_tier = kingdom - any_this_title_or_de_jure_above = { - this = title:e_persia - } - } - any_held_title = { - title_tier = empire - any_this_title_or_de_jure_above = { - this = title:e_persia - } - } - } - } - } +# trigger = { +# story_owner = { +# save_temporary_scope_as = temp_seljuk +# OR = { +# any_county_in_region = { +# region = world_persian_empire +# percent >= 0.51 +# holder.top_liege = scope:temp_seljuk +# } +# any_held_title = { +# count = 2 +# title_tier = kingdom +# any_this_title_or_de_jure_above = { +# this = title:e_persia +# } +# } +# any_held_title = { +# title_tier = empire +# any_this_title_or_de_jure_above = { +# this = title:e_persia +# } +# } +# } +# } +# } - triggered_effect = { - trigger = { - story_owner = { - is_ai = yes - } - } - effect = { - story_owner = { - save_scope_as = owner +# triggered_effect = { +# trigger = { +# story_owner = { +# is_ai = yes +# } +# } +# effect = { +# story_owner = { +# save_scope_as = owner - create_title_and_vassal_change = { - type = created - save_scope_as = title_change - add_claim_on_loss = no - } +# create_title_and_vassal_change = { +# type = created +# save_scope_as = title_change +# add_claim_on_loss = no +# } - title:e_persia = { - change_title_holder = { - holder = scope:owner - change = scope:title_change - } - save_scope_as = title_e_persia - } +# title:e_persia = { +# change_title_holder = { +# holder = scope:owner +# change = scope:title_change +# } +# save_scope_as = title_e_persia +# } - resolve_title_and_vassal_change = scope:title_change +# resolve_title_and_vassal_change = scope:title_change - set_primary_title_to = scope:title_e_persia +# set_primary_title_to = scope:title_e_persia - } +# } - end_story = yes - } - } - } +# end_story = yes +# } +# } +# } -} +#} diff --git a/common/subject_contracts/groups/subject_contract_groups.txt b/common/subject_contracts/groups/subject_contract_groups.txt index c50b4eccc..927b69dad 100644 --- a/common/subject_contracts/groups/subject_contract_groups.txt +++ b/common/subject_contracts/groups/subject_contract_groups.txt @@ -321,3 +321,27 @@ meritocratic_vassal = { modify_contract_layout = eastern_admin } + + +# CK3 1.21 Silk & Silver: merchant tributary contract group. +tributary_merchant = { + is_tributary = yes + is_beneficiary_relationship = yes + tributary_can_break_free = { always = no } + suzerain_line_type = line_suzerain + tributary_line_type = line_tributary + tributary_heir_succession = yes + suzerain_heir_succession = yes + + is_valid_tributary_contract = { + is_landless_merchant = yes + scope:suzerain = { is_landed = yes } + } + + contracts = { + merchant_taxes + merchant_prestige + merchant_competitiveness + merchant_marriage + } +} diff --git a/common/succession_election/NEOW_succession_elections.txt b/common/succession_election/NEOW_succession_elections.txt index 7757648cc..8d3038539 100644 --- a/common/succession_election/NEOW_succession_elections.txt +++ b/common/succession_election/NEOW_succession_elections.txt @@ -2,23 +2,23 @@ elector_vote_strength = { base = 0 modifier = { #Each voter is the "representative" of all the free men living in his domain. The larger the domain, the more voting power he has. - desc = tooltip_tribal_elective_development + desc = tooltip_tribal_elective_prosperity is_landed_or_landless_administrative = yes domain_size >= 1 any_held_title = { title_tier = county - development_level > 0 + prosperity_level > 0 target_is_de_jure_liege_or_above = scope:title } add = { every_held_title = { title_tier = county limit = { - development_level > 0 + prosperity_level > 0 target_is_de_jure_liege_or_above = scope:title } add = { - value = this.development_level + value = this.prosperity_level if = { limit = { this.faith != root.faith diff --git a/common/trade/county_potential_trade_goods/county_potential_trade_goods.txt b/common/trade/county_potential_trade_goods/county_potential_trade_goods.txt new file mode 100644 index 000000000..ea79e00f0 --- /dev/null +++ b/common/trade/county_potential_trade_goods/county_potential_trade_goods.txt @@ -0,0 +1,77 @@ +# NEOW 2555: 1.21 trade-good county potential, restricted to valid NEOW landed-title counties. +# Other vanilla counties are not defined in NEOW and produced 9508 invalid-title errors. +trade_good_alum = { counties = { c_ruyan c_prusa c_gilan c_ardabil c_aeolis c_naxos c_kharga c_lesbos c_murcia c_colonea c_abydos c_qazwin c_baduspan } } + +trade_good_medicaments = { + counties = { c_prusa c_mayyafariqin c_hadrianopolis c_alcacer_do_sal c_qain c_khabur c_ushmun c_faro c_mallorca c_upper_khabur c_silves c_beja c_nasibin c_aswan c_ionia c_philomelium c_dathina c_messenia c_laconia c_iviza c_sinjar c_irbil c_isauria c_edessa c_cairo c_tall_basma c_galatia_salutaris c_aintab c_aeolis c_lycaonia c_hama c_amida c_nikaea c_chios c_bahnasa } +} + +trade_good_horses = { + counties = { c_vogtland c_vienna c_gloucestershire c_alto_aragon c_ulm c_prerov c_zagreb c_hiiumaa c_zemigalians c_melitene c_sacz c_torun c_cheshire c_borsod c_bugurslan c_ferrara c_orkney c_northamptonshire c_beirut c_hadrianopolis c_malbork c_qinnasrin c_dijon c_tolna c_hulwan c_pisidia c_baalbek c_canarias c_dole c_cieszyn c_berry c_east-tokharestan c_bar c_zamora c_poznanska c_abbadan c_talish c_bacs c_sable c_vrbas c_hotin c_tihamat-al-yamani c_arnhem c_cetatea_alba c_krasso c_rethel c_montaigu c_reims c_lleida c_lori c_nihawand c_pila c_irbid c_vannes c_beja c_oldenburg c_baihaq c_waldeck c_vastmanland c_groningen c_amaya c_cuenca c_angus c_urgell c_honorias c_lydia c_khabur c_coruna c_fuerteventura c_sjaelland c_malaga c_masabadhan c_turnovo c_galatia_salutaris c_langres c_raqqa c_besinada c_slesvig c_ramhurmuz c_castellon c_nysa c_dresden c_hayk c_hampton c_nyland c_kherson c_tmutarakan c_dausar c_zela c_basra c_abkhazia c_verona c_saumur c_keve c_clermont c_bihar c_hvosno c_komarom c_ingolstadt c_glamorgan c_uwal c_vanand c_alarcon c_kaliska c_zadar c_osnabruck c_east_riding c_kaisereia c_mainz c_chalkidike c_rugen c_acre c_uman c_modena c_sebasteia c_rama c_murzzuschlag c_lubeck c_kiel c_olomouc c_firenze c_shropshire c_bearn c_tecklenburg c_nurnberg c_lycaonia c_lincolnshire c_rusafa c_fraga c_visegrad c_grodno c_coimbra c_zhytomyr c_suzdal c_orvieto c_oriel c_baisary c_uqayr c_girona c_navarra c_maragha c_cherkassy c_hereford c_guzgan c_najera c_turuberan c_saintonge c_galatia c_lucca c_kranj c_sinjar c_merida c_anket c_cuellar c_tall_basma c_ringkobing c_hamburg c_beziers c_ansbach c_yazd c_astorga c_trandheim c_tui c_constanta c_ardabil c_csongrad c_isfahan c_essex c_breslau c_oversticht c_zemplen c_wiek c_alcaraz c_brabant c_bithynia c_andujar c_gnieznienska c_novara c_agenais c_galloway c_passau c_qumisha c_soroca c_mesopotamia c_miliez c_rivsharan c_molina c_ribe c_bakharz c_behabad c_pisa c_tarsos c_zolyom c_coburg c_bari c_leczycka c_ohrid c_ninive c_philomelium c_farah c_strathearn c_fyn c_tortoli c_cologne c_orenburg c_ablastha c_hainaut c_braganza c_schmalkalden c_north_riding c_wiltshire c_avranches c_soria c_isle_of_wight c_hont c_ghazza c_viscaya c_trebizond c_kerak c_calatayud c_tourraine c_nikaea c_asturias_de_santillana c_nikopolis c_vanemane c_marmaros c_julfar c_tiberias c_plasencia c_gottingen c_bordeaux c_svaneti c_sakmara c_maghas c_herat c_irbil c_vaspurakan c_dathina c_fulda c_qazwin c_macva c_holland c_saarbrucken c_spis c_benevento c_socotra c_velbazhd c_wschowska c_ditmarschen c_azysia c_wittenberg c_zirkuh c_zanjan c_stade c_samarra c_vladimir c_pula c_bayeux c_coulommiers c_isauria c_aalborg c_mallorca c_catania c_konigsberg c_beograd c_leon c_ayrshire c_krems c_poszony c_euchaita c_lozova c_montpellier c_ancona c_sevilla c_namur c_theodosiopolis c_reggio_calabria c_hohenau c_plocka c_laconia c_thouars } +} + +trade_good_amber = { counties = { c_angerburg c_angouleme c_hiiumaa c_kernave c_kokenois c_limousin c_livs c_palermo c_raseiniai c_saintonge c_selpils c_siauliai c_torun c_riga c_wiek c_danzig c_kolobrzeg c_konigsberg } } + +trade_good_honey = { counties = { c_warwickshire c_la_marche c_west_riding c_parma c_phrygia c_moray c_bahnasa c_severin c_castelo_branco c_kaiserslautern c_qurta c_cardiganshire c_somogy c_qain c_firaun c_thessalonika c_plasencia c_marburg c_strassburg c_prusa c_trebizond c_salamanca c_qumisha c_ablastha c_kolobrzeg c_villach c_saimara c_perigord c_palanga c_neamnt c_nizwa c_az-dhahira c_badaraya c_chornobyl c_berent c_radomska c_viscaya c_elvas c_vanand c_naxos c_colonea c_ubulla c_amaya c_dhofar c_frankfurt c_gemer c_hereford c_dorohoi c_namdalfylki c_murcia c_monferrato c_calatayud c_gilan c_troyes c_brysis c_zollern c_kranj c_tortoli c_salerno c_vannes c_galatia c_pravia c_breifne c_clermont_sur_allier c_basra c_ulm c_novosil c_asyut c_litomerice c_alcaraz c_krakowska c_hvosno c_aquileia c_ingolstadt c_ghazna c_madrid c_naissus c_istakhr c_lika c_vitebsk c_canarias c_temes c_murzzuschlag c_zela c_teviotdale c_polotsk c_issoudun c_plocka c_isle_of_man c_rukhaj c_outer_hebrides c_al-buhaira c_hadrianopolis c_khawr c_monmouthshire c_brecknockshire c_konigsberg c_caernarfonshire c_mazandaran c_uiska c_caria c_sutherland c_szabolcs c_bar c_khachen c_orleans c_volodymyr c_hayk c_borsod c_mosul c_agrigento c_strathearn c_vastvag c_beograd c_lisboa c_dalarna c_damietta c_landsberg c_jiruft c_buchan c_modena c_voronezh c_mearns c_gowrie c_luni c_annandale c_cumberland c_cambridgeshire c_sandomierska c_marmaros c_shahrazur c_bithynia c_krems c_rusafa c_selge c_thessalia c_ljubljana c_alencon c_neufchateau c_sanaa c_lori c_strumica c_arnsberg c_ohrid c_pite c_yatvyagi c_giza c_iasi c_leon c_auvergne c_bagrewand c_anbar c_ural c_cairo c_beja c_alto_aragon c_zagorje c_cilicia c_attica c_barcelona c_norwegian_more c_rhodos c_braganza c_iskaf c_kalliopolis c_arnhem c_jabal_quzlum c_pula c_beszterce c_lomzynska c_liebnitz c_matya c_messina c_baalbek c_rivsharan c_cornwall c_hotin c_molina c_arezzo c_harjadalen c_gnezdovo c_prerov c_tustar c_opava c_krasso c_bam c_kalat c_cottbus c_kurdistan c_byzantion c_peremyshl c_batina c_euboea c_glamorgan c_rogalandi c_wurzburg c_chalkidike c_pozega c_novogrudok c_rugen c_soli c_bordeaux c_breisgau c_derby c_kursk c_venezia c_tambov c_belebey c_ufa c_petrovsk c_luxembourg c_serdosk c_zabulistan c_pinsk c_grunberg c_sibi c_kozelsk c_hunyad c_medellin c_burgos c_mugan c_chonae c_sancerre c_krajna c_puttlingen c_aargau c_babruysk c_sumadija c_nizhny_novgorod c_denbighshire c_aachen c_ossory c_inverness c_vaspurakan c_french_leon c_hereti c_bouillon c_shaki c_soria c_cerasus c_staffordshire c_lennox c_antipatreia c_buzau c_briey c_raniriki c_legnica c_harrat_rahat c_kletsk c_helgum c_ross c_craiova c_targu_jiu c_nottinghamshire c_dorset c_qusayr c_dunbar c_bekes c_penthievre c_miliez c_pembrokeshire c_dyrrachion c_zamindawar c_satala c_starodub c_spis c_fogaras c_mayyafariqin c_uman c_westmorland c_fraga c_zutphen c_lapusna c_aytos c_sevsk c_rennes c_turan c_huntingdonshire c_ghur c_amstetten c_lanarkshire c_sanij c_sankt_polten c_anglesey c_lviv c_khaybar c_turov c_upper_ghur c_connacht c_kyzistra c_kermanshah c_selpils c_penza c_piacenza c_abauj c_gevaudan c_rouergue c_apahunik c_shetland c_skopje c_jihlava c_thyatira c_ennis c_korosten c_calafat c_ratibor c_leicestershire c_novgorod_seversky c_calarasi c_sens c_memel c_braslau c_inner_hebrides c_mayo c_spreewald c_urgun c_macon c_bellac c_atholl c_oxfordshire c_allenstein c_stezycka c_tula c_cherven c_faereyar c_orhei c_raseiniai c_siauliai c_aland c_vermandois c_berlin c_angouleme c_knittelfeld c_mysia c_marsan c_panjgur c_zaragoza c_tigheci c_slupsk } } + +trade_good_cattle = { counties = { c_naxos c_kalliopolis c_ulm c_prerov c_homs c_saimara c_vorbasse c_samosata c_melitene c_kakisalmi c_blekinge c_vingulmork c_hertfordshire c_kerch c_mora c_northamptonshire c_baranya c_thiers c_hadrianopolis c_poitiers c_dorohoi c_asturias_de_oviedo c_namdalfylki c_dijon c_briey c_tolna c_dal c_sodermannaland c_aunis c_pisidia c_dessau c_berry c_east-tokharestan c_adrianopolis c_trenscen c_samander c_brunswick c_rostock c_syrrusafa c_prusa c_sable c_mafaza c_velay c_hotin c_tihamat-al-yamani c_rethel c_sandomierska c_cetatea_alba c_tbilisi c_puttlingen c_berkshire c_nihawand c_annandale c_najran c_aran c_pila c_irbid c_malta c_qom c_leinster c_lancashire c_caernarfonshire c_cherven c_bagrewand c_arbanon c_brecknockshire c_aydhab c_yatvyagi c_lysva c_amida c_rahba c_sharaf c_dalabergslagen c_liege c_sir_faesyfed c_branicevo c_iasi c_honorias c_khabur c_marash c_antwerpen c_bigorre c_sjaelland c_bucuresti c_langres c_bethen c_zurich c_raqqa c_besinada c_czerska c_carcassonne c_upland c_castellon c_derbent c_nysa c_riqan c_pompeiopolis c_elvas c_hampton c_agrigento c_ungvar c_friuli c_gyor c_komarom c_odishi c_bamberg c_glamorgan c_uwal c_norfolk c_krakowska c_ahqaf c_kaliska c_khachen c_tustar c_chonae c_rouergue c_bost c_hadithat-ana c_sebasteia c_khawr c_bastia c_olomouc c_nasibin c_shropshire c_dhofar c_slupsk c_bearn c_minsk c_sinai c_polovragi c_jilat c_kent c_bampur c_giurgiu c_gorlitz c_zabid c_visegrad c_arezzo c_suzdal c_sinope c_oriel c_darmashan c_cherkassy c_helenopontus c_auvergne c_dvin c_hereford c_halland c_guzgan c_qasim c_sirhan c_troyes c_turuberan c_jerusalem c_moura c_lucca c_suceava c_merida c_dokkum c_arad c_tall_basma c_waqisa c_ringkobing c_metz c_bothin c_armagnac c_al-hasa c_chandax c_ansbach c_jawf-al-yamani c_silves c_dublin c_tui c_marburg c_legnica c_skane c_ardabil c_caslav c_isfahan c_oversticht c_ahvaz c_madrid c_andujar c_gnieznienska c_linz c_strumica c_qumisha c_anbar c_iviza c_mesopotamia c_bam c_neamnt c_bakharz c_bereg c_breifne c_worcestershire c_valencia c_nyitra c_sukhna c_tib c_vas c_tarsos c_zolyom c_khuwar c_outer_hebrides c_ninive c_salamanca c_lisboa c_suriya c_devon c_euboea c_al_jawf c_schmalkalden c_vratsa c_ghazza c_chalons c_kerak c_hunyad c_jabal_kufs c_sundgau c_antiocheia c_asturias_de_santillana c_farama c_chania c_svaneti c_maghas c_clermont_sur_allier c_sebur c_durham c_ile_de_france c_kolobrzeg c_caceres c_teviotdale c_eystridalir c_kirman c_kartli c_lippe c_macva c_ljubljana c_saarbrucken c_spreewald c_thessalonika c_messenia c_socotra c_ditmarschen c_warwickshire c_cadiz c_bedford c_hauran c_juwair c_medelpad c_grunberg c_cosenza c_lubelska c_monmouthshire c_palmyra c_azysia c_buckinghamshire c_lille c_shaqiq c_tarragona c_turin c_phrygia c_pula c_tayma c_kakheti c_coulommiers c_mearns c_maldwyn c_cremona c_bern c_lolland_falster c_dhafra c_famagusta c_tikhvin c_dalarna c_leon c_augsburg c_viterbo c_thomond c_qasr_ibrim c_euchaita c_al-arid c_sutherland c_hildesheim c_northumberland c_konstanz c_gurgan c_murzzuschlag c_luxembourg c_abauj c_hohenlohe c_inverness c_kozelsk c_sibi c_subay c_zaranj c_sancerre c_nurnberg c_aargau c_fulda c_zanjan c_surrah c_thyatira c_coburg c_maine c_leicestershire c_sens c_thalabiya c_brabant c_yamama c_aqiq c_helgum c_kirkuk c_munster c_nassau c_yabrin c_zamindawar c_auxerre c_mysia c_tabuk c_falaj c_maan c_hail c_asir c_grisons c_mantua c_samar c_hannover c_plocka c_leczycka c_bihar c_navarra c_alcacer_do_sal c_sardan c_negev c_berent c_schwerin c_gent c_ribe c_buzau } } + +trade_good_copper = { counties = { c_taif c_votkinsk c_bamian c_kabul c_sakmara c_caslav c_batina c_gottingen c_sebur c_ural c_allaqi c_negev c_innsbruck c_lysva c_apahunik c_nicosia c_lori c_beograd c_trandheim c_ardestan c_trenscen c_famagusta c_dalabergslagen c_montpellier c_acampse c_foix c_perm c_gemer c_tus } } + + +trade_good_cotton = { counties = { c_upper_khabur c_asyut c_raqqa c_nicosia c_ushmun c_batiha c_qurta c_baalbek c_yanbu c_edessa c_qain c_uqayr c_wasit c_qaryatan c_kalabsha c_al-gharbiya c_tihamat-al-yamani c_qinnasrin c_ninive c_syrrusafa c_amida c_west-tokharestan c_bahnasa c_philomelium c_lower_galatia c_badaraya c_rusafa c_aleppo c_hauran c_qus c_palmyra c_dausar c_suriya c_juwair c_uwal c_qasr_ibrim c_wajh c_tun c_akhadid c_maab c_iskaf c_east-tokharestan c_beirut c_famagusta c_damascus c_kufa c_lycaonia c_hama c_ubulla c_galatia_salutaris c_balqa c_aintab c_giza c_al-buhaira c_aswan c_guzgan c_anbar c_sharkiya c_malta } } + +trade_good_dyes = { counties = { c_beaumont c_brie_francaise c_kirman c_korinthos c_chalkidike c_zeeland c_byzantion c_ile_de_france c_ramhurmuz c_dawraq c_sevilla c_cordoba c_montpellier c_bam c_foix c_sardan c_tihamat-al-yamani c_kalliopolis c_niebla c_moura c_nishapur c_messenia c_laconia c_calatrava c_ardabil c_zabid c_tustar c_juwain c_andujar c_urmiya c_euboea c_ahvaz c_baihaq c_malaga c_gottingen c_beirut c_boeotia c_toulouse c_sirjan c_clermont c_brysis c_maragha c_venezia c_almeria } } + +trade_good_fish = { counties = { c_halland c_onega_BJA c_carmarthenshire c_tmutarakan c_skane c_norwegian_more c_lubeck c_kiel c_riga c_girona c_aeolis c_aydhab c_socotra c_koutajoki c_antwerpen c_kolon c_cerasus c_salerno c_ringkobing c_braslau c_varend c_moray c_arbanon c_ditmarschen c_cambridgeshire c_niebla c_batina c_east_kiilt c_pembrokeshire c_odishi c_atyrau c_burgas c_ostergotland c_cephalonia c_tall_hamid c_castellon c_byzantion c_bornholm c_caithness c_hedmork c_irahistan c_argyll c_dublin c_yanbu c_zadar c_morarna c_isle_of_man c_leinster c_tihama c_pskov c_nedenes c_mallorca c_ubmejeiednuo c_aland c_inner_hebrides c_bothin c_hordalandi c_isle_of_wight c_menorca c_angus c_bordeaux c_kiz c_polesine c_samiran c_raniriki c_astrakhan c_totma c_nordmark c_acre c_viena c_luni c_vanemane c_lisboa c_alexandria c_monmouthshire c_namdalfylki c_tarsos c_uqayr c_essex c_jahkamakke c_alexandretta c_vastvag c_kirman c_dathina c_avranches c_annandale c_urmiya c_achaia c_rugen c_khumar c_honorias c_caria c_gutland c_saintonge c_north_riding c_vastergotland c_aviovara c_aquileia c_denbighshire c_vingulmork c_kittila c_livs c_kinda c_buchan c_lancashire c_karasjohka c_sjaelland c_angermanland c_constanta c_connacht c_ter c_tarragona c_lothian c_eu c_kernave c_genoa c_ravenna c_taranto c_dalarna c_coruna c_kent c_salinis c_outer_hebrides c_silves c_jovvkuj c_reggio_calabria c_montaigu c_shirvan c_al-gharbiya c_capua c_tihamat-al-yamani c_mandestan c_lolland_falster c_teramo c_lycia c_more c_yaroslavl c_kakisalmi c_sif-i-umara c_cairo c_skara c_faro c_carcassonne c_fermo c_azov c_aetolia c_samman c_onega c_angerburg c_sogn c_mandab c_jabal_kufs c_veria c_serres c_sharkiya c_zabid c_ribe c_hampton c_bampur c_dokkum c_mearns c_palanga c_rouen c_cornwall c_sullum c_satakunta c_skolt c_dal c_dalabergslagen c_arrajan c_korinthos c_antiocheia c_pisa c_minsk c_dhafra c_malta c_al-asa c_dyrrachion c_abbadan c_cumberland c_nantes c_qatif c_zemigalians c_lombardia c_abkhazia c_bithynia c_muscat c_westfriesland c_siracusa c_ravensburg c_frisia c_arezzo c_ferrara c_abydos c_basra c_wiek c_uwal c_shiraz c_kargopol c_oversticht c_ross c_finland c_thessalonika c_cadiz c_julevadno c_sodermannaland c_slesvig c_lincolnshire c_wajh c_groningen c_sinai c_zeeland c_madeira c_povenets c_coimbra c_viscaya c_medelpad c_derbent c_gurgan c_stade c_ajaccio c_wolgast c_orkney c_galloway c_talish c_gyor c_orvieto c_aarhus c_oland c_cardiganshire c_guines c_varmland c_blekinge c_kainuu c_inari c_aunis c_maastricht c_penthievre c_odessa c_maab c_pravia c_fife c_ennis c_halsingland c_sevede c_brugge c_bailaqan c_julfar c_dhofar c_farama c_mahra c_trebizond c_fayyum c_lesbos c_viborg c_beirut c_nikaea c_famagusta c_konstanz c_njudung c_boeotia c_gowrie c_memel c_lecce c_veszprem c_rostock c_thomond c_fuerteventura c_tui c_suzdal c_roma c_ayrshire c_anglesey c_riqan c_ionia c_oulu c_darabjerd c_hormuz c_somerset c_danzig c_aosta c_dorset c_desmond c_albret c_agdeside c_arnhem c_aalborg c_catania c_cosenza c_alicante c_gloucestershire c_naxos c_seleucia c_viipuri c_duqm c_pudozh c_trandheim c_dunbar c_faereyar c_pite c_vorbasse c_nyland c_mecca c_hiiumaa c_ruyan c_gastrikland c_jamtfir c_tabriz c_northumberland c_ancona c_al_aqabah c_iviza c_pula c_samander c_vestfold c_kalliopolis c_kolobrzeg c_east_riding c_malaga c_viterbo c_palermo c_akkel c_tortoli c_somogy c_boulogne c_fyn c_malbork c_ailech c_cherso c_kerch c_qusayr c_zichia c_avlonas c_tripoli c_shetland c_kherson c_oriel c_ostfriesland c_french_leon c_lennox c_sortavala c_venezia c_kontupohja c_vologda c_durham c_kirillov c_telemark c_cilicia c_murcia c_novgorod c_mayo c_friuli c_guria c_chios c_firdafylki c_luki c_schwerin c_ramhurmuz c_rounala c_ormond c_cetatea_alba c_ghazza c_suffolk c_tikhvin c_bayeux c_istakhr c_asturias_de_santillana c_natangia c_asturias_de_oviedo c_chandax c_devon c_mugan c_holland c_qumisha c_attica } } + +trade_good_flax = { counties = { c_vogtland c_vienna c_westfriesland c_amstetten c_damietta c_ulm c_prerov c_zagreb c_hiiumaa c_torun c_blekinge c_vingulmork c_plzen c_ferrara c_orkney c_thessalia c_penthievre c_opole c_hadrianopolis c_ossory c_brno c_dessau c_palermo c_piacenza c_brunswick c_abbadan c_capua c_lleida c_szekesfehervar c_asyut c_kalabsha c_vannes c_leinster c_oldenburg c_waldeck c_vastmanland c_yatvyagi c_suffolk c_taranto c_polesine c_bahnasa c_antwerpen c_erbach c_bremen c_verden c_sjaelland c_angermanland c_zurich c_evreux c_paderborn c_yaroslavl c_czerska c_zatec c_zollern c_vitebsk c_gyor c_verona c_komarom c_berestye c_staffordshire c_norfolk c_mantua c_osnabruck c_siena c_nantes c_pozega c_treviso c_magdeburg c_litomerice c_gostyninska c_zeeland c_ennis c_olomouc c_napoli c_firenze c_desmond c_tecklenburg c_znojmo c_ushmun c_ostfriesland c_gorlitz c_visegrad c_grodno c_arezzo c_zhytomyr c_suzdal c_mayo c_hannover c_rouen c_halland c_praha c_vestfold c_aluksne c_boulogne c_galatia c_ravensburg c_dokkum c_kujawy c_siracusa c_french_leon c_luneburg c_frankfurt c_ormond c_angerburg c_maastricht c_hamburg c_dublin c_tui c_gilan c_skane c_breslau c_novara c_cleves c_shetland c_miliez c_frisia c_polotsk c_roma c_hewes c_breifne c_zagorje c_valencia c_nyitra c_sieradzka c_vas c_al-gharbiya c_cambridgeshire c_bari c_leczycka c_qurta c_cologne c_hainaut c_pavia c_braganza c_schmalkalden c_avranches c_hont c_cottbus c_al-buhaira c_guines c_stendal c_porto c_fayyum c_dortmund c_gurgan c_bologna c_lippe c_macva c_eu c_bornholm c_giza c_kaiserslautern c_padua c_aachen c_medelpad c_aswan c_kokenois c_lombardia c_qus c_chornobyl c_sharkiya c_munster c_lille c_turin c_volodymyr c_vladimir c_moskva c_phrygia c_bayeux c_cremona c_lolland_falster c_tikhvin c_lecce c_augsburg c_viterbo c_poszony c_qasr_ibrim c_thomond c_ailech c_brugge c_gent c_hildesheim c_connacht c_hohenau c_plocka c_konstanz c_venezia c_slupsk } } + +trade_good_fruit = { counties = { c_jaffa c_istakhr c_lar c_nih c_al-hasa c_nihawand c_maab c_antiocheia c_yanbu c_rudbar c_damghan c_cordoba c_zirkuh c_balqa c_wajh c_samaiqan c_sardan c_murcia c_az-dhahira c_dhofar c_juwain c_dakhla c_achaia c_tihama c_ahvaz c_benevento c_barcelona c_west-tokharestan c_arrajan c_muscat c_farah c_hadramawt c_lecce c_kalabsha c_darabjerd c_beja c_bahriya c_wasit c_kharga c_homs c_tripoli c_niebla c_rusafa c_abydos c_salerno c_kinda_sakun c_qaryatan c_kerak c_rayy c_tiberias c_agrigento c_elvas c_siwa c_negev c_batina c_mahra c_harrat_rahat c_palmyra c_taizz c_bakharz c_medina c_rivsharan c_maragha c_taif c_fayyum c_faro c_ubulla c_ramhurmuz c_dawraq c_mandab c_yazd c_mandestan c_palermo c_ionia c_moura c_irahistan c_nishapur c_napoli c_taranto c_qom c_calatrava c_mecca c_bost c_bailaqan c_castelo_branco c_tib c_andujar c_urmiya c_herat c_khaybar c_cadiz c_abbadan c_nicosia c_hamadan c_sevilla c_farafra c_dinawar c_najran c_shiraz c_jerusalem c_menorca c_girona c_alexandretta c_lisboa c_shahre-babak c_laconia c_bisha c_tustar c_al_aqabah c_baihaq c_balkh c_aeolis c_nizwa c_talish c_eu c_guines c_brugge c_lycia c_boulogne c_seleucia c_tall_hamid c_rouen c_zurich c_lille c_sable c_bayeux c_kent c_surrey c_maine c_anjou c_saumur c_caria c_evreux c_avranches c_euboea c_baghdad c_karbala } } + +trade_good_furs = { counties = { c_gnezdovo c_nordmark c_pskov c_gastrikland c_vastmanland c_satakunta c_saran c_upland c_kozlov c_riga c_totma c_julevadno c_viipuri c_vastergotland c_kinda c_matya c_murom c_dalabergslagen c_more c_harjadalen c_ter c_tula c_pite c_nedenes c_nyland c_kittila c_koutajoki c_inari c_kursk c_smolensk c_jalmat c_pinsk c_yaroslavl c_shenkursk c_novogrudok c_perm c_jamtfir c_cheboksary c_jovvkuj c_rusa c_povenets c_mari-turek c_penza c_polotsk c_bezichi c_varmland c_yoshkar-ola c_sogn c_buchan c_lachyk-uba c_east_kiilt c_ryazan c_aviovara c_vitebsk c_aluksne c_kletsk c_narke c_glazov c_ubmejeiednuo c_novgorod c_wiek c_voronezh c_sortavala c_morarna c_yar-calli c_minsk c_sutherland c_dalarna c_pudozh c_salinis c_livs c_elabuga c_hordalandi c_mamadych c_viena c_tver c_babruysk c_vologda c_luki c_torne c_agdeside c_caithness c_sebezh c_korosten c_novgorod_seversky c_ostergotland c_helgum c_karasjohka c_kazan c_novosil c_namdalfylki c_onsthia c_varend c_halsingland c_starodub c_kokenois c_votkinsk c_kakisalmi c_siun c_choklema c_medelpad c_velsk c_turov c_kainuu c_lyubim c_akkel c_nizhny_novgorod c_ustyug c_lysva c_oulu c_sebur c_njudung c_onega_BJA c_angermanland c_ural c_birsk c_onega c_skolt c_chornobyl c_kirillov c_finland c_kargopol c_skara c_kontupohja c_jahkamakke c_sevede c_sevsk c_odoyev c_mozhaysk c_magdeburg c_kassel c_oldenburg c_waldeck c_tecklenburg c_ingolstadt c_wurzburg c_regensburg c_sundgau c_strassburg c_breisgau c_knittelfeld c_cottbus c_lippe c_gorlitz c_wittenberg c_mainz c_luneburg c_stendal c_marburg c_munchen c_passau c_dresden c_paderborn c_clermont_sur_allier c_tourraine c_thiers c_issoudun c_la_marche c_jaligny c_auvergne c_peremyshl c_berestye } } + +trade_good_gems = { counties = { c_hradec c_badakhshan c_shahre-babak c_caslav c_jabal_quzlum c_sanaa c_qasr_ibrim c_wakhan c_velay c_taizz c_khuwar c_trier c_kabul c_nishapur } } + +trade_good_gold = { counties = { c_allaqi c_trenscen c_praha c_hvosno c_chalkidike c_legnica c_qus c_feher c_medina c_nysa c_limousin c_maragha c_najran c_gemer } } + +trade_good_grain = { counties = { c_merida c_buckinghamshire c_dortmund c_skane c_armagnac c_bahriya c_upper_khabur c_calarasi c_aeolis c_asyut c_salerno c_raqqa c_ditmarschen c_ushmun c_orhei c_niebla c_batiha c_orleans c_qurta c_hewes c_bethen c_vienna c_kaiserslautern c_cologne c_angouleme c_surrey c_gnieznienska c_torun c_aachen c_ahvaz c_stendal c_polesine c_kujawy c_khachen c_wasit c_essex c_juwain c_kalabsha c_urmiya c_poszony c_cremona c_anbar c_kurdistan c_sjaelland c_szekesfehervar c_constanta c_kerak c_soroca c_eu c_clermont c_kent c_hadithat-ana c_mora c_shirvan c_al-gharbiya c_sabzevar c_magdeburg c_nasibin c_craiova c_yaroslavl c_ninive c_lubelska c_piacenza c_farafra c_amida c_tib c_munchen c_nikopolis c_sinjar c_praha c_keve c_mandab c_veria c_west-tokharestan c_bahnasa c_aran c_baranya c_ratibor c_wschowska c_cordoba c_rusafa c_qus c_sardan c_moskva c_mayyafariqin c_taizz c_nantes c_zemigalians c_hulwan c_kharga c_shaki c_wittenberg c_ferrara c_dausar c_olomouc c_mosul c_zutphen c_vladimir c_cadiz c_gostyninska c_qasr_ibrim c_tus c_brie_francaise c_lincolnshire c_saumur c_zeeland c_branicevo c_akhadid c_toledo c_stade c_benevento c_tourraine c_mantua c_talish c_gyor c_bakharz c_hamburg c_waqisa c_maastricht c_qadisiya c_iskaf c_damietta c_moura c_litomerice c_bailaqan c_berkshire c_bacs c_east-tokharestan c_brno c_hertfordshire c_fayyum c_samarra c_tall_basma c_sevilla c_beja c_kufa c_radomska c_elvas c_calafat c_suzdal c_ubulla c_anjou c_komarom c_agenais c_czerska c_danzig c_cleves c_safata c_dakhla c_rahba c_regensburg c_irbil c_erbach c_herat c_samaiqan c_zirkuh c_visegrad c_khabur c_poznanska c_evreux c_besancon c_al-haditha c_giza c_dawraq c_jerusalem c_shahrazur c_giurgiu c_irbid c_szabolcs c_dole c_hohenau c_east_riding c_arad c_cieszyn c_marburg c_oxfordshire c_balkh c_luneburg c_dessau c_nizhny_novgorod c_al-buhaira c_baihaq c_aswan c_baghdad c_kirkuk c_tolna c_vratsa c_turnovo c_krems c_feher c_beaumont c_cetatea_alba c_tikhvin c_sancerre c_mugan c_prerov c_holland c_lapusna c_lycia c_badaraya c_suenik c_damghan c_ile_de_france c_ionia c_malbork c_temes c_bordeaux c_faro c_palermo c_toulouse c_alexandria c_hampton c_dijon c_sharkiya c_znojmo c_karbala c_seleucia c_takrit c_tiberias c_caceres c_lombardia c_viterbo c_pavia c_hayk c_maragha c_vanand c_jaffa c_napoli c_tabriz c_madrid c_verona c_zatec c_frankfurt c_negev c_badajoz c_krakowska c_siwa c_dvin c_bagrewand c_beograd c_vidin c_zollern c_roma c_gurgan c_brysis c_poitiers c_maine c_serres c_hainaut c_malagon c_opole c_langres c_sieradzka c_siena c_zhytomyr c_landsberg c_vogtland c_sundgau c_neufchateau c_strassburg c_sacz c_westfriesland c_issoudun c_achaia c_arezzo c_gorlitz c_plzen c_hont c_brabant c_krasso c_saarbrucken c_lucca c_trier c_nyitra c_borsod c_passau c_hohenlohe c_fyn c_lolland_falster c_antwerpen c_lille c_halland c_catania c_siracusa c_messina c_lothian c_fife c_dunbar c_mearns c_dublin c_leinster c_ossory c_norfolk c_moray c_rugen c_pila c_skara c_narke c_gutland c_oland c_finland c_hauran c_baalbek c_kartli c_kakheti c_volodymyr c_nicosia c_anglesey c_kherson c_valladolid c_gent c_schwerin c_edessa c_hama c_nikaea c_lydia c_thessalia c_kokenois } } + +trade_good_hemp = { counties = { c_brie_francaise c_namur c_arnsberg c_dijon c_aluksne c_syrrusafa c_fife c_cordoba c_toledo c_guines c_murcia c_bern c_innsbruck c_regensburg c_baghdad c_sevede c_quercy c_onega c_brugge c_gent c_viipuri c_marash c_jaligny c_cuenca c_clermont c_amida c_berent c_oland c_gostyninska c_beaumont c_dortmund c_alencon c_gowrie c_berestye c_plzen c_madrid c_linz c_wasit c_bethen c_armagnac c_clermont_sur_allier c_besancon c_niebla c_qaryatan c_madeira c_malbork c_skane c_briey c_metz c_dausar c_znojmo c_allenstein c_aintab c_reims c_palanga c_kufa c_issoudun c_chalons c_baalbek c_limousin c_angus c_neufchateau c_njudung c_fayyum c_ubulla c_alarcon c_lothian c_batiha c_la_marche c_montaigu c_agenais c_cleves c_lille c_lviv c_sable c_mora c_jihlava c_bayeux c_suriya c_blekinge c_bar c_sandomierska c_bellac c_iskaf c_dole c_tib c_bouillon c_kaliska c_andujar c_brno c_bornholm c_zemigalians c_kolobrzeg c_hradec c_thouars c_lanarkshire c_radomska c_atholl c_hama c_trier c_ratibor c_langres c_berlin c_sieradzka c_ile_de_france c_farafra c_berry c_stezycka c_granada c_damietta c_nancy c_natangia c_takrit c_samarra c_auvergne c_vermandois c_liege c_wschowska c_kujawy c_malaga c_thiers c_ravensburg c_graz c_almeria c_kontupohja c_livs c_badaraya } } + +trade_good_incense = { counties = { c_dathina c_dhofar c_mahra c_najran c_sanaa c_taizz c_zabid c_mandab c_rivsharan c_darmashan c_qain c_hadramawt c_cilicia c_samaiqan c_tall_hamid c_seleucia c_tus c_upper_ghur c_caria c_rhodos c_juwain c_kinda_sakun c_al-asa c_ghur c_damghan c_lower_galatia c_lycia c_duqm c_isauria c_selge c_lycaonia } } + +trade_good_iron = { counties = { c_gottingen c_irbid c_gloucestershire c_gilan c_abkhazia c_nedenes c_hedmork c_telemark c_surrey c_odishi c_viscaya c_vastmanland c_gorz c_guria c_graz c_narke c_nassau c_foix c_tun c_sebasteia c_trent c_alencon c_auxerre c_waldeck c_eu c_upland c_gemer c_sandomierska c_krakowska c_brno c_novgorod c_viborg c_luxembourg c_knittelfeld c_liege c_bamian c_upper_ghur c_nishapur } } + +trade_good_ivory = { counties = { } } + +trade_good_jade = { counties = { } } + +trade_good_millet = { counties = { c_tmutarakan c_girona c_bereg c_kolon c_siwa c_csongrad c_bost c_burgas c_farah c_castellon c_golden_hills c_bari c_shahre-babak c_irahistan c_panjgur c_vidin c_sarkel c_thiers c_menorca c_bordeaux c_kiz c_dnipro c_galatia c_dinawar c_samiran c_aargau c_basagha c_bugurslan c_astrakhan c_padua c_baisary c_kirman c_zagreb c_turan c_quercy c_siena c_khumar c_saintonge c_temes c_charsianon c_badajoz c_euchaita c_ravenna c_coruna c_treviso c_madrid c_sakmara c_silves c_reggio_calabria c_montaigu c_mandestan c_bam c_bihar c_nyitra c_sif-i-umara c_faro c_bologna c_fermo c_azov c_agrigento c_valladolid c_jabal_kufs c_borsod c_zagorje c_zela c_lower_galatia c_bampur c_bern c_kyzistra c_arrajan c_calatrava c_pisa c_behabad c_zamora c_abbadan c_pavia c_najera c_adrianopolis c_sanij c_siracusa c_olmedo c_orenburg c_shiraz c_salavat c_vas c_burgos c_maghas c_anket c_rouergue c_yazd c_hamadan c_coimbra c_saimara c_jaligny c_orvieto c_plasencia c_aunis c_odessa c_pravia c_malagon c_kaisereia c_qom c_balachev c_jiruft c_bucuresti c_sirjan c_lar c_lecce c_saratov c_novara c_tui c_soli c_kermanshah c_darabjerd c_hormuz c_zemplen c_catania c_cuellar c_braganza c_masabadhan c_alarcon c_bellac c_leon c_alcacer_do_sal c_iviza c_toulouse c_beziers c_isfahan c_rudbar c_somogy c_khawr c_cuenca c_turin c_cherso c_kherson c_nih c_friuli c_vrbas c_navarra c_samar c_valencia c_istakhr c_asturias_de_santillana c_hont c_lozova c_ardestan c_lucca c_luristan c_qumisha c_tall_hamid c_acre c_dathina c_napoli c_cairo c_karbala c_zabid c_hampton c_ile_de_france c_korinthos c_takrit c_suenik c_znojmo c_basra c_negev c_zatec c_gurgan c_tiberias c_brugge c_vanand c_damghan c_ionia c_seleucia c_dijon c_malbork c_cilicia c_al-haditha c_badakhshan c_ghazna c_hulwan c_kirkuk c_mafaza c_qadisiya c_riqan c_rukhaj c_sabzevar c_safata c_wakhan c_zabulistan c_zanjan c_alicante c_helenopontus } } + +trade_good_oil = { counties = { c_abruzzi c_acre c_aetolia c_agrigento c_alexandretta c_alexandria c_alicante c_almeria c_ancona c_antiocheia c_aquileia c_arbanon c_attica c_avlonas c_barcelona c_bastia c_beziers c_boeotia c_bologna c_brysis c_cadiz c_capua c_caria c_casentino c_castellon c_catania c_cephalonia c_chandax c_chania c_cherso c_chios c_cilicia c_cosenza c_cremona c_damietta c_famagusta c_fermo c_firaun c_firenze c_foix c_genoa c_ghazza c_gorz c_granada c_irbid c_iviza c_jaffa c_lecce c_lesbos c_lleida c_lombardia c_luni c_malta c_menorca c_messenia c_messina c_modena c_monferrato c_novara c_orvieto c_pallas c_parma c_pavia c_pisa c_reggio_calabria c_roma c_salerno c_sharkiya c_siwa c_spoleto c_taranto c_teramo c_teruel c_thessalia c_tiberias c_tortoli c_treviso c_tripoli c_turin c_urbino c_verona c_viterbo c_zadar c_bahriya c_ninive c_veria } } + +trade_good_rice = { counties = { c_mazandaran } } + +trade_good_salt = { counties = { c_lubeck c_erbach c_montaigu c_hannover c_worcestershire c_bremen c_jawf-al-yamani c_mainz c_sacz c_wolgast c_kalat c_kinda_sakun c_lippe c_venezia c_oldenburg c_baisary c_sullum c_urgun c_wabar c_rostock c_galatia_salutaris c_hildesheim c_linz c_derby c_ahqaf c_alexandria c_kaiserslautern c_barcelona c_montpellier c_pula c_tabriz c_isauria c_atyrau c_pisidia c_tortoli c_urmiya c_hayk c_dvin c_devon c_lancashire c_hadramawt c_bastia c_lycaonia c_krakowska c_cornwall c_poitiers c_acre c_carcassonne c_salzburg c_ghazza c_philomelium c_besancon c_viscaya c_beziers c_jaffa c_luneburg c_cheshire c_selge c_torda c_stade c_siwa c_thouars c_ditmarschen c_frankfurt c_westmorland c_trent c_najera c_ajaccio c_nantes c_rusa c_ural c_astrakhan c_soli c_kujawy c_dole c_kolobrzeg } } + +trade_good_silk = { counties = { c_byzantion c_mazandaran c_attica c_korinthos } } + +trade_good_silver = { counties = { c_qus c_bamian c_bethen c_medina c_caslav c_gottingen c_colonea c_dresden c_allaqi c_hvosno c_chalkidike c_rayy c_tus c_innsbruck c_aswan c_cumberland c_sanaa c_lori c_almeria c_beograd c_tarragona c_dalabergslagen c_montpellier c_foix c_gemer c_breisgau } } + +trade_good_spices = { counties = { c_baihaq c_juwain c_nishapur c_samaiqan c_tus c_hamadan c_qom } } + +trade_good_stone = { counties = { c_ablastha c_acampse c_achaia c_aetolia c_aintab c_ajaccio c_al_aqabah c_alcaraz c_alexandretta c_alto_aragon c_ancona c_anjou c_antiocheia c_antipatreia c_aosta c_ardabil c_argyll c_astorga c_augsburg c_avlonas c_aytos c_badakhshan c_baduspan c_baghdad c_bagrewand c_bamian c_bampur c_barcasag c_bern c_beszterce c_bigorre c_bisha c_bothin c_cabardinia c_calatrava c_campulung c_carcassonne c_cherkassy c_colonea c_cuellar c_damghan c_debar c_dvin c_east_riding c_eystridalir c_firdafylki c_fogaras c_fyn c_gauldala c_geneva c_gilan c_gorz c_gostyninska c_granada c_grisons c_groningen c_gudbrandsdalir c_hadramawt c_harjadalen c_hertfordshire c_hordalandi c_hradec c_innsbruck c_isauria c_jahkamakke c_jamtfir c_jiruft c_kakheti c_kerch c_klarjeti c_krasso c_laconia c_leczycka c_leon c_lienz c_lika c_lipto c_luki c_luni c_luristan c_lycia c_macva c_marash c_mecca c_mesopotamia c_messenia c_monterrei c_mosul c_munjan c_naissus c_namdalfylki c_nancy c_nedenes c_norwegian_more c_nysa c_ohrid c_olmedo c_opole c_orava c_padua c_pallas c_peremyshl c_pite c_plzen c_podrinje c_polovragi c_pompeiopolis c_porto c_praha c_qazwin c_ramhurmuz c_rashka c_rayy c_rounala c_ruyan c_salzburg c_samosata c_sankt_polten c_sardan c_satala c_selge c_sirjan c_skopje c_sogn c_strumica c_sumadija c_svaneti c_tabriz c_taif c_takrit c_tall_hamid c_targu_jiu c_teruel c_theodosiopolis c_trandheim c_trenscen c_trent c_turnovo c_turov c_turuberan c_tustar c_ubmejeiednuo c_uraltau c_vanand c_vannes c_velbazhd c_villach c_viseu c_vogtland c_vorbasse c_wakhan c_west_riding c_yatvyagi c_yazd c_zatec c_zichia c_zlatibor c_zurich c_suenik c_urgell c_trebizond c_lydia c_chania c_caernarfonshire c_abruzzi c_treviso c_marmaros c_szekelyfold c_severin c_bihar c_veria c_soria c_zadar c_molina c_odishi c_neamnt c_sacz c_chandax c_litomerice c_zela c_telemark c_navarra c_pisidia c_hunyad c_lombardia c_chios c_ljubljana c_bearn c_azysia c_pravia c_asturias_de_oviedo c_suceava c_rogalandi c_vratsa c_vaspurakan c_helenopontus c_schmalkalden c_derbent c_rama c_teramo c_arbanon c_vestfold c_boeotia c_nikopolis c_spoleto c_urbino c_casentino c_bastia c_monferrato c_fermo c_parma c_genoa c_naxos c_isle_of_wight } } + +trade_good_sugar = { counties = { c_asyut c_ushmun c_al-gharbiya c_batiha c_giza c_akhadid c_madeira c_canarias c_iskaf c_al-buhaira c_kufa c_fuerteventura c_alcaraz c_dakhla c_teruel c_granada c_tripoli c_alexandria c_wasit c_dawraq c_kerak c_ahvaz c_mosul c_kharga c_samarra } } + +trade_good_wine = { counties = { c_caceres c_hamadan c_murzzuschlag c_reims c_alcaraz c_attica c_medellin c_dakhla c_chios c_pozega c_badajoz c_abkhazia c_campulung c_besancon c_torda c_coimbra c_wurzburg c_malta c_porto c_namur c_vienna c_langres c_coulommiers c_shirvan c_thessalonika c_teruel c_kakheti c_puttlingen c_tbilisi c_zamora c_galati c_tarragona c_shaki c_modena c_graz c_siena c_mora c_aquileia c_alarcon c_aosta c_mainz c_dole c_urgell c_najera c_kartli c_veria c_friuli c_ferrara c_herat c_capua c_bost c_viseu c_hereti c_albret c_bahriya c_bearn c_shiraz c_toulouse c_dvin c_agenais c_valladolid c_dinawar c_istakhr c_aran c_castelo_branco c_hayk c_lisboa c_chania c_sens c_hvosno c_ancona c_metz c_farafra c_kolon c_nancy c_erbach c_iasi c_macon c_lesbos c_sundgau c_armagnac c_neufchateau c_keve c_liege c_odishi c_siracusa c_bologna c_hohenau c_nantes c_strassburg c_canarias c_saarbrucken c_konstanz c_somogy c_farah c_rethel c_philomelium c_bamberg c_trent c_genoa c_znojmo c_charsianon c_napoli c_guria c_barcelona c_teramo c_rashka c_casentino c_abruzzi c_verona c_dresden c_bari c_qazwin c_breisgau c_merida c_firenze c_bigorre c_trier c_luni c_lleida c_ravenna c_treviso c_auxerre c_monterrei c_visegrad c_madeira c_astorga c_saumur c_frankfurt c_marsan c_taranto c_navarra c_anjou c_chalons c_euboea c_komarom c_fermo c_tourraine c_geneva c_calatayud c_troyes c_carcassonne c_perigord } } + +trade_good_wood = { counties = { c_onega_BJA c_carmarthenshire c_riga c_wurzburg c_gorlitz c_rusa c_koutajoki c_kolon c_cerasus c_vitebsk c_braslau c_varend c_csongrad c_cambridgeshire c_east_kiilt c_konigsberg c_ostergotland c_bouillon c_buzau c_caithness c_hedmork c_votkinsk c_mainz c_morarna c_kaiserslautern c_pskov c_nedenes c_ubmejeiednuo c_surrey c_hordalandi c_thiers c_bedford c_shenkursk c_novogrudok c_plzen c_tecklenburg c_bugurslan c_slupsk c_totma c_nordmark c_viena c_kujawy c_vanemane c_ulm c_viipuri c_tarsos c_jahkamakke c_vastvag c_serdosk c_landsberg c_passau c_korosten c_gevaudan c_cheshire c_dresden c_honorias c_huntingdonshire c_vastergotland c_aviovara c_krajna c_vingulmork c_kittila c_livs c_matya c_cheboksary c_kinda c_karasjohka c_angermanland c_babruysk c_ter c_kernave c_saran c_clermont c_dalarna c_waldeck c_sir_faesyfed c_salinis c_ryazan c_lachyk-uba c_szekelyfold c_jovvkuj c_sundgau c_sebezh c_bezichi c_magdeburg c_helgum c_sevsk c_bihar c_more c_kozlov c_issoudun c_kakisalmi c_lubelska c_skara c_siauliai c_perigord c_novgorod_seversky c_onega c_praha c_keve c_warwickshire c_selpils c_zagorje c_tula c_ufa c_marsan c_palanga c_rouen c_cottbus c_satakunta c_skolt c_aluksne c_mari-turek c_munchen c_opava c_choklema c_strassburg c_cumberland c_allenstein c_perm c_pila c_bithynia c_breisgau c_stezycka c_glazov c_mozhaysk c_wittenberg c_kokenois c_siun c_tver c_raseiniai c_velsk c_wiek c_kargopol c_odoyev c_salavat c_finland c_julevadno c_plocka c_slesvig c_onsthia c_gnezdovo c_troyes c_povenets c_kazan c_sebur c_glamorgan c_toledo c_berlin c_wolgast c_jaligny c_tourraine c_penza c_aarhus c_plasencia c_novosil c_varmland c_kainuu c_inari c_graz c_halsingland c_petrovsk c_sevede c_bar c_arnsberg c_ural c_balachev c_bucuresti c_viborg c_wiltshire c_zaragoza c_njudung c_jihlava c_murom c_memel c_saratov c_radomska c_czerska c_oulu c_somerset c_uiska c_albret c_belebey c_agdeside c_knittelfeld c_aalborg c_gloucestershire c_maldwyn c_ustyug c_yatvyagi c_macon c_pudozh c_berent c_faereyar c_yar-calli c_bekes c_nyland c_kletsk c_ruyan c_alcacer_do_sal c_gastrikland c_rethel c_jalmat c_starodub c_paderborn c_lyubim c_polotsk c_narke c_sieradzka c_torne c_vermandois c_beziers c_tambov c_ingolstadt c_cieszyn c_akkel c_marburg c_voronezh c_luneburg c_ailech c_lomzynska c_ungvar c_amaya c_clermont_sur_allier c_rennes c_sortavala c_lippe c_nottinghamshire c_elabuga c_kontupohja c_oldenburg c_vologda c_torda c_kirillov c_novgorod c_guria c_hradec c_luki c_upland c_schwerin c_breslau c_birsk c_kursk c_chornobyl c_natangia c_kassel c_mamadych c_lysva c_yoshkar-ola c_sinope c_badajoz c_helenopontus c_smolensk c_galati c_teviotdale c_beszterce c_barcasag c_berkshire c_mazandaran c_annandale c_temes c_coruna c_bothin c_kent c_eystridalir c_harjadalen c_pite c_hertfordshire c_desmond c_yaroslavl c_shropshire c_zemplen c_essex c_jamtfir c_moray c_reggio_calabria c_sogn c_tolna c_buchan c_raniriki c_regensburg c_neufchateau c_north_riding c_peremyshl c_somogy c_norwegian_more c_litomerice c_rugen c_orleans c_durham c_minsk c_telemark c_sutherland c_fogaras c_westmorland c_limousin c_feher c_hereford c_stendal c_hont c_la_marche c_lancashire c_cornwall c_zatec c_torun c_rogalandi c_brno c_hewes c_nizhny_novgorod c_denbighshire c_szabolcs c_poznanska c_breifne c_northumberland c_zemigalians c_arnhem c_messina c_auvergne c_devon c_veszprem c_quercy c_buckinghamshire c_zichia c_fraga c_namur c_luxembourg c_aargau c_abauj c_ablastha c_acampse c_adrianopolis c_ahqaf c_ajaccio c_akhadid c_al-asa c_al-haditha c_aland c_aleppo c_amstetten c_angerburg c_anglesey c_angouleme c_angus c_anket c_ansbach c_antipatreia c_apahunik c_arad c_aran c_argyll c_arrajan c_astrakhan c_atholl c_atyrau c_aunis c_auxerre c_avlonas c_aydhab c_ayrshire c_aytos c_azov c_bacs c_baduspan c_bailaqan c_balkh c_bamberg c_baranya c_basagha c_behabad c_bellac c_benevento c_bereg c_berestye c_berry c_besinada c_bisha c_boulogne c_brabant c_branicevo c_brecknockshire c_bremen c_verden c_brie_francaise c_briey c_brunswick c_burgas c_burgos c_cabardinia c_calafat c_calarasi c_campulung c_cardiganshire c_cephalonia c_chalons c_charsianon c_cherven c_chonae c_cleves c_coburg c_connacht c_constanta c_cosenza c_coulommiers c_craiova c_cuellar c_dal c_damascus c_danzig c_darmashan c_debar c_derby c_dessau c_dnipro c_dorohoi c_dorset c_dortmund c_dunbar c_dyrrachion c_edessa c_ennis c_evreux c_farama c_fife c_firaun c_firdafylki c_french_leon c_frisia c_fulda c_galloway c_gauldala c_geneva c_ghazna c_ghur c_giurgiu c_gnieznienska c_golden_hills c_gowrie c_grisons c_grodno c_grunberg c_gudbrandsdalir c_gutland c_hadithat-ana c_hainaut c_hamadan c_hamburg c_harrat_rahat c_hauran c_hereti c_hildesheim c_hohenlohe c_homs c_hormuz c_hulwan c_inner_hebrides c_inverness c_irahistan c_irbil c_isfahan c_isle_of_man c_jabal_quzlum c_jawf-al-yamani c_jerusalem c_jiruft c_juwair c_kabul c_kaisereia c_kalat c_kaliska c_kartli c_kermanshah c_khachen c_khaybar c_khumar c_khuwar c_kirkuk c_klarjeti c_kozelsk c_kranj c_kurdistan c_kyzistra c_lanarkshire c_lapusna c_lar c_legnica c_leicestershire c_leinster c_lennox c_liebnitz c_lienz c_lika c_lincolnshire c_lipto c_lothian c_lozova c_lubeck c_kiel c_luristan c_lviv c_lydia c_maastricht c_mafaza c_maine c_malagon c_mandestan c_mantua c_marash c_masabadhan c_mayo c_mayyafariqin c_mecca c_medellin c_melitene c_metz c_miliez c_monmouthshire c_monterrei c_moskva c_mugan c_munster c_mysia c_naissus c_nancy c_nasibin c_nassau c_norfolk c_northamptonshire c_nurnberg c_odessa c_ohrid c_olmedo c_opole c_orava c_orenburg c_orhei c_ormond c_osnabruck c_ossory c_ostfriesland c_outer_hebrides c_oxfordshire c_pallas c_pembrokeshire c_penthievre c_piacenza c_pinsk c_podrinje c_polesine c_polovragi c_pompeiopolis c_poszony c_puttlingen c_qadisiya c_qinnasrin c_qusayr c_rahba c_rama c_rashka c_ratibor c_reims c_rhodos c_ribe c_ross c_rostock c_rouergue c_rounala c_rukhaj c_sabzevar c_safata c_saimara c_salamanca c_salzburg c_samander c_samar c_samiran c_samosata c_sancerre c_sankt_polten c_sarkel c_satala c_sens c_serres c_severin c_shahrazur c_shaki c_shetland c_shirvan c_sibi c_sif-i-umara c_sinai c_sinjar c_skopje c_sodermannaland c_soli c_soroca c_spis c_spoleto c_spreewald c_staffordshire c_strathearn c_strumica c_suceava c_suffolk c_sukhna c_sullum c_sumadija c_szekesfehervar c_targu_jiu c_theodosiopolis c_thouars c_thyatira c_tigheci c_tihama c_tun c_turov c_uman c_upper_ghur c_upper_khabur c_uraltau c_urbino c_urgun c_valladolid c_velay c_velbazhd c_vidin c_villach c_viseu c_volodymyr c_vrbas c_wabar c_waqisa c_west_riding c_worcestershire c_wschowska c_zabulistan c_zamindawar c_zanjan c_zhytomyr c_zirkuh c_zlatibor c_zollern c_zolyom c_zutphen c_beirut c_tripoli c_mesopotamia } } + +trade_good_wool = { counties = { c_podrinje c_theodosiopolis c_lipto c_csongrad c_castelo_branco c_orhei c_burgas c_farah c_atholl c_bari c_apahunik c_shropshire c_yanbu c_aland c_sarkel c_isle_of_wight c_kiz c_innsbruck c_soria c_bugurslan c_volodymyr c_grodno c_chonae c_uqayr c_qaryatan c_alexandretta c_annandale c_khumar c_honorias c_vastergotland c_leicestershire c_buchan c_kurdistan c_mafaza c_tarragona c_sukhna c_augsburg c_sakmara c_capua c_bam c_gorz c_nizwa c_yamama c_alencon c_allaqi c_west-tokharestan c_serres c_ribe c_lower_galatia c_cherkassy c_calatrava c_behabad c_bamian c_najera c_sanij c_abkhazia c_bithynia c_palmyra c_turuberan c_zutphen c_hotin c_severin c_anket c_groningen c_zeeland c_orkney c_zolyom c_gyor c_aarhus c_blekinge c_khaybar c_waqisa c_bacs c_vaspurakan c_mahra c_hertfordshire c_wiltshire c_nikaea c_sirjan c_cherven c_novara c_norfolk c_riqan c_kartli c_darabjerd c_arnhem c_safata c_aalborg c_salzburg c_naissus c_vorbasse c_al-haditha c_al_aqabah c_kozelsk c_hohenau c_firaun c_rudbar c_ingolstadt c_fyn c_cuenca c_zichia c_nizhny_novgorod c_fraga c_ungvar c_iasi c_luki c_upland c_cetatea_alba c_valencia c_linz c_falaj c_holland c_qasim c_calarasi c_lapusna c_carmarthenshire c_rogalandi c_northamptonshire c_hail c_arbanon c_batina c_ostergotland c_casentino c_panjgur c_ossory c_zlatibor c_dnipro c_samiran c_raniriki c_tarsos c_cheshire c_north_riding c_charsianon c_denbighshire c_al-hasa c_lancashire c_szekesfehervar c_lothian c_sandomierska c_lolland_falster c_teramo c_pallas c_sacz c_murzzuschlag c_nikopolis c_warwickshire c_tbilisi c_dokkum c_cordoba c_sullum c_dal c_dhafra c_dyrrachion c_zamora c_modena c_nysa c_caernarfonshire c_sanaa c_suriya c_orava c_juwair c_vladimir c_salavat c_oversticht c_burgos c_slesvig c_wajh c_darmashan c_al_jawf c_coimbra c_abruzzi c_glamorgan c_la_marche c_khuwar c_nihawand c_bakharz c_fife c_balachev c_thomond c_elvas c_calafat c_lleida c_barcasag c_derby c_kermanshah c_campulung c_staffordshire c_aintab c_dakhla c_alicante c_maldwyn c_rhodos c_duqm c_herat c_urgell c_giurgiu c_sankt_polten c_cherso c_kherson c_amaya c_nih c_urgun c_guria c_thalabiya c_kranj c_asturias_de_santillana c_asturias_de_oviedo c_luristan c_tmutarakan c_fogaras c_bahriya c_socotra c_bost c_kakheti c_thessalia c_bornholm c_shahre-babak c_asir c_hewes c_zadar c_isle_of_man c_marmaros c_bedford c_menorca c_galatia c_qain c_dinawar c_basagha c_taif c_padua c_baisary c_aqiq c_vastmanland c_medina c_thyatira c_smolensk c_vingulmork c_mysia c_soroca c_coruna c_sir_faesyfed c_hadithat-ana c_silves c_qinnasrin c_sabzevar c_jawf-al-yamani c_al-arid c_aetolia c_samman c_borsod c_mearns c_krasso c_kyzistra c_munchen c_velay c_wabar c_phrygia c_zaranj c_sibi c_westmorland c_adrianopolis c_ravensburg c_frisia c_abydos c_prusa c_uwal c_vas c_maan c_sodermannaland c_samosata c_maghas c_teviotdale c_yazd c_debar c_medelpad c_galloway c_oland c_kalat c_qadisiya c_moura c_farama c_trebizond c_kabul c_bucuresti c_sirhan c_damascus c_lar c_ayrshire c_galatia_salutaris c_balqa c_liebnitz c_somerset c_aosta c_dorset c_desmond c_zemplen c_agdeside c_rahba c_gloucestershire c_dunbar c_alarcon c_nyland c_alcacer_do_sal c_worcestershire c_szabolcs c_vestfold c_lydia c_arad c_satala c_oxfordshire c_ailech c_kerch c_friuli c_guzgan c_vratsa c_lozova c_chandax c_lucca c_pisidia c_halland c_girona c_aydhab c_kolon c_ringkobing c_pembrokeshire c_cephalonia c_ghazna c_golden_hills c_lanarkshire c_besinada c_shaqiq c_dublin c_tihama c_mallorca c_surrey c_edessa c_tabuk c_kinda_sakun c_jilat c_spis c_zagreb c_turan c_yabrin c_passau c_quercy c_pozega c_gutland c_anbar c_aquileia c_angermanland c_hereford c_euchaita c_jabal_quzlum c_sharaf c_szekelyfold c_zamindawar c_nyitra c_kakisalmi c_syrrusafa c_azov c_canarias c_keve c_tigheci c_az-dhahira c_baranya c_alto_aragon c_aleppo c_hauran c_peremyshl c_al-asa c_lienz c_qatif c_ghur c_muscat c_westfriesland c_kharga c_orenburg c_uman c_upper_ghur c_shiraz c_finland c_ljubljana c_viseu c_sinai c_tun c_tayma c_cabardinia c_monterrei c_antipatreia c_plasencia c_graz c_odessa c_maab c_julfar c_berkshire c_bisha c_svaneti c_spoleto c_east-tokharestan c_klarjeti c_saratov c_veszprem c_fuerteventura c_hama c_hereti c_anglesey c_ahqaf c_amstetten c_surrah c_masabadhan c_trandheim c_rivsharan c_galati c_subay c_zabulistan c_northumberland c_shahrazur c_kalliopolis c_khawr c_qusayr c_harrat_rahat c_oriel c_ostfriesland c_telemark c_medellin c_bigorre c_najran c_tolna c_lviv c_krems c_poitiers c_ormond c_suffolk c_samar c_tikhvin c_ardestan c_caceres c_suceava c_hunyad c_suenik c_sumadija c_abauj c_inverness c_skopje c_valladolid c_lennox c_inner_hebrides c_vidin c_ross c_urbino c_malagon c_rama c_craiova c_targu_jiu c_rashka c_karbala c_aytos c_geneva c_rukhaj c_uraltau c_gudbrandsdalir c_munjan c_gauldala c_gnezdovo c_cardiganshire c_badakhshan c_jamtfir c_balkh c_kaisereia c_beszterce c_melitene c_porto c_moray c_feher c_argyll c_brecknockshire c_moskva c_firdafylki c_helenopontus c_sogn c_bearn c_vrbas c_azysia c_dorohoi c_homs c_parma c_baduspan c_strathearn c_chania c_samander c_branicevo c_atyrau c_sinope c_molina c_lika c_eystridalir c_derbent c_messina c_neamnt c_harjadalen c_olmedo c_grisons c_genoa c_wakhan c_salamanca c_astrakhan c_velbazhd c_monferrato c_bereg c_polovragi c_rounala c_buckinghamshire c_durham c_astorga c_minsk c_pompeiopolis c_villach c_sutherland c_soli c_acampse c_calatayud c_west_riding c_osnabruck c_hohenlohe c_hannover c_spreewald c_kassel c_bremen c_verden c_brunswick c_stendal c_coburg c_ansbach c_nurnberg c_munster c_bamberg c_nassau c_fulda c_farafra c_landsberg c_gent } } +trade_good_tea = { counties = { } } + +trade_good_ceramics = { + counties = { c_nicosia c_korinthos c_selge c_saintonge c_byzantion c_cairo c_cologne c_basra c_nihawand c_ravenna c_sebasteia c_north_riding c_baghdad c_rayy c_orvieto c_nottinghamshire c_raqqa c_teruel c_hama c_damascus c_malaga c_samarra c_valencia c_ardestan c_firenze c_mallorca c_thessalonika c_opava c_jihlava c_olomouc c_aachen c_kirman c_namur c_toledo c_turnovo c_kerch c_taizz c_liege c_beaumont c_mandab c_tabriz c_tbilisi c_almeria } +} diff --git a/events/activities/coronation_activity/coronation_events.txt b/events/activities/coronation_activity/coronation_events.txt index 980c93211..b2e380ad4 100644 --- a/events/activities/coronation_activity/coronation_events.txt +++ b/events/activities/coronation_activity/coronation_events.txt @@ -177,8 +177,8 @@ coronation_events.0100 = { value = oath_university_gold_value } save_scope_value_as = { - name = learning_oath_temp_development - value = oath_university_development_value + name = learning_oath_temp_prosperity + value = oath_university_prosperity_value } } @@ -2087,13 +2087,13 @@ coronation_events.0205 = { } } } - animation = jockey_walk + animation = jockey_walk # always horse } triggered_animation = { trigger = { scope:activity.var:activity_special_type_progression >= 25 } - animation = jockey_wave + animation = jockey_wave # always horse } camera = camera_event_horse_left_centered } @@ -2239,51 +2239,58 @@ coronation_events.0205 = { } activity_location = { save_scope_as = location } activity_host = { save_scope_as = bg_override_char } - #Guards for orderly east asian ceremonies in the palace if = { limit = { - scope:host = { - OR = { - coronation_host_east_asian_trigger = yes - government_has_flag = government_is_steppe_admin - } + root = { + is_ai = no } } - create_character = { - template = mercenary - location = scope:location - culture = scope:host.culture - faith = scope:host.faith - rite = scope:host.rite - gender_female_chance = scope_value_target_soldier_female_chance - save_scope_as = audience_1 + #Guards for orderly east asian ceremonies in the palace + if = { + limit = { + scope:host = { + OR = { + coronation_host_east_asian_trigger = yes + government_has_flag = government_is_steppe_admin + } + } + } + create_character = { + template = mercenary + location = scope:location + culture = scope:host.culture + faith = scope:host.faith + rite = scope:host.rite + gender_female_chance = scope_value_target_soldier_female_chance + save_scope_as = audience_1 + } + create_character = { + template = mercenary + location = scope:location + culture = scope:host.culture + faith = scope:host.faith + rite = scope:host.rite + gender_female_chance = scope_value_target_soldier_female_chance + save_scope_as = audience_2 + } } - create_character = { - template = mercenary - location = scope:location - culture = scope:host.culture - faith = scope:host.faith - rite = scope:host.rite - gender_female_chance = scope_value_target_soldier_female_chance - save_scope_as = audience_2 - } - } - else = { - create_character = { - template = generic_peasant_character_no_rags - location = scope:location - culture = scope:location.culture - faith = scope:location.faith - rite = scope:location.rite - save_scope_as = audience_1 - } - create_character = { - template = generic_peasant_character_no_rags - location = scope:location - culture = scope:location.culture - faith = scope:location.faith - rite = scope:location.rite - save_scope_as = audience_2 + else = { + create_character = { + template = generic_peasant_character_no_rags + location = scope:location + culture = scope:location.culture + faith = scope:location.faith + rite = scope:location.rite + save_scope_as = audience_1 + } + create_character = { + template = generic_peasant_character_no_rags + location = scope:location + culture = scope:location.culture + faith = scope:location.faith + rite = scope:location.rite + save_scope_as = audience_2 + } } } @@ -2730,10 +2737,10 @@ coronation_events.0205 = { # For MP coronation_ready_effect = yes - scope:audience_1 = { + scope:audience_1 ?= { silent_disappearance_effect = yes } - scope:audience_2 = { + scope:audience_2 ?= { silent_disappearance_effect = yes } #Ask for clergy/nobility approval event @@ -2885,12 +2892,19 @@ coronation_events.0210 = { } } } - create_character = { - template = bard_template - dynasty = none - location = root.location - gender_female_chance = root_faith_dominant_gender_female_chance - save_scope_as = musician + if = { + limit = { + root = { + is_ai = no + } + } + create_character = { + template = bard_template + dynasty = none + location = root.location + gender_female_chance = root_faith_dominant_gender_female_chance + save_scope_as = musician + } } if = { limit = { @@ -2928,7 +2942,7 @@ coronation_events.0210 = { after = { # For MP coronation_ready_effect = yes - scope:musician = { + scope:musician ?= { silent_disappearance_effect = yes } } @@ -2989,7 +3003,7 @@ coronation_events.0300 = { limit = { OR = { cp:councillor_court_chaplain.involved_activity ?= involved_activity - cp:councillor_court_chaplain = { + cp:councillor_court_chaplain ?= { coronation_events_0200_available_chaplain_trigger = yes } } @@ -4643,7 +4657,7 @@ coronation_events.0310 = { } } - option = { #embrace_supporters supporter vassals get development boost to their realms + option = { #embrace_supporters supporter vassals get prosperity boost to their realms name = coronation_events.0310.h custom_tooltip = coronation_events.0310.h.reward.tooltip trigger = { @@ -4705,7 +4719,7 @@ coronation_events.0310 = { } set_variable = { name = host_had_intent_reward - value = flag:vassal_development_boost + value = flag:vassal_prosperity_boost } } @@ -4844,7 +4858,7 @@ coronation_events.0310 = { } } - option = { #exalt_crown domain boost development + option = { #exalt_crown domain boost prosperity name = coronation_events.0310.k custom_tooltip = coronation_events.0310.k.reward.tooltip trigger = { @@ -4906,7 +4920,7 @@ coronation_events.0310 = { } set_variable = { name = host_had_intent_reward - value = flag:host_development_boost + value = flag:host_prosperity_boost } } @@ -5213,8 +5227,8 @@ coronation_events.0312 = { #Guest ending event flag:better_councillors = { custom_tooltip = coronation_events.0312.better_councillors } - flag:vassal_development_boost = { - custom_tooltip = coronation_events.0312.vassal_development_boost + flag:vassal_prosperity_boost = { + custom_tooltip = coronation_events.0312.vassal_prosperity_boost } flag:vassal_defensive_boost = { custom_tooltip = coronation_events.0312.vassal_defensive_boost diff --git a/events/activities/coronation_activity/coronation_events_1.txt b/events/activities/coronation_activity/coronation_events_1.txt index b5c373f1f..62b4c588f 100644 --- a/events/activities/coronation_activity/coronation_events_1.txt +++ b/events/activities/coronation_activity/coronation_events_1.txt @@ -19,9 +19,9 @@ coronation_events.1000 = { } triggered_desc = { trigger = { - has_character_flag = low_county_opinion + has_character_flag = low_popular_opinion } - desc = coronation_events.1000.low_county_opinion.desc + desc = coronation_events.1000.low_popular_opinion.desc } triggered_desc = { trigger = { @@ -62,7 +62,7 @@ coronation_events.1000 = { } } scope:activity.activity_location.county = { - county_opinion < 0 + popular_opinion < 0 } tyranny >= 20 } @@ -102,11 +102,11 @@ coronation_events.1000 = { if = { limit = { scope:activity.activity_location.county = { - county_opinion < 0 + popular_opinion < 0 } } add_character_flag = { - flag = low_county_opinion + flag = low_popular_opinion } } if = { @@ -265,9 +265,9 @@ coronation_events.1000 = { if = { limit = { - has_character_flag = low_county_opinion + has_character_flag = low_popular_opinion } - remove_character_flag = low_county_opinion + remove_character_flag = low_popular_opinion } if = { limit = { @@ -1874,7 +1874,7 @@ coronation_events.1013 = { trigger = { trigger_if = { limit = { - involved_activity = { + involved_activity ?= { has_activity_type = activity_coronation } } @@ -1887,7 +1887,7 @@ coronation_events.1013 = { } trigger_if = { limit = { - involved_activity = { + involved_activity ?= { has_activity_type = activity_feast } } @@ -1902,7 +1902,7 @@ coronation_events.1013 = { NOT = { has_character_flag = poor_activity_option_accident } - involved_activity = { + involved_activity ?= { any_attending_character = { is_ai = yes is_adult = yes @@ -8872,9 +8872,12 @@ coronation_events.1032 = { } } } - set_relation_friend = { - reason = friend_coronation_honor - target = scope:supporter + if = { + limit = { can_set_relation_friend_trigger = { CHARACTER = scope:supporter } } + set_relation_friend = { + reason = friend_coronation_honor + target = scope:supporter + } } hidden_effect = { add_opinion = { @@ -9050,9 +9053,9 @@ coronation_events.1033 = { } } } - set_relation_nemesis = { - target = scope:rival - reason = rival_publicly_denounced_at_coronation + set_relation_nemesis_effect = { + TARGET = scope:rival + REASON = rival_publicly_denounced_at_coronation } } else = { diff --git a/events/activities/coronation_activity/coronation_events_6.txt b/events/activities/coronation_activity/coronation_events_6.txt index 3e766dbc1..b3060f97a 100644 --- a/events/activities/coronation_activity/coronation_events_6.txt +++ b/events/activities/coronation_activity/coronation_events_6.txt @@ -888,9 +888,9 @@ coronation_events.6001 = { } } scope:loyal_vassal = { - set_relation_rival = { - target = root - reason = rival_traitor_to_confederation + set_relation_rival_effect = { + TARGET = root + REASON = rival_traitor_to_confederation } } coronation_move_towards_detractor_effect = { CHARACTER = scope:loyal_vassal } @@ -1591,9 +1591,9 @@ scripted_trigger coronation_events_6011_county_trigger = { any_county_province = { has_holding_type = tribal_holding OR = { - has_building_or_higher = palisades_01 - has_building_or_higher = war_camps_01 - has_building_or_higher = warrior_lodges_01 + has_building_or_higher = warrior_households_1 + has_building_or_higher = fortified_holds_1 + has_building_or_higher = armed_clans_1 } } } @@ -1751,7 +1751,7 @@ coronation_events.6011 = { } else = { ordered_held_title = { - order_by = development_level + order_by = prosperity_level limit = { tier = tier_county coronation_events_6011_county_trigger = yes @@ -1772,7 +1772,7 @@ coronation_events.6011 = { } else = { ordered_held_title = { - order_by = development_level + order_by = prosperity_level limit = { tier = tier_county coronation_events_6011_county_trigger = yes @@ -1857,28 +1857,28 @@ coronation_events.6011 = { random_county_province = { limit = { OR = { - has_building_or_higher = warrior_lodges_01 - has_building_or_higher = palisades_01 - has_building_or_higher = war_camps_01 + has_building_or_higher = warrior_households_1 + has_building_or_higher = fortified_holds_1 + has_building_or_higher = armed_clans_1 } } if = { limit = { - has_building_or_higher = war_camps_01 + has_building_or_higher = warrior_households_1 } - destroy_or_downgrade_tribal_building_effect = { BUILDING = war_camps } + destroy_or_downgrade_district_building_effect = { BUILDING = warrior_households } } if = { limit = { - has_building_or_higher = palisades_01 + has_building_or_higher = fortified_holds_1 } - destroy_or_downgrade_tribal_building_effect = { BUILDING = palisades } + destroy_or_downgrade_district_building_effect = { BUILDING = fortified_holds } } if = { limit = { - has_building_or_higher = warrior_lodges_01 + has_building_or_higher = armed_clans_1 } - destroy_or_downgrade_building_effect = { BUILDING = warrior_lodges } + destroy_or_downgrade_district_building_effect = { BUILDING = armed_clans } } } random_county_province = { @@ -1893,28 +1893,28 @@ coronation_events.6011 = { random_county_province = { limit = { OR = { - has_building_or_higher = warrior_lodges_01 - has_building_or_higher = palisades_01 - has_building_or_higher = war_camps_01 + has_building_or_higher = warrior_households_1 + has_building_or_higher = fortified_holds_1 + has_building_or_higher = armed_clans_1 } } if = { limit = { - has_building_or_higher = war_camps_01 + has_building_or_higher = warrior_households_1 } - destroy_or_downgrade_tribal_building_effect = { BUILDING = war_camps } + destroy_or_downgrade_district_building_effect = { BUILDING = warrior_households } } if = { limit = { - has_building_or_higher = palisades_01 + has_building_or_higher = fortified_holds_1 } - destroy_or_downgrade_tribal_building_effect = { BUILDING = palisades } + destroy_or_downgrade_district_building_effect = { BUILDING = fortified_holds } } if = { limit = { - has_building_or_higher = warrior_lodges_01 + has_building_or_higher = armed_clans_1 } - destroy_or_downgrade_building_effect = { BUILDING = warrior_lodges } + destroy_or_downgrade_district_building_effect = { BUILDING = armed_clans } } } random_county_province = { @@ -2436,7 +2436,7 @@ scripted_trigger coronation_events_6020_supporter_trigger = { } } capital_county ?= { - development_level >= 1 + prosperity_level >= 1 } } } @@ -2445,15 +2445,15 @@ scripted_effect coronation_events_6020_mass_mobilization_effect = { scope:supporter = { if = { limit = { - has_variable = mass_mobilitization_development_progress_value + has_variable = mass_mobilitization_prosperity_progress_value } - custom_tooltip = mass_mob_dev_progress_tt + custom_tooltip = mass_mob_pros_progress_tt hidden_effect = { every_held_title = { limit = { tier = tier_county } - change_development_progress_with_overflow = scope:supporter.var:mass_mobilitization_development_progress_value + change_prosperity_progress_with_overflow = scope:supporter.var:mass_mobilitization_prosperity_progress_value } } } @@ -2473,20 +2473,20 @@ scripted_effect coronation_events_6020_mass_mobilization_effect = { } } } - #Tribal era just does development progress else = { - - custom_tooltip = mass_mob_dev_tt + + custom_tooltip = mass_mob_pros_tt + hidden_effect = { every_held_title = { limit = { tier = tier_county - development_level >= 1 + prosperity_level >= 1 } - change_development_level = { - add = scope:supporter.var:mass_mobilitization_development_value + change_prosperity_level = { + add = scope:supporter.var:mass_mobilitization_prosperity_value min = { - value = development_level + value = prosperity_level multiply = -1 } } @@ -2852,18 +2852,6 @@ scripted_effect coronation_events_6020_declare_war_effect = { } } if = { - limit = { - government_has_mechanic = administrative - NOT = { - has_variable = admin_permission_to_declare_war - } - } - custom_tooltip = { - text = admin_gain_war_permission_desc - set_variable = admin_permission_to_declare_war - } - } - else_if = { limit = { government_has_flag = government_is_feudal vassal_contract_obligation_level:war_declaration_rights < 1 @@ -2922,7 +2910,7 @@ scripted_effect coronation_events_6020_declare_war_effect = { ordered_claim = { order_by = tier limit = { - holder = { + holder ?= { OR = { this ?= $FOE$ any_liege_or_above = { @@ -3214,7 +3202,7 @@ coronation_events.6020 = { } scope:supporter = { set_variable = { - name = mass_mobilitization_development_progress_value + name = mass_mobilitization_prosperity_progress_value value = -50 } set_variable = { @@ -3268,7 +3256,7 @@ coronation_events.6020 = { else = { scope:supporter = { set_variable = { - name = mass_mobilitization_development_value + name = mass_mobilitization_prosperity_value value = { if = { limit = { @@ -3288,7 +3276,7 @@ coronation_events.6020 = { set_variable = { name = mass_mobilitization_total value = { - add = var:mass_mobilitization_development_value + add = var:mass_mobilitization_prosperity_value multiply = domain_size } } @@ -3360,7 +3348,7 @@ coronation_events.6020 = { trigger = { has_activity_intent = coronation_weaken_detractors } - #Increase armies and tank development effect + #Increase armies and tank prosperity effect coronation_events_6020_mass_mobilization_effect = yes scope:supporter = { coronation_events_6020_declare_war_effect = { FOE = scope:foe } @@ -3697,8 +3685,8 @@ coronation_events.6020 = { coronation_ready_effect = yes scope:supporter = { - remove_variable = mass_mobilitization_development_value - remove_variable = mass_mobilitization_development_progress_value + remove_variable = mass_mobilitization_prosperity_value + remove_variable = mass_mobilitization_prosperity_progress_value remove_variable = mass_mobilitization_fertility_value remove_variable = mass_mobilitization_total } @@ -3805,7 +3793,7 @@ coronation_events.6030 = { has_contagious_deadly_disease_trigger = yes has_trait = leper } - involved_activity = { + involved_activity ?= { activity_host = { OR = { AND = { @@ -5404,7 +5392,7 @@ scripted_effect coronation_events_6101_self_crowning_effect = { } } } - scope:activity.var:anointment_authority ?= { + faith.religious_head ?= { save_scope_as = judger } } @@ -8901,48 +8889,22 @@ coronation_events.6121 = { #Break alliance between vassal and foreign ruler scope:vassal_1 = { break_alliance = scope:detractor_ally_1 - if = { - limit = { - NOT = { - has_relation_rival = root - } - } - set_relation_rival = { - target = root - reason = rival_accused_of_foreign_collusion - } - } - else = { - set_relation_nemesis = { - target = root - reason = rival_accused_of_foreign_collusion - } + progress_towards_nemesis_effect = { + REASON = rival_accused_of_foreign_collusion + CHARACTER = root + OPINION = 0 } coronation_move_towards_detractor_effect = { CHARACTER = scope:vassal_1 } } scope:vassal_2 = { if = { - limit = { - exists = scope:detractor_ally_2 - } + limit = { exists = scope:detractor_ally_2 } break_alliance = scope:detractor_ally_2 } - if = { - limit = { - NOT = { - has_relation_rival = root - } - } - set_relation_rival = { - target = root - reason = rival_accused_of_foreign_collusion - } - } - else = { - set_relation_nemesis = { - target = root - reason = rival_accused_of_foreign_collusion - } + progress_towards_nemesis_effect = { + REASON = rival_accused_of_foreign_collusion + CHARACTER = root + OPINION = 0 } coronation_move_towards_detractor_effect = { CHARACTER = scope:vassal_2 } } @@ -8951,7 +8913,7 @@ coronation_events.6121 = { scope:vassal_1 = { if = { limit = { - government_has_flag = government_has_influence + government_has_mechanic = administrative } change_influence = medium_influence_loss } @@ -8962,7 +8924,7 @@ coronation_events.6121 = { scope:vassal_2 = { if = { limit = { - government_has_flag = government_has_influence + government_has_mechanic = administrative } change_influence = medium_influence_loss } @@ -9212,7 +9174,7 @@ coronation_events.6121 = { if = { limit = { - government_has_flag = government_has_influence + government_has_mechanic = administrative } change_influence = medium_influence_gain } @@ -9228,7 +9190,7 @@ coronation_events.6121 = { } if = { limit = { - government_has_flag = government_has_influence + government_has_mechanic = administrative top_liege = involved_activity.activity_host } change_influence = minor_influence_gain @@ -9363,16 +9325,6 @@ coronation_events.6121 = { custom_tooltip = coronation_events.6121_duel_tt - configure_start_single_combat_effect = { - SC_INITIATOR = root - SC_ATTACKER = root - SC_DEFENDER = scope:vassal_2 - FATALITY = always - FIXED = no - LOCALE = temple - OUTPUT_EVENT = single_combat.1006 - INVALIDATION_EVENT = single_combat.1006 - } add_dread = major_dread_gain add_prestige = medium_prestige_gain if = { @@ -9394,21 +9346,30 @@ coronation_events.6121 = { } add_tyranny = medium_tyranny_gain } + configure_start_single_combat_effect = { + SC_INITIATOR = root + SC_ATTACKER = root + SC_DEFENDER = scope:vassal_2 + FATALITY = always + FIXED = no + LOCALE = temple + OUTPUT_EVENT = single_combat.1006 + INVALIDATION_EVENT = single_combat.1006 + } scope:vassal_2 = { if = { limit = { is_alive = yes + root = { is_alive = yes } # The duel is fatal and can kill root can_set_relation_rival_trigger = { CHARACTER = root } } - set_relation_rival = { - target = root - reason = rival_duel_attacked + set_relation_rival_effect = { + TARGET = root + REASON = rival_duel_attacked } } if = { - limit = { - involved_activity ?= scope:activity - } + limit = { involved_activity ?= scope:activity } coronation_move_towards_detractor_effect = { CHARACTER = scope:vassal_2 } } } @@ -12899,7 +12860,7 @@ scripted_effect coronation_events_6140_spouse_effects = { add_prestige = coronation_spouse_prestige_value if = { limit = { - government_has_flag = government_has_influence + government_has_mechanic = administrative top_liege.primary_title = scope:host.top_liege.primary_title } change_influence = coronation_spouse_influence_value @@ -13203,7 +13164,6 @@ coronation_events.6140 = { OR = { has_relation_lover = scope:spouse has_relation_crush = scope:spouse - has_relation_soulmate = scope:spouse } } } @@ -13697,7 +13657,6 @@ coronation_events.6140 = { trigger = { OR = { has_relation_lover = scope:spouse - has_relation_soulmate = scope:spouse opinion = { target = scope:spouse value >= 90 diff --git a/events/activities/ecumenical_council_activity/pam_ecumenical_council_events_josh.txt b/events/activities/ecumenical_council_activity/pam_ecumenical_council_events_josh.txt index 0f3bdb0ba..2400a0ca4 100644 --- a/events/activities/ecumenical_council_activity/pam_ecumenical_council_events_josh.txt +++ b/events/activities/ecumenical_council_activity/pam_ecumenical_council_events_josh.txt @@ -91,11 +91,13 @@ ecumenical_council_events_josh.0001 = { scope:murder_target = { NOR = { has_relation_rival = root - has_relation_nemesis = root } } } - set_relation_rival = scope:murder_target + set_relation_rival_effect = { + TARGET = scope:murder_target + REASON = rival_murder_compline + } } } } @@ -386,7 +388,9 @@ ecumenical_council_events_josh.0011 = { change_spiritual_fulfillment = minor_spiritual_fulfillment_value involved_activity = { every_attending_character = { + limit = { this != root } custom = every_guest_scope_tt + limit = { this != root } add_opinion = { target = ROOT modifier = thankful_opinion @@ -754,6 +758,7 @@ ecumenical_council_events_josh.0012 = { option = { # Get a strong hook on them. name = ecumenical_council_events_josh.0012.c + trigger = { exists = scope:bishoplover_homosexual_secret } add_hook = { type = strong_blackmail_hook target = scope:guest_bishoplover @@ -1231,10 +1236,22 @@ ecumenical_council_events_josh.0021 = { limit = { is_clergy = yes } - pam_boost_clerical_appointment_score_effect = { CHARACTER = this VALUE = 50 } + pam_boost_clerical_appointment_score_effect = { CHARACTER = root VALUE = 50 } + } + else_if = { + limit = { + exists = puppet:theological_agent_puppet + } + puppet:theological_agent_puppet = { + save_scope_as = theological_agent_puppet + pam_boost_clerical_appointment_score_effect = { CHARACTER = scope:theological_agent_puppet VALUE = 50 } + } } else = { - pam_boost_clerical_appointment_score_effect = { CHARACTER = puppet:theological_agent_puppet VALUE = 50 } + puppet:external_theological_agent_puppet ?= { + save_scope_as = theological_agent_puppet + pam_boost_clerical_appointment_score_effect = { CHARACTER = scope:theological_agent_puppet VALUE = 50 } + } } ai_chance = { @@ -1626,6 +1643,15 @@ ecumenical_council_events_josh.0024 = { ecumenical_shareable_unknown_tenet_for_root_trigger = yes save_temporary_scope_as = ecumenical_tenet_teacher_b any_character_tenet = { + knowledge_filter = known + save_temporary_scope_as = ecumenical_tenet_candidate + NOT = { root = { knows_tenet = scope:ecumenical_tenet_candidate } } + root.faith.main_rite = { + has_tenet_status = { + tenet = scope:ecumenical_tenet_candidate + status = unknown + } + } NOT = { this = scope:tenet_a_temp } @@ -1671,6 +1697,18 @@ ecumenical_council_events_josh.0024 = { this = scope:tenet_target_a } ecumenical_shareable_unknown_tenet_for_root_trigger = yes + any_character_tenet = { + knowledge_filter = known + save_temporary_scope_as = ecumenical_tenet_candidate + NOT = { root = { knows_tenet = scope:ecumenical_tenet_candidate } } + root.faith.main_rite = { + has_tenet_status = { + tenet = scope:ecumenical_tenet_candidate + status = unknown + } + } + NOT = { this = scope:tenet_target_a_shareable_tenet } + } } save_scope_as = tenet_target_b random_character_tenet = { @@ -1775,6 +1813,7 @@ ecumenical_council_events_josh.0024 = { # That book seems interesting. option = { name = ecumenical_council_events_josh.0024.b + trigger = { exists = scope:tenet_target_b_shareable_tenet } # Their only shareable tenet can be the one already picked for the other guest add_known_tenet = scope:tenet_target_b_shareable_tenet scope:tenet_target_b = { add_opinion = { @@ -1887,7 +1926,7 @@ ecumenical_council_events_josh.0025 = { cooldown = { years = 5 } trigger = { - religion = religion:christianity_religion + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } NOR = { involved_activity.activity_host.faith = { OR = { diff --git a/events/activities/hold_court_activity/hold_court_events_general.txt b/events/activities/hold_court_activity/hold_court_events_general.txt index 0c2067d6d..941ebddb3 100644 --- a/events/activities/hold_court_activity/hold_court_events_general.txt +++ b/events/activities/hold_court_activity/hold_court_events_general.txt @@ -773,7 +773,7 @@ hold_court.1021 = { limit = { OR = { this = scope:county - development_level <= 15 + prosperity_level <= 15 } } add_county_modifier = { @@ -800,7 +800,7 @@ hold_court.1021 = { limit = { OR = { this = scope:county - development_level <= 15 + prosperity_level <= 15 } } add_county_modifier = { @@ -828,7 +828,7 @@ hold_court.1021 = { limit = { OR = { this = scope:county - development_level <= 15 + prosperity_level <= 15 } } add_county_modifier = { @@ -846,7 +846,7 @@ hold_court.1021 = { limit = { OR = { this = scope:county - development_level <= 15 + prosperity_level <= 15 } } add_county_modifier = { @@ -1953,7 +1953,7 @@ hold_court.3030 = { base = 1 modifier = { add = 10 - has_free_building_slot = yes + has_free_district_slot = yes } } save_scope_as = province @@ -2028,7 +2028,7 @@ hold_court.3030 = { option = { name = hold_court.3030.b trigger = { - scope:province = { has_free_building_slot = yes } + scope:province = { has_free_district_slot = yes } } stress_and_fulfillment_impact = { @@ -4129,7 +4129,6 @@ hold_court.4600 = { has_relation_lover = root has_relation_friend = root has_relation_rival = root - has_relation_soulmate = root is_close_family_of = root } } @@ -9622,7 +9621,7 @@ hold_court.6121 = { # 6130 ################################################## -# Someone suggests a "cadastral survey" - high cost for an increase of development in all counties you hold # +# Someone suggests a "cadastral survey" - high cost for an increase of prosperity in all counties you hold # scripted_trigger hold_court_6130_valid_child_trigger = { has_court_event_flag = no @@ -9641,7 +9640,7 @@ scripted_effect hold_court_6130_a_rewards = { } every_held_county = { custom = custom.every_held_county - change_development_progress_with_overflow = 50 + change_prosperity_progress_with_overflow = 50 } } else_if = { @@ -9653,7 +9652,7 @@ scripted_effect hold_court_6130_a_rewards = { } every_held_county = { custom = custom.every_held_county - change_development_progress_with_overflow = 35 + change_prosperity_progress_with_overflow = 35 } } scope:6130_proposer = { @@ -12156,9 +12155,9 @@ scripted_effect hold_court_8001_revoke_title_effect = { remove_relation_potential_rival = root } root = { - set_relation_rival = { - target = prev - reason = rival_revoked_title + set_relation_rival_effect = { + TARGET = prev + REASON = rival_revoked_title } } } @@ -12277,7 +12276,7 @@ hold_court.8001 = { } hold_court_8001_revoke_title_effect = yes } - scope:town.county = { change_development_progress = 50 } + scope:town.county = { change_prosperity_progress = 50 } add_character_modifier = { modifier = hold_court_8001_deposed_modifier years = 10 @@ -12345,7 +12344,7 @@ hold_court.8001 = { modifier = hold_court_8001_merchant_boon_modifier years = 15 } - change_development_level = 1 + change_prosperity_level = 1 } } } @@ -12453,7 +12452,7 @@ hold_court.8001 = { send_interface_toast = { title = hold_court.8001.c.tt_failure scope:town.county = { - scope:town.county = { change_development_progress = -50 } + scope:town.county = { change_prosperity_progress = -50 } add_county_modifier = { modifier = hold_court_8001_ignored_modifier years = 10 @@ -15098,7 +15097,7 @@ hold_court.8060 = { county_has_all_holding_types = yes } alternative_limit = { county_has_empty_province_trigger = yes } - order_by = development_level + order_by = prosperity_level save_scope_as = target_county } } @@ -15147,7 +15146,7 @@ hold_court.8060 = { faith = ROOT.faith any_county_province = { province_has_no_holding_trigger = yes } } - order_by = development_level + order_by = prosperity_level save_scope_as = target_county holder = { if = { @@ -15855,7 +15854,7 @@ hold_court.8070 = { county_has_all_holding_types = yes } alternative_limit = { county_has_empty_province_trigger = yes } - order_by = development_level + order_by = prosperity_level save_scope_as = target_county } } @@ -15898,7 +15897,7 @@ hold_court.8070 = { holder = { hold_court_8070_vassal_trigger = yes } any_county_province = { province_has_no_holding_trigger = yes } } - order_by = development_level + order_by = prosperity_level save_scope_as = target_county holder = { save_scope_as = vassal } } @@ -16388,7 +16387,7 @@ hold_court.8071 = { scripted_trigger hold_court_8080_mayor_trigger = { # Check mayor's culture, and city wealth hold_court_available_mayor_trigger = yes - culture = { has_innovation = innovation_development_02 } + culture = { has_innovation = innovation_prosperity_02 } primary_title = { de_jure_liege = { this != root.capital_county @@ -16465,7 +16464,7 @@ hold_court.8080 = { name = has_had_government_request_event } top_liege = this - culture = { has_innovation = innovation_development_02 } + culture = { has_innovation = innovation_prosperity_02 } any_vassal = { hold_court_8080_mayor_trigger = yes } NOT = { any_sub_realm_county = { @@ -16481,7 +16480,7 @@ hold_court.8080 = { add = 1 any_vassal = { hold_court_8080_mayor_trigger = yes - primary_title.title_province = { has_building_or_higher = common_tradeport_01 } + primary_title.title_province = { has_port_district = yes } } } modifier = { @@ -16512,7 +16511,7 @@ hold_court.8080 = { ordered_vassal = { limit = { hold_court_8080_mayor_trigger = yes - primary_title.title_province = { has_building_or_higher = common_tradeport_01 } + primary_title.title_province = { has_port_district = yes } } alternative_limit = { hold_court_8080_mayor_trigger = yes @@ -17382,10 +17381,7 @@ hold_court.8090 = { } if = { limit = { - OR = { - has_relation_lover = scope:vassal - has_relation_soulmate = scope:vassal - } + has_relation_lover = scope:vassal OR = { scope:vassal.var:target_court_position = flag:bodyguard scope:vassal.var:target_court_position = flag:akolouthos @@ -18628,7 +18624,7 @@ hold_court.8110 = { any_held_title = { title_tier = county county = { - county_control > 80 + county_control > county_control_relative_80 any_county_province = { has_holding = yes } } } @@ -18647,7 +18643,7 @@ hold_court.8110 = { title_tier = county limit = { county = { - county_control > 80 + county_control > county_control_relative_80 any_county_province = { has_holding = yes } } } @@ -23187,7 +23183,7 @@ hold_court.8180 = { } order_by = { value = 0 - subtract = development_level + subtract = prosperity_level } save_scope_as = vassal_title } @@ -26738,7 +26734,7 @@ hold_court.8280 = { alternative_limit = { hold_court_8280_nomad_county_trigger = yes } order_by = { value = 0 - subtract = development_level + subtract = prosperity_level } save_scope_as = nomad_county culture = { save_scope_as = nomad_culture } diff --git a/events/activities/pilgrimage_activity/pilgrimage_events.txt b/events/activities/pilgrimage_activity/pilgrimage_events.txt index a43031ab7..9cfc0431d 100644 --- a/events/activities/pilgrimage_activity/pilgrimage_events.txt +++ b/events/activities/pilgrimage_activity/pilgrimage_events.txt @@ -310,6 +310,20 @@ pilgrimage.0500 = { } cooldown = { years = 10 } trigger = { + is_available_healthy_adult = yes + #Forbidden from pilgrimages? No pilgrimage for you! + rite = { NOT = { rite_has_parameter = forbidden_from_pilgrimage } } + #This really should take care of most Hajj/Pilgrim-related trigger checks - if you don't have this trait, you haven't been pilgrimming before + NOR = { + has_trait = pilgrim + has_trait = hajjaj + } + #Only one modifier for _you_ + NOR = { + has_character_modifier = ghost_pilgrimage_promised_modifier + has_character_modifier = hajj_promised_modifier + has_character_modifier = pilgrimage_promised_modifier + } any_close_family_member = { OR = { has_any_good_relationship_with_character_trigger = { CHARACTER = root } @@ -337,9 +351,6 @@ pilgrimage.0500 = { faith = root.faith has_trait = pilgrim } - is_available_healthy_adult = yes - #Forbidden from pilgrimages? No pilgrimage for you! - rite = { NOT = { rite_has_parameter = forbidden_from_pilgrimage } } faith = { any_holy_site_barony = { pilgrimage_0500_valid_holy_site_trigger = yes @@ -350,17 +361,6 @@ pilgrimage.0500 = { this != scope:holy_site_check } } - #This really should take care of most Hajj/Pilgrim-related trigger checks - if you don't have this trait, you haven't been pilgrimming before - NOR = { - has_trait = pilgrim - has_trait = hajjaj - } - #Only one modifier for _you_ - NOR = { - has_character_modifier = ghost_pilgrimage_promised_modifier - has_character_modifier = hajj_promised_modifier - has_character_modifier = pilgrimage_promised_modifier - } } immediate = { random_close_family_member = { @@ -1616,7 +1616,7 @@ pilgrimage.1120 = { location = { has_holding_type = church_holding county = { - development_level >= 5 + prosperity_level >= 5 faith = { religion = root.religion faith_hostility_level = { target = root.faith value <= 1 } @@ -1642,12 +1642,12 @@ pilgrimage.1120 = { add = 10 } modifier = { - location = { has_special_building = yes } + location = { has_special_district = yes } add = 10 } modifier = { add = { - value = location.county.development_level + value = location.county.prosperity_level divide = 4 } } @@ -1860,7 +1860,7 @@ pilgrimage.1130 = { base = 1 modifier = { add = -0.75 - location.county.development_level >= 10 + location.county.prosperity_level >= 10 } } @@ -2255,7 +2255,7 @@ pilgrimage.1140 = { base = 1 modifier = { add = { - value = location.county.development_level + value = location.county.prosperity_level divide = 4 } } @@ -5514,20 +5514,20 @@ pilgrimage.2070 = { } stress_and_fulfillment_impact = { lifestyle_reveler = medium_stress_impact_loss - cynical = medium_stress_impact_loss - zealous = major_stress_impact_gain + cynical = medium_stress_impact_gain + zealous = medium_stress_impact_loss } ai_chance = { base = 100 modifier = { - has_trait = zealous + has_trait = cynical factor = 0 } modifier = { OR = { has_trait = lifestyle_reveler - has_trait = cynical + has_trait = zealous } factor = 2 } @@ -5539,7 +5539,7 @@ pilgrimage.2070 = { name = pilgrimage.2070.b current_travel_plan = { delay_travel_plan = { - days = 5 + days = 2 } } progress_towards_friend_effect = { @@ -5548,22 +5548,19 @@ pilgrimage.2070 = { OPINION = default_friend_opinion } stress_and_fulfillment_impact = { - zealous = medium_stress_impact_loss + zealous = medium_stress_impact_gain shy = minor_stress_impact_gain lifestyle_reveler = medium_stress_impact_gain cynical = major_stress_impact_gain } ai_chance = { base = 100 - modifier = { - has_trait = zealous - factor = 2 - } modifier = { OR = { has_trait = shy has_trait = lifestyle_reveler has_trait = cynical + has_trait = zealous } factor = 0 } @@ -5577,19 +5574,17 @@ pilgrimage.2070 = { add_travel_plan_modifier = { modifier = pilgrimage_make_haste_modifier } } stress_and_fulfillment_impact = { - lazy = minor_stress_impact_loss - zealous = medium_stress_impact_gain + zealous = minor_stress_impact_loss lifestyle_reveler = medium_stress_impact_gain } ai_chance = { base = 100 modifier = { - has_trait = lazy + has_trait = zealous factor = 2 } modifier = { OR = { - has_trait = zealous has_trait = lifestyle_reveler } factor = 0 @@ -13708,7 +13703,10 @@ scripted_effect pilgrimage_6810_friend_effect = { } } else_if = { #if you can't be friends we make them endorse you - limit = { exists = scope:my_bishop } + limit = { # The caller can be their own bishop + exists = scope:my_bishop + scope:my_bishop != this + } scope:my_bishop = { add_opinion = { target = prev #we use prev so we can use the effect with your heir too @@ -15115,7 +15113,7 @@ pilgrimage.7000 = { option = { name = pilgrimage.7000.b trigger = { # If it's Pious or Hajj we lower your Gallowsbait - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_trait = gallowsbait has_any_gallowsbait_xp_trigger = yes OR = { @@ -15133,7 +15131,7 @@ pilgrimage.7000 = { } } } - if = { # If you are a devoted Pilgrim you lose it entirely + if = { # If you are a devoted Pilgrim, and there is not too much left to answer for, you lose it entirely limit = { OR = { AND = { @@ -15146,6 +15144,7 @@ pilgrimage.7000 = { has_character_flag = perfect_pious_reward has_character_flag = high_pious_reward } + notorious_gallowsbait_xp_trigger = no } remove_trait = gallowsbait } diff --git a/events/activities/tour_activity/tour_grounds_events_chad.txt b/events/activities/tour_activity/tour_grounds_events_chad.txt index 805c0593a..188545bbf 100644 --- a/events/activities/tour_activity/tour_grounds_events_chad.txt +++ b/events/activities/tour_activity/tour_grounds_events_chad.txt @@ -360,9 +360,8 @@ scripted_trigger tg_6100_appropriate_loved_one_memory_trigger = { has_memory_type = soulmate_died } any_memory_participant = { - NOR = { + NOT = { has_relation_rival = root - has_relation_nemesis = root } trigger_if = { limit = { @@ -465,7 +464,7 @@ tour_grounds_events.6100 = { trigger = { # check for a christian cathedral special building location = { - has_special_building = yes + has_special_district = yes OR = { tg_6100_location_has_cathedral_trigger = yes tg_6100_location_has_mosque_trigger = yes @@ -774,28 +773,78 @@ tour_grounds_events.6100 = { # Cereal Fields # Vassal let's it slip that they've had a bountiful harvest -# Checks that you, the liege, have the same building as the one you're seeing in your vassal's province -scripted_trigger tg_6200_does_root_have_matching_building_trigger = { +# The farm buildings this event can show off, one trigger per flavour variant +scripted_trigger tg_6200_province_has_pastures_trigger = { + has_building_or_higher = meadowlands_pastures_1 +} + +scripted_trigger tg_6200_province_has_orchard_trigger = { + OR = { + has_building_or_higher = fruit_resource_building_1 + has_building_or_higher = fruit_gardens_1 + } +} + +scripted_trigger tg_6200_province_has_cereal_fields_trigger = { + has_building_or_higher = farming_fields_1 +} + +scripted_trigger tg_6200_province_has_hill_farms_trigger = { + has_building_or_higher = terrace_gardens_1 +} + +scripted_trigger tg_6200_province_has_plantations_trigger = { + has_building_or_higher = communal_plantations_1 +} + +# Checks that a province has a farm building that the liege also has in their own capital +scripted_trigger tg_6200_province_shares_farm_building_with_root_trigger = { + OR = { + AND = { + tg_6200_province_has_pastures_trigger = yes + root.capital_province = { tg_6200_province_has_pastures_trigger = yes } + } + AND = { + tg_6200_province_has_orchard_trigger = yes + root.capital_province = { tg_6200_province_has_orchard_trigger = yes } + } + AND = { + tg_6200_province_has_cereal_fields_trigger = yes + root.capital_province = { tg_6200_province_has_cereal_fields_trigger = yes } + } + AND = { + tg_6200_province_has_hill_farms_trigger = yes + root.capital_province = { tg_6200_province_has_hill_farms_trigger = yes } + } + AND = { + tg_6200_province_has_plantations_trigger = yes + root.capital_province = { tg_6200_province_has_plantations_trigger = yes } + } + } +} + +# Checks that a province has the farm building the event ended up focusing on +scripted_trigger tg_6200_province_has_focus_building_trigger = { OR = { AND = { root.var:building_focus = flag:pastures - capital_province = { has_building_or_higher = pastures_01 } + tg_6200_province_has_pastures_trigger = yes } AND = { root.var:building_focus = flag:orchard - capital_province = { has_building_or_higher = orchards_01 } + tg_6200_province_has_orchard_trigger = yes } AND = { root.var:building_focus = flag:cereal_fields - capital_province = { has_building_or_higher = cereal_fields_01 } + tg_6200_province_has_cereal_fields_trigger = yes } AND = { root.var:building_focus = flag:hill_farms - capital_province = { has_building_or_higher = hill_farms_01 } + tg_6200_province_has_hill_farms_trigger = yes } AND = { root.var:building_focus = flag:plantations - capital_province = { has_building_or_higher = plantations_01 } + tg_6200_province_has_plantations_trigger = yes } } } @@ -804,791 +853,78 @@ scripted_trigger tg_6200_does_root_have_matching_building_trigger = { scripted_effect tg_6200_pick_building_focus_effect = { random_list = { 1 = { - trigger = { + trigger = { location.county = { - any_county_province = { has_building_or_higher = pastures_01 } + any_county_province = { + tg_6200_province_has_pastures_trigger = yes + root.capital_province = { tg_6200_province_has_pastures_trigger = yes } + } } } set_variable = { - name = building_focus + name = building_focus value = flag:pastures } } 1 = { - trigger = { + trigger = { location.county = { - any_county_province = { has_building_or_higher = orchards_01 } + any_county_province = { + tg_6200_province_has_orchard_trigger = yes + root.capital_province = { tg_6200_province_has_orchard_trigger = yes } + } } } set_variable = { - name = building_focus + name = building_focus value = flag:orchard } } 1 = { - trigger = { + trigger = { location.county = { - any_county_province = { has_building_or_higher = cereal_fields_01 } + any_county_province = { + tg_6200_province_has_cereal_fields_trigger = yes + root.capital_province = { tg_6200_province_has_cereal_fields_trigger = yes } + } } } set_variable = { - name = building_focus + name = building_focus value = flag:cereal_fields } } 1 = { - trigger = { + trigger = { location.county = { - any_county_province = { has_building_or_higher = hill_farms_01 } + any_county_province = { + tg_6200_province_has_hill_farms_trigger = yes + root.capital_province = { tg_6200_province_has_hill_farms_trigger = yes } + } } } set_variable = { - name = building_focus + name = building_focus value = flag:hill_farms } } 1 = { - trigger = { + trigger = { location.county = { - any_county_province = { has_building_or_higher = plantations_01 } + any_county_province = { + tg_6200_province_has_plantations_trigger = yes + root.capital_province = { tg_6200_province_has_plantations_trigger = yes } + } } } set_variable = { - name = building_focus + name = building_focus value = flag:plantations } } } } -# Determine the difference in building level between the liege and vassal respectively -scripted_effect tg_6200_determine_building_level_diff_effect = { - if = { - limit = { root.var:building_focus = flag:pastures } - # check vassal building level - root.location = { - switch = { - trigger = has_building - pastures_01 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 1 - } - } - } - pastures_02 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 2 - } - } - } - pastures_03 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 3 - } - } - } - pastures_04 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 4 - } - } - } - pastures_05 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 5 - } - } - } - pastures_06 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 6 - } - } - } - pastures_07 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 7 - } - } - } - pastures_08 = { - scope:root_scope = { - set_variable = { - name = vassal_building_level - value = 8 - } - } - } - } - } - # check root building level - root.capital_province = { - switch = { - trigger = has_building - pastures_01 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 1 - } - } - } - pastures_02 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 2 - } - } - } - pastures_03 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 3 - } - } - } - pastures_04 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 4 - } - } - } - pastures_05 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 5 - } - } - } - pastures_06 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 6 - } - } - } - pastures_07 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 7 - } - } - } - pastures_08 = { - scope:root_scope = { - set_variable = { - name = root_building_level - value = 8 - } - } - } - } - } - } - else_if = { - limit = { root.var:building_focus = flag:orchard } - # check vassal building level - root.location = { - switch = { - trigger = has_building - orchards_01 = { - root = { - set_variable = { - name = vassal_building_level - value = 1 - } - } - } - orchards_02 = { - root = { - set_variable = { - name = vassal_building_level - value = 2 - } - } - } - orchards_03 = { - root = { - set_variable = { - name = vassal_building_level - value = 3 - } - } - } - orchards_04 = { - root = { - set_variable = { - name = vassal_building_level - value = 4 - } - } - } - orchards_05 = { - root = { - set_variable = { - name = vassal_building_level - value = 5 - } - } - } - orchards_06 = { - root = { - set_variable = { - name = vassal_building_level - value = 6 - } - } - } - orchards_07 = { - root = { - set_variable = { - name = vassal_building_level - value = 7 - } - } - } - orchards_08 = { - root = { - set_variable = { - name = vassal_building_level - value = 8 - } - } - } - } - } - # check root building level - root.capital_province = { - switch = { - trigger = has_building - orchards_01 = { - root = { - set_variable = { - name = root_building_level - value = 1 - } - } - } - orchards_02 = { - root = { - set_variable = { - name = root_building_level - value = 2 - } - } - } - orchards_03 = { - root = { - set_variable = { - name = root_building_level - value = 3 - } - } - } - orchards_04 = { - root = { - set_variable = { - name = root_building_level - value = 4 - } - } - } - orchards_05 = { - root = { - set_variable = { - name = root_building_level - value = 5 - } - } - } - orchards_06 = { - root = { - set_variable = { - name = root_building_level - value = 6 - } - } - } - orchards_07 = { - root = { - set_variable = { - name = root_building_level - value = 7 - } - } - } - orchards_08 = { - root = { - set_variable = { - name = root_building_level - value = 8 - } - } - } - } - } - } - else_if = { - limit = { root.var:building_focus = flag:cereal_fields } - # check vassal building level - root.location = { - switch = { - trigger = has_building - cereal_fields_01 = { - root = { - set_variable = { - name = vassal_building_level - value = 1 - } - } - } - cereal_fields_02 = { - root = { - set_variable = { - name = vassal_building_level - value = 2 - } - } - } - cereal_fields_03 = { - root = { - set_variable = { - name = vassal_building_level - value = 3 - } - } - } - cereal_fields_04 = { - root = { - set_variable = { - name = vassal_building_level - value = 4 - } - } - } - cereal_fields_05 = { - root = { - set_variable = { - name = vassal_building_level - value = 5 - } - } - } - cereal_fields_06 = { - root = { - set_variable = { - name = vassal_building_level - value = 6 - } - } - } - cereal_fields_07 = { - root = { - set_variable = { - name = vassal_building_level - value = 7 - } - } - } - cereal_fields_08 = { - root = { - set_variable = { - name = vassal_building_level - value = 8 - } - } - } - } - } - # check root building level - root.capital_province = { - switch = { - trigger = has_building - cereal_fields_01 = { - root = { - set_variable = { - name = root_building_level - value = 1 - } - } - } - cereal_fields_02 = { - root = { - set_variable = { - name = root_building_level - value = 2 - } - } - } - cereal_fields_03 = { - root = { - set_variable = { - name = root_building_level - value = 3 - } - } - } - cereal_fields_04 = { - root = { - set_variable = { - name = root_building_level - value = 4 - } - } - } - cereal_fields_05 = { - root = { - set_variable = { - name = root_building_level - value = 5 - } - } - } - cereal_fields_06 = { - root = { - set_variable = { - name = root_building_level - value = 6 - } - } - } - cereal_fields_07 = { - root = { - set_variable = { - name = root_building_level - value = 7 - } - } - } - cereal_fields_08 = { - root = { - set_variable = { - name = root_building_level - value = 8 - } - } - } - } - } - } - else_if = { - limit = { root.var:building_focus = flag:hill_farms } - # check vassal building level - root.location = { - switch = { - trigger = has_building - hill_farms_01 = { - root = { - set_variable = { - name = vassal_building_level - value = 1 - } - } - } - hill_farms_02 = { - root = { - set_variable = { - name = vassal_building_level - value = 2 - } - } - } - hill_farms_03 = { - root = { - set_variable = { - name = vassal_building_level - value = 3 - } - } - } - hill_farms_04 = { - root = { - set_variable = { - name = vassal_building_level - value = 4 - } - } - } - hill_farms_05 = { - root = { - set_variable = { - name = vassal_building_level - value = 5 - } - } - } - hill_farms_06 = { - root = { - set_variable = { - name = vassal_building_level - value = 6 - } - } - } - hill_farms_07 = { - root = { - set_variable = { - name = vassal_building_level - value = 7 - } - } - } - hill_farms_08 = { - root = { - set_variable = { - name = vassal_building_level - value = 8 - } - } - } - } - } - # check root building level - root.capital_province = { - switch = { - trigger = has_building - hill_farms_01 = { - root = { - set_variable = { - name = root_building_level - value = 1 - } - } - } - hill_farms_02 = { - root = { - set_variable = { - name = root_building_level - value = 2 - } - } - } - hill_farms_03 = { - root = { - set_variable = { - name = root_building_level - value = 3 - } - } - } - hill_farms_04 = { - root = { - set_variable = { - name = root_building_level - value = 4 - } - } - } - hill_farms_05 = { - root = { - set_variable = { - name = root_building_level - value = 5 - } - } - } - hill_farms_06 = { - root = { - set_variable = { - name = root_building_level - value = 6 - } - } - } - hill_farms_07 = { - root = { - set_variable = { - name = root_building_level - value = 7 - } - } - } - hill_farms_08 = { - root = { - set_variable = { - name = root_building_level - value = 8 - } - } - } - } - } - } - else_if = { - limit = { root.var:building_focus = flag:plantations } - # check vassal building level - root.location = { - switch = { - trigger = has_building - plantations_01 = { - root = { - set_variable = { - name = vassal_building_level - value = 1 - } - } - } - plantations_02 = { - root = { - set_variable = { - name = vassal_building_level - value = 2 - } - } - } - plantations_03 = { - root = { - set_variable = { - name = vassal_building_level - value = 3 - } - } - } - plantations_04 = { - root = { - set_variable = { - name = vassal_building_level - value = 4 - } - } - } - plantations_05 = { - root = { - set_variable = { - name = vassal_building_level - value = 5 - } - } - } - plantations_06 = { - root = { - set_variable = { - name = vassal_building_level - value = 6 - } - } - } - plantations_07 = { - root = { - set_variable = { - name = vassal_building_level - value = 7 - } - } - } - plantations_08 = { - root = { - set_variable = { - name = vassal_building_level - value = 8 - } - } - } - } - } - # check root building level - root.capital_province = { - switch = { - trigger = has_building - plantations_01 = { - root = { - set_variable = { - name = root_building_level - value = 1 - } - } - } - plantations_02 = { - root = { - set_variable = { - name = root_building_level - value = 2 - } - } - } - plantations_03 = { - root = { - set_variable = { - name = root_building_level - value = 3 - } - } - } - plantations_04 = { - root = { - set_variable = { - name = root_building_level - value = 4 - } - } - } - plantations_05 = { - root = { - set_variable = { - name = root_building_level - value = 5 - } - } - } - plantations_06 = { - root = { - set_variable = { - name = root_building_level - value = 6 - } - } - } - plantations_07 = { - root = { - set_variable = { - name = root_building_level - value = 7 - } - } - } - plantations_08 = { - root = { - set_variable = { - name = root_building_level - value = 8 - } - } - } - } - } - } - - set_variable = { - name = building_level_diff - value = root.var:root_building_level - } - change_variable = { - name = building_level_diff - divide = root.var:vassal_building_level - } -} - tour_grounds_events.6200 = { type = activity_event title = tour_grounds_events.6200.t @@ -1634,32 +970,9 @@ tour_grounds_events.6200 = { } trigger = { - # check for pastures/orchards/cereal fields and that root has a matching building in their capital province + # The vassal's county must have a farm building that we also have in our own capital location.county = { - any_county_province = { - OR = { - AND = { - has_building_or_higher = pastures_01 - root.capital_province = { has_building_or_higher = pastures_01 } - } - AND = { - has_building_or_higher = orchards_01 - root.capital_province = { has_building_or_higher = orchards_01 } - } - AND = { - has_building_or_higher = cereal_fields_01 - root.capital_province = { has_building_or_higher = cereal_fields_01 } - } - AND = { - has_building_or_higher = hill_farms_01 - root.capital_province = { has_building_or_higher = hill_farms_01 } - } - AND = { - has_building_or_higher = plantations_01 - root.capital_province = { has_building_or_higher = plantations_01 } - } - } - } + any_county_province = { tg_6200_province_shares_farm_building_with_root_trigger = yes } } } @@ -1670,34 +983,17 @@ tour_grounds_events.6200 = { immediate = { # save scopes for loc save_scope_as = root_scope - location.county = { - random_county_province = { - limit = { - OR = { - has_building_or_higher = pastures_01 - has_building_or_higher = orchards_01 - has_building_or_higher = cereal_fields_01 - has_building_or_higher = hill_farms_01 - has_building_or_higher = plantations_01 - } - } - save_scope_as = tour_grounds_event_location - } - } capital_province = { save_scope_as = root_capital_scope } # Pick which building we want to focus on tg_6200_pick_building_focus_effect = yes - if = { - limit = { - # technically shouldn't be necessary, but prevents errors - exists = root.var:building_focus - # check if root has the right building - tg_6200_does_root_have_matching_building_trigger = yes + # The province we show off has to be one that actually has the focused building + location.county = { + random_county_province = { + limit = { tg_6200_province_has_focus_building_trigger = yes } + save_scope_as = tour_grounds_event_location } - # determine the difference in their building level - tg_6200_determine_building_level_diff_effect = yes } } @@ -1845,18 +1141,6 @@ tour_grounds_events.6200 = { limit = { exists = root.var:building_focus } remove_variable = building_focus } - if = { - limit = { exists = root.var:vassal_building_level } - remove_variable = vassal_building_level - } - if = { - limit = { exists = root.var:root_building_level } - remove_variable = root_building_level - } - if = { - limit = { exists = root.var:building_level_diff } - remove_variable = root_building_level - } } } @@ -1973,7 +1257,7 @@ tour_grounds_events.6202 = { trigger = { location.county = { any_county_province = { - has_building_or_higher = common_tradeport_01 + has_port_district = yes } } } @@ -1986,7 +1270,7 @@ tour_grounds_events.6202 = { save_scope_as = root_scope location.county = { random_county_province = { - limit = { has_building_or_higher = common_tradeport_01 } + limit = { has_port_district = yes } save_scope_as = event_location } } diff --git a/events/activities/tour_activity/tour_phase_cultural_festival.txt b/events/activities/tour_activity/tour_phase_cultural_festival.txt index 6b50e0b0b..b46ceaeff 100644 --- a/events/activities/tour_activity/tour_phase_cultural_festival.txt +++ b/events/activities/tour_activity/tour_phase_cultural_festival.txt @@ -1104,17 +1104,17 @@ cultural_festival.2010 = { } else_if = { limit = { has_relation_rival = scope:stop_host_scope } - set_relation_nemesis = { #this is bad enough to make you nemesis - target = scope:stop_host_scope - copy_reason = rival - reason = nemesis_monarch_of_grim_and_grievance + progress_towards_nemesis_effect = { + REASON = nemesis_monarch_of_grim_and_grievance + CHARACTER = scope:stop_host_scope + OPINION = 0 } } else = { progress_towards_rival_effect = { - CHARACTER = scope:stop_host_scope REASON = rival_king_of_ugly - OPINION = -10 + CHARACTER = scope:stop_host_scope + OPINION = 0 } } scope:cultural_festival_scope = { @@ -1460,7 +1460,7 @@ cultural_festival.2030 = { trigger = { is_landed_or_landless_administrative_or_theocratic = yes location.county ?= { - development_level >= bad_development_level + prosperity_level >= bad_prosperity_level } } @@ -1468,7 +1468,7 @@ cultural_festival.2030 = { base = 1 modifier = { factor = 2 - location.county = { development_level >= medium_development_level } + location.county = { prosperity_level >= medium_prosperity_level } } } @@ -1570,7 +1570,7 @@ cultural_festival.2030 = { } add_treasury_or_gold = major_treasury_or_gold_value location.county = { - change_development_level = -1 + change_prosperity_level = -1 } if = { limit = { @@ -2182,7 +2182,7 @@ cultural_festival.2060 = { trigger = { is_landed_or_landless_administrative_or_theocratic = yes location.county ?= { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level } any_character_artifact = { #you bring something with you is_equipped = no @@ -2203,7 +2203,7 @@ cultural_festival.2060 = { modifier = { factor = 2 location.county = { - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } modifier = { @@ -2303,7 +2303,7 @@ cultural_festival.2060 = { target = scope:stop_host_scope artifact = scope:sophisticated_artifact root.location.county = { - change_development_progress = 2 + change_prosperity_progress = 2 } scope:sophisticated_artifact = { set_owner = scope:stop_host_scope @@ -2395,7 +2395,7 @@ cultural_festival.2060 = { gold = minor_gold_value } location.county = { - change_development_progress = 2 + change_prosperity_progress = 2 } scope:inspired_character = { inspiration = { @@ -3303,7 +3303,7 @@ cultural_festival.2100 = { max = 100 } location.county = { - change_development_progress = medium_development_progress_gain + change_prosperity_progress = medium_prosperity_progress_gain } stress_and_fulfillment_impact = { greedy = minor_stress_impact_gain @@ -3958,7 +3958,7 @@ cultural_festival.3001 = { after = { clear_available_compliments_effect = yes - scope:visiting_liege = { trigger_event = { id = cultural_festival.3002 } } + scope:visiting_liege = { trigger_event = cultural_festival.3002 } } } @@ -4392,7 +4392,7 @@ cultural_festival.3010 = { years = 5 } set_variable = alcohol_fountain_var - trigger_event = { id = cultural_festival.3011 } + trigger_event = cultural_festival.3011 } if = { limit = { @@ -4466,7 +4466,7 @@ cultural_festival.3010 = { years = 5 } set_variable = juice_fountain_var - trigger_event = { id = cultural_festival.3011 } + trigger_event = cultural_festival.3011 } stress_and_fulfillment_impact = { greedy = minor_stress_impact_gain @@ -4668,7 +4668,7 @@ cultural_festival.3020 = { option = { # I sure do! name = cultural_festival.3020.a custom_tooltip = cultural_festival.3020.a.tt - trigger_event = { id = cultural_festival.3021 } + trigger_event = cultural_festival.3021 stress_and_fulfillment_impact = { humble = minor_stress_impact_gain } @@ -4880,7 +4880,7 @@ cultural_festival.3021 = { after = { scope:stop_host_scope = { - trigger_event = { id = cultural_festival.3022 } + trigger_event = cultural_festival.3022 } } } @@ -5086,7 +5086,7 @@ cultural_festival.3030 = { modifier = { factor = 2 location.county = { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level } } modifier = { @@ -5104,7 +5104,7 @@ cultural_festival.3030 = { years = 5 } } - scope:visiting_liege = { trigger_event = { id = cultural_festival.3031 } } + scope:visiting_liege = { trigger_event = cultural_festival.3031 } stress_and_fulfillment_impact = { greedy = minor_stress_impact_gain callous = minor_stress_impact_gain #you think this is stupid @@ -5305,9 +5305,9 @@ cultural_festival.3031 = { } } #you become nemesis, this is highly humiliating - set_relation_nemesis = { - reason = nemesis_animal_contest - target = scope:farm_animal_rival + set_relation_nemesis_effect = { + TARGET = scope:farm_animal_rival + REASON = nemesis_animal_contest } stress_and_fulfillment_impact = { base = minor_stress_impact_loss @@ -5558,11 +5558,7 @@ cultural_festival.3041 = { add_prestige = minor_prestige_loss } set_variable = couldnt_get_sword_var - scope:stop_host_scope = { - trigger_event = { - id = cultural_festival.3042 - } - } + scope:stop_host_scope = { trigger_event = cultural_festival.3042 } } } stress_and_fulfillment_impact = { @@ -5590,11 +5586,7 @@ cultural_festival.3041 = { CHARACTER = scope:stop_host_scope OPINION = 15 } - scope:stop_host_scope = { #now they get a chance to take it out - trigger_event = { - id = cultural_festival.3042 - } - } + scope:stop_host_scope = { trigger_event = cultural_festival.3042 } #now they get a chance to take it out if = { limit = { scope:activity = { @@ -5868,7 +5860,7 @@ cultural_festival.3050 = { has_trait = deceitful #they know you're lying } } - scope:stop_host_scope = { trigger_event = { id = cultural_festival.3051 } } + scope:stop_host_scope = { trigger_event = cultural_festival.3051 } } 40 = { #they don't notice modifier = { @@ -6225,7 +6217,7 @@ cultural_festival.3060 = { increase_tour_success_effect = { POINTS = 1 } } hidden_effect = { - scope:stop_host_scope = { trigger_event = { id = cultural_festival.3061 } } + scope:stop_host_scope = { trigger_event = cultural_festival.3061 } } stress_and_fulfillment_impact = { lustful = minor_stress_impact_loss @@ -6495,7 +6487,6 @@ cultural_festival.3070 = { OR = { has_relation_potential_rival = root has_relation_rival = root - has_relation_nemesis = root root = { opinion = { target = prev #the character @@ -6641,69 +6632,28 @@ cultural_festival.3070 = { } } if = { - limit = { - exists = cp:councillor_court_chaplain - } - cp:councillor_court_chaplain = { - save_scope_as = bishop - } + limit = { exists = cp:councillor_court_chaplain } + cp:councillor_court_chaplain = { save_scope_as = bishop } } } option = { # pick someone you dislike name = cultural_festival.3070.a - if = { #become potential rivals - limit = { - scope:rival_jester = { - NOR = { - has_relation_potential_rival = root - has_relation_rival = root - has_relation_nemesis = root - } - } - } - scope:rival_jester = { - set_relation_potential_rival = { - target = root - reason = rival_feast_of_fools - } - } - } - else_if = { #become rivals if potential rivals - limit = { - scope:rival_jester = { - has_relation_potential_rival = root - } - } - scope:rival_jester = { - set_relation_rival = { - target = root - reason = rival_feast_of_fools - } - } - } - else_if = { #become nemesis if rivals - limit = { - scope:rival_jester = { - has_relation_rival = root - } - } - scope:rival_jester = { - set_relation_nemesis = { - target = root - reason = rival_feast_of_fools - } - } - } - else = { #they get hostile scheme power against you if nemesis - scope:rival_jester = { + scope:rival_jester = { + if = { + limit = { has_relation_nemesis = root } set_variable = { name = festival_nemesis_fool_var value = scope:stop_host_scope } } - } - scope:rival_jester = { + else = { + progress_towards_nemesis_effect = { + REASON = rival_feast_of_fools + CHARACTER = root + OPINION = 0 + } + } if = { limit = { is_male = no } give_nickname = nick_monarch_of_fools @@ -6725,7 +6675,7 @@ cultural_festival.3070 = { } add_piety = minor_piety_loss cultural_festival.3070.bishop_angry_effect = yes - scope:visiting_liege = { trigger_event = { id = cultural_festival.3071 } } + scope:visiting_liege = { trigger_event = cultural_festival.3071 } stress_and_fulfillment_impact = { forgiving = minor_stress_impact_gain compassionate = minor_stress_impact_gain @@ -6752,7 +6702,6 @@ cultural_festival.3070 = { NOR = { has_relation_potential_rival = root has_relation_rival = root - has_relation_nemesis = root } } } @@ -6794,7 +6743,7 @@ cultural_festival.3070 = { } add_piety = minor_piety_loss #bishop doesn't really care that much since they're sinful - scope:visiting_liege = { trigger_event = { id = cultural_festival.3071 } } + scope:visiting_liege = { trigger_event = cultural_festival.3071 } stress_and_fulfillment_impact = { compassionate = medium_stress_impact_gain forgiving = medium_stress_impact_gain @@ -6829,9 +6778,9 @@ cultural_festival.3070 = { limit = { scope:visiting_liege = { is_ai = yes } } - set_relation_rival = { - target = scope:visiting_liege - reason = rival_feast_of_fools + set_relation_rival_effect = { + TARGET = scope:visiting_liege + REASON = rival_feast_of_fools } } every_held_county = { @@ -6845,7 +6794,7 @@ cultural_festival.3070 = { scope:visiting_liege = { save_scope_as = final_jester set_variable = im_the_jester_var - trigger_event = { id = cultural_festival.3071 } + trigger_event = cultural_festival.3071 } stress_and_fulfillment_impact = { compassionate = minor_stress_impact_gain @@ -7119,21 +7068,10 @@ cultural_festival.3071 = { character = scope:visiting_liege target = scope:stop_host_scope root = { - if = { - limit = { #if you're rivals but not nemesis become nemesis - has_relation_rival = scope:stop_host_scope - NOT = { has_relation_nemesis = scope:stop_host_scope} - } - set_relation_nemesis = { - target = scope:stop_host_scope - reason = rival_feast_of_fools - } - } - else = { - set_relation_rival = { - target = scope:stop_host_scope - reason = rival_feast_of_fools - } + progress_towards_nemesis_effect = { + REASON = rival_feast_of_fools + CHARACTER = scope:stop_host_scope + OPINION = 0 } } } @@ -7664,7 +7602,6 @@ cultural_festival.4100 = { #Your courtier made a cultural faux pas factor = 0 OR = { has_relation_rival = scope:inconsiderate_character_scope - has_relation_nemesis = scope:inconsiderate_character_scope short_term_gold < minor_gold_value } } @@ -8898,7 +8835,7 @@ cultural_festival.4300 = { #Vassal: Decide which gift to give } set_variable = { name = gifted_artifact - value = yes + value = root days = 1825 } set_owner = { @@ -8947,7 +8884,7 @@ cultural_festival.4300 = { #Vassal: Decide which gift to give } set_variable = { name = gifted_artifact - value = yes + value = root days = 1825 } set_owner = { @@ -9112,9 +9049,7 @@ cultural_festival.4301 = { #Liege: Get the gift from vassal and decide to keep i add = 100 OR = { has_relation_friend = scope:stop_host_scope - has_relation_best_friend = scope:stop_host_scope has_relation_lover = scope:stop_host_scope - has_relation_soulmate = scope:stop_host_scope } } modifier = { @@ -9153,10 +9088,7 @@ cultural_festival.4301 = { #Liege: Get the gift from vassal and decide to keep i } modifier = { add = 100 - OR = { - has_relation_rival = scope:stop_host_scope - has_relation_nemesis = scope:stop_host_scope - } + has_relation_rival = scope:stop_host_scope } modifier = { add = 20 @@ -9272,7 +9204,7 @@ cultural_festival.4302 = { #Liege: Pick the gift for Vassal, mirror of cultural_ } set_variable = { name = gifted_artifact - value = yes + value = root days = 1825 } set_owner = { @@ -9320,7 +9252,7 @@ cultural_festival.4302 = { #Liege: Pick the gift for Vassal, mirror of cultural_ } set_variable = { name = gifted_artifact - value = yes + value = root days = 1825 } set_owner = { @@ -9491,9 +9423,7 @@ cultural_festival.4303 = { #Vassal: Get the gift from liege, mirror of cultural_ add = 100 OR = { has_relation_friend = scope:stop_host_scope - has_relation_best_friend = scope:stop_host_scope has_relation_lover = scope:stop_host_scope - has_relation_soulmate = scope:stop_host_scope } } modifier = { @@ -9532,10 +9462,7 @@ cultural_festival.4303 = { #Vassal: Get the gift from liege, mirror of cultural_ } modifier = { add = 100 - OR = { - has_relation_rival = scope:stop_host_scope - has_relation_nemesis = scope:stop_host_scope - } + has_relation_rival = scope:stop_host_scope } modifier = { add = 20 diff --git a/events/activities/tour_activity/tour_travel_events.txt b/events/activities/tour_activity/tour_travel_events.txt index e21bebf6e..c54986bc9 100644 --- a/events/activities/tour_activity/tour_travel_events.txt +++ b/events/activities/tour_activity/tour_travel_events.txt @@ -105,7 +105,7 @@ tour_travel.1001 = { trigger = { is_location_valid_for_travel_event_on_land = yes faith_forbids_alcohol_trigger = no # It should make sense that there is a tavern in this county - root.location.county = { county_opinion <= -5 } + root.location.county = { popular_opinion <= -5 } } weight_multiplier = { @@ -113,7 +113,7 @@ tour_travel.1001 = { modifier = { factor = 2 root.location.county = { - county_opinion <= -5 + popular_opinion <= -5 NOT = { root = { knows_language_of_culture = prev.culture @@ -492,7 +492,7 @@ tour_travel.1003 = { has_activity_intent = justice_intent is_location_valid_for_travel_event_on_land = yes root.location.county = { - county_opinion <= -5 + popular_opinion <= -5 county_control <= 90 } } @@ -1231,7 +1231,7 @@ tour_travel.1007 = { is_location_valid_for_travel_event_on_land = yes root.location.barony = { county = { - development_level <= 5 + prosperity_level <= 5 } title_province = { OR = { # The location is somewhat remote @@ -1905,12 +1905,11 @@ scripted_trigger tour_travel_3130_valid_vassal = { scripted_trigger tour_travel_3130_valid_location = { OR = { - has_building_or_higher = hunting_grounds_01 + has_building_or_higher = manor_hunting_grounds_1 has_building_or_higher = royal_garden_01 - has_building_or_higher = regimental_grounds_01 - has_building_or_higher = caravanserai_01 - has_building_or_higher = watermills_01 - has_building_or_higher = windmills_01 + has_building_or_higher = royal_knights_hall_1 + province_has_district = market_district + has_building_or_higher = communal_mill_1 } } @@ -1924,9 +1923,9 @@ tour_travel.3130 = { trigger = { location = { OR = { - has_building_or_higher = hunting_grounds_01 + has_building_or_higher = manor_hunting_grounds_1 has_building_or_higher = royal_garden_01 - has_building_or_higher = regimental_grounds_01 + has_building_or_higher = royal_knights_hall_1 } } } @@ -1936,9 +1935,8 @@ tour_travel.3130 = { trigger = { location = { OR = { - has_building_or_higher = caravanserai_01 - has_building_or_higher = watermills_01 - has_building_or_higher = windmills_01 + province_has_district = market_district + has_building_or_higher = communal_mill_1 } } } diff --git a/events/artifacts/artifact_events.txt b/events/artifacts/artifact_events.txt index 7d5e13bd0..4604e3a11 100644 --- a/events/artifacts/artifact_events.txt +++ b/events/artifacts/artifact_events.txt @@ -70,6 +70,20 @@ artifact.0021 = { exists = scope:owner scope:owner = { is_alive = yes } } + if = { + limit = { + gdp_menagerie_artifact_has_active_story_trigger = { CHARACTER = scope:owner ARTIFACT = scope:this_artifact } + } + scope:owner = { + random_owned_story = { + limit = { + story_type = story_cycle_menagerie + var:artifact_type ?= scope:this_artifact + } + end_story = yes + } + } + } scope:owner = { send_interface_toast = { title = artifact.0021.t @@ -294,21 +308,20 @@ artifact.0031 = { else_if = { #this effect fires before the dynasty head change, but after the scope:old_owner death, so scope:old_owner can be still a dynast limit = { exists = var:banner_dynasty.dynast } if = { - limit = { - scope:old_owner != var:banner_dynasty.dynast - } + limit = { scope:old_owner != var:banner_dynasty.dynast } var:banner_dynasty.dynast = { save_scope_as = new_banner_owner } } else = { #hence this - scope:old_owner.house.house_head = { - save_scope_as = new_banner_owner - } + scope:old_owner.house.house_head ?= { save_scope_as = new_banner_owner } } - set_owner = { - target = scope:new_banner_owner - history = { - type = inherited - recipient = scope:new_banner_owner + if = { + limit = { exists = scope:new_banner_owner } # The dead dynast can have been the house head + set_owner = { + target = scope:new_banner_owner + history = { + type = inherited + recipient = scope:new_banner_owner + } } } } diff --git a/events/court_events/01_ep3_court_events_3.txt b/events/court_events/01_ep3_court_events_3.txt index 2b49c812f..281a431fa 100644 --- a/events/court_events/01_ep3_court_events_3.txt +++ b/events/court_events/01_ep3_court_events_3.txt @@ -1881,9 +1881,9 @@ court_events.3091 = { trigger = { scope:parent = { is_alive = yes } } - animation = jockey_victory + animation = jockey_victory # always horse } - animation = jockey_walk + animation = jockey_walk # always horse camera = camera_event_horse_right } right_portrait = { @@ -2254,7 +2254,7 @@ scripted_trigger court_3110_valid_vassal_trigger = { combined_building_level > root.capital_county.title_province.combined_building_level num_buildings > root.capital_county.title_province.num_buildings } - has_ongoing_construction = yes + has_ongoing_holding_construction = yes } OR = { has_trait = arrogant @@ -2310,7 +2310,7 @@ court_events.3110 = { } modifier = { capital_county.title_province = { - has_ongoing_construction = yes + has_ongoing_holding_construction = yes } add = 1 } @@ -3248,18 +3248,6 @@ court_events.3120 = { } } } - 10 = { - root = { - send_interface_toast = { - type = event_toast_effect_good - title = artifact_improved_tt - left_icon = scope:artifact - hidden_effect = { - scope:artifact = { add_artifact_modifier = artifact_domain_tax_mult_2_modifier } - } - } - } - } 20 = { trigger = { artifact_durability < define:NInventory|ARTIFACT_LOW_DURABILITY diff --git a/events/court_events/court_events_general.txt b/events/court_events/court_events_general.txt index 53d737c05..f21edfaf4 100644 --- a/events/court_events/court_events_general.txt +++ b/events/court_events/court_events_general.txt @@ -995,7 +995,7 @@ court.0109 = { option = { name = court.0109.d primary_title.title_capital_county = { - change_development_progress = medium_development_progress_gain + change_prosperity_progress = medium_prosperity_progress_gain } reverse_add_opinion = { target = scope:executioner @@ -1686,28 +1686,27 @@ court.2201 = { limit = { can_set_relation_rival_even_if_teen_trigger = { CHARACTER = root } } - set_relation_rival = { - target = root - reason = rival_parent_rivalry + set_relation_rival_effect = { + TARGET = root + REASON = rival_parent_rivalry } } if = { limit = { can_set_relation_nemesis_even_if_teen_trigger = { CHARACTER = scope:younger_heir } } - set_relation_nemesis = { - reason = nemesis_parent_rivalry - copy_reason = rival - target = scope:younger_heir + set_relation_nemesis_effect = { + TARGET = scope:younger_heir + REASON = nemesis_parent_rivalry } } else_if = { limit = { can_set_relation_rival_even_if_teen_trigger = { CHARACTER = scope:younger_heir } } - set_relation_rival = { - target = scope:younger_heir - reason = rival_inter_heir_rivalry + set_relation_rival_effect = { + TARGET = scope:younger_heir + REASON = rival_inter_heir_rivalry } } else = { @@ -1773,28 +1772,27 @@ court.2201 = { limit = { can_set_relation_rival_even_if_teen_trigger = { CHARACTER = root } } - set_relation_rival = { - target = root - reason = rival_parent_rivalry + set_relation_rival_effect = { + TARGET = root + REASON = rival_parent_rivalry } } if = { limit = { can_set_relation_nemesis_even_if_teen_trigger = { CHARACTER = scope:eldest_heir } } - set_relation_nemesis = { - reason = nemesis_parent_rivalry - copy_reason = rival - target = scope:eldest_heir + set_relation_nemesis_effect = { + TARGET = scope:eldest_heir + REASON = nemesis_parent_rivalry } } else_if = { limit = { can_set_relation_rival_even_if_teen_trigger = { CHARACTER = scope:eldest_heir } } - set_relation_rival = { - target = scope:eldest_heir - reason = rival_inter_heir_rivalry + set_relation_rival_effect = { + TARGET = scope:eldest_heir + REASON = rival_inter_heir_rivalry } } else = { @@ -2176,7 +2174,6 @@ scripted_trigger court_3010_inspired_work_courtier_trigger = { has_trait = blind has_relation_rival = root has_relation_potential_rival = root - has_relation_nemesis = root } learning >= 10 diplomacy >= 12 @@ -8524,7 +8521,10 @@ scripted_trigger court_8010_underequipped_trigger = { count = all artifact_slot_type = primary_armament OR = { - var:quality < 25 + AND = { + has_variable = quality + var:quality < 25 + } ep1_artifact_durability_lower_equal_percent_trigger = { PERCENT = 0.24 } # could be replaced by checking LOW_DURATION } } @@ -9735,7 +9735,7 @@ court.8040 = { } order_by = { value = 0 - subtract = development_level + subtract = prosperity_level } save_scope_as = worst_title } @@ -10941,21 +10941,21 @@ court.8140 = { name = { trigger = { #hunt OR = { - scope:vassal_2 = cp:councillor_marshal - scope:vassal_2 = court_position:master_of_hunt_court_position + cp:councillor_marshal ?= scope:vassal_2 + court_position:master_of_hunt_court_position ?= scope:vassal_2 } } text = court.8140.d.1 } name = { trigger = { #horse - scope:vassal_2 = court_position:master_of_horse_court_position + court_position:master_of_horse_court_position ?= scope:vassal_2 } text = court.8140.d.2 } name = { trigger = { #fresh air - scope:vassal_2 = court_position:court_physician_court_position + court_position:court_physician_court_position ?= scope:vassal_2 } text = court.8140.d.3 } @@ -10963,8 +10963,8 @@ court.8140 = { if = { #hunt limit = { OR = { - scope:vassal_2 = cp:councillor_marshal - scope:vassal_2 = court_position:master_of_hunt_court_position + cp:councillor_marshal ?= scope:vassal_2 + court_position:master_of_hunt_court_position ?= scope:vassal_2 } } custom_tooltip = court.8140.d.tt @@ -10975,7 +10975,7 @@ court.8140 = { } else_if = { limit = { - scope:vassal_2 = court_position:master_of_horse_court_position + court_position:master_of_horse_court_position ?= scope:vassal_2 } start_warhorse_story_cycle_effect = yes } @@ -11571,9 +11571,9 @@ court.8160 = { limit = { NOT = { has_relation_rival = scope:knight_1 } } - set_relation_rival = { - target = scope:knight_1 - reason = rival_age_old_rivalry + set_relation_rival_effect = { + TARGET = scope:knight_1 + REASON = rival_age_old_rivalry } } } @@ -11906,9 +11906,8 @@ scripted_trigger court_8170_criminal_trigger = { is_landed = no is_adult = yes is_illegal_criminal_trigger = yes - NOR = { + NOT = { has_relation_lover = root - has_relation_soulmate = root } } diff --git a/events/court_events/court_events_general_1.txt b/events/court_events/court_events_general_1.txt index 2cb267b8e..eedabc880 100644 --- a/events/court_events/court_events_general_1.txt +++ b/events/court_events/court_events_general_1.txt @@ -214,7 +214,6 @@ court_events.1000 = { scope:guest = { NOR = { has_relation_rival = scope:guest_2 - has_relation_nemesis = scope:guest_2 has_character_flag = created_character } } @@ -337,7 +336,7 @@ court_events.1000 = { reason = high_almoner add_piety = medium_piety_gain capital_county = { - change_development_level = 1 + change_prosperity_level = 1 } remove_short_term_gold = medium_gold_value stress_and_fulfillment_impact = { @@ -474,9 +473,7 @@ scripted_trigger court_events_1010_players_nobody_trigger = { NOR = { is_close_family_of = liege has_relation_lover = liege - has_relation_soulmate = liege has_relation_friend = liege - has_relation_best_friend = liege has_relation_guardian = liege has_relation_bully = liege has_relation_victim = liege @@ -500,9 +497,7 @@ scripted_trigger court_events_1010_ais_courtier_trigger = { NOR = { is_heir_of = liege has_relation_lover = liege - has_relation_soulmate = liege has_relation_friend = liege - has_relation_best_friend = liege has_relation_guardian = liege has_relation_bully = liege has_relation_victim = liege @@ -772,9 +767,9 @@ court_events.1010 = { } } } - set_relation_rival = { - target = scope:grander_ruler - reason = rival_stole_artifact + set_relation_rival_effect = { + TARGET = scope:grander_ruler + REASON = rival_stole_artifact } change_current_court_grandeur = 25 scope:grander_ruler = { change_current_court_grandeur = -15 } diff --git a/events/decisions_events/major_decisions_events.txt b/events/decisions_events/major_decisions_events.txt index 2e56f3e6f..6489e8cb1 100644 --- a/events/decisions_events/major_decisions_events.txt +++ b/events/decisions_events/major_decisions_events.txt @@ -265,7 +265,10 @@ major_decisions.0102 = { # Divine Blood if Temporal Head. triggered_desc = { trigger = { - scope:scoped_ruler.faith.religious_head = scope:scoped_ruler + OR = { + scope:scoped_ruler.faith.religious_head = scope:scoped_ruler + scope:scoped_ruler.faith = { has_doctrine = doctrine_no_head } + } } desc = major_decisions.0102.desc.temporal } @@ -309,7 +312,10 @@ major_decisions.0103 = { # Divine Blood if Temporal Head. triggered_desc = { trigger = { - scope:scoped_ruler.faith.religious_head = scope:scoped_ruler + OR = { + scope:scoped_ruler.faith.religious_head = scope:scoped_ruler + scope:scoped_ruler.faith = { has_doctrine = doctrine_no_head } + } } desc = major_decisions.0103.desc.temporal } @@ -991,12 +997,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_fes } title:b_fes = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_fes.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1021,12 +1027,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_cairo } title:b_cairo = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_cairo.title_province = { - add_special_building_slot = al_azhar_university + add_special_district_slot = al_azhar_university_district set_variable = { #To unlock the building name = university value = yes @@ -1051,12 +1057,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_bologna } title:b_bologna = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_bologna.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1081,12 +1087,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_salamanca } title:b_salamanca = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_salamanca.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1111,12 +1117,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_madrid } title:b_madrid = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_madrid.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1141,12 +1147,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_oxford } title:b_oxford = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_oxford.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1171,12 +1177,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_cambridge } title:b_cambridge = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_cambridge.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1201,12 +1207,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_padua } title:b_padua = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_padua.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1231,12 +1237,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_siena } title:b_siena = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_siena.title_province = { - add_special_building_slot = siena_university + add_special_district_slot = siena_university_district set_variable = { #To unlock the building name = university value = yes @@ -1261,12 +1267,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_coimbra } title:b_coimbra = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_coimbra.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1291,12 +1297,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_napoli } title:b_napoli = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_napoli.title_province = { - add_special_building_slot = generic_university + add_special_district_slot = generic_university_district set_variable = { #To unlock the building name = university value = yes @@ -1321,12 +1327,12 @@ major_decisions.2001 = { trigger = { any_sub_realm_barony = { this = title:b_tirakka } title:b_tirakka = { - county = { development_level >= 30 } + county = { prosperity_level >= 30 } title_province = { has_special_building_slot = no } } } title:b_tirakka.title_province = { - add_special_building_slot = sankore_university + add_special_district_slot = sankore_university_district set_variable = { #To unlock the building name = university value = yes @@ -1347,7 +1353,7 @@ major_decisions.2001 = { name = major_decisions.2001.b_tirakka } - option = { # fallback in case development somehow tumbles + option = { # fallback in case prosperity somehow tumbles trigger = { always = no } fallback = yes name = major_decisions.2001.fallback diff --git a/events/decisions_events/mpo_greatest_of_khans_events.txt b/events/decisions_events/mpo_greatest_of_khans_events.txt index e4e20edd7..a31b96f91 100644 --- a/events/decisions_events/mpo_greatest_of_khans_events.txt +++ b/events/decisions_events/mpo_greatest_of_khans_events.txt @@ -1,2823 +1,2825 @@ - -namespace = mpo_greatest_of_khans +# NEOW 2555: all historical Greatest of Khans events disabled. +## NEOW 2555: Medieval Greatest-of-Khans / Mongol conquest narrative (original source retained as comments). +##namespace = mpo_greatest_of_khans -################ -# Become Greatest of Khans events -#Jason Cantalini -#Out of order so that event numbering can still mirror central_asia_events that provide base game Great Khan content (sorry) -#Hidden war of defiance setup event -mpo_greatest_of_khans.0100 = { - hidden = yes - immediate = { - #Remove primary defender truces with root AND START WAR! - scope:primary_coalition_defender = { - if = { - limit = { - OR = { - any_truce_holder = { - this = root - } - any_truce_target = { - this = root - } - } - } - cancel_truce_both_ways = root - } - if = { - limit = { - is_vassal_or_below_of = root - } - create_title_and_vassal_change = { - type = independency - save_scope_as = change - } - becomes_independent = { change = scope:change } - resolve_title_and_vassal_change = scope:change - } - #BEGIN THE WAR! - start_war = { - cb = mpo_great_war_of_defiance_cb - target = root - target_title = root.primary_title - } - random_character_war = { - limit = { - using_cb = mpo_great_war_of_defiance_cb - } - every_in_list = { - list = anti_gok_coalition_members - limit = { - NOR = { - is_defender_in_war = prev - is_attacker_in_war = prev - } - } - prev = { - add_attacker = prev - } - } - } - random_character_war = { - limit = { - using_cb = mpo_great_war_of_defiance_cb - } - every_in_list = { - list = obedient_nomad_vassals - limit = { - NOR = { - is_defender_in_war = prev - is_attacker_in_war = prev - } - } - prev = { - add_defender = prev - } - } - } - } - #End all the other wars characters are involved in - every_in_list = { - list = anti_gok_coalition_members - every_character_war = { - limit = { - NOR = { - using_cb = mpo_great_war_of_defiance_cb -# using_cb = crusading_claim_cb - AND = { - primary_defender = prev - NOT = { - using_cb = peasant_war - } - } - primary_defender = { - is_ai = no - } - } - } - if = { - limit = { - primary_attacker = prev - } - end_war = white_peace - } - else = { - remove_participant = prev - } - } - } - every_in_list = { - list = obedient_nomad_vassals - every_character_war = { - limit = { - NOR = { - using_cb = mpo_great_war_of_defiance_cb -# using_cb = crusading_claim_cb - AND = { - primary_defender = prev - NOT = { - using_cb = peasant_war - } - } - primary_defender = { - is_ai = no - } - } - } - if = { - limit = { - primary_attacker = prev - } - end_war = white_peace - } - else = { - remove_participant = prev - } - } - } - #Add global_variable that prevents anyone taking decision - if = { - limit = { - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - } - set_global_variable = { - name = mpo_gok_war_ongoing - value = root - } - } - random_character_war = { - limit = { - using_cb = mpo_great_war_of_defiance_cb - } - save_scope_as = gok_war - } - if = { - limit = { - OR = { - has_relation_potential_rival = scope:primary_coalition_defender - scope:primary_coalition_defender = { - opinion = { - target = root - value < -40 - } - } - } - } - set_relation_rival = { - target = scope:primary_coalition_defender - reason = rival_led_coalition_against_me - } - } - #Memory for Gurkhan - create_character_memory = { - type = gok_called_the_clans - } - - #trigger event for gurkhan - obedient vassals pledge to fight - if = { - limit = { - any_in_list = { - list = obedient_nomad_vassals - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - } - } - trigger_event = { - id = mpo_greatest_of_khans.0101 - days = 1 - } - } - else = { - #add submitters as tributaries since root is getting no event - every_in_list = { - list = gok_submitters - start_tributary_interaction_effect = { - TRIBUTARY = this - SUZERAIN = root - } - } - save_scope_as = gurkhan_to_gok - #Player notification and offer to join/submit event - every_player = { - limit = { - mpo_war_of_defiance_notified_player_trigger = yes - } - trigger_event = { - id = mpo_greatest_of_khans.0102 - days = 2 - } - } - } - } -} - -scripted_trigger mpo_greatest_of_khans_0101_ideal_vassal_trigger = { - is_adult = yes - is_imprisoned = no - has_contagious_deadly_disease_trigger = no - can_be_knight_trigger = { ARMY_OWNER = root } -} - -scripted_trigger mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = { - NOR = { - is_obedient_to = root - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - is_at_war_with = root - has_relation_rival = root - is_imprisoned = yes - } - government_has_flag = government_is_nomadic - basic_is_available_ai = yes - is_adult = yes -} - -#You are the Gurkhan and now fighting to be GoK -mpo_greatest_of_khans.0101 = { - type = character_event - title = mpo_greatest_of_khans.0101.t - desc = { - desc = mpo_greatest_of_khans.0101.desc_intro - first_valid = { - triggered_desc = { - trigger = { - exists = scope:gok_opponent - NOT = { - scope:primary_coalition_defender = { - this = scope:gok_opponent - } - } - } - desc = mpo_greatest_of_khans.0101.desc_gok_opponent - } - desc = mpo_greatest_of_khans.0101.desc_primary_attacker - } - triggered_desc = { - trigger = { - exists = scope:big_sub - } - desc = mpo_greatest_of_khans.0101.desc_sub - } - desc = mpo_greatest_of_khans.0101.desc - } - theme = nomads - left_portrait = { - character = scope:vassal_1 - animation = horse_sword_shield - camera = camera_event_horse_left_forward - - } - right_portrait = { - character = scope:vassal_2 - animation = jockey_gallop - camera = camera_event_horse_right_forward - } - lower_left_portrait = scope:potential_joiner_1 - lower_center_portrait = scope:potential_joiner_2 - lower_right_portrait = scope:potential_joiner_3 - override_background = { reference = wilderness } - override_effect_2d = { - reference = rain - } - - trigger = { - is_at_war = yes - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - any_in_list = { - list = obedient_nomad_vassals - age >= 10 - is_imprisoned = no - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - } - } - - immediate = { - #add submitters as tributaries - if = { - limit = { - list_size = { - name = gok_submitters - value <= 4 - } - } - every_in_list = { - list = gok_submitters - custom_tooltip = became_your_tributary_tt - add_opinion = { - target = root - modifier = obedience_opinion - years = 10 - } - hidden_effect = { - start_tributary_interaction_effect = { - TRIBUTARY = this - SUZERAIN = root - } - } - } - } - #vague tooltip if too many to show - else = { - custom_tooltip = gok_submitters_became_tributaries_tt - hidden_effect = { - every_in_list = { - list = gok_submitters - custom_tooltip = became_your_tributary_tt - add_opinion = { - target = root - modifier = obedience_opinion - years = 10 - } - start_tributary_interaction_effect = { - TRIBUTARY = this - SUZERAIN = root - } - } - } - } - - if = { - limit = { - any_in_list = { - list = gok_submitters - } - } - ordered_in_list = { - list = gok_submitters - order_by = current_military_strength - save_scope_as = big_sub - } - } - if = { - limit = { - any_in_list = { - list = obedient_nomad_vassals - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes - } - } - ordered_in_list = { - list = obedient_nomad_vassals - order_by = current_military_strength - limit = { - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes - } - save_scope_as = vassal_1 - } - } - else = { - ordered_in_list = { - list = obedient_nomad_vassals - order_by = current_military_strength - limit = { - is_adult = yes - is_imprisoned = no - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - } - save_scope_as = vassal_1 - } - } - if = { - limit = { - any_in_list = { - list = obedient_nomad_vassals - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes - NOT = { this = scope:vassal_1 } - } - } - ordered_in_list = { - list = obedient_nomad_vassals - order_by = current_military_strength - limit = { - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes - NOT = { this = scope:vassal_1 } - } - save_scope_as = vassal_2 - } - } - else = { - ordered_in_list = { - list = obedient_nomad_vassals - order_by = current_military_strength - limit = { - age >= 10 - is_imprisoned = no - any_character_war = { - using_cb = mpo_great_war_of_defiance_cb - } - NOT = { this = scope:vassal_1 } - } - save_scope_as = vassal_2 - } - } - scope:vassal_1 = { - add_character_flag = need_military_outfit - } - scope:vassal_2 ?= { - add_character_flag = need_military_outfit - } - #Potential additional joiners - ordered_vassal = { - order_by = current_military_strength - limit = { - mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = yes - } - save_scope_as = potential_joiner_1 - add_to_list = potential_joiners - } - #Potential additional joiners - ordered_vassal = { - order_by = current_military_strength - limit = { - mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = yes - NOT = { - this = scope:potential_joiner_1 - } - } - save_scope_as = potential_joiner_2 - add_to_list = potential_joiners - } - #Potential additional joiners - ordered_vassal = { - order_by = current_military_strength - limit = { - mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = yes - NOR = { - this = scope:potential_joiner_1 - this = scope:potential_joiner_2 - } - } - save_scope_as = potential_joiner_3 - add_to_list = potential_joiners - } - } - - #Entreat even more help from other vassals - option = { - name = mpo_greatest_of_khans.0101.a - flavor = mpo_greatest_of_khans.0101.a.flavor - trigger = { - exists = scope:potential_joiner_1 - exists = dynasty - } - #Will pay renown to get aid - if = { - limit = { - is_ai = no - #Combined title tiers of joiners to roughly judge their strength - potential_joiner_combined_value >= 13 - } - dynasty = { - add_dynasty_prestige = monumental_dynasty_prestige_loss - } - } - else_if = { - limit = { - potential_joiner_combined_value >= 7 - is_ai = no - } - dynasty = { - add_dynasty_prestige = massive_dynasty_prestige_loss - } - } - else_if = { - limit = { - is_ai = no - } - dynasty = { - add_dynasty_prestige = major_dynasty_prestige_loss - } - } - else = { - #Lower loss for AI because they can't make smart judgements like players and will always take this - dynasty = { - add_dynasty_prestige = medium_dynasty_prestige_loss - } - } - - scope:gok_war = { - every_in_list = { - list = potential_joiners - limit = { - NOR = { - is_defender_in_war = prev - is_attacker_in_war = prev - } - } - prev = { - add_defender = prev - } - } - } - hidden_effect = { - every_in_list = { - list = potential_joiners - every_character_war = { - limit = { - NOR = { - using_cb = mpo_great_war_of_defiance_cb -# using_cb = crusading_claim_cb - AND = { - primary_defender = prev - NOT = { - using_cb = peasant_war - } - } - primary_defender = { - is_ai = no - } - } - } - if = { - limit = { - primary_attacker = prev - } - end_war = white_peace - } - else = { - remove_participant = prev - } - } - } - } - custom_tooltip = gok_joiners_wars_cancelled_tt - if = { - limit = { - is_ai = no - } - stress_and_fulfillment_impact = { - arrogant = major_stress_impact_gain - brave = major_stress_impact_gain - ambitious = major_stress_impact_gain - } - } - ai_chance = { - base = 1000 - } - } - #Refuse their aid for the swag - option = { - name = mpo_greatest_of_khans.0101.b - flavor = mpo_greatest_of_khans.0101.b.flavor - - custom_tooltip = gok_obedient_vassals_leave_war_tt - hidden_effect = { - every_in_list = { - list = obedient_nomad_vassals - limit = { - NOT = { - this = root - } - } - scope:gok_war = { - remove_participant = prev - } - } - } - custom_tooltip = gok_fights_alone_reward_on_victory_tt - set_variable = { - name = fought_for_gok_alone - value = gok_obedient_vassals_strength_value - } - stress_and_fulfillment_impact = { - humble = medium_stress_impact_gain - craven = major_stress_impact_gain - } - #The AI should be as scary as possible - ai_chance = { - base = 0 - } - } - #Just accept their aid - option = { - name = mpo_greatest_of_khans.0101.c - - #AI should take first option if they have it - ai_chance = { - base = 100 - modifier = { - exists = scope:potential_joiner_1 - exists = dynasty - factor = 0 - } - } - } - after = { - scope:vassal_1 = { - remove_character_flag = need_military_outfit - } - scope:vassal_2 ?= { - remove_character_flag = need_military_outfit - } - save_scope_as = gurkhan_to_gok - #Player notification and offer to join/submit event - every_player = { - limit = { - mpo_war_of_defiance_notified_player_trigger = yes - } - trigger_event = { - id = mpo_greatest_of_khans.0102 - days = 2 - } - } - } -} - -#Someone is trying to become GoK! Stop them! -mpo_greatest_of_khans.0102 = { - type = character_event - title = mpo_greatest_of_khans.0102.t - desc = mpo_greatest_of_khans.0102.desc - theme = nomads - left_portrait = { - character = scope:gurkhan_to_gok - animation = horse_archer_aggressive - camera = camera_event_horse_left_forward - } - right_portrait = { - character = scope:knight - animation = horse_archer_aggressive - camera = camera_event_horse_right_facing_left - hide_info = yes - } - lower_right_portrait = scope:primary_coalition_defender - override_background = { - trigger = { - NOT = { - government_has_flag = government_is_nomadic - } - } - reference = burning_building - } - override_background = { - trigger = { - government_has_flag = government_is_nomadic - } - reference = mpo_steppe_evening - } - override_effect_2d = { - reference = smoke - } - - immediate = { - scope:gurkhan_to_gok = { - add_character_flag = need_military_outfit - custom_tooltip = gok_took_become_gok_decision_tt - custom_tooltip = gok_began_war_of_defiance_tt - custom_tooltip = gok_gurkhan_declared_intent_tt - custom_tooltip = gok_warning_one_off_tt - } - scope:gurkhan_to_gok = { - ordered_knight = { - order_by = prowess - limit = { - is_imprisoned = no - NOT = { - this = root - } - } - save_scope_as = knight - add_character_flag = need_military_outfit - } - - } - } - #Join war to aid Gurkhan! - option = { - trigger = { - OR = { - is_vassal_or_below_of = scope:gurkhan_to_gok - is_tributary_of_suzerain_or_above = scope:gurkhan_to_gok - is_allied_to = scope:gurkhan_to_gok - dynasty ?= { - any_dynasty_member = { - this = scope:gurkhan_to_gok - } - } - has_relation_soulmate = scope:gurkhan_to_gok - has_relation_friend = scope:gurkhan_to_gok - any_spouse = { - this = scope:gurkhan_to_gok - } - } - NOR = { - is_at_war_with = scope:gurkhan_to_gok - has_relation_rival = scope:gurkhan_to_gok - } - } - name = mpo_greatest_of_khans.0102.a - add_internal_flag = dangerous - scope:gok_war = { - add_defender = root - } - #Makes Gurkhan like you - reverse_add_opinion = { - modifier = pleased_opinion - target = scope:gurkhan_to_gok - opinion = 40 - } - stress_and_fulfillment_impact = { - craven = medium_stress_impact_gain - } - } - #Join war against Gurkhan! - option = { - trigger = { - NOR = { - is_at_war_with = scope:gurkhan_to_gok - is_at_war_with = scope:primary_coalition_defender - is_imprisoned_by = scope:gurkhan_to_gok - } - } - name = mpo_greatest_of_khans.0102.b - add_internal_flag = dangerous - scope:gok_war = { - add_attacker = root - } - reverse_add_opinion = { - modifier = pleased_opinion - target = scope:primary_coalition_defender - opinion = 20 - } - #This is a crime if you're his vassal! - if = { - limit = { - is_vassal_or_below_of = scope:gurkhan_to_gok - } - #Makes Gurkhan hate you - reverse_add_opinion = { - modifier = coup_plotter_opinion - target = scope:gurkhan_to_gok - opinion = -100 - } - } - else_if = { - limit = { - is_allied_to = scope:gurkhan_to_gok - } - reverse_add_opinion = { - modifier = betrayal_opinion - target = scope:gurkhan_to_gok - opinion = -100 - } - break_alliance = scope:gurkhan_to_gok - - } - else = { - reverse_add_opinion = { - modifier = hate_opinion - target = scope:gurkhan_to_gok - opinion = -40 - } - } - stress_and_fulfillment_impact = { - craven = medium_stress_impact_gain - } - } - #I will submit as a tributary - option = { - trigger = { - is_independent_ruler = yes - is_tributary = no - NOT = { - is_at_war_with = scope:gurkhan_to_gok - } - } - name = mpo_greatest_of_khans.0102.c - start_tributary_interaction_effect = { - TRIBUTARY = root - SUZERAIN = scope:gurkhan_to_gok - } - reverse_add_opinion = { - modifier = pleased_opinion - target = scope:gurkhan_to_gok - opinion = 10 - } - stress_and_fulfillment_impact = { - brave = medium_stress_impact_gain - arrogant = major_stress_impact_gain - } - } - #I will submit as a vassal - option = { - trigger = { - is_independent_ruler = yes - NOR = { - is_at_war_with = scope:gurkhan_to_gok - is_vassal_or_below_of = scope:gurkhan_to_gok - AND = { - is_tributary = yes - NOT = { - is_tributary_of_suzerain_or_above = scope:gurkhan_to_gok - } - } - } - #is roughly the gurkhan's neighbor - OR = { - scope:gurkhan_to_gok = { - any_land_neighboring_realm_with_tributaries_owner = { - this = root - } - } - root = { - any_land_neighboring_realm_with_tributaries_owner = { - this = scope:gurkhan_to_gok - } - } - } - - } - name = mpo_greatest_of_khans.0102.d - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = change - } - change_liege = { - liege = scope:gurkhan_to_gok - change = scope:change - } - resolve_title_and_vassal_change = scope:change - - reverse_add_opinion = { - modifier = pleased_opinion - target = scope:gurkhan_to_gok - opinion = 30 - } - - stress_and_fulfillment_impact = { - brave = medium_stress_impact_gain - arrogant = major_stress_impact_gain - } - } - #Uh... well that's ominous - option = { - name = mpo_greatest_of_khans.0102.e - } - - after = { - scope:gurkhan_to_gok = { - remove_character_flag = need_military_outfit - } - scope:knight = { - remove_character_flag = need_military_outfit - } - } -} - -#The Gurkhan lost the war. Hah. Loser. -mpo_greatest_of_khans.0103 = { - type = character_event - title = mpo_greatest_of_khans.0103.t - desc = { - first_valid = { - triggered_desc = { - trigger = { - root = scope:defender - } - desc = mpo_greatest_of_khans.0103.desc_defender_intro - } - desc = mpo_greatest_of_khans.0103.desc_intro - } - first_valid = { - triggered_desc = { - trigger = { - root = scope:defender - } - desc = mpo_greatest_of_khans.0103.desc_defender - } - triggered_desc = { - trigger = { - root = scope:attacker - } - desc = mpo_greatest_of_khans.0103.desc_attacker - } - triggered_desc = { - trigger = { - root = { - is_in_list = anti_gok_defenders - } - } - desc = mpo_greatest_of_khans.0103.desc_defenders - } - triggered_desc = { - trigger = { - root = { - is_in_list = anti_gok_attackers - } - } - desc = mpo_greatest_of_khans.0103.desc_attackers - } - desc = mpo_greatest_of_khans.0103.desc - } - } - theme = nomads - left_portrait = { - character = scope:defender - animation = prisonhouse - camera = camera_event_left_forward - override_imprisonment_visuals = yes - outfit_tags = { beggar_rags } - } - right_portrait = { - character = scope:knight - animation = menacing - hide_info = yes - } - lower_right_portrait = scope:attacker - override_background = { - reference = wilderness_scope - } - override_effect_2d = { - reference = flies - } - - immediate = { - scope:attacker = { - capital_province = { save_scope_as = background_wilderness_scope } - ordered_knight = { - order_by = prowess - limit = { - is_imprisoned = no - NOR = { - this = root - this = scope:defender - } - } - save_scope_as = knight - add_character_flag = need_military_outfit - } - } - } - option = { - name = mpo_greatest_of_khans.0103.a - } -} - -scripted_trigger mpo_greatest_of_khans_0002_confederation_trigger = { - is_confederation_member = yes - #Prev be with you - NOR = { - has_relation_rival = prev - is_at_war_with = prev - is_causing_raid_hostility_towards = prev - prev = { - is_causing_raid_hostility_towards = prev - } - opinion = { - target = prev - value <= -50 - } - reverse_opinion = { - target = prev - value <= -50 - } - } -} - -#I became Greatest of Khans -mpo_greatest_of_khans.0001 = { - type = character_event - window = fullscreen_event - queue_icon = "gfx/interface/icons/situation_types/the_great_steppe.dds" - title = mpo_greatest_of_khans.0001.t - desc = mpo_greatest_of_khans.0001.desc - theme = nomads - left_portrait = { - character = root - animation = personality_vengeful - } - override_background = { reference = mpo_fullscreen_greatest_of_khans } - - immediate = { - save_scope_as = genghis_khan - - play_music_cue = mx_cue_conquest_of_the_golden_horde - - add_trait = greatest_of_khans - if = { - limit = { - prestige_level < 5 - } - add_prestige_level = 1 - } - legend_seed_new_title_effect = yes - form_the_greatest_khan_empire_effect = yes - - create_story = story_greatest_of_khans - save_scope_value_as = { - name = gok_empire_crumble_date - value = { - value = current_year - add = 75 - } - } - #Add dynasty prestige if you chose to fight this without vassals' aid - if = { - limit = { - has_variable = fought_for_gok_alone - exists = dynasty - } - dynasty = { - add_dynasty_prestige = fought_gok_alone_value - } - } - mpo_add_golden_lineage_effect = yes - } - - option = { - name = mpo_greatest_of_khans.0001.a - custom_tooltip = greatest_of_khans_prevents_mongol_invasion_tt - custom_tooltip = gok_enable_offer_submission_or_ruin_tt - custom_tooltip = become_greatest_of_khans_decision_enable_gok_invasion_cb - add_to_global_variable_list = { - name = unavailable_unique_decisions - target = flag:mpo_become_greatest_of_khans_decision - } - custom_tooltip = gok_protected_from_chaotic_succession_tt - custom_tooltip = gok_time_limit_end_decision_tt - } - after = { - #You pick a nickname - trigger_event = mpo_greatest_of_khans.0003 - } -} - -#Someone became Greatest of Khans -mpo_greatest_of_khans.0002 = { - type = character_event - window = fullscreen_event - queue_icon = "gfx/interface/icons/situation_types/the_great_steppe.dds" - title = mongol_invasion.1002.t - desc = { - first_valid = { - triggered_desc = { - trigger = { - OR = { - any_realm_province = { - OR = { - geographical_region = special_mongol_empire_start_region - geographical_region = special_mongol_empire_conquest_region_prio_1 - geographical_region = special_mongol_empire_conquest_region_prio_1_alpha - } - } - NOT = { - government_has_flag = government_is_nomadic - } - } - } - desc = { - desc = mongol_invasion.1002.desc.close - first_valid = { - triggered_desc = { - trigger = { - any_realm_province = { - geographical_region = special_mongol_empire_start_region - } - } - desc = mongol_invasion.1002.desc.close_mongolia - } - desc = mongol_invasion.1002.desc.close_steppes - } - desc = mongol_invasion.1002.desc.close.mid - #Great Khan or Genghis? - first_valid = { - triggered_desc = { - trigger = { - exists = scope:temujin - } - desc = mongol_invasion.1002.desc.genghis - } - desc = mongol_invasion.1002.desc.gok - } - desc = mongol_invasion.1002.desc.close.end - } - } - desc = mongol_invasion.1002.desc.far_intro - first_valid = { - triggered_desc = { - trigger = { - exists = scope:temujin - root = scope:temujin - } - desc = mongol_invasion.1002.desc.genghis - } - desc = mongol_invasion.1002.desc.gok - } - desc = mongol_invasion.1002.desc.far - } - } - theme = nomads - left_portrait = { - character = scope:genghis_khan - animation = personality_vengeful - } - override_background = { reference = mpo_fullscreen_greatest_of_khans } - - immediate = { - play_music_cue = mx_cue_conquest_of_the_golden_horde - show_as_tooltip = { - scope:genghis_khan = { - add_trait_force_tooltip = greatest_of_khans - form_the_greatest_khan_empire_effect = yes - custom_tooltip = gok_threatening_powers_tt - custom_tooltip = mongol_invasion.1002.genghis_khan_tt - custom_tooltip = gok_time_limit_end_decision_other_players_tt - mpo_add_golden_lineage_effect = yes - } - if = { - limit = { - OR = { - government_has_flag = government_is_nomadic - has_trait = nomadic_philosophy - } - } - custom_tooltip = become_gok_decision_now_unavailable_tt - } - } - - #Save confederation if there is one - if = { - limit = { - any_land_neighboring_realm_with_tributaries_owner = { - mpo_greatest_of_khans_0002_confederation_trigger = yes - save_temporary_scope_as = confed_buddy - } - valid_confederation_member_trigger = { CHARACTER = scope:confed_buddy } - is_at_war = no - } - ordered_land_neighboring_realm_with_tributaries_owner = { - order_by = current_military_strength - limit = { - mpo_greatest_of_khans_0002_confederation_trigger = yes - } - save_scope_as = confederation_neighbor - confederation = { - save_scope_as = confederation - } - } - } - } - #Submit to the Great Khan if you're already their tributary anyway - option = { - trigger = { - NOR = { - is_vassal_or_below_of = scope:genghis_khan - is_at_war_with = scope:genghis_khan - } - is_tributary_of_suzerain_or_above = scope:genghis_khan - } - name = mpo_greatest_of_khans.0002.a - #tributary of great khan's vassal or below - if = { - limit = { - is_tributary_of_suzerain_or_above = scope:genghis_khan - suzerain = { - highest_held_title_tier > root.highest_held_title_tier - } - } - suzerain = { - save_scope_as = new_liege - } - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = change - } - change_liege = { - liege = scope:new_liege - change = scope:change - } - resolve_title_and_vassal_change = scope:change - } - else = { - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = change - } - change_liege = { - liege = scope:genghis_khan - change = scope:change - } - resolve_title_and_vassal_change = scope:change - } - - stress_and_fulfillment_impact = { - brave = minor_stress_impact_gain - stubborn = minor_stress_impact_gain - } - ai_chance = { - base = 200 - ai_value_modifier = { - ai_boldness = 1 - } - modifier = { - has_trait = ambitious - add = -20 - } - modifier = { - has_dread_level_towards = { - target = scope:genghis_khan - level >= 1 - } - add = 100 - } - modifier = { - has_dread_level_towards = { - target = scope:genghis_khan - level >= 2 - } - add = 200 - } - modifier = { - government_has_flag = government_is_herder - add = 1000 - } - modifier = { - add = 50 - opinion = { - target = scope:genghis_khan - value >= 50 - } - } - modifier = { - add = 50 - opinion = { - target = scope:genghis_khan - value >= 75 - } - } - modifier = { - add = -50 - opinion = { - target = scope:genghis_khan - value <= -50 - } - } - modifier = { - add = -50 - opinion = { - target = scope:genghis_khan - value <= -75 - } - } - } - } - #Join a confederation that's next to me - option = { - trigger = { - exists = scope:confederation - } - name = mpo_greatest_of_khans.0002.b - scope:confederation = { add_confederation_member = root } - scope:confederation_neighbor = { - if = { - limit = { - is_at_war = yes - } - every_character_war = { - limit = { - primary_defender = { - is_member_of_confederation = scope:confederation - } - } - add_defender = root - } - } - } - if = { - limit = { - government_has_flag = government_is_nomadic - } - add_character_modifier = { - modifier = mpo_confederation_member_modifier - years = 5 - } - capital_county ?= { - change_county_fertility = major_county_fertility_level_gain - } - } - stress_and_fulfillment_impact = { - ambitious = minor_stress_impact_gain - } - ai_chance = { - base = 100 - modifier = { - add = 50 - opinion = { - target = scope:confederation_neighbor - value > 50 - } - } - modifier = { - add = 50 - opinion = { - target = scope:confederation_neighbor - value > 0 - } - } - modifier = { - add = -50 - opinion = { - target = scope:confederation_neighbor - value < -25 - } - } - modifier = { - add = -50 - opinion = { - target = scope:confederation_neighbor - value < -75 - } - } - modifier = { - has_trait = ambitious - add = -50 - } - } - } - #Cry (unless you are vassal of the Khan!) - option = { - name = { - trigger = { - NOT = { - government_has_flag = government_is_nomadic - } - } - text = mongol_invasion.1002.b - } - name = { - trigger = { - government_has_flag = government_is_nomadic - } - text = mongol_invasion.1002.a - } - - ai_chance = { - base = 100 - ai_value_modifier = { - ai_boldness = 1 - ai_honor = -0.5 - } - } - } -} - -#Greatest of Khans picks nickname -mpo_greatest_of_khans.0003 = { - type = character_event - title = mpo_greatest_of_khans.0003.t - desc = mpo_greatest_of_khans.0003.desc - theme = nomads - left_portrait = { - character = root - animation = standing_horse - camera = camera_event_standing_with_horse_left - } - override_background = { - reference = mpo_temple_steppe - } - override_effect_2d = { - reference = legend_glow - } - option = { - trigger = { - NOT = { - culture = { - has_cultural_pillar = language_turkic - } - } - } - name = mpo_greatest_of_khans.0003.a - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_genghis_khan - ai_chance = { - base = 50 - modifier = { - factor = 0 - NOT = { - culture = { - has_cultural_pillar = language_mongolic - } - } - } -# modifier = { -# factor = 100 -# this = character:125501 -# } - } - } - option = { - trigger = { - culture = { - has_cultural_pillar = language_turkic - } - } - name = mpo_greatest_of_khans.0003.b - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_cengiz_khan - ai_chance = { - base = 50 - } - } - option = { - trigger = { - culture = { - has_cultural_pillar = language_mongolic - } - } - name = mpo_greatest_of_khans.0003.c - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_yekhe_khagan - ai_chance = { - base = 50 - } - } - option = { - trigger = { - culture = { - has_cultural_pillar = language_turkic - } - } - name = mpo_greatest_of_khans.0003.d - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_dort_yonlug_khagan - ai_chance = { - base = 50 - } - } - option = { - trigger = { - NOR = { - OR = { faith.religion = religion:eastern_orthodox_religion faith.religion = religion:oriental_orthodox_religion faith.religion = religion:catholic_religion faith.religion = religion:protestant_religion } - faith.religion = religion:islam_religion - } - } - name = mpo_greatest_of_khans.0003.e - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_tengri_khagan - ai_chance = { - base = 50 - modifier = { - add = -45 - NOT = { - faith.religion = religion:tengrism_religion - } - } - } - } - option = { - trigger = { - OR = { - faith = faith:nestorian - faith.religion = faith:manichaean_faith.religion - } - } - name = mpo_greatest_of_khans.0003.f - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_xormuzta - ai_chance = { - base = 100 - } - } - option = { - trigger = { - faith.religion = religion:islam_religion - capital_province ?= { - OR = { - geographical_region = world_middle_east - geographical_region = world_asia_minor - geographical_region = world_steppe_tarim - geographical_region = world_steppe_central - } - } - current_date >= 1250 - } - name = mpo_greatest_of_khans.0003.g - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_cihangir - ai_chance = { - base = 100 - } - } - option = { - trigger = { - faith = faith:nestorian - } - name = mpo_greatest_of_khans.0003.h - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_mar_sargis - ai_chance = { - base = 100 - } - } - option = { - trigger = { - culture = { - OR = { - has_cultural_pillar = language_iranian - has_cultural_pillar = language_scythian - } - } - } - name = mpo_greatest_of_khans.0003.i - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_akhshunwar - ai_chance = { - base = 100 - } - } - option = { - name = mpo_greatest_of_khans.0003.j - if = { - limit = { has_any_nickname = yes } - remove_nickname = yes - } - give_nickname = nick_culture_khagan - ai_chance = { - base = 10 - } - } - option = { - name = mpo_greatest_of_khans.0003.k - ai_chance = { - base = 0 - } - } - after = { - #notification events go to other rulers - - add_to_temporary_list = received_notification - every_vassal_or_below = { - limit = { - is_ai = no - } - trigger_event = { - id = mpo_greatest_of_khans.0002 #Someone has become Genghis Khan - days = 1 - } - add_to_temporary_list = received_notification - } - every_ruler = { - limit = { - NOT = { - is_in_list = received_notification - } - OR = { - #Notify players - is_ai = no - #Give AI tributaries and herder neighbors chance to submit - #And strengthen confederations - AND = { - OR = { - AND = { - is_independent_ruler = yes - highest_held_title_tier <= tier_duchy - is_tributary = no - } - is_tributary_of_suzerain_or_above = root - } - OR = { - is_tributary_of_suzerain_or_above = root - #Is on the steppe and can join a confederation - AND = { - any_character_situation = { - this = situation:the_great_steppe - } - any_land_neighboring_realm_with_tributaries_owner = { - mpo_greatest_of_khans_0002_confederation_trigger = yes - save_temporary_scope_as = maybe_confederate - } - valid_confederation_member_trigger = { CHARACTER = scope:maybe_confederate } - - } - } - } - - } - } - trigger_event = { - id = mpo_greatest_of_khans.0002 #Someone has become Genghis Khan - days = 1 - } - } - } -} - -#Fires notification that minor lord has accepted submission -mpo_greatest_of_khans.0020 = { - hidden = yes - immediate = { - send_interface_message = { - type = event_gok_submission_with_text - title = mpo_greatest_of_khans.0020_title - left_icon = scope:recipient - - show_as_tooltip = { - mpo_gok_offer_submission_effect = yes - } - } - } -} - -#Your new vassal chooses to submit -mpo_greatest_of_khans.0021 = { - type = letter_event - opening = { - desc = mpo_greatest_of_khans.0021.opening - } - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - OR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - } - } - desc = mpo_greatest_of_khans.0021.desc_nomad - } - desc = mpo_greatest_of_khans.0021.desc - } - } - - sender = scope:recipient - - immediate = { - - } - - option = { - name = mpo_greatest_of_khans.0021.a - show_as_tooltip = { - mpo_gok_offer_submission_effect = yes - } - } -} - -#Your generous offer of submission has been refused... this means war -mpo_greatest_of_khans.0022 = { - type = letter_event - opening = { - desc = mpo_greatest_of_khans.0022.opening - } - desc = { - first_valid = { - triggered_desc = { - trigger = { - scope:recipient = { - OR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - } - } - desc = mpo_greatest_of_khans.0022.desc_nomad - } - desc = mpo_greatest_of_khans.0022.desc - } - } - - sender = scope:recipient - - option = { - name = { - trigger = { - scope:recipient = { - NOR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - } - } - text = mpo_greatest_of_khans.0022.a - } - name = { - trigger = { - scope:recipient = { - OR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_herder - } - } - } - text = mpo_greatest_of_khans.0022.a_nomadic - } - mpo_gok_offer_submission_refusal_effect = yes - } -} - -#Final Greatest of Khans decision event -mpo_greatest_of_khans.0030 = { - type = character_event - window = visit_settlement_window - title = mpo_greatest_of_khans.0030.t - desc = mpo_greatest_of_khans.0030.desc - theme = nomads - left_portrait = { - character = scope:knight - animation = throne_room_two_handed_passive_shield - camera = camera_event_very_left - hide_info = yes - } - center_portrait = { - character = root - animation = war_over_win - camera = camera_event_center - } - right_portrait = { - character = scope:scholar - animation = reading - camera = camera_event_very_right - hide_info = yes - } - override_background = { - reference = throne_room - } - override_effect_2d = { - reference = legend_glow - } - immediate = { - play_music_cue = mx_cue_the_khans_glory - ordered_knight = { - order_by = prowess - limit = { - basic_is_available_ai = yes - is_adult = yes - culture = { - OR = { - has_cultural_pillar = heritage_mongolic - has_cultural_pillar = heritage_turkic - } - } - is_courtier_of = root - } - alternative_limit = { - basic_is_available_ai = yes - is_adult = yes - culture = { - OR = { - has_cultural_pillar = heritage_mongolic - has_cultural_pillar = heritage_turkic - } - } - } - alternative_limit = { - basic_is_available_ai = yes - is_adult = yes - } - save_scope_as = knight - add_character_flag = need_military_outfit - } - ordered_courtier = { - order_by = learning - limit = { - basic_is_available_ai = yes - is_adult = yes - culture = { - trigger_if = { - limit = { - NOT = { - this = culture:uyghur - } - } - NOR = { - has_cultural_pillar = heritage_mongolic - has_cultural_pillar = heritage_turkic - } - } - } - } - alternative_limit = { - basic_is_available_ai = yes - is_adult = yes - } - save_scope_as = scholar - } - custom_tooltip = gok_reform_invalides_gok_stuff_tt - gok_world_conquest_generic_rewards_effect = yes - every_owned_story = { - limit = { - story_type = story_greatest_of_khans - } - end_story = yes - } - } - #BURN THE SETTLED WORLD AND LET US GRAZE - option = { - name = mpo_greatest_of_khans.0030.a - flavor = mpo_greatest_of_khans.0030.a.flavor - add_dread = massive_dread_gain - add_gold = { - add = "list_size(burned_to_nomadism)" - multiply = miniscule_gold_value - } - add_internal_flag = dangerous - custom_tooltip = gok_counties_become_nomad_counties_tt - custom_tooltip = gok_new_nomad_counties_lose_development_tt - custom_tooltip = gok_other_counties_lose_development_tt - hidden_effect = { - every_in_list = { - list = burned_to_nomadism - raze_county = { - holding_type = nomad_holding - purge_secondary_holdings = yes - } - if = { - limit = { - development_level > 1 - } - save_scope_value_as = { - name = dev_reduction - value = { - add = development_level - multiply = -1 - add = 1 - } - } - } - change_development_level = scope:dev_reduction - change_county_control = -100 - } - #damage the rest a bit too - every_realm_county = { - limit = { - NOR = { - is_in_list = burned_to_nomadism - any_county_province = { - OR = { - has_holding_type = nomad_holding - has_holding_type = herder_holding - } - } - holder = { - is_ai = no - } - } - development_level > 1 - } - change_development_level = { - add = development_level - divide = 10 - floor = yes - multiply = -1 - } - } - } - - custom_tooltip = gok_non_nomads_become_nomad_tt - #Willing vassals convert to nomad - hidden_effect = { - every_in_list = { - list = sedentary_to_nomad_vassals - adopt_nomadic_ways_decision_effect = yes - } - } - - custom_tooltip = gok_city_state_creation - hidden_effect = { - every_in_list = { - list = city_state_vassals - every_held_title = { - limit = { - tier >= tier_county - is_head_of_faith = no - is_landless_type_title = no - #Leave them with their capital duchy - NOR = { - this = holder.capital_county - this = holder.capital_county.duchy - AND = { - tier = tier_county - duchy = holder.capital_county.duchy - } - } - } - create_title_and_vassal_change = { - type = revoked - save_scope_as = change - add_claim_on_loss = yes - } - change_title_holder = { - holder = root - change = scope:change - take_baronies = no - } - resolve_title_and_vassal_change = scope:change - } - } - } - stress_and_fulfillment_impact = { - compassionate = major_stress_impact_gain - greedy = massive_stress_impact_gain - lazy = medium_stress_impact_gain - forgiving = medium_stress_impact_gain - } - ai_chance = { - base = 0 - } - } - #Convert to admin government - option = { - trigger = { - has_dlc_feature = admin_gov - } - name = mpo_greatest_of_khans.0030.b - flavor = mpo_greatest_of_khans.0030.b.flavor - add_internal_flag = special - nomad_domicile_refund_effect = yes - nomad_convert_herds_to_gold_special_troops_effect = yes - gok_upgrade_realm_and_government_effect = yes - custom_tooltip = gok_some_sedentaries_become_admin_tt - hidden_effect = { - if = { - limit = { - ep3_is_clan_inclined_trigger = yes - } - nomad_convert_people_to_clan_effect = yes - } - else = { - nomad_convert_people_to_feudal_effect = yes - } - } - convert_to_administrative_from_feudalism_effect = { GOVERNMENT_TO_ADOPT = flag:dynamic } - hidden_effect = { - every_vassal = { - limit = { - gok_willing_new_admin_vassal_trigger = yes - } - change_to_administrative_effect = yes - every_vassal = { - limit = { - gok_willing_new_admin_vassal_trigger = yes - } - change_to_administrative_effect = yes - every_vassal = { - limit = { - gok_willing_new_admin_vassal_trigger = yes - } - change_to_administrative_effect = yes - every_vassal = { - limit = { - gok_willing_new_admin_vassal_trigger = yes - } - change_to_administrative_effect = yes - } - } - } - - } - } - - ai_chance = { - base = 100 - modifier = { - is_roman_emperor_trigger = yes - add = 100 - } - modifier = { - culture = { - OR = { - has_cultural_pillar = ethos_bureaucratic - has_cultural_pillar = ethos_courtly - has_cultural_pillar = ethos_egalitarian - } - } - add = 50 - } - modifier = { - culture = { - has_cultural_tradition = tradition_legalistic - } - add = 50 - } - modifier = { - culture = { - OR = { - has_cultural_tradition = tradition_fp3_enlightened_magnates - has_cultural_tradition = tradition_loyal_soldiers - } - } - add = 20 - } - modifier = { - culture = { - OR = { - has_cultural_tradition = tradition_ep3_indomitable_azatani - has_cultural_tradition = tradition_ep3_audacious_cadets - has_cultural_tradition = tradition_fp3_fierce_independence - } - } - add = -50 - } - modifier = { - culture = { - has_cultural_tradition = tradition_staunch_traditionalists - } - add = -50 - } - modifier = { - culture = { - has_cultural_tradition = tradition_quarrelsome - } - add = -50 - } - modifier = { - culture = { - has_cultural_tradition = tradition_warrior_culture - } - add = -50 - } - modifier = { - culture = { - has_cultural_tradition = tradition_hereditary_hierarchy - } - add = -50 - } - modifier = { - culture = { - has_cultural_tradition = tradition_hereditary_hierarchy - } - add = -50 - } - modifier = { - culture = { - OR = { - has_cultural_pillar = ethos_stoic - has_cultural_pillar = ethos_bellicose - has_cultural_pillar = ethos_communal - } - } - add = -50 - } - modifier = { - culture = { - culture_is_historically_admin_trigger = yes - } - add = 100 - } - } - } - #Convert to feudal government - option = { - name = mpo_greatest_of_khans.0030.c - flavor = mpo_greatest_of_khans.0030.c.flavor - nomad_domicile_refund_effect = yes - nomad_convert_herds_to_gold_special_troops_effect = yes - gok_upgrade_realm_and_government_effect = yes - nomad_convert_people_to_feudal_effect = yes - hidden_effect = { - every_in_list = { - list = switching_vassals - nomad_convert_people_to_feudal_effect = yes - } - } - ai_chance = { - base = 0 - modifier = { - ep3_is_clan_inclined_trigger = no - add = 5 - } - } - } - #Convert to clan government - option = { - name = mpo_greatest_of_khans.0030.d - flavor = mpo_greatest_of_khans.0030.d.flavor - nomad_domicile_refund_effect = yes - nomad_convert_herds_to_gold_special_troops_effect = yes - gok_upgrade_realm_and_government_effect = yes - nomad_convert_people_to_clan_effect = yes - hidden_effect = { - every_in_list = { - list = switching_vassals - nomad_convert_people_to_clan_effect = yes - } - } - ai_chance = { - base = 0 - modifier = { - ep3_is_clan_inclined_trigger = yes - add = 5 - } - } - } - #Actually... I don't want to change anything - option = { - name = mpo_greatest_of_khans.0030.e - flavor = mpo_greatest_of_khans.0030.e.flavor - ai_chance = { - base = 0 - } - } - - after = { - scope:knight = { - remove_character_flag = need_military_outfit - } - } -} - -#Invalidate event for story - your dynasty timed out or lost control of the GoK title -mpo_greatest_of_khans.0040 = { - type = character_event - title = mpo_greatest_of_khans.0040.t - desc = { - first_valid = { - triggered_desc = { - trigger = { - exists = scope:timed_out - } - desc = mpo_greatest_of_khans.0040.desc_timed_out - } - desc = mpo_greatest_of_khans.0040.desc - } - } - theme = nomads - left_portrait = { - character = root - animation = horse_exhausted - camera = camera_event_horse_very_left - } - override_background = { - reference = mpo_steppe_evening - } - immediate = { - add_legitimacy = major_legitimacy_loss - custom_tooltip = gok_no_more_reform_decision - custom_tooltip = gok_no_more_special_powers - custom_tooltip = gok_lose_succession_protection_tt - if = { - limit = { - has_realm_law = nomadic_authority_5 - } - remove_realm_law = nomadic_authority_5 - add_realm_law = nomadic_authority_4 - } - if = { - limit = { - has_trait = greatest_of_khans - } - remove_trait = greatest_of_khans - } - if = { - limit = { - has_character_modifier = the_great_khan_modifier - } - remove_character_modifier = the_great_khan_modifier - } - - every_owned_story = { - limit = { story_type = story_greatest_of_khans } - end_story = yes - } - } - option = { - name = mpo_greatest_of_khans.0040.a - if = { - limit = { - any_held_title = { - this = global_var:greatest_of_khans_title - } - } - custom_tooltip = gok_guaranteed_disastrous_chaotic_succession_tt - global_var:greatest_of_khans_title = { - set_variable = { - name = guaranteed_disastrous_succession - value = yes - } - } - } - } -} - -#Switched government type on purpose... sort of GoK, but not really now -mpo_greatest_of_khans.0041 = { - type = character_event - title = mpo_greatest_of_khans.0041.t - desc = mpo_greatest_of_khans.0041.desc - theme = nomads - left_portrait = { - character = root - triggered_animation = { - trigger = { - OR = { faith.religion = religion:eastern_orthodox_religion faith.religion = religion:oriental_orthodox_religion faith.religion = religion:catholic_religion faith.religion = religion:protestant_religion } - } - animation = acknowledging - } - triggered_animation = { - trigger = { - primary_title = title:h_china - } - animation = emperor - } - triggered_animation = { - trigger = { - OR = { - government_has_flag = government_is_tribal - government_has_flag = government_is_wanua - } - } - animation = personality_honorable - } - animation = chancellor - } - right_portrait = { - character = scope:bower - animation = throne_room_bow_3 - } - override_background = { - reference = throne_room - } - immediate = { - ordered_vassal = { - order_by = current_military_strength - limit = { - basic_is_available_ai = yes - is_adult = yes - NOR = { - is_at_war_with = root - is_a_faction_member = yes - government_has_flag = government_is_nomadic - } - } - save_scope_as = bower - } - if = { - limit = { - NOT = { - exists = scope:bower - } - } - random_courtier = { - limit = { - basic_is_available_ai = yes - is_adult = yes - } - save_scope_as = bower - } - } - if = { - limit = { - NOT = { - exists = scope:bower - } - } - random_pool_character = { - province = root.capital_province - limit = { - basic_is_available_ai = yes - is_adult = yes - } - save_scope_as = bower - } - } - save_scope_as = root_scope - custom_tooltip = gok_forsaken_nomadism_tt - custom_tooltip = gok_no_more_reform_decision - custom_tooltip = gok_no_more_special_powers - } - option = { - name = mpo_greatest_of_khans.0041.a - } -} - -#GoK threatens new vassal -mpo_greatest_of_khans.0050 = { - type = letter_event - opening = { - desc = mpo_greatest_of_khans.0050.opening - } - desc = { - desc = mpo_greatest_of_khans.0050.desc - first_valid = { - triggered_desc = { - trigger = { - exists = scope:liege - } - desc = mpo_greatest_of_khans.0050.desc_reorganized - } - desc = mpo_greatest_of_khans.0050.desc_end - } - } - - sender = scope:attacker - - immediate = { - if = { - limit = { - liege ?= { - NOT = { - this = scope:attacker - } - } - } - liege = { - save_scope_as = liege - } - } - } - - option = { - name = mpo_greatest_of_khans.0050.a - } -} - -#GoK mocks unlanded former vassal of enemy -mpo_greatest_of_khans.0051 = { - type = letter_event - opening = { - desc = mpo_greatest_of_khans.0051.opening - } - desc = mpo_greatest_of_khans.0051.desc - - sender = scope:attacker - - trigger = { - is_landed = no - } - immediate = { - - } - - option = { - name = mpo_greatest_of_khans.0051.a - } -} - -# -# END Become Greatest of Khans events ################# +## Become Greatest of Khans events +##Jason Cantalini -#MONGOL INVASION EVENTS - UPDATED FOR MPO +##Out of order so that event numbering can still mirror central_asia_events that provide base game Great Khan content (sorry) +##Hidden war of defiance setup event +#mpo_greatest_of_khans.0100 = { +# hidden = yes +# immediate = { +# #Remove primary defender truces with root AND START WAR! +# scope:primary_coalition_defender = { +# if = { +# limit = { +# OR = { +# any_truce_holder = { +# this = root +# } +# any_truce_target = { +# this = root +# } +# } +# } +# cancel_truce_both_ways = root +# } +# if = { +# limit = { +# is_vassal_or_below_of = root +# } +# create_title_and_vassal_change = { +# type = independency +# save_scope_as = change +# } +# becomes_independent = { change = scope:change } +# resolve_title_and_vassal_change = scope:change +# } +# #BEGIN THE WAR! +# start_war = { +# cb = mpo_great_war_of_defiance_cb +# target = root +# target_title = root.primary_title +# } +# random_character_war = { +# limit = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# every_in_list = { +# list = anti_gok_coalition_members +# limit = { +# NOR = { +# is_defender_in_war = prev +# is_attacker_in_war = prev +# } +# } +# prev = { +# add_attacker = prev +# } +# } +# } +# random_character_war = { +# limit = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# every_in_list = { +# list = obedient_nomad_vassals +# limit = { +# NOR = { +# is_defender_in_war = prev +# is_attacker_in_war = prev +# } +# } +# prev = { +# add_defender = prev +# } +# } +# } +# } +# #End all the other wars characters are involved in +# every_in_list = { +# list = anti_gok_coalition_members +# every_character_war = { +# limit = { +# NOR = { +# using_cb = mpo_great_war_of_defiance_cb +## using_cb = crusading_claim_cb +# AND = { +# primary_defender = prev +# NOT = { +# using_cb = peasant_war +# } +# } +# primary_defender = { +# is_ai = no +# } +# } +# } +# if = { +# limit = { +# primary_attacker = prev +# } +# end_war = white_peace +# } +# else = { +# remove_participant = prev +# } +# } +# } +# every_in_list = { +# list = obedient_nomad_vassals +# every_character_war = { +# limit = { +# NOR = { +# using_cb = mpo_great_war_of_defiance_cb +## using_cb = crusading_claim_cb +# AND = { +# primary_defender = prev +# NOT = { +# using_cb = peasant_war +# } +# } +# primary_defender = { +# is_ai = no +# } +# } +# } +# if = { +# limit = { +# primary_attacker = prev +# } +# end_war = white_peace +# } +# else = { +# remove_participant = prev +# } +# } +# } +# #Add global_variable that prevents anyone taking decision +# if = { +# limit = { +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# } +# set_global_variable = { +# name = mpo_gok_war_ongoing +# value = root +# } +# } +# random_character_war = { +# limit = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# save_scope_as = gok_war +# } +# if = { +# limit = { +# OR = { +# has_relation_potential_rival = scope:primary_coalition_defender +# scope:primary_coalition_defender = { +# opinion = { +# target = root +# value < -40 +# } +# } +# } +# } +# set_relation_rival_effect = { +# TARGET = scope:primary_coalition_defender +# REASON = rival_led_coalition_against_me +# } +# } +# #Memory for Gurkhan +# create_character_memory = { +# type = gok_called_the_clans +# } -### Appearance of Genghis Khan (others) -# by Petter Vilberg (updated by Jason Cantalini) -mpo_greatest_of_khans.1001 = { - type = character_event - window = fullscreen_event - queue_icon = "gfx/interface/icons/situation_types/the_great_steppe.dds" - title = mongol_invasion.1002.t - desc = { - first_valid = { - triggered_desc = { - trigger = { - OR = { - any_realm_province = { - OR = { - geographical_region = special_mongol_empire_start_region - geographical_region = special_mongol_empire_conquest_region_prio_1 - geographical_region = special_mongol_empire_conquest_region_prio_1_alpha - } - } - government_has_flag = government_is_nomadic - } - } - desc = { - desc = mongol_invasion.1002.desc.close - first_valid = { - triggered_desc = { - trigger = { - any_realm_province = { - geographical_region = special_mongol_empire_start_region - } - } - desc = mongol_invasion.1002.desc.close_mongolia - } - desc = mongol_invasion.1002.desc.close_steppes - } - desc = mongol_invasion.1002.desc.close.mid - #Great Khan or Genghis? - first_valid = { - triggered_desc = { - trigger = { - exists = scope:temujin - } - desc = mongol_invasion.1002.desc.genghis - } - desc = mongol_invasion.1002.desc.gok - } - desc = mongol_invasion.1002.desc.close.end - } - } +# #trigger event for gurkhan - obedient vassals pledge to fight +# if = { +# limit = { +# any_in_list = { +# list = obedient_nomad_vassals +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# } +# } +# trigger_event = { +# id = mpo_greatest_of_khans.0101 +# days = 1 +# } +# } +# else = { +# #add submitters as tributaries since root is getting no event +# every_in_list = { +# list = gok_submitters +# start_tributary_interaction_effect = { +# TRIBUTARY = this +# SUZERAIN = root +# } +# } +# save_scope_as = gurkhan_to_gok +# #Player notification and offer to join/submit event +# every_player = { +# limit = { +# mpo_war_of_defiance_notified_player_trigger = yes +# } +# trigger_event = { +# id = mpo_greatest_of_khans.0102 +# days = 2 +# } +# } +# } +# } +#} - desc = { - desc = mongol_invasion.1002.desc.far_intro - first_valid = { - triggered_desc = { - trigger = { - exists = scope:temujin - root = scope:temujin - } - desc = mongol_invasion.1002.desc.genghis - } - desc = mongol_invasion.1002.desc.gok - } - desc = mongol_invasion.1002.desc.far - } - } - } - theme = nomads - left_portrait = { - character = scope:temujin - animation = celebrate_sword - camera = camera_event_left_forward - } - override_background = { reference = mpo_fullscreen_greatest_of_khans } +#scripted_trigger mpo_greatest_of_khans_0101_ideal_vassal_trigger = { +# is_adult = yes +# is_imprisoned = no +# has_contagious_deadly_disease_trigger = no +# can_be_knight_trigger = { ARMY_OWNER = root } +#} - immediate = { - play_music_cue = mx_cue_conquest_of_the_golden_horde +#scripted_trigger mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = { +# NOR = { +# is_obedient_to = root +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# is_at_war_with = root +# has_relation_rival = root +# is_imprisoned = yes +# } +# government_has_flag = government_is_nomadic +# basic_is_available_ai = yes +# is_adult = yes +#} - scope:temujin = { - save_scope_as = genghis_khan - primary_title = { - save_scope_as = gok_title - } - show_as_tooltip = { - add_trait_force_tooltip = greatest_of_khans - } +##You are the Gurkhan and now fighting to be GoK +#mpo_greatest_of_khans.0101 = { +# type = character_event +# title = mpo_greatest_of_khans.0101.t +# desc = { +# desc = mpo_greatest_of_khans.0101.desc_intro +# first_valid = { +# triggered_desc = { +# trigger = { +# exists = scope:gok_opponent +# NOT = { +# scope:primary_coalition_defender = { +# this = scope:gok_opponent +# } +# } +# } +# desc = mpo_greatest_of_khans.0101.desc_gok_opponent +# } +# desc = mpo_greatest_of_khans.0101.desc_primary_attacker +# } +# triggered_desc = { +# trigger = { +# exists = scope:big_sub +# } +# desc = mpo_greatest_of_khans.0101.desc_sub +# } +# desc = mpo_greatest_of_khans.0101.desc +# } +# theme = nomads +# left_portrait = { +# character = scope:vassal_1 +# animation = horse_sword_shield +# camera = camera_event_horse_left_forward - custom_tooltip = genghis_khan_mongol_empire_tt - custom_tooltip = genghis_khan_mongol_troops_tt - custom_tooltip = gok_threatening_powers_tt - custom_tooltip = mongol_invasion.1002.genghis_khan_tt - mpo_add_golden_lineage_effect = yes - } +# } +# right_portrait = { +# character = scope:vassal_2 +# animation = jockey_gallop +# camera = camera_event_horse_right_forward +# } +# lower_left_portrait = scope:potential_joiner_1 +# lower_center_portrait = scope:potential_joiner_2 +# lower_right_portrait = scope:potential_joiner_3 +# override_background = { reference = wilderness } +# override_effect_2d = { +# reference = rain +# } - if = { - limit = { - OR = { - government_has_flag = government_is_nomadic - has_trait = nomadic_philosophy - } - } - custom_tooltip = become_gok_decision_now_unavailable_tt - } +# trigger = { +# is_at_war = yes +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# any_in_list = { +# list = obedient_nomad_vassals +# age >= 10 +# is_imprisoned = no +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# } +# } - #Save confederation if there is one - if = { - limit = { - any_land_neighboring_realm_with_tributaries_owner = { - mpo_greatest_of_khans_0002_confederation_trigger = yes - save_temporary_scope_as = confed_buddy - } - valid_confederation_member_trigger = { CHARACTER = scope:confed_buddy } - is_at_war = no - } - ordered_land_neighboring_realm_with_tributaries_owner = { - order_by = current_military_strength - limit = { - mpo_greatest_of_khans_0002_confederation_trigger = yes - } - save_scope_as = confederation_neighbor - confederation = { - save_scope_as = confederation - } - } - } - } - #Submit to the Great Khan if you're already their tributary anyway - option = { - trigger = { - NOR = { - is_vassal_or_below_of = scope:genghis_khan - is_at_war_with = scope:genghis_khan - } - is_tributary_of_suzerain_or_above = scope:genghis_khan - } - name = mpo_greatest_of_khans.0002.a - #tributary of great khan's vassal or below - if = { - limit = { - is_tributary_of_suzerain_or_above = scope:genghis_khan - suzerain = { - highest_held_title_tier > root.highest_held_title_tier - } - } - suzerain = { - save_scope_as = new_liege - } - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = change - } - change_liege = { - liege = scope:new_liege - change = scope:change - } - resolve_title_and_vassal_change = scope:change - } - else = { - create_title_and_vassal_change = { - type = swear_fealty - save_scope_as = change - } - change_liege = { - liege = scope:genghis_khan - change = scope:change - } - resolve_title_and_vassal_change = scope:change - } +# immediate = { +# #add submitters as tributaries +# if = { +# limit = { +# list_size = { +# name = gok_submitters +# value <= 4 +# } +# } +# every_in_list = { +# list = gok_submitters +# custom_tooltip = became_your_tributary_tt +# add_opinion = { +# target = root +# modifier = obedience_opinion +# years = 10 +# } +# hidden_effect = { +# start_tributary_interaction_effect = { +# TRIBUTARY = this +# SUZERAIN = root +# } +# } +# } +# } +# #vague tooltip if too many to show +# else = { +# custom_tooltip = gok_submitters_became_tributaries_tt +# hidden_effect = { +# every_in_list = { +# list = gok_submitters +# custom_tooltip = became_your_tributary_tt +# add_opinion = { +# target = root +# modifier = obedience_opinion +# years = 10 +# } +# start_tributary_interaction_effect = { +# TRIBUTARY = this +# SUZERAIN = root +# } +# } +# } +# } - stress_and_fulfillment_impact = { - brave = minor_stress_impact_gain - stubborn = minor_stress_impact_gain - } - ai_chance = { - base = 200 - ai_value_modifier = { - ai_boldness = 1 - } - modifier = { - has_trait = ambitious - add = -20 - } - modifier = { - has_dread_level_towards = { - target = scope:genghis_khan - level >= 1 - } - add = 100 - } - modifier = { - has_dread_level_towards = { - target = scope:genghis_khan - level >= 2 - } - add = 200 - } - modifier = { - government_has_flag = government_is_herder - add = 1000 - } - modifier = { - add = 50 - opinion = { - target = scope:genghis_khan - value >= 50 - } - } - modifier = { - add = 50 - opinion = { - target = scope:genghis_khan - value >= 75 - } - } - modifier = { - add = -50 - opinion = { - target = scope:genghis_khan - value <= -50 - } - } - modifier = { - add = -50 - opinion = { - target = scope:genghis_khan - value <= -75 - } - } - } - } - #Join a confederation that's next to me - option = { - trigger = { - exists = scope:confederation - } - name = mpo_greatest_of_khans.0002.b - scope:confederation = { add_confederation_member = root } - scope:confederation_neighbor = { - if = { - limit = { - is_at_war = yes - } - every_character_war = { - limit = { - primary_defender = { - is_member_of_confederation = scope:confederation - } - } - add_defender = root - } - } - } - if = { - limit = { - government_has_flag = government_is_nomadic - } - add_character_modifier = { - modifier = mpo_confederation_member_modifier - years = 5 - } - capital_county ?= { - change_county_fertility = major_county_fertility_level_gain - } - } - stress_and_fulfillment_impact = { - ambitious = minor_stress_impact_gain - } - ai_chance = { - base = 100 - modifier = { - add = 50 - opinion = { - target = scope:confederation_neighbor - value > 50 - } - } - modifier = { - add = 50 - opinion = { - target = scope:confederation_neighbor - value > 0 - } - } - modifier = { - add = -50 - opinion = { - target = scope:confederation_neighbor - value < -25 - } - } - modifier = { - add = -50 - opinion = { - target = scope:confederation_neighbor - value < -75 - } - } - modifier = { - has_trait = ambitious - add = -50 - } - } - } +# if = { +# limit = { +# any_in_list = { +# list = gok_submitters +# } +# } +# ordered_in_list = { +# list = gok_submitters +# order_by = current_military_strength +# save_scope_as = big_sub +# } +# } +# if = { +# limit = { +# any_in_list = { +# list = obedient_nomad_vassals +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes +# } +# } +# ordered_in_list = { +# list = obedient_nomad_vassals +# order_by = current_military_strength +# limit = { +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes +# } +# save_scope_as = vassal_1 +# } +# } +# else = { +# ordered_in_list = { +# list = obedient_nomad_vassals +# order_by = current_military_strength +# limit = { +# is_adult = yes +# is_imprisoned = no +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# } +# save_scope_as = vassal_1 +# } +# } +# if = { +# limit = { +# any_in_list = { +# list = obedient_nomad_vassals +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes +# NOT = { this = scope:vassal_1 } +# } +# } +# ordered_in_list = { +# list = obedient_nomad_vassals +# order_by = current_military_strength +# limit = { +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# mpo_greatest_of_khans_0101_ideal_vassal_trigger = yes +# NOT = { this = scope:vassal_1 } +# } +# save_scope_as = vassal_2 +# } +# } +# else = { +# ordered_in_list = { +# list = obedient_nomad_vassals +# order_by = current_military_strength +# limit = { +# age >= 10 +# is_imprisoned = no +# any_character_war = { +# using_cb = mpo_great_war_of_defiance_cb +# } +# NOT = { this = scope:vassal_1 } +# } +# save_scope_as = vassal_2 +# } +# } +# scope:vassal_1 = { +# add_character_flag = need_military_outfit +# } +# scope:vassal_2 ?= { +# add_character_flag = need_military_outfit +# } +# #Potential additional joiners +# ordered_vassal = { +# order_by = current_military_strength +# limit = { +# mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = yes +# } +# save_scope_as = potential_joiner_1 +# add_to_list = potential_joiners +# } +# #Potential additional joiners +# ordered_vassal = { +# order_by = current_military_strength +# limit = { +# mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = yes +# NOT = { +# this = scope:potential_joiner_1 +# } +# } +# save_scope_as = potential_joiner_2 +# add_to_list = potential_joiners +# } +# #Potential additional joiners +# ordered_vassal = { +# order_by = current_military_strength +# limit = { +# mpo_greatest_of_khans_0101_uninvolved_vassal_trigger = yes +# NOR = { +# this = scope:potential_joiner_1 +# this = scope:potential_joiner_2 +# } +# } +# save_scope_as = potential_joiner_3 +# add_to_list = potential_joiners +# } +# } - option = { # Option for close characters - name = { - trigger = { has_trait = craven } - text = mongol_invasion.1002.craven - } - name = { - text = mongol_invasion.1002.a - } - trigger = { - government_has_flag = government_is_nomadic - } +# #Entreat even more help from other vassals +# option = { +# name = mpo_greatest_of_khans.0101.a +# flavor = mpo_greatest_of_khans.0101.a.flavor +# trigger = { +# exists = scope:potential_joiner_1 +# exists = dynasty +# } +# #Will pay renown to get aid +# if = { +# limit = { +# is_ai = no +# #Combined title tiers of joiners to roughly judge their strength +# potential_joiner_combined_value >= 13 +# } +# dynasty = { +# add_dynasty_prestige = monumental_dynasty_prestige_loss +# } +# } +# else_if = { +# limit = { +# potential_joiner_combined_value >= 7 +# is_ai = no +# } +# dynasty = { +# add_dynasty_prestige = massive_dynasty_prestige_loss +# } +# } +# else_if = { +# limit = { +# is_ai = no +# } +# dynasty = { +# add_dynasty_prestige = major_dynasty_prestige_loss +# } +# } +# else = { +# #Lower loss for AI because they can't make smart judgements like players and will always take this +# dynasty = { +# add_dynasty_prestige = medium_dynasty_prestige_loss +# } +# } - if = { - limit = { - highest_held_title_tier < tier_empire - } - custom_tooltip = mongol_invasion_submission_reminder_tt - } - ai_chance = { - base = 100 - } - } +# scope:gok_war = { +# every_in_list = { +# list = potential_joiners +# limit = { +# NOR = { +# is_defender_in_war = prev +# is_attacker_in_war = prev +# } +# } +# prev = { +# add_defender = prev +# } +# } +# } +# hidden_effect = { +# every_in_list = { +# list = potential_joiners +# every_character_war = { +# limit = { +# NOR = { +# using_cb = mpo_great_war_of_defiance_cb +## using_cb = crusading_claim_cb +# AND = { +# primary_defender = prev +# NOT = { +# using_cb = peasant_war +# } +# } +# primary_defender = { +# is_ai = no +# } +# } +# } +# if = { +# limit = { +# primary_attacker = prev +# } +# end_war = white_peace +# } +# else = { +# remove_participant = prev +# } +# } +# } +# } +# custom_tooltip = gok_joiners_wars_cancelled_tt +# if = { +# limit = { +# is_ai = no +# } +# stress_and_fulfillment_impact = { +# arrogant = major_stress_impact_gain +# brave = major_stress_impact_gain +# ambitious = major_stress_impact_gain +# } +# } +# ai_chance = { +# base = 1000 +# } +# } +# #Refuse their aid for the swag +# option = { +# name = mpo_greatest_of_khans.0101.b +# flavor = mpo_greatest_of_khans.0101.b.flavor - option = { # Options for distant characters - name = { - text = mongol_invasion.1002.craven - trigger = { has_trait = craven } - } - name = { - text = mongol_invasion.1002.b - } - trigger = { - NOT = { government_has_flag = government_is_nomadic } - } - custom_tooltip = mongol_invasion.1002.genghis_khan_tt +# custom_tooltip = gok_obedient_vassals_leave_war_tt +# hidden_effect = { +# every_in_list = { +# list = obedient_nomad_vassals +# limit = { +# NOT = { +# this = root +# } +# } +# scope:gok_war = { +# remove_participant = prev +# } +# } +# } +# custom_tooltip = gok_fights_alone_reward_on_victory_tt +# set_variable = { +# name = fought_for_gok_alone +# value = gok_obedient_vassals_strength_value +# } +# stress_and_fulfillment_impact = { +# humble = medium_stress_impact_gain +# craven = major_stress_impact_gain +# } +# #The AI should be as scary as possible +# ai_chance = { +# base = 0 +# } +# } +# #Just accept their aid +# option = { +# name = mpo_greatest_of_khans.0101.c - if = { - limit = { - highest_held_title_tier < tier_empire - } - } - ai_chance = { - base = 100 - } +# #AI should take first option if they have it +# ai_chance = { +# base = 100 +# modifier = { +# exists = scope:potential_joiner_1 +# exists = dynasty +# factor = 0 +# } +# } +# } +# after = { +# scope:vassal_1 = { +# remove_character_flag = need_military_outfit +# } +# scope:vassal_2 ?= { +# remove_character_flag = need_military_outfit +# } +# save_scope_as = gurkhan_to_gok +# #Player notification and offer to join/submit event +# every_player = { +# limit = { +# mpo_war_of_defiance_notified_player_trigger = yes +# } +# trigger_event = { +# id = mpo_greatest_of_khans.0102 +# days = 2 +# } +# } +# } +#} - } -} +##Someone is trying to become GoK! Stop them! +##mpo_greatest_of_khans.0102 = { +## type = character_event +## title = mpo_greatest_of_khans.0102.t +## desc = mpo_greatest_of_khans.0102.desc +## theme = nomads +## left_portrait = { +## character = scope:gurkhan_to_gok +## animation = horse_archer_aggressive +## camera = camera_event_horse_left_forward +## } +## right_portrait = { +## character = scope:knight +## animation = horse_archer_aggressive +## camera = camera_event_horse_right_facing_left +## hide_info = yes +## } +## lower_right_portrait = scope:primary_coalition_defender +## override_background = { +## trigger = { +## NOT = { +## government_has_flag = government_is_nomadic +## } +## } +## reference = burning_building +## } +## override_background = { +## trigger = { +## government_has_flag = government_is_nomadic +## } +## reference = mpo_steppe_evening +## } +## override_effect_2d = { +## reference = smoke +## } -#Player Temujin's buffs through feed messages -mpo_greatest_of_khans.1010 = { - hidden = yes - trigger = { - OR = { - NOT = { - exists = local_var:temujin_buff_count - } - local_var:temujin_buff_count < 9 - } - is_alive = yes - is_ruler = yes - government_has_flag = government_is_nomadic - exists = domicile - #Only meant to help you GET TO GoK decision - NOR = { - has_trait = greatest_of_khans - has_global_variable = mpo_gok_war_ongoing - } - #Decreasing authority means he loses it - OR = { - has_realm_law = nomadic_authority_4 - has_realm_law = nomadic_authority_5 - } - } - immediate = { - #Adjust tracking variable so this only happens 6 times max - if = { - limit = { - NOT = { - exists = local_var:temujin_buff_count - } - } - set_local_variable = { - name = temujin_buff_count - value = 1 - } - } - else = { - change_local_variable = { - name = temujin_buff_count - add = 1 - } - } - send_interface_message = { - type = event_gok_temujin_with_text - title = mpo_greatest_of_khans.1010_title - desc = mpo_greatest_of_khans.1010_desc - domicile = { - change_herd = { - value = nomadic_authority_level_3_requirement - divide = 3 - add = { 1000 3000 } - } - } - add_prestige = { 200 300 } - add_gold = { 30 80 } - } - if = { - limit = { - local_var:temujin_buff_count < 9 - } - trigger_event = { - id = mpo_greatest_of_khans.1010 - months = { 3 9 } - } - } - } -} +## immediate = { +## scope:gurkhan_to_gok = { +## add_character_flag = need_military_outfit +## custom_tooltip = gok_took_become_gok_decision_tt +## custom_tooltip = gok_began_war_of_defiance_tt +## custom_tooltip = gok_gurkhan_declared_intent_tt +## custom_tooltip = gok_warning_one_off_tt +## } +## scope:gurkhan_to_gok = { +## ordered_knight = { +## order_by = prowess +## limit = { +## is_imprisoned = no +## NOT = { +## this = root +## } +## } +## save_scope_as = knight +## add_character_flag = need_military_outfit +## } + +## } +## } +## #Join war to aid Gurkhan! +## option = { +## trigger = { +## OR = { +## is_vassal_or_below_of = scope:gurkhan_to_gok +## is_tributary_of_suzerain_or_above = scope:gurkhan_to_gok +## is_allied_to = scope:gurkhan_to_gok +## dynasty ?= { +## any_dynasty_member = { +## this = scope:gurkhan_to_gok +## } +## } +## has_relation_soulmate = scope:gurkhan_to_gok +## has_relation_friend = scope:gurkhan_to_gok +## any_spouse = { +## this = scope:gurkhan_to_gok +## } +## } +## NOR = { +## is_at_war_with = scope:gurkhan_to_gok +## has_relation_rival = scope:gurkhan_to_gok +## } +## } +## name = mpo_greatest_of_khans.0102.a +## add_internal_flag = dangerous +## scope:gok_war = { +## add_defender = root +## } +## #Makes Gurkhan like you +## reverse_add_opinion = { +## modifier = pleased_opinion +## target = scope:gurkhan_to_gok +## opinion = 40 +## } +## stress_and_fulfillment_impact = { +## craven = medium_stress_impact_gain +## } +## } +## #Join war against Gurkhan! +## option = { +## trigger = { +## NOR = { +## is_at_war_with = scope:gurkhan_to_gok +## is_at_war_with = scope:primary_coalition_defender +## is_imprisoned_by = scope:gurkhan_to_gok +## } +## } +## name = mpo_greatest_of_khans.0102.b +## add_internal_flag = dangerous +## scope:gok_war = { +## add_attacker = root +## } +## reverse_add_opinion = { +## modifier = pleased_opinion +## target = scope:primary_coalition_defender +## opinion = 20 +## } +## #This is a crime if you're his vassal! +## if = { +## limit = { +## is_vassal_or_below_of = scope:gurkhan_to_gok +## } +## #Makes Gurkhan hate you +## reverse_add_opinion = { +## modifier = coup_plotter_opinion +## target = scope:gurkhan_to_gok +## opinion = -100 +## } +## } +## else_if = { +## limit = { +## is_allied_to = scope:gurkhan_to_gok +## } +## reverse_add_opinion = { +## modifier = betrayal_opinion +## target = scope:gurkhan_to_gok +## opinion = -100 +## } +## break_alliance = scope:gurkhan_to_gok + +## } +## else = { +## reverse_add_opinion = { +## modifier = hate_opinion +## target = scope:gurkhan_to_gok +## opinion = -40 +## } +## } +## stress_and_fulfillment_impact = { +## craven = medium_stress_impact_gain +## } +## } +## #I will submit as a tributary +## option = { +## trigger = { +## is_independent_ruler = yes +## is_tributary = no +## NOT = { +## is_at_war_with = scope:gurkhan_to_gok +## } +## } +## name = mpo_greatest_of_khans.0102.c +## start_tributary_interaction_effect = { +## TRIBUTARY = root +## SUZERAIN = scope:gurkhan_to_gok +## } +## reverse_add_opinion = { +## modifier = pleased_opinion +## target = scope:gurkhan_to_gok +## opinion = 10 +## } +## stress_and_fulfillment_impact = { +## brave = medium_stress_impact_gain +## arrogant = major_stress_impact_gain +## } +## } +## #I will submit as a vassal +## option = { +## trigger = { +## is_independent_ruler = yes +## NOR = { +## is_at_war_with = scope:gurkhan_to_gok +## is_vassal_or_below_of = scope:gurkhan_to_gok +## AND = { +## is_tributary = yes +## NOT = { +## is_tributary_of_suzerain_or_above = scope:gurkhan_to_gok +## } +## } +## } +## #is roughly the gurkhan's neighbor +## OR = { +## scope:gurkhan_to_gok = { +## any_land_neighboring_realm_with_tributaries_owner = { +## this = root +## } +## } +## root = { +## any_land_neighboring_realm_with_tributaries_owner = { +## this = scope:gurkhan_to_gok +## } +## } +## } + +## } +## name = mpo_greatest_of_khans.0102.d +## create_title_and_vassal_change = { +## type = swear_fealty +## save_scope_as = change +## } +## change_liege = { +## liege = scope:gurkhan_to_gok +## change = scope:change +## } +## resolve_title_and_vassal_change = scope:change + +## reverse_add_opinion = { +## modifier = pleased_opinion +## target = scope:gurkhan_to_gok +## opinion = 30 +## } + +## stress_and_fulfillment_impact = { +## brave = medium_stress_impact_gain +## arrogant = major_stress_impact_gain +## } +## } +## #Uh... well that's ominous +## option = { +## name = mpo_greatest_of_khans.0102.e +## } + +## after = { +## scope:gurkhan_to_gok = { +## remove_character_flag = need_military_outfit +## } +## scope:knight = { +## remove_character_flag = need_military_outfit +## } +## } +##} + +##The Gurkhan lost the war. Hah. Loser. +##mpo_greatest_of_khans.0103 = { +## type = character_event +## title = mpo_greatest_of_khans.0103.t +## desc = { +## first_valid = { +## triggered_desc = { +## trigger = { +## root = scope:defender +## } +## desc = mpo_greatest_of_khans.0103.desc_defender_intro +## } +## desc = mpo_greatest_of_khans.0103.desc_intro +## } +## first_valid = { +## triggered_desc = { +## trigger = { +## root = scope:defender +## } +## desc = mpo_greatest_of_khans.0103.desc_defender +## } +## triggered_desc = { +## trigger = { +## root = scope:attacker +## } +## desc = mpo_greatest_of_khans.0103.desc_attacker +## } +## triggered_desc = { +## trigger = { +## root = { +## is_in_list = anti_gok_defenders +## } +## } +## desc = mpo_greatest_of_khans.0103.desc_defenders +## } +## triggered_desc = { +## trigger = { +## root = { +## is_in_list = anti_gok_attackers +## } +## } +## desc = mpo_greatest_of_khans.0103.desc_attackers +## } +## desc = mpo_greatest_of_khans.0103.desc +## } +## } +## theme = nomads +## left_portrait = { +## character = scope:defender +## animation = prisonhouse +## camera = camera_event_left_forward +## override_imprisonment_visuals = yes +## outfit_tags = { beggar_rags } +## } +## right_portrait = { +## character = scope:knight +## animation = menacing +## hide_info = yes +## } +## lower_right_portrait = scope:attacker +## override_background = { +## reference = wilderness_scope +## } +## override_effect_2d = { +## reference = flies +## } + +## immediate = { +## scope:attacker = { +## capital_province = { save_scope_as = background_wilderness_scope } +## ordered_knight = { +## order_by = prowess +## limit = { +## is_imprisoned = no +## NOR = { +## this = root +## this = scope:defender +## } +## } +## save_scope_as = knight +## add_character_flag = need_military_outfit +## } +## } +## } +## option = { +## name = mpo_greatest_of_khans.0103.a +## } +##} + +##scripted_trigger mpo_greatest_of_khans_0002_confederation_trigger = { +## is_confederation_member = yes +## #Prev be with you +## NOR = { +## has_relation_rival = prev +## is_at_war_with = prev +## is_causing_raid_hostility_towards = prev +## prev = { +## is_causing_raid_hostility_towards = prev +## } +## opinion = { +## target = prev +## value <= -50 +## } +## reverse_opinion = { +## target = prev +## value <= -50 +## } +## } +##} + +##I became Greatest of Khans +##mpo_greatest_of_khans.0001 = { +## type = character_event +## window = fullscreen_event +## queue_icon = "gfx/interface/icons/situation_types/the_great_steppe.dds" +## title = mpo_greatest_of_khans.0001.t +## desc = mpo_greatest_of_khans.0001.desc +## theme = nomads +## left_portrait = { +## character = root +## animation = personality_vengeful +## } +## override_background = { reference = mpo_fullscreen_greatest_of_khans } + +## immediate = { +## save_scope_as = genghis_khan + +## play_music_cue = mx_cue_conquest_of_the_golden_horde + +## add_trait = greatest_of_khans +## if = { +## limit = { +## prestige_level < 5 +## } +## add_prestige_level = 1 +## } +## legend_seed_new_title_effect = yes +## form_the_greatest_khan_empire_effect = yes + +## create_story = story_greatest_of_khans +## save_scope_value_as = { +## name = gok_empire_crumble_date +## value = { +## value = current_year +## add = 75 +## } +## } +## #Add dynasty prestige if you chose to fight this without vassals' aid +## if = { +## limit = { +## has_variable = fought_for_gok_alone +## exists = dynasty +## } +## dynasty = { +## add_dynasty_prestige = fought_gok_alone_value +## } +## } +## mpo_add_golden_lineage_effect = yes +## } + +## option = { +## name = mpo_greatest_of_khans.0001.a +## custom_tooltip = greatest_of_khans_prevents_mongol_invasion_tt +## custom_tooltip = gok_enable_offer_submission_or_ruin_tt +## custom_tooltip = become_greatest_of_khans_decision_enable_gok_invasion_cb +## add_to_global_variable_list = { +## name = unavailable_unique_decisions +## target = flag:mpo_become_greatest_of_khans_decision +## } +## custom_tooltip = gok_protected_from_chaotic_succession_tt +## custom_tooltip = gok_time_limit_end_decision_tt +## } +## after = { +## #You pick a nickname +## trigger_event = mpo_greatest_of_khans.0003 +## } +##} + +##Someone became Greatest of Khans +##mpo_greatest_of_khans.0002 = { +## type = character_event +## window = fullscreen_event +## queue_icon = "gfx/interface/icons/situation_types/the_great_steppe.dds" +## title = mongol_invasion.1002.t +## desc = { +## first_valid = { +## triggered_desc = { +## trigger = { +## OR = { +## any_realm_province = { +## OR = { +## geographical_region = special_mongol_empire_start_region +## geographical_region = special_mongol_empire_conquest_region_prio_1 +## geographical_region = special_mongol_empire_conquest_region_prio_1_alpha +## } +## } +## NOT = { +## government_has_flag = government_is_nomadic +## } +## } +## } +## desc = { +## desc = mongol_invasion.1002.desc.close +## first_valid = { +## triggered_desc = { +## trigger = { +## any_realm_province = { +## geographical_region = special_mongol_empire_start_region +## } +## } +## desc = mongol_invasion.1002.desc.close_mongolia +## } +## desc = mongol_invasion.1002.desc.close_steppes +## } +## desc = mongol_invasion.1002.desc.close.mid +## #Great Khan or Genghis? +## first_valid = { +## triggered_desc = { +## trigger = { +## exists = scope:temujin +## } +## desc = mongol_invasion.1002.desc.genghis +## } +## desc = mongol_invasion.1002.desc.gok +## } +## desc = mongol_invasion.1002.desc.close.end +## } +## } +## desc = mongol_invasion.1002.desc.far_intro +## first_valid = { +## triggered_desc = { +## trigger = { +## exists = scope:temujin +## root = scope:temujin +## } +## desc = mongol_invasion.1002.desc.genghis +## } +## desc = mongol_invasion.1002.desc.gok +## } +## desc = mongol_invasion.1002.desc.far +## } +## } +## theme = nomads +## left_portrait = { +## character = scope:genghis_khan +## animation = personality_vengeful +## } +## override_background = { reference = mpo_fullscreen_greatest_of_khans } + +## immediate = { +## play_music_cue = mx_cue_conquest_of_the_golden_horde +## show_as_tooltip = { +## scope:genghis_khan = { +## add_trait_force_tooltip = greatest_of_khans +## form_the_greatest_khan_empire_effect = yes +## custom_tooltip = gok_threatening_powers_tt +## custom_tooltip = mongol_invasion.1002.genghis_khan_tt +## custom_tooltip = gok_time_limit_end_decision_other_players_tt +## mpo_add_golden_lineage_effect = yes +## } +## if = { +## limit = { +## OR = { +## government_has_flag = government_is_nomadic +## has_trait = nomadic_philosophy +## } +## } +## custom_tooltip = become_gok_decision_now_unavailable_tt +## } +## } + +## #Save confederation if there is one +## if = { +## limit = { +## any_land_neighboring_realm_with_tributaries_owner = { +## mpo_greatest_of_khans_0002_confederation_trigger = yes +## save_temporary_scope_as = confed_buddy +## } +## valid_confederation_member_trigger = { CHARACTER = scope:confed_buddy } +## is_at_war = no +## } +## ordered_land_neighboring_realm_with_tributaries_owner = { +## order_by = current_military_strength +## limit = { +## mpo_greatest_of_khans_0002_confederation_trigger = yes +## } +## save_scope_as = confederation_neighbor +## confederation = { +## save_scope_as = confederation +## } +## } +## } +## } +## #Submit to the Great Khan if you're already their tributary anyway +## option = { +## trigger = { +## NOR = { +## is_vassal_or_below_of = scope:genghis_khan +## is_at_war_with = scope:genghis_khan +## } +## is_tributary_of_suzerain_or_above = scope:genghis_khan +## } +## name = mpo_greatest_of_khans.0002.a +## #tributary of great khan's vassal or below +## if = { +## limit = { +## is_tributary_of_suzerain_or_above = scope:genghis_khan +## suzerain = { +## highest_held_title_tier > root.highest_held_title_tier +## } +## } +## suzerain = { +## save_scope_as = new_liege +## } +## create_title_and_vassal_change = { +## type = swear_fealty +## save_scope_as = change +## } +## change_liege = { +## liege = scope:new_liege +## change = scope:change +## } +## resolve_title_and_vassal_change = scope:change +## } +## else = { +## create_title_and_vassal_change = { +## type = swear_fealty +## save_scope_as = change +## } +## change_liege = { +## liege = scope:genghis_khan +## change = scope:change +## } +## resolve_title_and_vassal_change = scope:change +## } + +## stress_and_fulfillment_impact = { +## brave = minor_stress_impact_gain +## stubborn = minor_stress_impact_gain +## } +## ai_chance = { +## base = 200 +## ai_value_modifier = { +## ai_boldness = 1 +## } +## modifier = { +## has_trait = ambitious +## add = -20 +## } +## modifier = { +## has_dread_level_towards = { +## target = scope:genghis_khan +## level >= 1 +## } +## add = 100 +## } +## modifier = { +## has_dread_level_towards = { +## target = scope:genghis_khan +## level >= 2 +## } +## add = 200 +## } +## modifier = { +## government_has_flag = government_is_herder +## add = 1000 +## } +## modifier = { +## add = 50 +## opinion = { +## target = scope:genghis_khan +## value >= 50 +## } +## } +## modifier = { +## add = 50 +## opinion = { +## target = scope:genghis_khan +## value >= 75 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:genghis_khan +## value <= -50 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:genghis_khan +## value <= -75 +## } +## } +## } +## } +## #Join a confederation that's next to me +## option = { +## trigger = { +## exists = scope:confederation +## } +## name = mpo_greatest_of_khans.0002.b +## scope:confederation = { add_confederation_member = root } +## scope:confederation_neighbor = { +## if = { +## limit = { +## is_at_war = yes +## } +## every_character_war = { +## limit = { +## primary_defender = { +## is_member_of_confederation = scope:confederation +## } +## } +## add_defender = root +## } +## } +## } +## if = { +## limit = { +## government_has_flag = government_is_nomadic +## } +## add_character_modifier = { +## modifier = mpo_confederation_member_modifier +## years = 5 +## } +## capital_county ?= { +## change_county_fertility = major_county_fertility_level_gain +## } +## } +## stress_and_fulfillment_impact = { +## ambitious = minor_stress_impact_gain +## } +## ai_chance = { +## base = 100 +## modifier = { +## add = 50 +## opinion = { +## target = scope:confederation_neighbor +## value > 50 +## } +## } +## modifier = { +## add = 50 +## opinion = { +## target = scope:confederation_neighbor +## value > 0 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:confederation_neighbor +## value < -25 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:confederation_neighbor +## value < -75 +## } +## } +## modifier = { +## has_trait = ambitious +## add = -50 +## } +## } +## } +## #Cry (unless you are vassal of the Khan!) +## option = { +## name = { +## trigger = { +## NOT = { +## government_has_flag = government_is_nomadic +## } +## } +## text = mongol_invasion.1002.b +## } +## name = { +## trigger = { +## government_has_flag = government_is_nomadic +## } +## text = mongol_invasion.1002.a +## } + +## ai_chance = { +## base = 100 +## ai_value_modifier = { +## ai_boldness = 1 +## ai_honor = -0.5 +## } +## } +## } +##} + +##Greatest of Khans picks nickname +#mpo_greatest_of_khans.0003 = { +# type = character_event +# title = mpo_greatest_of_khans.0003.t +# desc = mpo_greatest_of_khans.0003.desc +# theme = nomads +# left_portrait = { +# character = root +# animation = standing_horse +# camera = camera_event_standing_with_horse_left +# } +# override_background = { +# reference = mpo_temple_steppe +# } +# override_effect_2d = { +# reference = legend_glow +# } +# option = { +# trigger = { +# NOT = { +# culture = { +# has_cultural_pillar = language_turkic +# } +# } +# } +# name = mpo_greatest_of_khans.0003.a +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_genghis_khan +# ai_chance = { +# base = 50 +# modifier = { +# factor = 0 +# NOT = { +# culture = { +# has_cultural_pillar = language_mongolic +# } +# } +# } +## modifier = { +## factor = 100 +## this = character:125501 +## } +# } +# } +# option = { +# trigger = { +# culture = { +# has_cultural_pillar = language_turkic +# } +# } +# name = mpo_greatest_of_khans.0003.b +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_cengiz_khan +# ai_chance = { +# base = 50 +# } +# } +# option = { +# trigger = { +# culture = { +# has_cultural_pillar = language_mongolic +# } +# } +# name = mpo_greatest_of_khans.0003.c +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_yekhe_khagan +# ai_chance = { +# base = 50 +# } +# } +# option = { +# trigger = { +# culture = { +# has_cultural_pillar = language_turkic +# } +# } +# name = mpo_greatest_of_khans.0003.d +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_dort_yonlug_khagan +# ai_chance = { +# base = 50 +# } +# } +# option = { +# trigger = { +# NOR = { +# OR = { faith.religion = religion:eastern_orthodox_religion faith.religion = religion:oriental_orthodox_religion faith.religion = religion:catholic_religion faith.religion = religion:protestant_religion } +# faith.religion = religion:islam_religion +# } +# } +# name = mpo_greatest_of_khans.0003.e +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_tengri_khagan +# ai_chance = { +# base = 50 +# modifier = { +# add = -45 +# NOT = { +# faith.religion = religion:tengrism_religion +# } +# } +# } +# } +# option = { +# trigger = { +# OR = { +# faith = faith:nestorian +# faith.religion = faith:manichaean_faith.religion +# } +# } +# name = mpo_greatest_of_khans.0003.f +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_xormuzta +# ai_chance = { +# base = 100 +# } +# } +# option = { +# trigger = { +# faith.religion = religion:islam_religion +# capital_province ?= { +# OR = { +# geographical_region = world_middle_east +# geographical_region = world_asia_minor +# geographical_region = world_steppe_tarim +# geographical_region = world_steppe_central +# } +# } +# current_date >= 1250 +# } +# name = mpo_greatest_of_khans.0003.g +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_cihangir +# ai_chance = { +# base = 100 +# } +# } +# option = { +# trigger = { +# faith = faith:nestorian +# } +# name = mpo_greatest_of_khans.0003.h +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_mar_sargis +# ai_chance = { +# base = 100 +# } +# } +# option = { +# trigger = { +# culture = { +# OR = { +# has_cultural_pillar = language_iranian +# has_cultural_pillar = language_scythian +# } +# } +# } +# name = mpo_greatest_of_khans.0003.i +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_akhshunwar +# ai_chance = { +# base = 100 +# } +# } +# option = { +# name = mpo_greatest_of_khans.0003.j +# if = { +# limit = { has_any_nickname = yes } +# remove_nickname = yes +# } +# give_nickname = nick_culture_khagan +# ai_chance = { +# base = 10 +# } +# } +# option = { +# name = mpo_greatest_of_khans.0003.k +# ai_chance = { +# base = 0 +# } +# } +# after = { +# #notification events go to other rulers + +# add_to_temporary_list = received_notification +# every_vassal_or_below = { +# limit = { +# is_ai = no +# } +# trigger_event = { +# id = mpo_greatest_of_khans.0002 #Someone has become Genghis Khan +# days = 1 +# } +# add_to_temporary_list = received_notification +# } +# every_ruler = { +# limit = { +# NOT = { +# is_in_list = received_notification +# } +# OR = { +# #Notify players +# is_ai = no +# #Give AI tributaries and herder neighbors chance to submit +# #And strengthen confederations +# AND = { +# OR = { +# AND = { +# is_independent_ruler = yes +# highest_held_title_tier <= tier_duchy +# is_tributary = no +# } +# is_tributary_of_suzerain_or_above = root +# } +# OR = { +# is_tributary_of_suzerain_or_above = root +# #Is on the steppe and can join a confederation +# AND = { +# any_character_situation = { +# this = situation:the_great_steppe +# } +# any_land_neighboring_realm_with_tributaries_owner = { +# mpo_greatest_of_khans_0002_confederation_trigger = yes +# save_temporary_scope_as = maybe_confederate +# } +# valid_confederation_member_trigger = { CHARACTER = scope:maybe_confederate } + +# } +# } +# } + +# } +# } +# trigger_event = { +# id = mpo_greatest_of_khans.0002 #Someone has become Genghis Khan +# days = 1 +# } +# } +# } +#} + +##Fires notification that minor lord has accepted submission +##mpo_greatest_of_khans.0020 = { +## hidden = yes +## immediate = { +## send_interface_message = { +## type = event_gok_submission_with_text +## title = mpo_greatest_of_khans.0020_title +## left_icon = scope:recipient + +## show_as_tooltip = { +## mpo_gok_offer_submission_effect = yes +## } +## } +## } +##} + +##Your new vassal chooses to submit +##mpo_greatest_of_khans.0021 = { +## type = letter_event +## opening = { +## desc = mpo_greatest_of_khans.0021.opening +## } +## desc = { +## first_valid = { +## triggered_desc = { +## trigger = { +## scope:recipient = { +## OR = { +## government_has_flag = government_is_nomadic +## government_has_flag = government_is_herder +## } +## } +## } +## desc = mpo_greatest_of_khans.0021.desc_nomad +## } +## desc = mpo_greatest_of_khans.0021.desc +## } +## } + +## sender = scope:recipient + +## immediate = { + +## } + +## option = { +## name = mpo_greatest_of_khans.0021.a +## show_as_tooltip = { +## mpo_gok_offer_submission_effect = yes +## } +## } +##} + +##Your generous offer of submission has been refused... this means war +##mpo_greatest_of_khans.0022 = { +## type = letter_event +## opening = { +## desc = mpo_greatest_of_khans.0022.opening +## } +## desc = { +## first_valid = { +## triggered_desc = { +## trigger = { +## scope:recipient = { +## OR = { +## government_has_flag = government_is_nomadic +## government_has_flag = government_is_herder +## } +## } +## } +## desc = mpo_greatest_of_khans.0022.desc_nomad +## } +## desc = mpo_greatest_of_khans.0022.desc +## } +## } + +## sender = scope:recipient + +## option = { +## name = { +## trigger = { +## scope:recipient = { +## NOR = { +## government_has_flag = government_is_nomadic +## government_has_flag = government_is_herder +## } +## } +## } +## text = mpo_greatest_of_khans.0022.a +## } +## name = { +## trigger = { +## scope:recipient = { +## OR = { +## government_has_flag = government_is_nomadic +## government_has_flag = government_is_herder +## } +## } +## } +## text = mpo_greatest_of_khans.0022.a_nomadic +## } +## mpo_gok_offer_submission_refusal_effect = yes +## } +##} + +##Final Greatest of Khans decision event +##mpo_greatest_of_khans.0030 = { +## type = character_event +## window = visit_settlement_window +## title = mpo_greatest_of_khans.0030.t +## desc = mpo_greatest_of_khans.0030.desc +## theme = nomads +## left_portrait = { +## character = scope:knight +## animation = throne_room_two_handed_passive_shield +## camera = camera_event_very_left +## hide_info = yes +## } +## center_portrait = { +## character = root +## animation = war_over_win +## camera = camera_event_center +## } +## right_portrait = { +## character = scope:scholar +## animation = reading +## camera = camera_event_very_right +## hide_info = yes +## } +## override_background = { +## reference = throne_room +## } +## override_effect_2d = { +## reference = legend_glow +## } +## immediate = { +## play_music_cue = mx_cue_the_khans_glory +## ordered_knight = { +## order_by = prowess +## limit = { +## basic_is_available_ai = yes +## is_adult = yes +## culture = { +## OR = { +## has_cultural_pillar = heritage_mongolic +## has_cultural_pillar = heritage_turkic +## } +## } +## is_courtier_of = root +## } +## alternative_limit = { +## basic_is_available_ai = yes +## is_adult = yes +## culture = { +## OR = { +## has_cultural_pillar = heritage_mongolic +## has_cultural_pillar = heritage_turkic +## } +## } +## } +## alternative_limit = { +## basic_is_available_ai = yes +## is_adult = yes +## } +## save_scope_as = knight +## add_character_flag = need_military_outfit +## } +## ordered_courtier = { +## order_by = learning +## limit = { +## basic_is_available_ai = yes +## is_adult = yes +## culture = { +## trigger_if = { +## limit = { +## NOT = { +## this = culture:uyghur +## } +## } +## NOR = { +## has_cultural_pillar = heritage_mongolic +## has_cultural_pillar = heritage_turkic +## } +## } +## } +## } +## alternative_limit = { +## basic_is_available_ai = yes +## is_adult = yes +## } +## save_scope_as = scholar +## } +## custom_tooltip = gok_reform_invalides_gok_stuff_tt +## gok_world_conquest_generic_rewards_effect = yes +## every_owned_story = { +## limit = { +## story_type = story_greatest_of_khans +## } +## end_story = yes +## } +## } +## #BURN THE SETTLED WORLD AND LET US GRAZE +## option = { +## name = mpo_greatest_of_khans.0030.a +## flavor = mpo_greatest_of_khans.0030.a.flavor +## add_dread = massive_dread_gain +## add_gold = { +## add = "list_size(burned_to_nomadism)" +## multiply = miniscule_gold_value +## } +## add_internal_flag = dangerous +## custom_tooltip = gok_counties_become_nomad_counties_tt +## custom_tooltip = gok_new_nomad_counties_lose_development_tt +## custom_tooltip = gok_other_counties_lose_development_tt +## hidden_effect = { +## every_in_list = { +## list = burned_to_nomadism +## raze_county = { +## holding_type = nomad_holding +## purge_secondary_holdings = yes +## } +## if = { +## limit = { +## prosperity_level > 1 +## } +## save_scope_value_as = { +## name = dev_reduction +## value = { +## add = prosperity_level +## multiply = -1 +## add = 1 +## } +## } +## } +## change_prosperity_level = scope:dev_reduction +## change_county_control = -100 +## } +## #damage the rest a bit too +## every_realm_county = { +## limit = { +## NOR = { +## is_in_list = burned_to_nomadism +## any_county_province = { +## OR = { +## has_holding_type = nomad_holding +## has_holding_type = herder_holding +## } +## } +## holder = { +## is_ai = no +## } +## } +## prosperity_level > 1 +## } +## change_prosperity_level = { +## add = prosperity_level +## divide = 10 +## floor = yes +## multiply = -1 +## } +## } +## } + +## custom_tooltip = gok_non_nomads_become_nomad_tt +## #Willing vassals convert to nomad +## hidden_effect = { +## every_in_list = { +## list = sedentary_to_nomad_vassals +## adopt_nomadic_ways_decision_effect = yes +## } +## } + +## custom_tooltip = gok_city_state_creation +## hidden_effect = { +## every_in_list = { +## list = city_state_vassals +## every_held_title = { +## limit = { +## tier >= tier_county +## is_head_of_faith = no +## is_landless_type_title = no +## #Leave them with their capital duchy +## NOR = { +## this = holder.capital_county +## this = holder.capital_county.duchy +## AND = { +## tier = tier_county +## duchy = holder.capital_county.duchy +## } +## } +## } +## create_title_and_vassal_change = { +## type = revoked +## save_scope_as = change +## add_claim_on_loss = yes +## } +## change_title_holder = { +## holder = root +## change = scope:change +## take_baronies = no +## } +## resolve_title_and_vassal_change = scope:change +## } +## } +## } +## stress_and_fulfillment_impact = { +## compassionate = major_stress_impact_gain +## greedy = massive_stress_impact_gain +## lazy = medium_stress_impact_gain +## forgiving = medium_stress_impact_gain +## } +## ai_chance = { +## base = 0 +## } +## } +## #Convert to admin government +## option = { +## trigger = { +## has_dlc_feature = admin_gov +## } +## name = mpo_greatest_of_khans.0030.b +## flavor = mpo_greatest_of_khans.0030.b.flavor +## add_internal_flag = special +## nomad_domicile_refund_effect = yes +## nomad_convert_herds_to_gold_special_troops_effect = yes +## gok_upgrade_realm_and_government_effect = yes +## custom_tooltip = gok_some_sedentaries_become_admin_tt +## hidden_effect = { +## if = { +## limit = { +## ep3_is_clan_inclined_trigger = yes +## } +## nomad_convert_people_to_clan_effect = yes +## } +## else = { +## nomad_convert_people_to_feudal_effect = yes +## } +## } +## convert_to_administrative_from_feudalism_effect = { GOVERNMENT_TO_ADOPT = flag:dynamic } +## hidden_effect = { +## every_vassal = { +## limit = { +## gok_willing_new_admin_vassal_trigger = yes +## } +## change_to_administrative_effect = yes +## every_vassal = { +## limit = { +## gok_willing_new_admin_vassal_trigger = yes +## } +## change_to_administrative_effect = yes +## every_vassal = { +## limit = { +## gok_willing_new_admin_vassal_trigger = yes +## } +## change_to_administrative_effect = yes +## every_vassal = { +## limit = { +## gok_willing_new_admin_vassal_trigger = yes +## } +## change_to_administrative_effect = yes +## } +## } +## } + +## } +## } + +## ai_chance = { +## base = 100 +## modifier = { +## is_roman_emperor_trigger = yes +## add = 100 +## } +## modifier = { +## culture = { +## OR = { +## has_cultural_pillar = ethos_bureaucratic +## has_cultural_pillar = ethos_courtly +## has_cultural_pillar = ethos_egalitarian +## } +## } +## add = 50 +## } +## modifier = { +## culture = { +## has_cultural_tradition = tradition_legalistic +## } +## add = 50 +## } +## modifier = { +## culture = { +## OR = { +## has_cultural_tradition = tradition_fp3_enlightened_magnates +## has_cultural_tradition = tradition_loyal_soldiers +## } +## } +## add = 20 +## } +## modifier = { +## culture = { +## OR = { +## has_cultural_tradition = tradition_ep3_indomitable_azatani +## has_cultural_tradition = tradition_ep3_audacious_cadets +## has_cultural_tradition = tradition_fp3_fierce_independence +## } +## } +## add = -50 +## } +## modifier = { +## culture = { +## has_cultural_tradition = tradition_staunch_traditionalists +## } +## add = -50 +## } +## modifier = { +## culture = { +## has_cultural_tradition = tradition_quarrelsome +## } +## add = -50 +## } +## modifier = { +## culture = { +## has_cultural_tradition = tradition_warrior_culture +## } +## add = -50 +## } +## modifier = { +## culture = { +## has_cultural_tradition = tradition_hereditary_hierarchy +## } +## add = -50 +## } +## modifier = { +## culture = { +## has_cultural_tradition = tradition_hereditary_hierarchy +## } +## add = -50 +## } +## modifier = { +## culture = { +## OR = { +## has_cultural_pillar = ethos_stoic +## has_cultural_pillar = ethos_bellicose +## has_cultural_pillar = ethos_communal +## } +## } +## add = -50 +## } +## modifier = { +## culture = { +## culture_is_historically_admin_trigger = yes +## } +## add = 100 +## } +## } +## } +## #Convert to feudal government +## option = { +## name = mpo_greatest_of_khans.0030.c +## flavor = mpo_greatest_of_khans.0030.c.flavor +## nomad_domicile_refund_effect = yes +## nomad_convert_herds_to_gold_special_troops_effect = yes +## gok_upgrade_realm_and_government_effect = yes +## nomad_convert_people_to_feudal_effect = yes +## hidden_effect = { +## every_in_list = { +## list = switching_vassals +## nomad_convert_people_to_feudal_effect = yes +## } +## } +## ai_chance = { +## base = 0 +## modifier = { +## ep3_is_clan_inclined_trigger = no +## add = 5 +## } +## } +## } +## #Convert to clan government +## option = { +## name = mpo_greatest_of_khans.0030.d +## flavor = mpo_greatest_of_khans.0030.d.flavor +## nomad_domicile_refund_effect = yes +## nomad_convert_herds_to_gold_special_troops_effect = yes +## gok_upgrade_realm_and_government_effect = yes +## nomad_convert_people_to_clan_effect = yes +## hidden_effect = { +## every_in_list = { +## list = switching_vassals +## nomad_convert_people_to_clan_effect = yes +## } +## } +## ai_chance = { +## base = 0 +## modifier = { +## ep3_is_clan_inclined_trigger = yes +## add = 5 +## } +## } +## } +## #Actually... I don't want to change anything +## option = { +## name = mpo_greatest_of_khans.0030.e +## flavor = mpo_greatest_of_khans.0030.e.flavor +## ai_chance = { +## base = 0 +## } +## } + +## after = { +## scope:knight = { +## remove_character_flag = need_military_outfit +## } +## } +##} + +##Invalidate event for story - your dynasty timed out or lost control of the GoK title +##mpo_greatest_of_khans.0040 = { +## type = character_event +## title = mpo_greatest_of_khans.0040.t +## desc = { +## first_valid = { +## triggered_desc = { +## trigger = { +## exists = scope:timed_out +## } +## desc = mpo_greatest_of_khans.0040.desc_timed_out +## } +## desc = mpo_greatest_of_khans.0040.desc +## } +## } +## theme = nomads +## left_portrait = { +## character = root +## animation = horse_exhausted +## camera = camera_event_horse_very_left +## } +## override_background = { +## reference = mpo_steppe_evening +## } +## immediate = { +## add_legitimacy = major_legitimacy_loss +## custom_tooltip = gok_no_more_reform_decision +## custom_tooltip = gok_no_more_special_powers +## custom_tooltip = gok_lose_succession_protection_tt +## if = { +## limit = { +## has_realm_law = nomadic_authority_5 +## } +## remove_realm_law = nomadic_authority_5 +## add_realm_law = nomadic_authority_4 +## } +## if = { +## limit = { +## has_trait = greatest_of_khans +## } +## remove_trait = greatest_of_khans +## } +## if = { +## limit = { +## has_character_modifier = the_great_khan_modifier +## } +## remove_character_modifier = the_great_khan_modifier +## } + +## every_owned_story = { +## limit = { story_type = story_greatest_of_khans } +## end_story = yes +## } +## } +## option = { +## name = mpo_greatest_of_khans.0040.a +## if = { +## limit = { +## any_held_title = { +## this = global_var:greatest_of_khans_title +## } +## } +## custom_tooltip = gok_guaranteed_disastrous_chaotic_succession_tt +## global_var:greatest_of_khans_title = { +## set_variable = { +## name = guaranteed_disastrous_succession +## value = yes +## } +## } +## } +## } +##} + +##Switched government type on purpose... sort of GoK, but not really now +#mpo_greatest_of_khans.0041 = { +# type = character_event +# title = mpo_greatest_of_khans.0041.t +# desc = mpo_greatest_of_khans.0041.desc +# theme = nomads +# left_portrait = { +# character = root +# triggered_animation = { +# trigger = { +# OR = { faith.religion = religion:eastern_orthodox_religion faith.religion = religion:oriental_orthodox_religion faith.religion = religion:catholic_religion faith.religion = religion:protestant_religion } +# } +# animation = acknowledging +# } +# triggered_animation = { +# trigger = { +# primary_title = title:h_china +# } +# animation = emperor +# } +# triggered_animation = { +# trigger = { +# OR = { +# government_has_flag = government_is_tribal +# government_has_flag = government_is_wanua +# } +# } +# animation = personality_honorable +# } +# animation = chancellor +# } +# right_portrait = { +# character = scope:bower +# animation = throne_room_bow_3 +# } +# override_background = { +# reference = throne_room +# } +# immediate = { +# ordered_vassal = { +# order_by = current_military_strength +# limit = { +# basic_is_available_ai = yes +# is_adult = yes +# NOR = { +# is_at_war_with = root +# is_a_faction_member = yes +# government_has_flag = government_is_nomadic +# } +# } +# save_scope_as = bower +# } +# if = { +# limit = { +# NOT = { +# exists = scope:bower +# } +# } +# random_courtier = { +# limit = { +# basic_is_available_ai = yes +# is_adult = yes +# } +# save_scope_as = bower +# } +# } +# if = { +# limit = { +# NOT = { +# exists = scope:bower +# } +# } +# random_pool_character = { +# province = root.capital_province +# limit = { +# basic_is_available_ai = yes +# is_adult = yes +# } +# save_scope_as = bower +# } +# } +# save_scope_as = root_scope +# custom_tooltip = gok_forsaken_nomadism_tt +# custom_tooltip = gok_no_more_reform_decision +# custom_tooltip = gok_no_more_special_powers +# } +# option = { +# name = mpo_greatest_of_khans.0041.a +# } +#} + +##GoK threatens new vassal +##mpo_greatest_of_khans.0050 = { +## type = letter_event +## opening = { +## desc = mpo_greatest_of_khans.0050.opening +## } +## desc = { +## desc = mpo_greatest_of_khans.0050.desc +## first_valid = { +## triggered_desc = { +## trigger = { +## exists = scope:liege +## } +## desc = mpo_greatest_of_khans.0050.desc_reorganized +## } +## desc = mpo_greatest_of_khans.0050.desc_end +## } +## } + +## sender = scope:attacker + +## immediate = { +## if = { +## limit = { +## liege ?= { +## NOT = { +## this = scope:attacker +## } +## } +## } +## liege = { +## save_scope_as = liege +## } +## } +## } + +## option = { +## name = mpo_greatest_of_khans.0050.a +## } +##} + +##GoK mocks unlanded former vassal of enemy +##mpo_greatest_of_khans.0051 = { +## type = letter_event +## opening = { +## desc = mpo_greatest_of_khans.0051.opening +## } +## desc = mpo_greatest_of_khans.0051.desc + +## sender = scope:attacker + +## trigger = { +## is_landed = no +## } +## immediate = { + +## } + +## option = { +## name = mpo_greatest_of_khans.0051.a +## } +##} + +## +## END Become Greatest of Khans events +################## + +##MONGOL INVASION EVENTS - UPDATED FOR MPO + +#### Appearance of Genghis Khan (others) +## by Petter Vilberg (updated by Jason Cantalini) +##mpo_greatest_of_khans.1001 = { +## type = character_event +## window = fullscreen_event +## queue_icon = "gfx/interface/icons/situation_types/the_great_steppe.dds" +## title = mongol_invasion.1002.t +## desc = { +## first_valid = { +## triggered_desc = { +## trigger = { +## OR = { +## any_realm_province = { +## OR = { +## geographical_region = special_mongol_empire_start_region +## geographical_region = special_mongol_empire_conquest_region_prio_1 +## geographical_region = special_mongol_empire_conquest_region_prio_1_alpha +## } +## } +## government_has_flag = government_is_nomadic +## } +## } +## desc = { +## desc = mongol_invasion.1002.desc.close +## first_valid = { +## triggered_desc = { +## trigger = { +## any_realm_province = { +## geographical_region = special_mongol_empire_start_region +## } +## } +## desc = mongol_invasion.1002.desc.close_mongolia +## } +## desc = mongol_invasion.1002.desc.close_steppes +## } +## desc = mongol_invasion.1002.desc.close.mid +## #Great Khan or Genghis? +## first_valid = { +## triggered_desc = { +## trigger = { +## exists = scope:temujin +## } +## desc = mongol_invasion.1002.desc.genghis +## } +## desc = mongol_invasion.1002.desc.gok +## } +## desc = mongol_invasion.1002.desc.close.end +## } +## } + +## desc = { +## desc = mongol_invasion.1002.desc.far_intro +## first_valid = { +## triggered_desc = { +## trigger = { +## exists = scope:temujin +## root = scope:temujin +## } +## desc = mongol_invasion.1002.desc.genghis +## } +## desc = mongol_invasion.1002.desc.gok +## } +## desc = mongol_invasion.1002.desc.far +## } +## } +## } +## theme = nomads +## left_portrait = { +## character = scope:temujin +## animation = celebrate_sword +## camera = camera_event_left_forward +## } +## override_background = { reference = mpo_fullscreen_greatest_of_khans } + +## immediate = { +## play_music_cue = mx_cue_conquest_of_the_golden_horde + +## scope:temujin = { +## save_scope_as = genghis_khan +## primary_title = { +## save_scope_as = gok_title +## } +## show_as_tooltip = { +## add_trait_force_tooltip = greatest_of_khans +## } + +## custom_tooltip = genghis_khan_mongol_empire_tt +## custom_tooltip = genghis_khan_mongol_troops_tt +## custom_tooltip = gok_threatening_powers_tt +## custom_tooltip = mongol_invasion.1002.genghis_khan_tt +## mpo_add_golden_lineage_effect = yes +## } + +## if = { +## limit = { +## OR = { +## government_has_flag = government_is_nomadic +## has_trait = nomadic_philosophy +## } +## } +## custom_tooltip = become_gok_decision_now_unavailable_tt +## } + +## #Save confederation if there is one +## if = { +## limit = { +## any_land_neighboring_realm_with_tributaries_owner = { +## mpo_greatest_of_khans_0002_confederation_trigger = yes +## save_temporary_scope_as = confed_buddy +## } +## valid_confederation_member_trigger = { CHARACTER = scope:confed_buddy } +## is_at_war = no +## } +## ordered_land_neighboring_realm_with_tributaries_owner = { +## order_by = current_military_strength +## limit = { +## mpo_greatest_of_khans_0002_confederation_trigger = yes +## } +## save_scope_as = confederation_neighbor +## confederation = { +## save_scope_as = confederation +## } +## } +## } +## } +## #Submit to the Great Khan if you're already their tributary anyway +## option = { +## trigger = { +## NOR = { +## is_vassal_or_below_of = scope:genghis_khan +## is_at_war_with = scope:genghis_khan +## } +## is_tributary_of_suzerain_or_above = scope:genghis_khan +## } +## name = mpo_greatest_of_khans.0002.a +## #tributary of great khan's vassal or below +## if = { +## limit = { +## is_tributary_of_suzerain_or_above = scope:genghis_khan +## suzerain = { +## highest_held_title_tier > root.highest_held_title_tier +## } +## } +## suzerain = { +## save_scope_as = new_liege +## } +## create_title_and_vassal_change = { +## type = swear_fealty +## save_scope_as = change +## } +## change_liege = { +## liege = scope:new_liege +## change = scope:change +## } +## resolve_title_and_vassal_change = scope:change +## } +## else = { +## create_title_and_vassal_change = { +## type = swear_fealty +## save_scope_as = change +## } +## change_liege = { +## liege = scope:genghis_khan +## change = scope:change +## } +## resolve_title_and_vassal_change = scope:change +## } + +## stress_and_fulfillment_impact = { +## brave = minor_stress_impact_gain +## stubborn = minor_stress_impact_gain +## } +## ai_chance = { +## base = 200 +## ai_value_modifier = { +## ai_boldness = 1 +## } +## modifier = { +## has_trait = ambitious +## add = -20 +## } +## modifier = { +## has_dread_level_towards = { +## target = scope:genghis_khan +## level >= 1 +## } +## add = 100 +## } +## modifier = { +## has_dread_level_towards = { +## target = scope:genghis_khan +## level >= 2 +## } +## add = 200 +## } +## modifier = { +## government_has_flag = government_is_herder +## add = 1000 +## } +## modifier = { +## add = 50 +## opinion = { +## target = scope:genghis_khan +## value >= 50 +## } +## } +## modifier = { +## add = 50 +## opinion = { +## target = scope:genghis_khan +## value >= 75 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:genghis_khan +## value <= -50 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:genghis_khan +## value <= -75 +## } +## } +## } +## } +## #Join a confederation that's next to me +## option = { +## trigger = { +## exists = scope:confederation +## } +## name = mpo_greatest_of_khans.0002.b +## scope:confederation = { add_confederation_member = root } +## scope:confederation_neighbor = { +## if = { +## limit = { +## is_at_war = yes +## } +## every_character_war = { +## limit = { +## primary_defender = { +## is_member_of_confederation = scope:confederation +## } +## } +## add_defender = root +## } +## } +## } +## if = { +## limit = { +## government_has_flag = government_is_nomadic +## } +## add_character_modifier = { +## modifier = mpo_confederation_member_modifier +## years = 5 +## } +## capital_county ?= { +## change_county_fertility = major_county_fertility_level_gain +## } +## } +## stress_and_fulfillment_impact = { +## ambitious = minor_stress_impact_gain +## } +## ai_chance = { +## base = 100 +## modifier = { +## add = 50 +## opinion = { +## target = scope:confederation_neighbor +## value > 50 +## } +## } +## modifier = { +## add = 50 +## opinion = { +## target = scope:confederation_neighbor +## value > 0 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:confederation_neighbor +## value < -25 +## } +## } +## modifier = { +## add = -50 +## opinion = { +## target = scope:confederation_neighbor +## value < -75 +## } +## } +## modifier = { +## has_trait = ambitious +## add = -50 +## } +## } +## } + +## option = { # Option for close characters +## name = { +## trigger = { has_trait = craven } +## text = mongol_invasion.1002.craven +## } +## name = { +## text = mongol_invasion.1002.a +## } +## trigger = { +## government_has_flag = government_is_nomadic +## } + +## if = { +## limit = { +## highest_held_title_tier < tier_empire +## } +## custom_tooltip = mongol_invasion_submission_reminder_tt +## } +## ai_chance = { +## base = 100 +## } +## } + +## option = { # Options for distant characters +## name = { +## text = mongol_invasion.1002.craven +## trigger = { has_trait = craven } +## } +## name = { +## text = mongol_invasion.1002.b +## } +## trigger = { +## NOT = { government_has_flag = government_is_nomadic } +## } +## custom_tooltip = mongol_invasion.1002.genghis_khan_tt + +## if = { +## limit = { +## highest_held_title_tier < tier_empire +## } +## } +## ai_chance = { +## base = 100 +## } + +## } +##} + +##Player Temujin's buffs through feed messages +##mpo_greatest_of_khans.1010 = { +## hidden = yes +## trigger = { +## OR = { +## NOT = { +## exists = local_var:temujin_buff_count +## } +## local_var:temujin_buff_count < 9 +## } +## is_alive = yes +## is_ruler = yes +## government_has_flag = government_is_nomadic +## exists = domicile +## #Only meant to help you GET TO GoK decision +## NOR = { +## has_trait = greatest_of_khans +## has_global_variable = mpo_gok_war_ongoing +## } +## #Decreasing authority means he loses it +## OR = { +## has_realm_law = nomadic_authority_4 +## has_realm_law = nomadic_authority_5 +## } +## } +## immediate = { +## #Adjust tracking variable so this only happens 6 times max +## if = { +## limit = { +## NOT = { +## exists = local_var:temujin_buff_count +## } +## } +## set_local_variable = { +## name = temujin_buff_count +## value = 1 +## } +## } +## else = { +## change_local_variable = { +## name = temujin_buff_count +## add = 1 +## } +## } +## send_interface_message = { +## type = event_gok_temujin_with_text +## title = mpo_greatest_of_khans.1010_title +## desc = mpo_greatest_of_khans.1010_desc +## domicile = { +## change_herd = { +## value = nomadic_authority_level_3_requirement +## divide = 3 +## add = { 1000 3000 } +## } +## } +## add_prestige = { 200 300 } +## add_gold = { 30 80 } +## } +## if = { +## limit = { +## local_var:temujin_buff_count < 9 +## } +## trigger_event = { +## id = mpo_greatest_of_khans.1010 +## months = { 3 9 } +## } +## } +## } +##} diff --git a/events/dlc/ach/ach_coronation_events.txt b/events/dlc/ach/ach_coronation_events.txt index abe309e2b..8b2437138 100644 --- a/events/dlc/ach/ach_coronation_events.txt +++ b/events/dlc/ach/ach_coronation_events.txt @@ -1997,9 +1997,9 @@ ach_coronation.0012 = { is_ai = yes scope:second = { is_ai = yes } } - set_relation_rival = { - target = scope:second - reason = rival_ruined_coronation_role + set_relation_rival_effect = { + TARGET = scope:second + REASON = rival_ruined_coronation_role } } } @@ -2393,7 +2393,7 @@ ach_coronation.0013 = { trigger = { OR = { involved_activity.var:activity_special_type_progression < 25 - location.county = { county_control < 25 } + location.county = { county_control < county_control_relative_25 } } #V Serious roots NOR = { @@ -3440,7 +3440,7 @@ ach_coronation.0015 = { government_has_flag = government_is_tribal } } - reference = market_tribal + reference = market } override_background = { reference = alley_day } @@ -3988,7 +3988,7 @@ ach_coronation.0015 = { years = 5 } county = { - change_development_progress = medium_development_progress_loss + change_prosperity_progress = medium_prosperity_progress_loss } } @@ -4716,7 +4716,7 @@ ach_coronation.0016 = { } set_variable = { name = gifted_artifact - value = yes + value = root days = 1825 } set_owner = { @@ -5379,7 +5379,7 @@ scripted_effect ach_coronation_0018_choose_title_effect = { # Prefer worse titles modifier = { add = { - value = development_level + value = prosperity_level multiply = -1 } } @@ -5574,7 +5574,10 @@ ach_coronation.0018 = { save_scope_as = host if = { # If the Seneschal exists and isn't AI then they're the Servant Boss limit = { - court_position:seneschal_court_position ?= { is_ai = yes } + court_position:seneschal_court_position ?= { + is_ai = yes + this != root + } } court_position:seneschal_court_position = { save_scope_as = servant_boss } } @@ -8461,7 +8464,7 @@ ach_coronation.0027 = { title:e_byzantium ?= { has_variable = founded_varangian_guard } OR = { culture = { has_cultural_pillar = heritage_north_germanic } - dynasty = { has_dynasty_perk = fp1_adventure_legacy_1 } + dynasty ?= { has_dynasty_perk = fp1_adventure_legacy_1 } } } create_character = { diff --git a/events/dlc/bp2/bp2_adult_education_activity_events.txt b/events/dlc/bp2/bp2_adult_education_activity_events.txt index cf9197cdb..556a2bfaf 100644 --- a/events/dlc/bp2/bp2_adult_education_activity_events.txt +++ b/events/dlc/bp2/bp2_adult_education_activity_events.txt @@ -2132,9 +2132,9 @@ bp2_adult_education.1040 = { limit = { can_set_relation_rival_trigger = { CHARACTER = scope:teacher_2 } } - set_relation_rival = { - target = scope:teacher_2 - reason = rival_grave_insult + set_relation_rival_effect = { + TARGET = scope:teacher_2 + REASON = rival_grave_insult } } } diff --git a/events/dlc/bp3/bp3_journey_events.txt b/events/dlc/bp3/bp3_journey_events.txt index e6a4c1316..092c3dbeb 100644 --- a/events/dlc/bp3/bp3_journey_events.txt +++ b/events/dlc/bp3/bp3_journey_events.txt @@ -567,7 +567,7 @@ bp3_journey.0015 = { exists = capital_county } capital_county ?= { - change_development_progress_with_overflow = 10 + change_prosperity_progress_with_overflow = 10 } } ai_chance = { @@ -5116,6 +5116,10 @@ bp3_journey.1900 = { } after = { + scope:local_character = { + remove_character_flag = peasant_outfit + remove_character_flag = no_hat + } if = { # Cleanup limit = { root = { @@ -5134,6 +5138,20 @@ bp3_journey.1900 = { remove_character_flag = peasant_outfit remove_character_flag = no_hat } + if = { # Cleanup + limit = { + root = { + is_ai = yes + } + scope:local_character = { + is_courtier = no + has_character_flag = silently_disappear_me + } + } + scope:local_character = { + silent_disappearance_effect = yes + } + } remove_character_flag = court_tutor_court_position remove_character_flag = royal_architect_court_position remove_character_flag = cupbearer_court_position diff --git a/events/dlc/ce1/epidemic_events.txt b/events/dlc/ce1/epidemic_events.txt index 8a5900bd2..f1f5a2877 100644 --- a/events/dlc/ce1/epidemic_events.txt +++ b/events/dlc/ce1/epidemic_events.txt @@ -781,7 +781,7 @@ epidemic_events.0110 = { weight = { base = 1 modifier = { - add = title_capital_county.development_level + add = title_capital_county.prosperity_level } } limit = { @@ -1270,6 +1270,7 @@ epidemic_events.1000 = { modifier = plague_cult_embraced years = 10 } + change_county_control = -5 } stress_and_fulfillment_impact = { cynical = major_stress_impact_loss @@ -1343,6 +1344,7 @@ epidemic_events.1000 = { modifier = plague_cult_embraced years = 10 } + change_county_control = -5 } stress_and_fulfillment_impact = { zealous = medium_stress_impact_gain @@ -1505,6 +1507,7 @@ epidemic_events.1010 = { modifier = beset_by_revenants years = 5 } + change_county_control = -5 } stress_and_fulfillment_impact = { callous = minor_stress_impact_loss @@ -1992,6 +1995,7 @@ epidemic_events.1040 = { modifier = persecuted_flagellants years = 10 } + change_county_control = 5 } stress_and_fulfillment_impact = { zealous = minor_stress_impact_gain @@ -2026,6 +2030,7 @@ epidemic_events.1040 = { modifier = rampant_flagellants years = 10 } + change_county_control = -5 } stress_and_fulfillment_impact = { flagellant = minor_stress_impact_loss # They're just like me fr! @@ -2056,6 +2061,7 @@ epidemic_events.1040 = { modifier = rampant_flagellants years = 10 } + change_county_control = -5 } if = { limit = { @@ -2153,6 +2159,7 @@ epidemic_events.1050 = { modifier = apocalyptic_inquisition years = 10 } + change_county_control = 5 } stress_and_fulfillment_impact = { # What if they're right? D: @@ -2216,6 +2223,7 @@ epidemic_events.1050 = { modifier = plague_cult years = 10 } + change_county_control = -5 } } } @@ -2252,6 +2260,7 @@ epidemic_events.1050 = { modifier = plague_cult years = 10 } + change_county_control = -5 } stress_and_fulfillment_impact = { diligent = minor_stress_impact_gain @@ -3337,7 +3346,7 @@ epidemic_events.1064 = { var:blamed_plague_on = flag:trait } any_sub_realm_county = { - development_level >= 3 + prosperity_level >= 3 any_county_province = { any_province_epidemic = { this = scope:epidemic_scope @@ -3349,7 +3358,7 @@ epidemic_events.1064 = { immediate = { random_sub_realm_county = { limit = { - development_level >= 3 + prosperity_level >= 3 any_county_province = { any_province_epidemic = { this = scope:epidemic_scope @@ -3425,7 +3434,7 @@ epidemic_events.1064 = { option = { # The witch trials are fine maybe probably name = epidemic_events.1064.a scope:witch_trial_county = { - change_development_level = -2 + change_prosperity_level = -2 change_county_control = -100 } ai_chance = { @@ -3768,10 +3777,10 @@ epidemic_events.1066 = { } this != root.capital_county } - change_development_progress = -50 + change_prosperity_progress = -50 } capital_county = { - change_development_progress_with_overflow = 50 + change_prosperity_progress_with_overflow = 50 add_county_modifier = { modifier = persecuted_minorities_protected years = 15 @@ -3845,7 +3854,7 @@ epidemic_events.1066 = { } } } - change_development_progress = -50 + change_prosperity_progress = -50 add_county_modifier = { modifier = persecuted_minorities_expelled years = 10 @@ -3911,7 +3920,7 @@ epidemic_events.1067 = { has_trait = administrator } capital_county = { - change_development_progress_with_overflow = 150 + change_prosperity_progress_with_overflow = 150 add_county_modifier = { modifier = plague_minorities_sanctuary_boosted years = 10 @@ -3938,7 +3947,7 @@ epidemic_events.1067 = { scope:bigoted_ruler_that_everyone_hates = { every_character_to_title_neighboring_and_across_water_county = { custom = every_bordering_county - change_development_progress = 50 + change_prosperity_progress = 50 add_county_modifier = { modifier = plague_minorities_sanctuary years = 10 @@ -4068,7 +4077,7 @@ epidemic_events.1068 = { scope:loneless_vassal = { every_sub_realm_county = { custom = all_of_vassals_holding - change_development_progress = 15 + change_prosperity_progress = 15 add_county_modifier = { modifier = persecuted_minorities_financial_sanctuary years = 10 @@ -4209,7 +4218,7 @@ epidemic_events.1100 = { scope:infected_county = { OR = { this = root.capital_county - development_level >= 20 + prosperity_level >= 20 } } } @@ -4497,7 +4506,7 @@ epidemic_events.1101 = { scope:infected_county = { OR = { this = root.capital_county - development_level >= 20 + prosperity_level >= 20 } } } @@ -4869,6 +4878,7 @@ epidemic_events.1110 = { modifier = ce1_bodies_in_the_street years = 15 } + change_county_control = -5 } stress_and_fulfillment_impact = { compassionate = minor_stress_impact_gain @@ -5001,6 +5011,7 @@ epidemic_events.1120 = { modifier = ce1_siege_corpse years = 15 } + change_county_control = -10 } } } @@ -5219,6 +5230,7 @@ epidemic_events.1121 = { modifier = ce1_siege_corpse years = 15 } + change_county_control = -10 } stress_and_fulfillment_impact = { arrogant = minor_stress_impact_loss @@ -5343,6 +5355,7 @@ epidemic_events.1123 = { modifier = ce1_siege_corpse years = 15 } + change_county_control = -10 } create_character_memory = { type = ce1_meat_shower @@ -5642,7 +5655,7 @@ epidemic_events.3010 = { } left_portrait = { character = root - animation = jockey_walk + scripted_animation = horse_camel_animation camera = camera_event_horse_left } cooldown = { years = 5 } @@ -6517,11 +6530,17 @@ epidemic_events.5003 = { years = 10 } - random = { - chance = 50 - contract_disease_effect = { DISEASE = ill TREATMENT_EVENT = yes } + if = { + limit = { + NOT = { + has_trait = ill + } + } + random = { + chance = 50 + contract_disease_effect = { DISEASE = ill TREATMENT_EVENT = yes } + } } - stress_and_fulfillment_impact = { compassionate = miniscule_stress_impact_loss trusting = miniscule_stress_impact_loss @@ -6623,6 +6642,7 @@ epidemic_events.5004 = { NOR = { government_has_flag = government_is_nomadic government_has_flag = government_is_tribal + government_has_flag = government_is_merchant } } @@ -8042,6 +8062,7 @@ epidemic_events.5010 = { modifier = plague_alms_donations years = 10 } + change_county_control = 5 } stress_and_fulfillment_impact = { diff --git a/events/dlc/ce1/legend_spread_events_8.txt b/events/dlc/ce1/legend_spread_events_8.txt index 82a37599f..ab83df0a5 100644 --- a/events/dlc/ce1/legend_spread_events_8.txt +++ b/events/dlc/ce1/legend_spread_events_8.txt @@ -2743,7 +2743,7 @@ legend_spread_events.8122 = { triggered_desc = { trigger = { scope:distant_location.county = { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level title_province = { is_wetland_trigger = yes } } } @@ -2752,7 +2752,7 @@ legend_spread_events.8122 = { triggered_desc = { trigger = { scope:distant_location.county = { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level title_province = { is_drylands_or_desert_trigger = yes } } } @@ -2761,7 +2761,7 @@ legend_spread_events.8122 = { triggered_desc = { trigger = { scope:distant_location.county = { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level } } desc = legend_spread_events.8122.desc.disappointing.fallback @@ -2769,7 +2769,7 @@ legend_spread_events.8122 = { triggered_desc = { trigger = { scope:distant_location.county = { - development_level > great_development_level + prosperity_level > great_prosperity_level } } desc = legend_spread_events.8122.desc.not_disappointing @@ -2777,7 +2777,7 @@ legend_spread_events.8122 = { triggered_desc = { trigger = { scope:distant_location.county = { - development_level > good_development_level + prosperity_level > good_prosperity_level } } desc = legend_spread_events.8122.desc.slightly_disappointing @@ -2785,7 +2785,7 @@ legend_spread_events.8122 = { triggered_desc = { trigger = { scope:distant_location.county = { - development_level > bad_development_level + prosperity_level > bad_prosperity_level } } desc = legend_spread_events.8122.desc.somewhat_disappointing @@ -3169,6 +3169,7 @@ legend_spread_events.8130 = { legend_type = legend_type:legitimizing exists = legend_property:title } + exists = house.house_founder root != house.house_founder house.house_founder = { is_alive = no } religion_has_angels_trigger = yes @@ -3402,6 +3403,9 @@ legend_spread_events.8150 = { title = legend_spread_events.8150.t desc = legend_spread_events.8150.desc theme = legend + + override_background = { reference = feast } + left_portrait = { character = root animation = sadness @@ -4200,9 +4204,9 @@ legend_spread_events.8180 = { has_relation_rival = scope:killer } } - set_relation_rival = { - target = scope:killer - reason = rival_murdered_parent + set_relation_rival_effect = { + TARGET = scope:killer + REASON = rival_murdered_parent } } custom_tooltip = { diff --git a/events/dlc/ep1/ep1_fund_inspiration_events.txt b/events/dlc/ep1/ep1_fund_inspiration_events.txt index 6ca199bc7..91888690d 100644 --- a/events/dlc/ep1/ep1_fund_inspiration_events.txt +++ b/events/dlc/ep1/ep1_fund_inspiration_events.txt @@ -7126,11 +7126,40 @@ fund_inspiration.1031 = { set_artifact_description = artifact_dedication_written_h } } + if = { + limit = { + has_royal_court = no + government_has_flag = government_is_merchant + scope:newly_created_artifact = { artifact_slot_type = book } + } + scope:newly_created_artifact = { + reforge_artifact = { type = library_item } + } + } } option = { name = fund_inspiration.1031.a custom_tooltip = create_artifact_book_tooltip + } + + option = { + name = fund_inspiration.1001.c + trigger = { + government_has_flag = government_is_merchant + NOT = { + scope:newly_created_artifact = { artifact_slot_type = library } + } + } + scope:newly_created_artifact = { + custom_tooltip = { + text = reforge_artifact_library_item_tt + reforge_artifact = { type = library_item } + } + } + } + + after = { if = { #If you wrote about your soulmate they'll love it! limit = { exists = scope:portrait_2_soulmate @@ -7165,9 +7194,6 @@ fund_inspiration.1031 = { trigger_event = fund_inspiration.1033 } } - } - - after = { inspiration_completion_effect = yes } } @@ -7408,6 +7434,17 @@ fund_inspiration.1041 = { custom_tooltip = create_artifact_tapestry_tooltip } + option = { + name = fund_inspiration.1001.c + trigger = { government_has_flag = government_is_merchant } + scope:newly_created_artifact = { + custom_tooltip = { + text = reforge_artifact_curio_tt + reforge_artifact = { type = curio } + } + } + } + after = { inspiration_completion_effect = yes } @@ -8235,6 +8272,17 @@ fund_inspiration.1061 = { name = fund_inspiration.1001.a custom_tooltip = create_artifact_artisan_tooltip } + + option = { + name = fund_inspiration.1001.c + trigger = { government_has_flag = government_is_merchant } + scope:newly_created_artifact = { + custom_tooltip = { + text = reforge_artifact_curio_tt + reforge_artifact = { type = curio } + } + } + } } #Let's not make icons for aniconic religions @@ -8556,12 +8604,35 @@ fund_inspiration.1071 = { set_artifact_description = artifact_motto_inscribed } } + if = { + limit = { + has_royal_court = no + government_has_flag = government_is_merchant + scope:newly_created_artifact = { + OR = { + artifact_slot_type = throne + artifact_slot_type = wall_big + artifact_slot_type = wall_small + artifact_slot_type = sculpture + artifact_slot_type = pedestal + } + } + } + scope:newly_created_artifact = { + reforge_artifact = { type = curio } + } + } } # option = { name = fund_inspiration.1001.a - trigger = { NOT = { has_character_flag = waiting_for_a_crown can_host_activity = activity_coronation } } + trigger = { + NOT = { + has_character_flag = waiting_for_a_crown + can_host_activity = activity_coronation + } + } custom_tooltip = create_artifact_smith_tooltip } @@ -8581,6 +8652,26 @@ fund_inspiration.1071 = { player = root } } + + option = { + name = fund_inspiration.1001.c + trigger = { + NOT = { + has_character_flag = waiting_for_a_crown + can_host_activity = activity_coronation + } + government_has_flag = government_is_merchant + NOT = { + scope:newly_created_artifact = { artifact_slot_type = curio } + } + } + scope:newly_created_artifact = { + custom_tooltip = { + text = reforge_artifact_curio_tt + reforge_artifact = { type = curio } + } + } + } } # Alchemy artifact @@ -13533,7 +13624,6 @@ fund_inspiration.2120 = { has_trait = chaste is_consort_of = root has_relation_lover = root - has_relation_soulmate = root is_close_family_of = root has_any_bad_relationship_with_character_trigger = { CHARACTER = root } has_trait = celibate @@ -15651,14 +15741,14 @@ fund_inspiration.3014 = { } } - #Development + #Prosperity option = { name = fund_inspiration.3014.b custom_tooltip = fund_inspiration.3014.b.tt scope:inspiration_owner = { set_variable = { name = book_topic_category - value = flag:stewardship_development + value = flag:stewardship_prosperity } } } @@ -17985,6 +18075,9 @@ fund_inspiration.6102 = { factor = root.learning } wound_treatment_results_effect = { TREATMENT = safe OUTCOME = success } + scope:tiny_sculpture_trinket = { + set_owner = root + } hidden_effect = { send_interface_toast = { left_icon = root @@ -17993,9 +18086,6 @@ fund_inspiration.6102 = { show_as_tooltip = { wound_treatment_results_effect = { TREATMENT = safe OUTCOME = success } } - scope:tiny_sculpture_trinket = { - set_owner = root - } } } } @@ -22718,9 +22808,8 @@ fund_inspiration.7001 = { if = { limit = { primary_spouse ?= { - NOR = { + NOT = { has_relation_rival = root - has_relation_nemesis = root } } } diff --git a/events/dlc/ep2/ep2_tournament_events.txt b/events/dlc/ep2/ep2_tournament_events.txt index 02725d40e..17c4e379d 100644 --- a/events/dlc/ep2/ep2_tournament_events.txt +++ b/events/dlc/ep2/ep2_tournament_events.txt @@ -2419,7 +2419,6 @@ ep2_tournament_events.0021 = { any_close_family_member = { OR = { has_relation_lover = root - has_relation_soulmate = root is_spouse_of = root } } @@ -2430,7 +2429,6 @@ ep2_tournament_events.0021 = { any_close_family_member = { OR = { has_relation_lover = root - has_relation_soulmate = root is_spouse_of = root } } @@ -2448,7 +2446,6 @@ ep2_tournament_events.0021 = { limit = { OR = { has_relation_lover = root - has_relation_soulmate = root is_spouse_of = root } } @@ -3633,19 +3630,15 @@ ep2_tournament_events.1006 = { first_valid = { triggered_desc = { trigger = { - OR = { - has_relation_rival = scope:surrendering_knight - has_relation_nemesis = scope:surrendering_knight - } + has_relation_rival = scope:surrendering_knight } desc = ep2_tournament_events.1006.rival } triggered_desc = { trigger = { AND = { - NOR = { + NOT = { has_relation_rival = scope:surrendering_knight - has_relation_nemesis = scope:surrendering_knight } scope:surrendering_knight.gold < 5 } @@ -3657,9 +3650,8 @@ ep2_tournament_events.1006 = { } triggered_desc = { trigger = { - NOR = { + NOT = { has_relation_rival = scope:surrendering_knight - has_relation_nemesis = scope:surrendering_knight } } desc = ep2_tournament_events.1006.normal @@ -3770,10 +3762,7 @@ ep2_tournament_events.1006 = { name = ep2_tournament_events.1006.a trigger = { - OR = { - has_relation_rival = scope:surrendering_knight - has_relation_nemesis = scope:surrendering_knight - } + has_relation_rival = scope:surrendering_knight } add_internal_flag = special @@ -5905,7 +5894,6 @@ ep2_tournament_events.1015 = { OR = { #Ensure it's someone meaningful to you is_close_family_or_spouse_of_root_trigger = yes has_relation_lover = root - has_relation_soulmate = root has_character_modifier = ignores_gender_army_rules #In case Mulan ends up really good! } } @@ -5921,7 +5909,6 @@ ep2_tournament_events.1015 = { OR = { #Ensure it's someone meaningful to you is_close_family_or_spouse_of_root_trigger = yes has_relation_lover = root - has_relation_soulmate = root has_character_modifier = ignores_gender_army_rules #In case Mulan ends up really good! } } @@ -5947,7 +5934,6 @@ ep2_tournament_events.1015 = { contest_event_general_contestant_valid_trigger = yes OR = { is_close_family_or_spouse_of_root_trigger = yes - has_relation_soulmate = root has_relation_lover = root has_character_modifier = ignores_gender_army_rules } @@ -5962,7 +5948,6 @@ ep2_tournament_events.1015 = { contest_event_general_contestant_valid_trigger = yes OR = { is_close_family_or_spouse_of_root_trigger = yes - has_relation_soulmate = root has_relation_lover = root has_character_modifier = ignores_gender_army_rules } @@ -6163,7 +6148,6 @@ ep2_tournament_events.1016 = { OR = { #Catchall for relations is_close_family_or_spouse_of_root_trigger = yes has_relation_lover = root - has_relation_soulmate = root } } } @@ -7942,10 +7926,7 @@ ep2_tournament_events.2003 = { this = scope:versus_matchee this = scope:versus_matcher } - OR = { - has_relation_friend = root - has_relation_best_friend = root - } + has_relation_friend = root } } } @@ -7961,10 +7942,7 @@ ep2_tournament_events.2003 = { this = scope:versus_matchee this = scope:versus_matcher } - OR = { - has_relation_friend = root - has_relation_best_friend = root - } + has_relation_friend = root } save_scope_as = friend } diff --git a/events/dlc/ep3/ep3_decisions_events.txt b/events/dlc/ep3/ep3_decisions_events.txt index 50b86b743..dffc1638c 100644 --- a/events/dlc/ep3/ep3_decisions_events.txt +++ b/events/dlc/ep3/ep3_decisions_events.txt @@ -709,6 +709,7 @@ ep3_decisions_event.0004 = { immediate = { # needed in the blinding effects save_scope_as = actor + save_scope_as = puppet_or_actor scope:valid_prisoner = { save_scope_as = recipient } } @@ -2286,7 +2287,7 @@ ep3_decisions_event.2011 = { learning < average_skill_rating } capital_county = { - county_control < 90 + county_control < county_control_baseline } legitimacy_level < 2 } @@ -4029,6 +4030,7 @@ scripted_effect ask_help_crusade_setup_effect = { faith = scope:the_faith highest_held_title_tier >= tier_county this != scope:ghw_sponsor + NOT = { government_has_flag = government_is_merchant } } trigger_event = great_holy_war.0003 #Send event immediately for player, then delay it for all the AIs. } @@ -4911,9 +4913,9 @@ ep3_decisions_event.4026 = { limit = { can_set_relation_rival_trigger = { CHARACTER = scope:pagan } } - set_relation_rival = { - reason = rival_killed_religious_emissary - target = scope:pagan + set_relation_rival_effect = { + TARGET = scope:pagan + REASON = rival_killed_religious_emissary } } if = { @@ -5207,6 +5209,7 @@ ep3_decisions_event.4060 = { government_has_flag = government_is_landless_adventurer government_has_flag = government_is_tribal government_has_mechanic = administrative + government_has_flag = government_is_merchant } primary_title = { target_is_de_jure_liege_or_above = scope:administrative_liege.primary_title #We only auto convert de jure vassals @@ -5223,6 +5226,7 @@ ep3_decisions_event.4060 = { government_has_flag = government_is_landless_adventurer government_has_flag = government_is_tribal government_has_mechanic = administrative + government_has_flag = government_is_merchant primary_title = { target_is_de_jure_liege_or_above = scope:administrative_liege.primary_title #We only auto convert de jure vassals } @@ -5241,6 +5245,7 @@ ep3_decisions_event.4060 = { government_has_flag = government_is_landless_adventurer government_has_flag = government_is_tribal government_has_mechanic = administrative + government_has_flag = government_is_merchant primary_title = { target_is_de_jure_liege_or_above = scope:administrative_liege.primary_title #We only auto convert de jure vassals } @@ -6490,9 +6495,9 @@ ep3_decisions_event.5002 = { limit = { can_set_relation_rival_trigger = { CHARACTER = scope:my_rival } } - set_relation_rival = { - target = scope:my_rival - reason = rival_called_me_a_disgrace + set_relation_rival_effect = { + TARGET = scope:my_rival + REASON = rival_called_me_a_disgrace } } add_character_modifier = { @@ -7474,9 +7479,9 @@ ep3_decisions_event.6001 = { this != scope:new_liege can_set_relation_rival_trigger = { CHARACTER = root } } - set_relation_rival = { - target = root - reason = seized_my_realm_crime + set_relation_rival_effect = { + TARGET = root + REASON = seized_my_realm_crime } } } @@ -7585,7 +7590,7 @@ ep3_decisions_event.6001 = { TITLE_LIST = transfer_titles TYPE = granted REASON = flag:culture_champion - ENNOBLED_ADVENTURER = flag:no + NEVER_ENNOBLED = flag:yes } hidden_effect = { scope:old_heir ?= { @@ -7902,7 +7907,7 @@ ep3_decisions_event.9010 = { # Fish Alone base = miniscule_stress_impact_loss ambitious = medium_stress_impact_loss } - domicile = { + domicile ?= { change_provisions = miniscule_provisions_value } } @@ -8008,7 +8013,7 @@ ep3_decisions_event.9020 = { # Fish With Your potential_friend base = miniscule_stress_impact_loss ambitious = major_stress_impact_loss } - domicile = { + domicile ?= { change_provisions = miniscule_provisions_value } } @@ -8055,7 +8060,7 @@ ep3_decisions_event.9020 = { # Fish With Your potential_friend base = miniscule_stress_impact_loss ambitious = major_stress_impact_loss } - domicile = { + domicile ?= { change_provisions = miniscule_provisions_value } } @@ -8138,7 +8143,7 @@ ep3_decisions_event.9030 = { # Fish On A Boat, your potential friend will join y base = minor_stress_impact_loss ambitious = major_stress_impact_loss } - domicile = { + domicile ?= { change_provisions = minor_provisions_value } } @@ -8178,7 +8183,7 @@ ep3_decisions_event.9030 = { # Fish On A Boat, your potential friend will join y title = ep3_decisions_event.9030.a.fishfriend left_icon = scope:potential_friend add_stress = minor_stress_impact_loss - domicile = { + domicile ?= { change_provisions = minor_provisions_value } } diff --git a/events/dlc/ep3/ep3_emperor_yearly_2.txt b/events/dlc/ep3/ep3_emperor_yearly_2.txt index b6db111e8..ab1a6a79c 100644 --- a/events/dlc/ep3/ep3_emperor_yearly_2.txt +++ b/events/dlc/ep3/ep3_emperor_yearly_2.txt @@ -89,7 +89,7 @@ ep3_emperor_yearly.2000 = { } triggered_desc = { trigger = { - scope:county = title:c_roma + scope:county = title:c_roma_urbs # Roma + Vaticano } desc = ep3_emperor_yearly.2000.desc_rome } @@ -215,10 +215,15 @@ ep3_emperor_yearly.2000 = { } NOT = { exists = global_var:ep3_reconquered_ravenna } } - trigger_else_if = { + trigger_else_if = { # Must have both Roma + Vaticano limit = { - scope:county = title:c_roma + OR = { + scope:county = title:c_roma # Vaticano + scope:county = title:c_roma_urbs # Roma + } } + title:c_roma.holder.top_liege = root.top_liege # Vaticano + title:c_roma_urbs.holder.top_liege = root.top_liege # Roma NOT = { exists = global_var:ep3_reconquered_roma } } trigger_else_if = { @@ -269,6 +274,10 @@ ep3_emperor_yearly.2000 = { } immediate = { + if = { # Must have both Roma + Vaticano, use Roma for loc + limit = { scope:county = title:c_roma } # Vaticano + title:c_roma_urbs = { save_scope_as = county } # Roma + } switch = { trigger = scope:county title:c_antiocheia = { @@ -292,7 +301,7 @@ ep3_emperor_yearly.2000 = { title:c_siracusa = { set_global_variable = ep3_reconquered_siracusa } - title:c_roma = { + title:c_roma_urbs = { # Roma + Vaticano set_global_variable = ep3_reconquered_roma } title:c_ravenna = { @@ -330,13 +339,25 @@ ep3_emperor_yearly.2000 = { #Option A option = { name = ep3_emperor_yearly.2000.a - if = { + if = { # Roma + Vaticano + limit = { scope:county = title:c_roma_urbs } # Roma + title:c_roma = { # Vaticano + add_county_modifier = { + modifier = ep3_restored_pentarchy_seat_county_modifier + years = 10 + } + } + add_character_modifier = { + modifier = ep3_restored_pentarchy_seat_modifier + years = 10 + } + } + else_if = { limit = { OR = { scope:county = title:c_antiocheia scope:county = title:c_jerusalem scope:county = title:c_alexandria - scope:county = title:c_roma } } scope:county = { @@ -2097,7 +2118,7 @@ ep3_emperor_yearly.2080 = { #Ongoing building construction in the capital capital_county = { any_county_province = { - has_ongoing_construction = yes + has_ongoing_holding_construction = yes } } } @@ -3792,11 +3813,10 @@ ep3_emperor_yearly.2150 = { change_influence = major_influence_gain } else = { - add_character_flag = { - flag = ep3_2150_found_truth + add_character_modifier = { + modifier = ep3_emperor_yearly_2150_found_truth_modifier years = 25 } - custom_tooltip = ep3_emperor_yearly.2150.b.tt change_influence = minor_influence_gain } random_list = { @@ -3834,11 +3854,10 @@ ep3_emperor_yearly.2150 = { change_influence = major_influence_gain } else = { - add_character_flag = { - flag = ep3_2150_found_truth + add_character_modifier = { + modifier = ep3_emperor_yearly_2150_found_truth_modifier years = 25 } - custom_tooltip = ep3_emperor_yearly.2150.b.tt change_influence = minor_influence_gain } if = { @@ -4189,11 +4208,10 @@ ep3_emperor_yearly.2160 = { left_icon = scope:nomad_neighbor type = event_generic_neutral add_pressed_claim = scope:nomad_county - add_character_flag = { - flag = ep3_2160_success + add_character_modifier = { + modifier = ep3_emperor_yearly_2160_frontier_success_modifier years = 25 } - custom_tooltip = ep3_emperor_yearly.2160.b.tt } } 50 = { @@ -4208,11 +4226,10 @@ ep3_emperor_yearly.2160 = { left_icon = scope:nomad_neighbor type = event_generic_neutral scope:nomad_neighbor = { add_pressed_claim = scope:our_county } - add_character_flag = { - flag = ep3_2160_failure + add_character_modifier = { + modifier = ep3_emperor_yearly_2160_frontier_failure_modifier years = 25 } - custom_tooltip = ep3_emperor_yearly.2160.b.tt2 } } } @@ -4357,11 +4374,10 @@ ep3_emperor_yearly.2170 = { years = 50 } } - add_character_flag = { - flag = ep3_2170_success + add_character_modifier = { + modifier = ep3_emperor_yearly_2170_tunnels_closed_modifier years = 25 } - custom_tooltip = ep3_emperor_yearly.2160.b.tt stress_and_fulfillment_impact = { generous = medium_stress_impact_gain deceitful = medium_stress_impact_gain @@ -4802,9 +4818,8 @@ ep3_emperor_yearly.2190 = { } } else = { - custom_tooltip = ep3_emperor_yearly.2150.b.tt - add_character_flag = { - flag = ep3_2190_honest + add_character_modifier = { + modifier = ep3_emperor_yearly_2190_honest_modifier years = 25 } liege = { @@ -5004,7 +5019,7 @@ ep3_emperor_yearly.2200 = { limit = { tgp_realm_has_ceremonial_liege_trigger = yes } - top_liege.primary_title.var:administrative_ui_special_title.holder = { + ceremonial_liege = { save_scope_as = ceremonial_monarch } } @@ -5014,11 +5029,10 @@ ep3_emperor_yearly.2200 = { option = { name = ep3_emperor_yearly.2200.a add_gold = major_gold_value - add_character_flag = { - flag = ep3_embezzling_governor + add_character_modifier = { + modifier = ep3_emperor_yearly_2200_embezzling_modifier years = 10 } - custom_tooltip = ep3_emperor_yearly.2160.b.tt2 increase_governance_effect = { VALUE = -4 } if = { limit = { @@ -5493,11 +5507,7 @@ scripted_trigger ep3_2220_valid_county_trigger = { has_holding_type = church_holding ep3_2220_famous_monastery_trigger = yes } - OR = { - has_building_or_higher = hill_farms_01 - has_building_or_higher = pastures_01 - has_building_or_higher = farm_estates_01 - } + province_has_district = villages_district } } @@ -5568,10 +5578,7 @@ ep3_emperor_yearly.2220 = { } alternative_limit = { has_holding_type = church_holding - OR = { - has_building_or_higher = scriptorium_01 - has_building_or_higher = monastic_schools_01 - } + has_building_or_higher = scriptorium_1 } alternative_limit = { has_holding_type = church_holding @@ -5584,11 +5591,7 @@ ep3_emperor_yearly.2220 = { has_holding_type = church_holding ep3_2220_famous_monastery_trigger = yes } - OR = { - has_building_or_higher = hill_farms_01 - has_building_or_higher = pastures_01 - has_building_or_higher = farm_estates_01 - } + province_has_district = villages_district } save_scope_as = shepherd_province } @@ -5679,14 +5682,14 @@ ep3_emperor_yearly.2230 = { valid_for_byz_governor_content_trigger = yes valid_for_byz_emperor_content_trigger = yes } - capital_county = { county_control <= 75 } + capital_county = { county_control <= county_control_relative_75 } } weight_multiplier = { base = 1 modifier = { capital_county = { - county_control <= 50 + county_control < county_control_baseline } add = 1 } @@ -5941,7 +5944,7 @@ ep3_emperor_yearly.2240 = { desc = ep3_emperor_yearly.2240.desc_outro } theme = learning - override_background = { reference = ep3_medi_market } + override_background = { reference = market } left_portrait = { character = root animation = rage diff --git a/events/dlc/ep3/ep3_emperor_yearly_8.txt b/events/dlc/ep3/ep3_emperor_yearly_8.txt index 86320c63b..f89d291d3 100644 --- a/events/dlc/ep3/ep3_emperor_yearly_8.txt +++ b/events/dlc/ep3/ep3_emperor_yearly_8.txt @@ -9,7 +9,7 @@ # Capital depopulated: move from somewhere else? scripted_trigger ep3_emperor_yearly_8000_county_holder_trigger = { - NOT = { has_county_modifier = ep3_development_sacrifice_modifier } + NOT = { has_county_modifier = ep3_prosperity_sacrifice_modifier } holder = { NOR = { this = root @@ -45,18 +45,18 @@ scripted_effect ep3_emperor_yearly_8000_county_effect = { } } save_scope_value_as = { - name = development_loss + name = prosperity_loss value = { - value = scope:county_$COUNT$.development_level + value = scope:county_$COUNT$.prosperity_level multiply = 0.1 ceiling = yes multiply = -1 } } scope:county_$COUNT$ = { - change_development_level = scope:development_loss + change_prosperity_level = scope:prosperity_loss add_county_modifier = { - modifier = ep3_development_sacrifice_modifier + modifier = ep3_prosperity_sacrifice_modifier years = 10 } } @@ -106,7 +106,7 @@ ep3_emperor_yearly.8000 = { } # Ensure this has not happened already NOT = { - capital_county = { has_county_modifier = ep3_development_waning_modifier } + capital_county = { has_county_modifier = ep3_prosperity_waning_modifier } } # Recent conflict OR = { @@ -164,20 +164,20 @@ ep3_emperor_yearly.8000 = { save_scope_as = suggestor } } - # Find development target + # Find prosperity target ordered_sub_realm_county = { limit = { ep3_emperor_yearly_8000_county_holder_trigger = yes } - order_by = development_level + order_by = prosperity_level position = 2 save_scope_value_as = { - name = minimum_development - value = development_level + name = minimum_prosperity + value = prosperity_level } } # Find matching counties every_sub_realm_county = { limit = { - development_level >= scope:minimum_development + prosperity_level >= scope:minimum_prosperity ep3_emperor_yearly_8000_county_holder_trigger = yes } add_to_list = developed_counties @@ -312,9 +312,9 @@ ep3_emperor_yearly.8000 = { option = { name = ep3_emperor_yearly.8000.d capital_county = { - change_development_level = -2 + change_prosperity_level = -2 add_county_modifier = { - modifier = ep3_development_waning_modifier + modifier = ep3_prosperity_waning_modifier years = 10 } } @@ -1549,7 +1549,7 @@ scripted_trigger ep3_emperor_yearly_8050_culture_trigger = { scripted_effect ep3_emperor_yearly_8050_unchecked_county_effect = { change_county_control = -10 - change_development_level = -1 + change_prosperity_level = -1 add_county_modifier = { modifier = ep3_raider_unchecked_modifier years = 10 @@ -1586,7 +1586,7 @@ ep3_emperor_yearly.8050 = { cp:councillor_marshal ?= { is_ai = yes } # Sea capital any_held_county = { - development_level >= terrible_development_level + prosperity_level >= terrible_prosperity_level title_province = { OR = { is_coastal = yes @@ -1633,14 +1633,14 @@ ep3_emperor_yearly.8050 = { else = { random_held_county = { limit = { - development_level >= terrible_development_level + prosperity_level >= terrible_prosperity_level title_province = { is_coastal = yes } } weight = { base = 1 - modifier = { add = development_level } + modifier = { add = prosperity_level } modifier = { - title_province = { has_building_or_higher = common_tradeport_01 } + title_province = { has_port_district = yes } factor = 2 } } diff --git a/events/dlc/ep3/ep3_eparch_events.txt b/events/dlc/ep3/ep3_eparch_events.txt index 8deb416b9..b291e5fff 100644 --- a/events/dlc/ep3/ep3_eparch_events.txt +++ b/events/dlc/ep3/ep3_eparch_events.txt @@ -383,7 +383,7 @@ ep3_eparch_event.0005 = { has_court_position = eparch_court_position liege = { capital_province.county ?= { - county_control < 90 + county_control < county_control_baseline } } } @@ -392,7 +392,7 @@ ep3_eparch_event.0005 = { base = 1 modifier = { capital_province.county ?= { - county_control < 60 + county_control < county_control_relative_60 } factor = 1.1 } diff --git a/events/dlc/ep3/ep3_governor_yearly_3.txt b/events/dlc/ep3/ep3_governor_yearly_3.txt index 5524385dc..282d10d95 100644 --- a/events/dlc/ep3/ep3_governor_yearly_3.txt +++ b/events/dlc/ep3/ep3_governor_yearly_3.txt @@ -948,11 +948,10 @@ ep3_governor_yearly.3002 = { has_character_flag = vast_lands_stolen } } - add_character_flag = { - flag = ep3_governor_yearly_3002_landlord_wins + add_character_modifier = { + modifier = ep3_governor_yearly_3002_landlord_wins_modifier years = 10 } - custom_tooltip = ep3_governor_yearly.3000_governance_loss show_as_tooltip = { scope:landlord.house = { add_house_modifier = { @@ -963,11 +962,10 @@ ep3_governor_yearly.3002 = { } } else = { - add_character_flag = { - flag = ep3_governor_yearly_3002_landlord_fight + add_character_modifier = { + modifier = ep3_governor_yearly_3002_landlord_fight_modifier years = 10 } - custom_tooltip = ep3_governor_yearly.3000_miniscule_governance_loss show_as_tooltip = { scope:landlord.house = { add_house_modifier = { @@ -1025,11 +1023,10 @@ ep3_governor_yearly.3002 = { has_character_flag = vast_lands_stolen } } - add_character_flag = { - flag = ep3_governor_yearly_3002_landlord_dominates + add_character_modifier = { + modifier = ep3_governor_yearly_3002_landlord_dominates_modifier years = 10 } - custom_tooltip = ep3_governor_yearly.3000_major_governance_loss show_as_tooltip = { scope:landlord.house = { add_house_modifier = { @@ -1040,11 +1037,10 @@ ep3_governor_yearly.3002 = { } } else = { - add_character_flag = { - flag = ep3_governor_yearly_3002_landlord_wins + add_character_modifier = { + modifier = ep3_governor_yearly_3002_landlord_wins_modifier years = 10 } - custom_tooltip = ep3_governor_yearly.3000_governance_loss show_as_tooltip = { scope:landlord.house = { add_house_modifier = { @@ -1204,9 +1200,9 @@ ep3_governor_yearly.3003 = { scope:governor = { has_character_flag = governor_becomes_rival } } scope:governor = { - set_relation_rival = { - target = root - reason = rival_accused_of_stealing_land + set_relation_rival_effect = { + TARGET = root + REASON = rival_accused_of_stealing_land } } } @@ -2985,7 +2981,7 @@ ep3_governor_yearly.3030 = { is_at_war = no age >= 12 capital_county = { - county_control >= 100 + county_control >= county_control_baseline } primary_title = { NOT = { @@ -3000,7 +2996,7 @@ ep3_governor_yearly.3030 = { } } capital_county = { - county_control >= 100 + county_control >= county_control_baseline } } OR = { @@ -3016,7 +3012,7 @@ ep3_governor_yearly.3030 = { } NOT = { any_sub_realm_county = { - any_province = { + any_county_province = { any_province_epidemic = { } } } @@ -5176,13 +5172,12 @@ ep3_governor_yearly.3050 = { if = { limit = { is_governor = yes - NOT = { has_character_flag = ep3_governor_yearly_3050_neglect_duties } + NOT = { has_character_modifier = ep3_governor_yearly_3050_neglect_duties_modifier } } change_influence = medium_influence_gain #Lose governor efficiency - custom_tooltip = ep3_governor_yearly_3050_neglect_duties_tooltip - add_character_flag = { - flag = ep3_governor_yearly_3050_neglect_duties + add_character_modifier = { + modifier = ep3_governor_yearly_3050_neglect_duties_modifier years = 10 } } @@ -5583,7 +5578,6 @@ ep3_governor_yearly.3060 = { has_relation_friend = scope:emperor has_relation_potential_friend = scope:emperor has_relation_lover = scope:emperor - has_relation_soulmate = scope:emperor is_allied_to = scope:emperor is_close_family_of = scope:emperor house = scope:emperor.house @@ -7141,7 +7135,7 @@ ep3_governor_yearly.3070 = { change_influence = minor_influence_gain every_sub_realm_county = { custom = custom.every_sub_realm_county - change_development_progress = medium_development_progress_gain + change_prosperity_progress = medium_prosperity_progress_gain } } @@ -7238,7 +7232,6 @@ ep3_governor_yearly.3070 = { add_character_modifier = { modifier = contented_governing_countrymen_modifier years = 10 - desc = contented_governing_countrymen_modifier_tooltip } } change_influence = minor_influence_loss @@ -7578,11 +7571,10 @@ ep3_governor_yearly.3080 = { } } else = { - add_character_flag = { - flag = ep3_governor_ignored_isolation + add_character_modifier = { + modifier = ep3_governor_yearly_3080_ignored_isolation_modifier years = 5 } - custom_tooltip = ep3_governor_ignored_isolation_tooltip } } #Long-term improvements are needed or this will only happen again @@ -7606,7 +7598,7 @@ ep3_governor_yearly.3080 = { } else = { capital_county = { - change_development_progress = medium_development_progress_gain + change_prosperity_progress = medium_prosperity_progress_gain } } increase_governance_effect = { VALUE = 5 } @@ -7638,9 +7630,7 @@ ep3_governor_yearly.3080 = { add_character_modifier = { modifier = ep3_anxious_for_new_assignment_modifier years = 5 - desc = ep3_anxious_for_new_assignment_desc } - custom_tooltip = ep3_anxious_for_new_assignment_tooltip stress_and_fulfillment_impact = { diligent = medium_stress_impact_gain just = medium_stress_impact_gain @@ -7817,8 +7807,10 @@ ep3_governor_yearly.3080 = { type = event_toast_effect_good title = ep3_governor_yearly.3080.d.success increase_governance_effect = { VALUE = 10 } - remove_character_flag = ep3_governor_ignored_isolation - custom_tooltip = ep3_governor_ignored_isolation_removal_tooltip + if = { + limit = { has_character_modifier = ep3_governor_yearly_3080_ignored_isolation_modifier } + remove_character_modifier = ep3_governor_yearly_3080_ignored_isolation_modifier + } } } 35 = { #You find nothing @@ -7845,7 +7837,7 @@ ep3_governor_yearly.3080 = { title = ep3_governor_yearly.3080.d.crit_fail capital_county = { - change_development_progress = medium_development_progress_loss + change_prosperity_progress = medium_prosperity_progress_loss } } } @@ -8254,7 +8246,7 @@ ep3_governor_yearly.3090 = { } increase_governance_effect = { VALUE = 10 } capital_county = { - change_development_progress = minor_development_progress_gain + change_prosperity_progress = minor_prosperity_progress_gain } } else = { @@ -9071,7 +9063,7 @@ ep3_governor_yearly.3100 = { } add_gold = medium_gold_value capital_county = { - change_development_progress = medium_development_progress_loss + change_prosperity_progress = medium_prosperity_progress_loss } add_prestige = medium_prestige_loss } @@ -9115,9 +9107,7 @@ ep3_governor_yearly.3100 = { add_character_modifier = { modifier = ep3_ignoring_realm_decline_modifier years = 10 - desc = ep3_ignoring_realm_decline_tooltip } - custom_tooltip = ep3_ignoring_realm_decline_years_tooltip random_list = { 45 = { add_stress = minor_stress_impact_loss diff --git a/events/dlc/ep3/ep3_governor_yearly_8.txt b/events/dlc/ep3/ep3_governor_yearly_8.txt index 5ea2dcfac..409ad8702 100644 --- a/events/dlc/ep3/ep3_governor_yearly_8.txt +++ b/events/dlc/ep3/ep3_governor_yearly_8.txt @@ -993,7 +993,11 @@ ep3_governor_yearly.8040 = { base = 1 modifier = { add = 1 - government_has_flag = government_is_republic + OR = { + government_has_flag = government_is_republic + government_has_flag = government_is_merchant + } + } modifier = { add = -1 @@ -1019,7 +1023,7 @@ ep3_governor_yearly.8040 = { name = ep3_governor_yearly.8040.a increase_governance_effect = { VALUE = 5 } add_character_modifier = { - modifier = ep3_governor_yearly_8040_province_development_modifier + modifier = ep3_governor_yearly_8040_province_prosperity_modifier years = 10 } reverse_add_opinion = { @@ -1043,7 +1047,7 @@ ep3_governor_yearly.8040 = { option = { # Focus on estate name = ep3_governor_yearly.8040.b add_character_modifier = { - modifier = ep3_governor_yearly_8040_domicile_development_modifier + modifier = ep3_governor_yearly_8040_domicile_prosperity_modifier years = 10 } reverse_add_opinion = { @@ -1325,12 +1329,9 @@ scripted_trigger ep3_governor_yearly_8060_complainant_trigger = { scripted_effect ep3_governor_yearly_8060_success_effect = { add_short_term_gold = scope:gold - custom_tooltip = { - text = ep3_governor_yearly.8060.efficiency_tt - add_character_flag = { - flag = ep3_8060_efficiency_drop - years = 10 - } + add_character_modifier = { + modifier = ep3_governor_yearly_8060_efficiency_drop_modifier + years = 10 } } @@ -2132,9 +2133,9 @@ ep3_governor_yearly.8090 = { option = { # Antagonize name = ep3_governor_yearly.8090.a - set_relation_rival = { - target = scope:old_holder - reason = rival_ep3_province_claim + set_relation_rival_effect = { + TARGET = scope:old_holder + REASON = rival_ep3_province_claim } duel = { skills = { stewardship intrigue } @@ -2784,7 +2785,7 @@ ep3_governor_yearly.8110 = { ##################################### scripted_trigger ep3_governor_yearly_8120_county_trigger = { - county_control >= 75 + county_control >= county_control_relative_75 OR = { ep3_governor_yearly_8120_earthquake_trigger = yes ep3_governor_yearly_8120_storm_trigger = yes @@ -2870,7 +2871,7 @@ ep3_governor_yearly.8120 = { } save_scope_as = disaster_county change_county_control = -30 - change_development_progress_with_overflow = -50 + change_prosperity_progress_with_overflow = -50 } } @@ -2894,7 +2895,7 @@ ep3_governor_yearly.8120 = { increase_governance_effect = { VALUE = 5 } scope:disaster_county = { change_county_control = 20 - change_development_progress_with_overflow = 40 + change_prosperity_progress_with_overflow = 40 } add_character_modifier = { modifier = ep3_governor_yearly_8120_relief_leader_modifier @@ -3186,7 +3187,7 @@ ep3_governor_yearly.8140 = { } save_scope_as = peasant } - scope:estate_county = { change_development_progress_with_overflow = -50 } + scope:estate_county = { change_prosperity_progress_with_overflow = -50 } } option = { # Fine family @@ -3341,7 +3342,11 @@ scripted_trigger ep3_governor_yearly_8150_county_trigger = { } scripted_trigger ep3_governor_yearly_8150_create_faction_chance_trigger = { - county_opinion < -25 + popular_opinion < -25 + can_title_create_faction = { + type = $TYPE$_faction + target = root + } title_create_faction_type_chance = { type = $TYPE$_faction target = root @@ -3491,7 +3496,7 @@ ep3_governor_yearly.8150 = { base = 1 modifier = { add = { - value = county_opinion + value = popular_opinion multiply = -1 } } @@ -3507,7 +3512,7 @@ ep3_governor_yearly.8150 = { list = rebel_counties order_by = { value = 0 - subtract = county_opinion + subtract = popular_opinion } save_scope_as = rebel_county } @@ -3691,7 +3696,7 @@ ep3_governor_yearly.8150 = { check_range_bounds = no order_by = { value = 0 - subtract = county_opinion + subtract = popular_opinion } title_join_faction = scope:targeting_faction } @@ -3820,7 +3825,7 @@ ep3_governor_yearly.8160 = { alternative_limit = { ep3_governor_yearly_8160_faith_trigger = yes } weight = { base = 1 - modifier = { add = development_level } + modifier = { add = prosperity_level } modifier = { holder = root factor = 2 diff --git a/events/dlc/ep3/ep3_interactions_events.txt b/events/dlc/ep3/ep3_interactions_events.txt index 0acb6aa55..93892eb74 100644 --- a/events/dlc/ep3/ep3_interactions_events.txt +++ b/events/dlc/ep3/ep3_interactions_events.txt @@ -521,7 +521,6 @@ scripted_trigger ep3_interactions_events_0030_callous_trigger = { has_trait = callous has_trait = zealous has_relation_rival = scope:recipient - has_relation_nemesis = scope:recipient has_relation_victim = scope:recipient has_relation_bully = scope:recipient } @@ -837,9 +836,9 @@ ep3_interactions_events.0031 = { # By Jason Cantalini remove_courtier_or_guest = scope:recipient } scope:recipient = { - set_relation_rival = { - target = scope:actor - reason = rival_attempted_castration + set_relation_rival_effect = { + TARGET = scope:actor + REASON = rival_attempted_castration } add_stress = medium_stress_gain } @@ -1478,7 +1477,10 @@ ep3_interactions_events.0102 = { } } hidden_effect = { - add_courtier = scope:rented_knight + if = { + limit = { scope:rented_knight = { NOT = { is_courtier_of = scope:og_liege } } } + add_courtier = scope:rented_knight + } } } } @@ -1700,7 +1702,7 @@ ep3_interactions_events.0111 = { TITLE_LIST = purchased_titles TYPE = granted REASON = flag:purchased - ENNOBLED_ADVENTURER = flag:yes + NEVER_ENNOBLED = flag:no } } scope:puppet_or_actor = { @@ -1715,7 +1717,7 @@ ep3_interactions_events.0111 = { value = 0 if = { limit = { scope:new_primary_title.tier = tier_county } - add = scope:new_primary_title.development_level + add = scope:new_primary_title.prosperity_level scope:new_primary_title = { every_county_province = { add = num_buildings } } @@ -1724,7 +1726,7 @@ ep3_interactions_events.0111 = { scope:new_primary_title = { every_de_jure_county = { limit = { ep3_purchase_land_valid_county_trigger = yes } - add = development_level + add = prosperity_level every_county_province = { add = num_buildings } } } @@ -2194,7 +2196,7 @@ ep3_interactions_events.0112 = { TITLE_LIST = purchased_titles TYPE = granted REASON = flag:purchased - ENNOBLED_ADVENTURER = flag:yes + NEVER_ENNOBLED = flag:no } # Extra purchase land specific scope:puppet_or_actor = { @@ -2841,10 +2843,6 @@ ep3_interactions_events.0210 = { immediate = { show_as_tooltip = { scope:recipient = { - change_influence = { - value = massive_influence_gain - multiply = 2 - } start_war = { cb = influence_war_cb target = scope:secondary_recipient @@ -2873,12 +2871,8 @@ ep3_interactions_events.0211 = { immediate = { show_as_tooltip = { - change_influence = { - value = massive_influence_gain - } - reverse_add_opinion = { - modifier = refused_summons_to_war_opinion - target = scope:actor + scope:recipient = { + change_influence = major_influence_loss } } } @@ -3190,12 +3184,28 @@ ep3_interactions_events.0502 = { save_scope_as = destination_realm_owner } random_character_to_title_neighboring_and_across_water_county = { - limit = { holder.top_liege = scope:destination_realm_owner } + limit = { + exists = scope:destination_realm_owner + holder.top_liege = scope:destination_realm_owner + } save_scope_as = expel_destination } if = { limit = { NOT = { exists = scope:expel_destination } } - scope:destination_realm_owner = { + scope:destination_realm_owner ?= { + random_realm_county = { + limit = { is_landless_type_title = no } + save_scope_as = expel_destination + } + } + } + if = { + limit = { NOT = { exists = scope:expel_destination } } + random_independent_ruler = { + limit = { + this != scope:expeller.top_liege + any_realm_county = { is_landless_type_title = no } + } random_realm_county = { limit = { is_landless_type_title = no } save_scope_as = expel_destination @@ -3222,7 +3232,6 @@ scripted_trigger ep3_interactions_events_0600_nice_option_trigger = { OR = { has_relation_friend = scope:supporter has_relation_lover = scope:supporter - has_relation_soulmate = scope:supporter has_trait = loyal has_trait = schemer has_trait = diplomat @@ -3244,13 +3253,11 @@ scripted_trigger ep3_interactions_events_0600_hate_option_trigger = { is_allied_to = scope:supporter has_relation_friend = scope:supporter has_relation_potential_friend = scope:supporter - has_relation_best_friend = scope:supporter has_trait = loyal } OR = { has_relation_potential_rival = scope:supporter has_relation_rival = scope:supporter - has_relation_nemesis = scope:supporter has_trait = disloyal has_trait = arrogant has_trait = arbitrary @@ -3321,9 +3328,9 @@ scripted_effect ep3_interactions_events_0601_insult = { can_set_relation_rival_trigger = { CHARACTER = scope:new_landed_admin } } } - set_relation_rival = { - target = scope:supporter - reason = rival_ignored_candidacy_support + set_relation_rival_effect = { + TARGET = scope:supporter + REASON = rival_ignored_candidacy_support } } else_if = { @@ -3332,9 +3339,9 @@ scripted_effect ep3_interactions_events_0601_insult = { can_set_relation_nemesis_trigger = { CHARACTER = scope:new_landed_admin } } } - set_relation_nemesis = { - target = scope:supporter - reason = rival_ignored_candidacy_support + set_relation_nemesis_effect = { + TARGET = scope:supporter + REASON = rival_ignored_candidacy_support } } else = { @@ -3455,6 +3462,24 @@ ep3_interactions_events.0600 = { animation = happiness } + trigger = { + primary_title = { + any_succession_appointment_investors = { + candidate = root + value >= 20 + NOT = { + house ?= root.house + } + is_alive = yes + is_imprisoned = no + NOR = { + has_relation_rival = root + is_at_war_with = root + } + } + } + } + immediate = { primary_title = { ordered_succession_appointment_investors = { diff --git a/events/dlc/ep3/ep3_laamp_decision_events.txt b/events/dlc/ep3/ep3_laamp_decision_events.txt index 28357e8ca..79cc221ee 100644 --- a/events/dlc/ep3/ep3_laamp_decision_events.txt +++ b/events/dlc/ep3/ep3_laamp_decision_events.txt @@ -3540,7 +3540,7 @@ ep3_laamp_decision_event.1010 = { value = domicile.max_provisions subtract = domicile.provisions #Now we have the missing provisions value - multiply = 0.05 + multiply = 0.02 round = yes } } @@ -5565,7 +5565,7 @@ scripted_effect 1025_randomize_and_remember_contract_type_effect = { add = 10 } modifier = { - scope:visiting_location.county = { county_control <= 50 } + scope:visiting_location.county = { county_control < county_control_baseline } add = 10 } #Are you actually looking for criminal contracts? @@ -5617,7 +5617,7 @@ scripted_effect 1025_randomize_and_remember_contract_type_effect = { add = 10 } modifier = { - scope:visiting_location.county = { county_control <= 50 } + scope:visiting_location.county = { county_control < county_control_baseline } add = 10 } #You're pretty law-abiding? @@ -5738,11 +5738,11 @@ scripted_effect 1025_randomize_and_remember_contract_type_effect = { } #More organization in highly developed areas modifier = { - scope:visiting_location.county = { development_level > bad_development_level } + scope:visiting_location.county = { prosperity_level > bad_prosperity_level } add = 10 } modifier = { - scope:visiting_location.county = { development_level > medium_development_level } + scope:visiting_location.county = { prosperity_level > medium_prosperity_level } add = 10 } #You're shrewd? @@ -5789,7 +5789,7 @@ scripted_effect 1025_randomize_and_remember_contract_type_effect = { } } modifier = { - scope:visiting_location.county = { development_level > medium_development_level } + scope:visiting_location.county = { prosperity_level > medium_prosperity_level } add = 10 } modifier = { @@ -20019,37 +20019,41 @@ scripted_effect 1100_book_creation_effect = { hidden_effect = { if = { limit = { - var:poi_visited >= 60 + var:poi_visited >= 90 } scope:newly_created_artifact = { - add_artifact_modifier = artifact_monthly_lifestyle_xp_4_modifier + add_artifact_modifier = artifact_monthly_lifestyle_xp_2_modifier + add_artifact_modifier = artifact_marco_polo_travel_illustrious_modifier set_artifact_rarity = illustrious } } else_if = { limit = { - var:poi_visited >= 48 + var:poi_visited >= 72 } scope:newly_created_artifact = { - add_artifact_modifier = artifact_monthly_lifestyle_xp_3_modifier + add_artifact_modifier = artifact_monthly_lifestyle_xp_1_5_modifier + add_artifact_modifier = artifact_marco_polo_travel_famed_modifier set_artifact_rarity = famed } } + else_if = { + limit = { + var:poi_visited >= 54 + } + scope:newly_created_artifact = { + add_artifact_modifier = artifact_monthly_lifestyle_xp_1_modifier + add_artifact_modifier = artifact_marco_polo_travel_masterwork_modifier + set_artifact_rarity = masterwork + } + } else_if = { limit = { var:poi_visited >= 36 } scope:newly_created_artifact = { - add_artifact_modifier = artifact_monthly_lifestyle_xp_2_modifier - set_artifact_rarity = masterwork - } - } - else_if = { - limit = { - var:poi_visited >= 24 - } - scope:newly_created_artifact = { - add_artifact_modifier = artifact_monthly_lifestyle_xp_1_modifier + add_artifact_modifier = artifact_monthly_lifestyle_xp_minor_modifier + add_artifact_modifier = artifact_marco_polo_travel_common_modifier set_artifact_rarity = common } } @@ -20068,31 +20072,31 @@ scripted_effect 1100_lifestyle_perk_effect = { } if = { limit = { - var:poi_visited >= 56 + var:poi_visited >= 90 } add_relevant_lifestyle_perk_point_effect = { NUMBER = 5 } } else_if = { limit = { - var:poi_visited >= 48 + var:poi_visited >= 72 } add_relevant_lifestyle_perk_point_effect = { NUMBER = 4 } } else_if = { limit = { - var:poi_visited >= 40 + var:poi_visited >= 54 } add_relevant_lifestyle_perk_point_effect = { NUMBER = 3 } } else_if = { limit = { - var:poi_visited >= 32 + var:poi_visited >= 36 } add_relevant_lifestyle_perk_point_effect = { NUMBER = 2 } } else_if = { limit = { - var:poi_visited >= 24 + var:poi_visited >= 18 } add_relevant_lifestyle_perk_point_effect = { NUMBER = 1 } } @@ -20342,7 +20346,7 @@ ep3_laamp_decision_event.1103 = { } modifier = { add = { - subtract = location.county.county_opinion + subtract = location.county.popular_opinion } } send_interface_toast = { @@ -20363,7 +20367,7 @@ ep3_laamp_decision_event.1103 = { min = -49 } modifier = { - add = location.county.development_level + add = location.county.prosperity_level } modifier = { factor = 0.75 @@ -20385,7 +20389,7 @@ ep3_laamp_decision_event.1103 = { add_stress = miniscule_stress_gain add_piety = { value = 10 - multiply = location.county.development_level + multiply = location.county.prosperity_level min = 20 } @@ -20472,7 +20476,7 @@ ep3_laamp_decision_event.1103 = { min = -49 } modifier = { - add = location.county.development_level + add = location.county.prosperity_level } modifier = { add = location.barony.building_max_garrison @@ -21521,7 +21525,7 @@ ep3_laamp_decision_event.1140 = { #city pays dividend } add = { value = 3 - multiply = scope:city_location.county.development_level + multiply = scope:city_location.county.prosperity_level } multiply = { # Slowly decrease over time, by 1% every year value = { diff --git a/events/dlc/ep3/ep3_laamp_events.txt b/events/dlc/ep3/ep3_laamp_events.txt index be0db4ad1..d6c094db0 100644 --- a/events/dlc/ep3/ep3_laamp_events.txt +++ b/events/dlc/ep3/ep3_laamp_events.txt @@ -23,29 +23,6 @@ # BRÖTHER # I CRAVE THE LAAMP -scripted_effect adventurer_prestige_reset_effect = { - hidden_effect = { - #Save Prestige - save_scope_value_as = { - name = prestige_amount - value = { - value = prestige - add = -100 - } - } - #Invert it, then take it away - add_prestige = { - value = scope:prestige_amount - multiply = -1 - } - #Take away 3 prestige levels - add_prestige_level = -3 - } - # Tooltips - custom_tooltip = lose_all_prestige_tt - custom_tooltip = lose_all_prestige_level_tt -} - ################################################## # Become Adventurer - Conquest # by Joe Parkin @@ -159,9 +136,9 @@ ep3_laamps.0001 = { limit = { NOT = { has_relation_rival = scope:winner } } - set_relation_rival = { - target = scope:winner - reason = rival_conquered_me + set_relation_rival_effect = { + TARGET = scope:winner + REASON = rival_conquered_me } } scope:winner = { trigger_event = ep3_laamps.0003 } @@ -195,7 +172,7 @@ ep3_laamps.0002 = { hidden = yes trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_valid_for_laampdom = yes } @@ -294,9 +271,9 @@ ep3_laamps.0003 = { limit = { NOT = { has_relation_rival = scope:adventurer } } - set_relation_rival = { - target = scope:adventurer - reason = rival_conquered_me + set_relation_rival_effect = { + TARGET = scope:adventurer + REASON = rival_conquered_me } } scope:adventurer = { create_landless_adventurer_title_tooltip_effect = yes } @@ -756,7 +733,7 @@ ep3_laamps.0012 = { type = character_event trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_landed = yes player_heir ?= { save_temporary_scope_as = heir_temp @@ -953,7 +930,7 @@ ep3_laamps.0021 = { hidden = yes trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_valid_for_laampdom = yes } @@ -1086,10 +1063,22 @@ ep3_laamps.0030 = { type = character_event window = fullscreen_event queue_icon = "gfx/interface/icons/splash_icons/splash_laamp.dds" - title = ep3_laamps.0030.t + title = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:former_merchant } + desc = ep3_laamps.0030.t.merchant + } + desc = ep3_laamps.0030.t + } + } desc = { desc = ep3_laamps.0030.desc first_valid = { + triggered_desc = { + trigger = { exists = scope:former_merchant } + desc = ep3_laamps.0030.merchant + } triggered_desc = { trigger = { exists = scope:laamp_heir } desc = ep3_laamps.0030.heir @@ -1121,6 +1110,10 @@ ep3_laamps.0030 = { limit = { top_liege != this } liege = { save_scope_as = old_liege } } + else_if = { + limit = { exists = suzerain } + suzerain = { save_scope_as = old_suzerain } + } # Transfer landed titles every_held_title = { title_tier > barony @@ -1133,26 +1126,38 @@ ep3_laamps.0030 = { } add_to_list = target_titles } - create_title_and_vassal_change = { - type = conquest - save_scope_as = change - add_claim_on_loss = no - } hidden_effect = { - every_in_list = { - list = target_titles - change_title_holder_include_vassals = { - holder = scope:laamp_inheritor - change = scope:change + if = { + limit = { list_size:target_titles >= 1 } + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + add_claim_on_loss = no } + every_in_list = { + list = target_titles + change_title_holder_include_vassals = { + holder = scope:laamp_inheritor + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change } - resolve_title_and_vassal_change = scope:change } + if = { + limit = { + NOT = { government_has_flag = government_is_merchant } + } + adventurer_prestige_reset_effect = yes + } + gdp_merchant_handover_company_for_voluntary_laamp_effect = yes # Create Adventurer create_landless_adventurer_title_effect = { REASON = flag:voluntary FLAVOR_CHAR = scope:laamp_inheritor } + gdp_merchant_restore_voluntary_laamp_associates_from_list_effect = yes + laamp_add_indebted_hook_holders_to_patrons_effect = yes scope:laamp_inheritor = { # Tooltip for player custom_tooltip = become_landless_adventurer_decision_title_scope_tt @@ -1162,23 +1167,89 @@ ep3_laamps.0030 = { trigger_event = game_rule.1001 remove_character_flag = new_laamp_inheritor } + if = { + limit = { + is_landless_merchant = yes + exists = scope:old_suzerain + } + # Create tributary + start_tributary = { + contract_group = tributary_merchant + suzerain = scope:old_suzerain + } + } } scope:old_liege ?= { trigger_event = ep3_laamps.0032 } - adventurer_prestige_reset_effect = yes hidden_effect = { every_held_title = { - limit = { - is_noble_family_title = yes - } + limit = { is_noble_family_title = yes } root = { destroy_title = prev } } } + if = { + limit = { + any_in_list = { variable = owes_me_money } + } + custom_tooltip = { + text = gdp_become_adventurer_debtors_to_contracts_tt + every_in_list = { + variable = owes_me_money + root = { add_contact = prev } + every_owned_story = { + limit = { + story_type = story_cycle_loan + var:lender = root + } + save_temporary_scope_as = loan_temp + story_owner = { + send_interface_toast = { + type = event_toast_effect_good + title = ho_debt_wiped_title + left_icon = scope:dead_debtor + right_icon = scope:lender + scope:loan_temp = { end_loan_story_effect = yes } + } + } + } + } + } + } + if = { + limit = { + any_owned_story = { story_type = story_cycle_loan } + } + custom_tooltip = { + text = gdp_become_adventurer_debts_transferred_tt + every_owned_story = { + limit = { story_type = story_cycle_loan } + save_temporary_scope_as = loan_temp + var:lender = { + send_interface_toast = { + type = event_toast_effect_good + title = ho_debt_wiped_title + left_icon = root + right_icon = scope:laamp_inheritor + transfer_loan_effect = { + OLD_LOAN = scope:loan_temp + NEW_LENDER = scope:loan_temp.var:lender + NEW_DEBTOR = scope:laamp_inheritor + } + } + } + } + } + } } option = { name = ep3_laamps.0030.a create_landless_adventurer_title_tooltip_effect = yes - add_prestige = medium_prestige_gain + if = { + limit = { + NOT = { government_has_flag = government_is_merchant } + } + add_prestige = medium_prestige_gain + } add_character_modifier = { modifier = ep3_voluntary_laamp_character_modifier years = 5 @@ -1317,7 +1388,7 @@ ep3_laamps.0041 = { hidden = yes trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_landed = no is_valid_for_laampdom = yes } @@ -1432,7 +1503,7 @@ ep3_laamps.0050 = { cooldown = { years = 10 } trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_landed_or_landless_administrative_or_theocratic = yes any_close_family_member = { ep3_laamp_runaway_child_trigger = yes } OR = { @@ -1612,7 +1683,7 @@ ep3_laamps.0051 = { lower_right_portrait = scope:potential_laamp trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes scope:potential_laamp = { ep3_laamp_runaway_child_trigger = yes } } @@ -1658,6 +1729,10 @@ ep3_laamps.0100 = { trigger = { government_has_flag = government_is_nomadic } desc = ep3_laamps.0100.desc_nomadic } + triggered_desc = { + trigger = { government_has_flag = government_is_merchant } + desc = ep3_laamps.0100.desc_merchant + } desc = ep3_laamps.0100.desc } first_valid = { @@ -1674,14 +1749,20 @@ ep3_laamps.0100 = { first_valid = { triggered_desc = { trigger = { - NOT = { government_has_flag = government_is_nomadic } + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_merchant + } exists = scope:new_liege } desc = ep3_laamps.0100.unpopular } triggered_desc = { trigger = { - NOT = { government_has_flag = government_is_nomadic } + NOR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_merchant + } } desc = ep3_laamps.0100.fallback } @@ -1697,23 +1778,20 @@ ep3_laamps.0100 = { animation = steward } lower_left_portrait = { - trigger = { - scope:recipient != scope:new_liege - } + trigger = { scope:recipient != scope:new_liege } character = scope:new_liege } - trigger = { - has_ep3_dlc_trigger = yes - } - immediate = { - purchase_land_interaction_effect = yes scope:recipient = { trigger_event = ep3_laamps.0101 } } option = { name = ep3_laamps.0100.a + purchase_land_interaction_effect = { + TITLE_RECEIVER = scope:actor + TITLE_GIVER = scope:recipient + } if = { # Vassal obligations limit = { scope:vassal_obligation = yes } vassal_contract_set_obligation_level = { type = feudal_government_taxes level = 4 } @@ -1724,7 +1802,7 @@ ep3_laamps.0100 = { after = { hidden_effect = { every_courtier = { - limit = { is_in_army = no } + limit = { should_in_default_location_trigger = yes } set_location_to_default = yes } every_prisoner = { set_location_to_default = yes } @@ -1752,11 +1830,16 @@ ep3_laamps.0101 = { sender = scope:actor trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } immediate = { - show_as_tooltip = { purchase_land_interaction_effect = yes } + show_as_tooltip = { + purchase_land_interaction_effect = { + TITLE_RECEIVER = scope:actor + TITLE_GIVER = scope:recipient + } + } if = { limit = { top_liege != this @@ -1769,7 +1852,12 @@ ep3_laamps.0101 = { title = ep3_laamps.0101.liege_message.title left_icon = scope:actor right_icon = scope:recipient - show_as_tooltip = { purchase_land_interaction_effect = yes } + show_as_tooltip = { + purchase_land_interaction_effect = { + TITLE_RECEIVER = scope:actor + TITLE_GIVER = scope:recipient + } + } } } } @@ -1804,7 +1892,7 @@ ep3_laamps.0102 = { sender = scope:actor trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } option = { @@ -1841,7 +1929,7 @@ ep3_laamps.0200 = { sender = scope:recipient trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } immediate = { @@ -1886,7 +1974,7 @@ ep3_laamps.0201 = { sender = scope:recipient trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } option = { @@ -1938,7 +2026,7 @@ ep3_laamps.0300 = { } trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } immediate = { @@ -1971,7 +2059,7 @@ ep3_laamps.0301 = { sender = scope:actor trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } immediate = { @@ -2023,7 +2111,7 @@ ep3_laamps.0302 = { sender = scope:actor trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } option = { @@ -2646,7 +2734,7 @@ ep3_laamps.0800 = { # Player adventurer has gained a landed title orphan = yes trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_landed = yes government_has_flag = government_is_landless_adventurer NOT = { has_variable = became_landed_through_separatist_uprising_var } # It feels repetitive to get this event after choosing to become landed @@ -2849,7 +2937,7 @@ ep3_laamps.0800 = { # Player adventurer has gained a landed title TITLE_LIST = landed_titles TYPE = granted REASON = flag:granted - ENNOBLED_ADVENTURER = flag:yes + NEVER_ENNOBLED = flag:no } if = { limit = { @@ -4081,6 +4169,7 @@ ep3_laamps.1011 = { # Destroy any inappropriate buildings and upgrades. ep3_laamps.1021 = { hidden = yes + trigger = { exists = domicile } # Fired with a delay, by which the camp can be gone immediate = { if = { @@ -4403,7 +4492,7 @@ ep3_laamps.5000 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available = yes @@ -4721,7 +4810,7 @@ ep3_laamps.5005 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -4975,7 +5064,7 @@ ep3_laamps.5010 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government age < 65 #Just for loc tonality is_available_allow_travelling = yes @@ -5086,6 +5175,7 @@ ep3_laamps.5010 = { NOT = { domicile = { has_domicile_building = camp_main_04 } } + domicile = { has_ongoing_domicile_construction = no } gold >= scope:gold_cost } show_as_unavailable = { @@ -5215,7 +5305,7 @@ ep3_laamps.5015 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -5225,14 +5315,14 @@ ep3_laamps.5015 = { base = 1 modifier = { factor = 2 - domicile = { + domicile ?= { provisions > provisions_threshold_good_value } } modifier = { factor = 2 location.county = { - county_control < full_county_control + county_control < county_control_baseline } } } @@ -5498,7 +5588,7 @@ ep3_laamps.5020 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -5785,7 +5875,7 @@ ep3_laamps.5025 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes } @@ -5977,7 +6067,7 @@ ep3_laamps.5030 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -5987,7 +6077,7 @@ ep3_laamps.5030 = { base = 1 modifier = { factor = 2 - domicile = { + domicile ?= { provisions < provisions_threshold_good_value } } @@ -6361,7 +6451,7 @@ ep3_laamps.5035 = { match = 0.75 } #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -6643,7 +6733,7 @@ ep3_laamps.5040 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -6806,7 +6896,7 @@ ep3_laamps.5045 = { trigger = { #Standard checks - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -6878,7 +6968,7 @@ ep3_laamps.5045 = { } #Least developed county as a rough approximation of backwaters order_by = { - value = development_level + value = prosperity_level multiply = -1 } @@ -8278,7 +8368,7 @@ ep3_laamps.7001 = { cooldown = { years = 200 } #Should never happen again trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes has_government = landless_adventurer_government character:90028 ?= { is_alive = yes @@ -8812,7 +8902,7 @@ ep3_laamps.7004 = { TITLE_LIST = landed_titles TYPE = granted REASON = flag:granted - ENNOBLED_ADVENTURER = flag:yes + NEVER_ENNOBLED = flag:no } every_in_list = { list = zichia_names diff --git a/events/dlc/ep3/ep3_laamp_events_8.txt b/events/dlc/ep3/ep3_laamp_events_8.txt index 5dbbe6caa..20e53bfb1 100644 --- a/events/dlc/ep3/ep3_laamp_events_8.txt +++ b/events/dlc/ep3/ep3_laamp_events_8.txt @@ -1948,6 +1948,7 @@ ep3_laamps.8090 = { trigger = { has_government = landless_adventurer_government + exists = domicile # Everything below reads the camp's location is_adult = yes is_available_allow_travelling = yes is_location_valid_for_travel_event_on_land = yes @@ -3318,9 +3319,9 @@ ep3_laamps.8107 = { has_relation_rival = scope:petitioned_ruler } } - set_relation_rival = { - target = scope:petitioned_ruler - reason = rival_nithing + set_relation_rival_effect = { + TARGET = scope:petitioned_ruler + REASON = rival_nithing } } scope:petitioned_ruler = { diff --git a/events/dlc/ep3/ep3_roman_restoration_events.txt b/events/dlc/ep3/ep3_roman_restoration_events.txt index 1dbd6c1c9..89b030f5d 100644 --- a/events/dlc/ep3/ep3_roman_restoration_events.txt +++ b/events/dlc/ep3/ep3_roman_restoration_events.txt @@ -296,7 +296,7 @@ ep3_roman_restoration.0300 = { every_sub_realm_county = { custom = ep3_roman_restoration.0300.every_sub_realm_county add_county_modifier = { - modifier = restore_rome_recuperated_county_opinion_modifier + modifier = restore_rome_recuperated_popular_opinion_modifier years = 10 } } @@ -319,7 +319,7 @@ ep3_roman_restoration.0300 = { every_sub_realm_county = { custom = ep3_roman_restoration.0300.every_sub_realm_county add_county_modifier = { - modifier = restore_rome_devastated_county_opinion_modifier + modifier = restore_rome_devastated_popular_opinion_modifier years = 10 } } @@ -345,7 +345,7 @@ ep3_roman_restoration.0300 = { every_sub_realm_county = { custom = ep3_roman_restoration.0300.every_sub_realm_county add_county_modifier = { - modifier = restore_rome_recuperated_county_opinion_modifier + modifier = restore_rome_recuperated_popular_opinion_modifier years = 10 } } @@ -360,7 +360,7 @@ ep3_roman_restoration.0300 = { every_sub_realm_county = { custom = ep3_roman_restoration.0300.every_sub_realm_county add_county_modifier = { - modifier = restore_rome_lowered_county_opinion_modifier + modifier = restore_rome_lowered_popular_opinion_modifier years = 10 } } @@ -509,37 +509,38 @@ ep3_roman_restoration.0500 = { #} # Mongol Invasion Spawns -ep3_roman_restoration.0520 = { - scope = none - hidden = yes +# NEOW 2555: no historical Temujin/Mongol invasion spawns. +#ep3_roman_restoration.0520 = { +# scope = none +# hidden = yes - trigger = { - NOR = { - has_global_variable = mongols_have_appeared - any_player = { - THIS = culture:mongol.culture_head - realm_size >= 100 - } - #Greatest of khans hasn't come along - has_global_variable = greatest_of_khans_title - #Someone's not currently trying to be greatest of khans - has_global_variable = mpo_gok_war_ongoing - #Temujin dying prevents Mongol invasion for at least 50 years - has_global_variable = temujin_failed - } - } +# trigger = { +# NOR = { +# has_global_variable = mongols_have_appeared +# any_player = { +# THIS = culture:mongol.culture_head +# realm_size >= 100 +# } +# #Greatest of khans hasn't come along +# has_global_variable = greatest_of_khans_title +# #Someone's not currently trying to be greatest of khans +# has_global_variable = mpo_gok_war_ongoing +# #Temujin dying prevents Mongol invasion for at least 50 years +# has_global_variable = temujin_failed +# } +# } - immediate = { - set_global_variable = { - name = mongols_have_appeared - value = yes - } - debug_log = "Mongols appeared!" - debug_log_date = yes - spawn_temujin_character_effect = yes - scope:temujin = { - save_scope_as = story_owner - create_story = story_mongol_invasion - } - } -} +# immediate = { +# set_global_variable = { +# name = mongols_have_appeared +# value = yes +# } +# debug_log = "Mongols appeared!" +# debug_log_date = yes +# spawn_temujin_character_effect = yes +# scope:temujin = { +# save_scope_as = story_owner +# create_story = story_mongol_invasion +# } +# } +#} diff --git a/events/dlc/ep3/ep3_story_cycle_admin_eunuch_events.txt b/events/dlc/ep3/ep3_story_cycle_admin_eunuch_events.txt index 7ea1b52ea..799c2ee93 100644 --- a/events/dlc/ep3/ep3_story_cycle_admin_eunuch_events.txt +++ b/events/dlc/ep3/ep3_story_cycle_admin_eunuch_events.txt @@ -4139,9 +4139,9 @@ ep3_story_cycle_admin_eunuch.3010 = { limit = { employer != root } root = { add_courtier = scope:rival } } - set_relation_rival = { - target = scope:eunuch - reason = rival_admin_eunuch + set_relation_rival_effect = { + TARGET = scope:eunuch + REASON = rival_admin_eunuch } } } @@ -4150,9 +4150,9 @@ ep3_story_cycle_admin_eunuch.3010 = { name = ep3_story_cycle_admin_eunuch.3010.a show_as_tooltip = { scope:rival ?= { - set_relation_rival = { - target = scope:eunuch - reason = rival_admin_eunuch + set_relation_rival_effect = { + TARGET = scope:eunuch + REASON = rival_admin_eunuch } } } @@ -5042,7 +5042,10 @@ ep3_story_cycle_admin_eunuch.5010 = { } } save_scope_as = rival - set_relation_rival = { reason = rival_admin_eunuch_family target = scope:eunuch } + set_relation_rival_effect = { + TARGET = scope:eunuch + REASON = rival_admin_eunuch_family + } add_character_flag = { flag = admin_rival_whinger_cooldown years = 6 diff --git a/events/dlc/ep3/ep3_story_cycle_grand_ambitions_events.txt b/events/dlc/ep3/ep3_story_cycle_grand_ambitions_events.txt index a6bc98f57..e38c23f7e 100644 --- a/events/dlc/ep3/ep3_story_cycle_grand_ambitions_events.txt +++ b/events/dlc/ep3/ep3_story_cycle_grand_ambitions_events.txt @@ -288,6 +288,7 @@ grand_ambitions.0002 = { immediate = { # Saving these scopes for the follow-up (grand_ambitions.0003) for the old emp which references the lost title save_scope_as = actor + save_scope_as = puppet_or_actor save_scope_as = root_scope # for loc primary_title = { save_scope_as = revoked } scope:defender = { @@ -901,9 +902,7 @@ scripted_trigger foreign_ruler_has_any_interest_in_coup_trigger = { } NOR = { has_relation_friend = scope:target_char - has_relation_best_friend = scope:target_char has_relation_lover = scope:target_char - has_relation_soulmate = scope:target_char } OR = { # They have a claim on something within the empire that you could help them with @@ -1570,6 +1569,7 @@ grand_ambitions.0130 = { modifier = ep3_grand_ambitions_rioting_county_modifier years = 10 } + change_county_control = -10 } } random = { @@ -1608,6 +1608,7 @@ grand_ambitions.0130 = { modifier = ep3_grand_ambitions_rioting_county_modifier years = 10 } + change_county_control = -10 } } random = { @@ -1660,6 +1661,7 @@ grand_ambitions.0130 = { modifier = ep3_grand_ambitions_rioting_county_modifier years = 10 } + change_county_control = -10 } } } @@ -3665,6 +3667,7 @@ grand_ambitions.0202 = { immediate = { # Saving these scopes for the follow-up (grand_ambitions.0003) for the old emp which references the lost title save_scope_as = actor + save_scope_as = puppet_or_actor save_scope_as = new_emp save_scope_as = root_scope # for loc primary_title = { save_scope_as = revoked } diff --git a/events/dlc/ep3/ep3_travel_events_3.txt b/events/dlc/ep3/ep3_travel_events_3.txt index 91873c8b9..f65a0bd89 100644 --- a/events/dlc/ep3/ep3_travel_events_3.txt +++ b/events/dlc/ep3/ep3_travel_events_3.txt @@ -379,7 +379,7 @@ ep3_travel_events.3001 = { } left_portrait = { character = root - animation = jockey_walk + scripted_animation = horse_camel_animation camera = camera_event_horse_left } trigger = { @@ -1146,7 +1146,7 @@ ep3_travel_events.3010 = { culture = { ep3_travel_events_3010_anatolian_native_trigger = yes } - county_control <= 90 + county_control < county_control_baseline duchy = { OR = { this = title:d_anatolia @@ -1227,7 +1227,7 @@ ep3_travel_events.3010 = { } } location.county = { - change_development_progress = minimal_development_progress_loss + change_prosperity_progress = minimal_prosperity_progress_loss change_county_control = miniscule_county_control_loss } stress_and_fulfillment_impact = { diff --git a/events/dlc/ep3/ep3_travel_option_events.txt b/events/dlc/ep3/ep3_travel_option_events.txt index 4e487fde8..4d1b00367 100644 --- a/events/dlc/ep3/ep3_travel_option_events.txt +++ b/events/dlc/ep3/ep3_travel_option_events.txt @@ -181,6 +181,78 @@ ep3_travel_option_events.0001 = { } desc = ep3_travel_option_events.0001.master_of_spoils_camp_officer } + triggered_desc = { + trigger = { + exists = scope:partner_court_position + } + desc = ep3_travel_option_events.0001.partner_court_position + } + triggered_desc = { + trigger = { + exists = scope:fixer_court_position + } + desc = ep3_travel_option_events.0001.fixer_court_position + } + triggered_desc = { + trigger = { + exists = scope:translator_court_position + } + desc = ep3_travel_option_events.0001.translator_court_position + } + triggered_desc = { + trigger = { + exists = scope:market_agent_court_position + } + desc = ep3_travel_option_events.0001.market_agent_court_position + } + triggered_desc = { + trigger = { + exists = scope:bailiff_court_position + } + desc = ep3_travel_option_events.0001.bailiff_court_position + } + triggered_desc = { + trigger = { + exists = scope:antiquarian_court_position + } + desc = ep3_travel_option_events.0001.antiquarian_court_position + } + triggered_desc = { + trigger = { + exists = scope:champion_court_position + } + desc = ep3_travel_option_events.0001.champion_court_position + } + triggered_desc = { + trigger = { + exists = scope:bookmaker_court_position + } + desc = ep3_travel_option_events.0001.bookmaker_court_position + } + triggered_desc = { + trigger = { + exists = scope:court_brewmaster_court_position + } + desc = ep3_travel_option_events.0001.court_brewmaster_court_position + } + triggered_desc = { + trigger = { + exists = scope:food_taster_court_position + } + desc = ep3_travel_option_events.0001.food_taster_court_position + } + triggered_desc = { + trigger = { + exists = scope:master_of_hunt_court_position + } + desc = ep3_travel_option_events.0001.master_of_hunt_court_position + } + triggered_desc = { + trigger = { + exists = scope:master_assassin_court_position + } + desc = ep3_travel_option_events.0001.master_assassin_court_position + } desc = ep3_travel_option_events.0001.fallback } first_valid = { # How good they are/salary expectations @@ -351,7 +423,10 @@ ep3_travel_option_events.0001 = { trigger = { NOT = { has_character_flag = had_talent_event } - has_government = landless_adventurer_government + OR = { + government_has_flag = government_is_merchant + government_has_flag = government_is_landless_adventurer + } any_pool_character = { province = root.location is_available_healthy_ai_adult = yes @@ -556,6 +631,48 @@ ep3_travel_option_events.0001 = { employer = root } } + AND = { + root = { can_employ_court_position_type = partner_court_position } + would_be_valid_for_court_position = { + court_position = partner_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = fixer_court_position } + would_be_valid_for_court_position = { + court_position = fixer_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = translator_court_position } + would_be_valid_for_court_position = { + court_position = translator_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = market_agent_court_position } + would_be_valid_for_court_position = { + court_position = market_agent_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = bailiff_court_position } + would_be_valid_for_court_position = { + court_position = bailiff_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = antiquarian_court_position } + would_be_valid_for_court_position = { + court_position = antiquarian_court_position + employer = root + } + } AND = { root = { can_employ_court_position_type = master_of_spoils_camp_officer } would_be_valid_for_court_position = { @@ -563,6 +680,48 @@ ep3_travel_option_events.0001 = { employer = root } } + AND = { + root = { can_employ_court_position_type = champion_court_position } + would_be_valid_for_court_position = { + court_position = champion_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = bookmaker_court_position } + would_be_valid_for_court_position = { + court_position = bookmaker_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = court_brewmaster_court_position } + would_be_valid_for_court_position = { + court_position = court_brewmaster_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = food_taster_court_position } + would_be_valid_for_court_position = { + court_position = food_taster_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = master_of_hunt_court_position } + would_be_valid_for_court_position = { + court_position = master_of_hunt_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = master_assassin_court_position } + would_be_valid_for_court_position = { + court_position = master_assassin_court_position + employer = root + } + } } } } @@ -814,6 +973,54 @@ ep3_travel_option_events.0001 = { } aptitude:pike_captain_camp_officer >= 2 } + AND = { + root = { can_employ_court_position_type = partner_court_position } + would_be_valid_for_court_position = { + court_position = partner_court_position + employer = root + } + aptitude:partner_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = fixer_court_position } + would_be_valid_for_court_position = { + court_position = fixer_court_position + employer = root + } + aptitude:fixer_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = translator_court_position } + would_be_valid_for_court_position = { + court_position = translator_court_position + employer = root + } + aptitude:translator_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = market_agent_court_position } + would_be_valid_for_court_position = { + court_position = market_agent_court_position + employer = root + } + aptitude:market_agent_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = bailiff_court_position } + would_be_valid_for_court_position = { + court_position = bailiff_court_position + employer = root + } + aptitude:bailiff_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = antiquarian_court_position } + would_be_valid_for_court_position = { + court_position = antiquarian_court_position + employer = root + } + aptitude:antiquarian_court_position >= 2 + } AND = { root = { can_employ_court_position_type = master_of_spoils_camp_officer } would_be_valid_for_court_position = { @@ -822,6 +1029,54 @@ ep3_travel_option_events.0001 = { } aptitude:master_of_spoils_camp_officer >= 2 } + AND = { + root = { can_employ_court_position_type = champion_court_position } + would_be_valid_for_court_position = { + court_position = champion_court_position + employer = root + } + aptitude:champion_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = bookmaker_court_position } + would_be_valid_for_court_position = { + court_position = bookmaker_court_position + employer = root + } + aptitude:bookmaker_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = court_brewmaster_court_position } + would_be_valid_for_court_position = { + court_position = court_brewmaster_court_position + employer = root + } + aptitude:court_brewmaster_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = food_taster_court_position } + would_be_valid_for_court_position = { + court_position = food_taster_court_position + employer = root + } + aptitude:food_taster_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = master_of_hunt_court_position } + would_be_valid_for_court_position = { + court_position = master_of_hunt_court_position + employer = root + } + aptitude:master_of_hunt_court_position >= 2 + } + AND = { + root = { can_employ_court_position_type = master_assassin_court_position } + would_be_valid_for_court_position = { + court_position = master_assassin_court_position + employer = root + } + aptitude:master_assassin_court_position >= 2 + } } } } @@ -1035,6 +1290,48 @@ ep3_travel_option_events.0001 = { employer = root } } + AND = { + root = { can_employ_court_position_type = partner_court_position } + would_be_valid_for_court_position = { + court_position = partner_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = fixer_court_position } + would_be_valid_for_court_position = { + court_position = fixer_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = translator_court_position } + would_be_valid_for_court_position = { + court_position = translator_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = market_agent_court_position } + would_be_valid_for_court_position = { + court_position = market_agent_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = bailiff_court_position } + would_be_valid_for_court_position = { + court_position = bailiff_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = antiquarian_court_position } + would_be_valid_for_court_position = { + court_position = antiquarian_court_position + employer = root + } + } AND = { root = { can_employ_court_position_type = master_of_spoils_camp_officer } would_be_valid_for_court_position = { @@ -1042,6 +1339,48 @@ ep3_travel_option_events.0001 = { employer = root } } + AND = { + root = { can_employ_court_position_type = champion_court_position } + would_be_valid_for_court_position = { + court_position = champion_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = bookmaker_court_position } + would_be_valid_for_court_position = { + court_position = bookmaker_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = court_brewmaster_court_position } + would_be_valid_for_court_position = { + court_position = court_brewmaster_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = food_taster_court_position } + would_be_valid_for_court_position = { + court_position = food_taster_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = master_of_hunt_court_position } + would_be_valid_for_court_position = { + court_position = master_of_hunt_court_position + employer = root + } + } + AND = { + root = { can_employ_court_position_type = master_assassin_court_position } + would_be_valid_for_court_position = { + court_position = master_assassin_court_position + employer = root + } + } } } weight = { @@ -1449,6 +1788,90 @@ ep3_travel_option_events.0001 = { aptitude:master_of_spoils_camp_officer >= 4 } } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = partner_court_position } + aptitude:partner_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = partner_court_position } + aptitude:partner_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = fixer_court_position } + aptitude:fixer_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = fixer_court_position } + aptitude:fixer_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = translator_court_position } + aptitude:translator_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = translator_court_position } + aptitude:translator_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = market_agent_court_position } + aptitude:market_agent_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = market_agent_court_position } + aptitude:market_agent_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = bailiff_court_position } + aptitude:bailiff_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = bailiff_court_position } + aptitude:bailiff_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = antiquarian_court_position } + aptitude:antiquarian_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = antiquarian_court_position } + aptitude:antiquarian_court_position >= 3 + } + } modifier = { add = 5 AND = { @@ -1456,6 +1879,90 @@ ep3_travel_option_events.0001 = { aptitude:master_of_spoils_camp_officer >= 3 } } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = champion_court_position } + aptitude:champion_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = champion_court_position } + aptitude:champion_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = bookmaker_court_position } + aptitude:bookmaker_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = bookmaker_court_position } + aptitude:bookmaker_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = court_brewmaster_court_position } + aptitude:court_brewmaster_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = court_brewmaster_court_position } + aptitude:court_brewmaster_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = food_taster_court_position } + aptitude:food_taster_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = food_taster_court_position } + aptitude:food_taster_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = master_of_hunt_court_position } + aptitude:master_of_hunt_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = master_of_hunt_court_position } + aptitude:master_of_hunt_court_position >= 3 + } + } + modifier = { + add = 10 + AND = { + root = { can_employ_court_position_type = master_assassin_court_position } + aptitude:master_assassin_court_position >= 4 + } + } + modifier = { + add = 5 + AND = { + root = { can_employ_court_position_type = master_assassin_court_position } + aptitude:master_assassin_court_position >= 3 + } + } } save_scope_as = local_character assign_quirk_effect = yes @@ -2640,6 +3147,498 @@ ep3_travel_option_events.0001 = { } else = { save_scope_as = terrible_aptitude } } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = partner_court_position } + would_be_valid_for_court_position = { + court_position = partner_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:partner_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:partner_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:partner_court_position >= 2 + } + save_scope_as = partner_court_position + if = { + limit = { aptitude:partner_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:partner_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:partner_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:partner_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = fixer_court_position } + would_be_valid_for_court_position = { + court_position = fixer_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:fixer_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:fixer_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:fixer_court_position >= 2 + } + save_scope_as = fixer_court_position + if = { + limit = { aptitude:fixer_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:fixer_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:fixer_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:fixer_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = translator_court_position } + would_be_valid_for_court_position = { + court_position = translator_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:translator_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:translator_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:translator_court_position >= 2 + } + save_scope_as = translator_court_position + if = { + limit = { aptitude:translator_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:translator_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:translator_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:translator_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = market_agent_court_position } + would_be_valid_for_court_position = { + court_position = market_agent_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:market_agent_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:market_agent_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:market_agent_court_position >= 2 + } + save_scope_as = market_agent_court_position + if = { + limit = { aptitude:market_agent_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:market_agent_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:market_agent_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:market_agent_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = bailiff_court_position } + would_be_valid_for_court_position = { + court_position = bailiff_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:bailiff_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:bailiff_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:bailiff_court_position >= 2 + } + save_scope_as = bailiff_court_position + if = { + limit = { aptitude:bailiff_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:bailiff_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:bailiff_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:bailiff_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = antiquarian_court_position } + would_be_valid_for_court_position = { + court_position = antiquarian_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:antiquarian_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:antiquarian_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:antiquarian_court_position >= 2 + } + save_scope_as = antiquarian_court_position + if = { + limit = { aptitude:antiquarian_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:antiquarian_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:antiquarian_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:antiquarian_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = champion_court_position } + would_be_valid_for_court_position = { + court_position = champion_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:champion_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:champion_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:champion_court_position >= 2 + } + save_scope_as = champion_court_position + if = { + limit = { aptitude:champion_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:champion_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:champion_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:champion_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = bookmaker_court_position } + would_be_valid_for_court_position = { + court_position = bookmaker_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:bookmaker_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:bookmaker_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:bookmaker_court_position >= 2 + } + save_scope_as = bookmaker_court_position + if = { + limit = { aptitude:bookmaker_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:bookmaker_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:bookmaker_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:bookmaker_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = court_brewmaster_court_position } + would_be_valid_for_court_position = { + court_position = court_brewmaster_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:court_brewmaster_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:court_brewmaster_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:court_brewmaster_court_position >= 2 + } + save_scope_as = court_brewmaster_court_position + if = { + limit = { aptitude:court_brewmaster_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:court_brewmaster_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:court_brewmaster_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:court_brewmaster_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = food_taster_court_position } + would_be_valid_for_court_position = { + court_position = food_taster_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:food_taster_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:food_taster_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:food_taster_court_position >= 2 + } + save_scope_as = food_taster_court_position + if = { + limit = { aptitude:food_taster_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:food_taster_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:food_taster_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:food_taster_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = master_of_hunt_court_position } + would_be_valid_for_court_position = { + court_position = master_of_hunt_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:master_of_hunt_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:master_of_hunt_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:master_of_hunt_court_position >= 2 + } + save_scope_as = master_of_hunt_court_position + if = { + limit = { aptitude:master_of_hunt_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:master_of_hunt_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:master_of_hunt_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:master_of_hunt_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } + 10 = { + trigger = { + AND = { + root = { can_employ_court_position_type = master_assassin_court_position } + would_be_valid_for_court_position = { + court_position = master_assassin_court_position + employer = root + } + } + } + modifier = { + factor = 10 + aptitude:master_assassin_court_position >= 4 + } + modifier = { + factor = 5 + aptitude:master_assassin_court_position >= 3 + } + modifier = { + factor = 2 + aptitude:master_assassin_court_position >= 2 + } + save_scope_as = master_assassin_court_position + if = { + limit = { aptitude:master_assassin_court_position >= 4 } + save_scope_as = excellent_aptitude + } + else_if = { + limit = { aptitude:master_assassin_court_position >= 3 } + save_scope_as = good_aptitude + } + else_if = { + limit = { aptitude:master_assassin_court_position >= 2 } + save_scope_as = average_aptitude + } + else_if = { + limit = { aptitude:master_assassin_court_position >= 1 } + save_scope_as = poor_aptitude + } + else = { save_scope_as = terrible_aptitude } + } } } if = { @@ -2936,6 +3935,60 @@ ep3_travel_option_events.0001 = { court_position = pike_captain_camp_officer } } + else_if = { + limit = { + exists = scope:partner_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = partner_court_position + } + } + else_if = { + limit = { + exists = scope:fixer_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = fixer_court_position + } + } + else_if = { + limit = { + exists = scope:translator_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = translator_court_position + } + } + else_if = { + limit = { + exists = scope:market_agent_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = market_agent_court_position + } + } + else_if = { + limit = { + exists = scope:bailiff_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = bailiff_court_position + } + } + else_if = { + limit = { + exists = scope:antiquarian_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = antiquarian_court_position + } + } else_if = { limit = { exists = scope:master_of_spoils_camp_officer @@ -2945,6 +3998,60 @@ ep3_travel_option_events.0001 = { court_position = master_of_spoils_camp_officer } } + else_if = { + limit = { + exists = scope:champion_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = champion_court_position + } + } + else_if = { + limit = { + exists = scope:bookmaker_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = bookmaker_court_position + } + } + else_if = { + limit = { + exists = scope:court_brewmaster_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = court_brewmaster_court_position + } + } + else_if = { + limit = { + exists = scope:food_taster_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = food_taster_court_position + } + } + else_if = { + limit = { + exists = scope:master_of_hunt_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = master_of_hunt_court_position + } + } + else_if = { + limit = { + exists = scope:master_assassin_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = master_assassin_court_position + } + } # Aptitude if = { @@ -2954,7 +4061,10 @@ ep3_travel_option_events.0001 = { custom_tooltip = excellent.aptitude_tt if = { limit = { - has_perk = large_levies_perk + OR = { + government_has_flag = government_is_merchant + has_perk = large_levies_perk + } } pay_short_term_gold = { target = scope:local_character @@ -2975,7 +4085,10 @@ ep3_travel_option_events.0001 = { custom_tooltip = good.aptitude_tt if = { limit = { - has_perk = large_levies_perk + OR = { + government_has_flag = government_is_merchant + has_perk = large_levies_perk + } } pay_short_term_gold = { target = scope:local_character @@ -2996,7 +4109,10 @@ ep3_travel_option_events.0001 = { custom_tooltip = average.aptitude_tt if = { limit = { - has_perk = large_levies_perk + OR = { + government_has_flag = government_is_merchant + has_perk = large_levies_perk + } } pay_short_term_gold = { target = scope:local_character @@ -3017,7 +4133,10 @@ ep3_travel_option_events.0001 = { custom_tooltip = poor.aptitude_tt if = { limit = { - has_perk = large_levies_perk + OR = { + government_has_flag = government_is_merchant + has_perk = large_levies_perk + } } pay_short_term_gold = { target = scope:local_character @@ -3048,8 +4167,9 @@ ep3_travel_option_events.0001 = { } option = { name = ep3_travel_option_events.0001.provisions - show_as_unavailable = { always = yes } + show_as_unavailable = { government_has_flag = government_is_landless_adventurer } trigger = { + government_has_flag = government_is_landless_adventurer trigger_if = { limit = { exists = scope:excellent_aptitude @@ -3394,6 +4514,60 @@ ep3_travel_option_events.0001 = { court_position = pike_captain_camp_officer } } + else_if = { + limit = { + exists = scope:partner_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = partner_court_position + } + } + else_if = { + limit = { + exists = scope:fixer_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = fixer_court_position + } + } + else_if = { + limit = { + exists = scope:translator_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = translator_court_position + } + } + else_if = { + limit = { + exists = scope:market_agent_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = market_agent_court_position + } + } + else_if = { + limit = { + exists = scope:bailiff_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = bailiff_court_position + } + } + else_if = { + limit = { + exists = scope:antiquarian_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = antiquarian_court_position + } + } else_if = { limit = { exists = scope:master_of_spoils_camp_officer @@ -3403,6 +4577,60 @@ ep3_travel_option_events.0001 = { court_position = master_of_spoils_camp_officer } } + else_if = { + limit = { + exists = scope:champion_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = champion_court_position + } + } + else_if = { + limit = { + exists = scope:bookmaker_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = bookmaker_court_position + } + } + else_if = { + limit = { + exists = scope:court_brewmaster_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = court_brewmaster_court_position + } + } + else_if = { + limit = { + exists = scope:food_taster_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = food_taster_court_position + } + } + else_if = { + limit = { + exists = scope:master_of_hunt_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = master_of_hunt_court_position + } + } + else_if = { + limit = { + exists = scope:master_assassin_court_position + } + appoint_court_position = { + recipient = scope:local_character + court_position = master_assassin_court_position + } + } # Aptitude if = { diff --git a/events/dlc/fp1/fp1_jomsvikings_events.txt b/events/dlc/fp1/fp1_jomsvikings_events.txt index 215e4d99a..6a50f7576 100644 --- a/events/dlc/fp1/fp1_jomsvikings_events.txt +++ b/events/dlc/fp1/fp1_jomsvikings_events.txt @@ -1671,24 +1671,24 @@ fp1_jomsvikings.0041 = { if = { limit = { has_relation_best_friend = scope:leader } remove_relation_best_friend = scope:leader - set_relation_nemesis = { - target = scope:leader - reason = nemesis_refused_holmgang + set_relation_nemesis_effect = { + TARGET = scope:leader + REASON = nemesis_refused_holmgang } } # If you have no relation or were friends, they become your rival. else_if = { limit = { has_relation_friend = scope:leader } remove_relation_friend = scope:leader - set_relation_nemesis = { - target = scope:leader - reason = nemesis_refused_holmgang + set_relation_rival_effect = { + TARGET = scope:leader + REASON = rival_refused_holmgang } } else = { - set_relation_nemesis = { - target = scope:leader - reason = nemesis_refused_holmgang + set_relation_rival_effect = { + TARGET = scope:leader + REASON = rival_refused_holmgang } } } @@ -1784,33 +1784,32 @@ fp1_jomsvikings.0041 = { # If possible, scope:leader immediately becomes your rival. if = { limit = { - NOR = { + NOT = { has_relation_rival = scope:leader - has_relation_nemesis = scope:leader } } # If you were best friends, they become your nemesis. if = { limit = { has_relation_best_friend = scope:leader } remove_relation_best_friend = scope:leader - set_relation_nemesis = { - target = scope:leader - reason = rival_refused_holmgang + set_relation_nemesis_effect = { + TARGET = scope:leader + REASON = nemesis_refused_holmgang } } # If you have no relation or were friends, they become your rival. else_if = { limit = { has_relation_friend = scope:leader } remove_relation_friend = scope:leader - set_relation_rival = { - target = scope:leader - reason = rival_refused_holmgang + set_relation_rival_effect = { + TARGET = scope:leader + REASON = rival_refused_holmgang } } else = { - set_relation_rival = { - target = scope:leader - reason = rival_refused_holmgang + set_relation_rival_effect = { + TARGET = scope:leader + REASON = rival_refused_holmgang } } } diff --git a/events/dlc/fp1/fp1_other_decision_events.txt b/events/dlc/fp1/fp1_other_decision_events.txt index e5a09d035..4ac9950b8 100644 --- a/events/dlc/fp1/fp1_other_decision_events.txt +++ b/events/dlc/fp1/fp1_other_decision_events.txt @@ -428,6 +428,10 @@ fp1_other_decisions.0003 = { trigger_event = fp1_other_decisions.1000 if = { limit = { sacrifice_method_hang_n_fang_trigger = yes } + ep5_12_would_you_like_fries_with_that_check_effect = { + VICTIM = scope:unlucky_guest + EATER = scope:blotter + } death = { killer = scope:blotter death_reason = death_ritually_hung_then_eaten @@ -436,6 +440,10 @@ fp1_other_decisions.0003 = { # All other Germanic pagans will hang them. else_if = { limit = { sacrifice_method_eat_em_trigger = yes } + ep5_12_would_you_like_fries_with_that_check_effect = { + VICTIM = scope:unlucky_guest + EATER = scope:blotter + } death = { killer = scope:blotter death_reason = death_ritually_eaten @@ -2535,7 +2543,7 @@ fp1_other_decisions.0111 = { } } } - ## Promotion stelae want stele-valid areas with high development. + ## Promotion stelae want stele-valid areas with high prosperity. else_if = { limit = { scope:stele_type = flag:promotion } ordered_in_list = { diff --git a/events/dlc/fp1/fp1_scandinavian_adventurer_events.txt b/events/dlc/fp1/fp1_scandinavian_adventurer_events.txt index 986c04728..052bf2190 100644 --- a/events/dlc/fp1/fp1_scandinavian_adventurer_events.txt +++ b/events/dlc/fp1/fp1_scandinavian_adventurer_events.txt @@ -177,11 +177,11 @@ scripted_effect scandinavian_adventurer_start_war_effect = { random_county_in_region = { region = world_europe_north limit = { valid_scandinavian_county_for_embark_trigger = yes } - # Weight up according to development, so armies tend to spawn in places where more randos would congregate. + # Weight up according to prosperity, so armies tend to spawn in places where more randos would congregate. weight = { modifier = { add = { - value = development_level + value = prosperity_level multiply = 10 } } @@ -204,7 +204,7 @@ scripted_effect scandinavian_adventurer_start_war_effect = { days = 365 } } - # Work out how many event troops we should give the adventurer for a 60:40 fight. + # Work out how many event troops we should give the adventurer. spawn_army = { levies = { add = { @@ -216,10 +216,11 @@ scripted_effect scandinavian_adventurer_start_war_effect = { scope:adventurer_target.holder.top_liege = { every_ally = { add = this.max_military_strength } } + multiply = 0.5 #Cut it off so things don't get too ridiculous. - max = 8000 + max = 4000 #Make sure all adventurers have a moderately respectable force. - min = 1000 + min = 500 } } inheritable = no @@ -232,6 +233,8 @@ scripted_effect scandinavian_adventurer_start_war_effect = { stacks = { value = 1 multiply = scope:adventurer_target.holder.top_liege.primary_title.tier + divide = 2 + ceiling = yes } } inheritable = yes @@ -244,6 +247,8 @@ scripted_effect scandinavian_adventurer_start_war_effect = { stacks = { value = 1 multiply = scope:adventurer_target.holder.top_liege.primary_title.tier + divide = 2 + floor = yes } } inheritable = yes diff --git a/events/dlc/fp1/fp1_trade_events.txt b/events/dlc/fp1/fp1_trade_events.txt new file mode 100644 index 000000000..058d53e50 --- /dev/null +++ b/events/dlc/fp1/fp1_trade_events.txt @@ -0,0 +1,2505 @@ +namespace = fp1_trade_events + +################################################## +# #Standard Trade Events +# 0001 - 0010 Raid or Trade - a raid potentially becomes a trading mission instead +# 0011 - 0020 A Comfortable Accomodation - a trade ceasefire has expired and can be renewed. +# 0021 - 0040 Visitors from Afar - courtiers swap between two places that trade with each other. +# 0041 - 0060 Belligerents with Benefits - beneficial modifiers are swapped between the capital and a foreign trade location. +# +# #Special Trade Events +# 1101 - 1130 An Alternative Arrangement - offer land to a raid-trade partner +# 1131 - 1170 The Northerner Menace - you buy off an SA's troops, or offer them a position under you. +# 1171 - 1180 A Holy Helping Hand - someone you have a raid-trade agreement with offers the hand of a child and conversion aid. +################################################## + + + + + + + + + + +################################################## +# STANDARD TRADE EVENTS + +################################################## +# Take or Trade? +# by Ewan Cowhig Croft +# 0001 - 0010 +################################################## + +# Hidden setup: could this raid become a trade mission instead? +fp1_trade_events.0001 = { + hidden = yes + scope = army + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Make sure that the army hasn't landed straight into combat or w/e. + is_army_in_combat = no + # Various checks related to scope:raider, including most of the stuff for fp1_trade_events.0002's trigger block. + scope:raider = { + #You must be leading your own forces. + this = root.army_commander + # Standard checks. + is_available_adult_or_is_commanding = yes + NOT = { has_character_flag = had_event_fp1_trade_events_0002 } + # Must be either river-capable raiders, or have invested in a suitable dynasty legacy. + OR = { + culture = { has_innovation = innovation_longboats } + dynasty ?= { has_dynasty_perk = fp1_adventure_legacy_2 } + } + # Must be at peace; not strictly, but this is the easiest way to reduce edge cases. + is_at_war = no + # Shouldn't hypothetically need to check whether or not scope:raider can actually raid the target, since that should be handled code-side before the on_action even fires. + } + # Is the target intimidating to this raid army? + army_size < fp1_trade_events_eligible_settlement_value + } + + immediate = { + random = { + chance = 20 + modifier = { + add = 20 + scope:raider = { + culture = { has_cultural_pillar = heritage_north_germanic } + dynasty = { has_dynasty_perk = fp1_adventure_legacy_2 } + } + } + save_scope_as = raid_army + scope:raider = { trigger_event = fp1_trade_events.0002 } + } + } +} + +scripted_effect fp1_trade_events_offer_trade_deal_raider_perspective_effect = { + # Add the truce. + add_truce_both_ways = { + character = scope:raider + days = fp1_trade_events_truce_length_value + name = TRUCE_TRADE_DEAL + } + # Add some mutual opinion gain. + add_opinion = { + target = scope:raider + modifier = pleased_opinion + opinion = 20 + } + # Raid loot for the army. + scope:raid_army = { add_loot = fp1_trade_events_cash_settlement_value } +} + +scripted_effect fp1_trade_events_offer_trade_deal_defender_perspective_effect = { + # Add the truce. + show_as_tooltip = { + add_truce_both_ways = { + character = scope:raider + days = fp1_trade_events_truce_length_value + name = TRUCE_TRADE_DEAL + } + } + # Add some mutual opinion gain. + reverse_add_opinion = { + target = scope:raider + modifier = pleased_opinion + opinion = 20 + } + # Minor beneficial modifier gain for the county. + scope:county = { + add_county_modifier = { + modifier = trade_instead_of_raid_fp1_modifier + days = fp1_trade_events_truce_length_value + } + } +} + +# You have the chance to trade peacefully instead of raiding. +fp1_trade_events.0002 = { + type = character_event + title = fp1_trade_events.0002.t + desc = fp1_trade_events.0002.desc + theme = raid + left_portrait = { + character = scope:raider + animation = personality_honorable + } + right_portrait = { + character = scope:county.holder + animation = disapproval + } + lower_right_portrait = scope:top_liege + override_background = { reference = burning_building } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + } + + immediate = { + add_character_flag = { + flag = had_event_fp1_trade_events_0002 + days = 365 + } + # Grab top_liege, if they're a separate character. + if = { + limit = { + scope:county.holder != scope:county.holder.top_liege + } + scope:county.holder.top_liege = { save_scope_as = top_liege } + } + } + + # Offer trade: local holder. + option = { + name = fp1_trade_events.0002.a + + # Show offer results. + show_as_tooltip = { + random_list = { + # We only want to show the two possibilities, actual percentages don't matter, since the results are decided in the recipient's event. + 100 = { + show_chance = no + desc = fp1_trade_events.0002.a.accepted + scope:county.holder = { fp1_trade_events_offer_trade_deal_raider_perspective_effect = yes } + } + 100 = { + show_chance = no + desc = fp1_trade_events.0002.a.rejected + custom_tooltip = fp1_trade_events.0002.a.tt + } + } + } + # Send the actual offer. + scope:county.holder = { trigger_event = fp1_trade_events.0003 } + # Charge a little prestige to make it a trade-off. + add_prestige = minor_prestige_loss + + stress_and_fulfillment_impact = { + calm = medium_stress_impact_loss + compassionate = major_stress_impact_loss + wrathful = medium_stress_impact_gain + callous = major_stress_impact_gain + sadistic = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_compassion = 0.5 + ai_greed = -0.5 + } + opinion_modifier = { opinion_target = scope:county.holder.top_liege } + modifier = { # Weight up for stress. + add = 20 + has_trait = calm + } + modifier = { # Weight up for stress. + add = 30 + has_trait = compassionate + } + modifier = { # Weight down for stress. + add = -20 + has_trait = wrathful + } + modifier = { # Weight down for stress. + add = -20 + has_trait = callous + } + modifier = { # Weight down for stress. + add = -30 + has_trait = sadistic + } + } + } + + # Offer trade: top liege. + option = { + name = fp1_trade_events.0002.b + trigger = { + scope:county.holder != scope:county.holder.top_liege + } + + # Show offer results. + show_as_tooltip = { + random_list = { + # We only want to show the two possibilities, actual percentages don't matter, since the results are decided in the recipient's event. + 100 = { + show_chance = no + desc = fp1_trade_events.0002.a.accepted + scope:county.holder.top_liege = { fp1_trade_events_offer_trade_deal_raider_perspective_effect = yes } + } + 100 = { + show_chance = no + desc = fp1_trade_events.0002.a.rejected + custom_tooltip = fp1_trade_events.0002.a.tt + } + } + } + # Send the actual offer. + scope:county.holder.top_liege = { trigger_event = fp1_trade_events.0003 } + # Charge a little prestige to make it a trade-off. + add_prestige = minor_prestige_loss + + stress_and_fulfillment_impact = { + calm = medium_stress_impact_loss + compassionate = major_stress_impact_loss + wrathful = medium_stress_impact_gain + callous = major_stress_impact_gain + sadistic = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_compassion = 0.5 + ai_greed = -0.5 + } + opinion_modifier = { opinion_target = scope:county.holder.top_liege } + modifier = { # Weight up for stress. + add = 20 + has_trait = calm + } + modifier = { # Weight up for stress. + add = 30 + has_trait = compassionate + } + modifier = { # Weight down for stress. + add = -20 + has_trait = wrathful + } + modifier = { # Weight down for stress. + add = -20 + has_trait = callous + } + modifier = { # Weight down for stress. + add = -30 + has_trait = sadistic + } + } + } + + # Pillage it anyway. + option = { + name = fp1_trade_events.0002.c + + # Nahhhhh, screw it. + custom_tooltip = fp1_trade_events.0002.c.tt + + stress_and_fulfillment_impact = { + wrathful = medium_stress_impact_loss + callous = major_stress_impact_loss + sadistic = major_stress_impact_loss + calm = medium_stress_impact_gain + compassionate = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = 0.5 + ai_compassion = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = wrathful + } + modifier = { # Weight up for stress. + add = 20 + has_trait = callous + } + modifier = { # Weight up for stress. + add = 30 + has_trait = sadistic + } + modifier = { # Weight down for stress. + add = -20 + has_trait = calm + } + modifier = { # Weight down for stress. + add = -30 + has_trait = compassionate + } + } + } + + # Pillage & don't poke me about this again. + option = { + name = fp1_trade_events.0002.d + # AI don't need an opt-out. + trigger = { is_ai = no } + + # Furthermore, screw it for a very long time. + custom_tooltip = fp1_trade_events.0002.d.tt + add_character_flag = { flag = had_event_fp1_trade_events_0002 } + + stress_and_fulfillment_impact = { + wrathful = medium_stress_impact_loss + callous = major_stress_impact_loss + sadistic = major_stress_impact_loss + calm = medium_stress_impact_gain + compassionate = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = 0.5 + ai_compassion = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = wrathful + } + modifier = { # Weight up for stress. + add = 20 + has_trait = callous + } + modifier = { # Weight up for stress. + add = 30 + has_trait = sadistic + } + modifier = { # Weight down for stress. + add = -20 + has_trait = calm + } + modifier = { # Weight down for stress. + add = -30 + has_trait = compassionate + } + } + } +} + +scripted_effect fp1_set_prime_trade_partner_effect = { + # Store the variable for general tracking. + set_variable = { + name = fp1_prime_trade_deal + value = scope:recipient + days = fp1_trade_events_truce_length_value + } + # Fire off the renewal event from the date of expiry. + trigger_event = { + id = fp1_trade_events.0011 + days = fp1_trade_events_truce_renewal_date_value + } + # Trigger the on_action. + if = { + limit = { + NOT = { has_character_flag = fp1_trade_events_cycle_start } + } + add_character_flag = fp1_trade_events_cycle_start + trigger_event = { on_action = fp1_trade_events_cycle } + } +} + +# A raider in your lands would prefer commerce to pillage. +fp1_trade_events.0003 = { + type = character_event + title = fp1_trade_events.0003.t + desc = fp1_trade_events.0003.desc + theme = raid + left_portrait = { + character = scope:raider + animation = personality_bold + } + right_portrait = { + character = scope:recipient + animation = disapproval + } + override_background = { reference = burning_building } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + } + + immediate = { + # Grab a scope:recipient for the portraits, since this may have gone to two different characters. + save_scope_as = recipient + } + + # Unexpected, but highly welcome. + option = { + name = fp1_trade_events.0003.a + + # Apply effects & inform scope:raider. + hidden_effect = { + scope:raider = { + send_interface_toast = { + title = fp1_trade_events.0003.a.tt_success + left_icon = scope:recipient + scope:recipient = { fp1_trade_events_offer_trade_deal_raider_perspective_effect = yes } + } + # Quietly work out if this would become their pre-eminent trade deal. + ## Due to no existing prime trade deal. + if = { + limit = { + NOT = { has_variable = fp1_prime_trade_deal } + } + fp1_set_prime_trade_partner_effect = yes + } + ## Due to a dead/landless prime trade deal or cancelled truces. + else_if = { + limit = { + has_variable = fp1_prime_trade_deal + var:fp1_prime_trade_deal = { + OR = { + is_alive = no + is_landed = no + NOR = { + has_truce = scope:raider + scope:raider = { has_truce = var:fp1_prime_trade_deal } + } + } + } + } + fp1_set_prime_trade_partner_effect = yes + } + ## Due to scope:recipient being of a higher tier than their current one. + else_if = { + limit = { + has_variable = fp1_prime_trade_deal + scope:recipient.primary_title.tier > var:fp1_prime_trade_deal.primary_title.tier + } + fp1_set_prime_trade_partner_effect = yes + } + } + } + fp1_trade_events_offer_trade_deal_defender_perspective_effect = yes + + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_loss + forgiving = major_stress_impact_loss + callous = medium_stress_impact_gain + sadistic = major_stress_impact_gain + vengeful = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_compassion = 0.5 + ai_vengefulness = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = compassionate + } + modifier = { # Weight up for stress. + add = 30 + has_trait = forgiving + } + modifier = { # Weight down for stress. + add = -20 + has_trait = callous + } + modifier = { # Weight down for stress. + add = -30 + has_trait = sadistic + } + modifier = { # Weight down for stress. + add = -40 + has_trait = vengeful + } + } + } + + # *Trade*? With these murderers?! + option = { + name = fp1_trade_events.0003.b + + # Gain some prestige for turning down these marauders. + add_prestige = minor_prestige_gain + # Inform scope:raider that negotiations have failed. + hidden_effect = { + scope:raider = { + send_interface_toast = { + title = fp1_trade_events.0003.b.tt_failure + left_icon = scope:recipient + custom_tooltip = fp1_trade_events.0003.b.tt_failure + } + } + } + + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + forgiving = major_stress_impact_gain + callous = medium_stress_impact_loss + sadistic = major_stress_impact_loss + vengeful = major_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_compassion = 0.5 + ai_vengefulness = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = callous + } + modifier = { # Weight up for stress. + add = 30 + has_trait = sadistic + } + modifier = { # Weight up for stress. + add = 40 + has_trait = vengeful + } + modifier = { # Weight down for stress. + add = -20 + has_trait = compassionate + } + modifier = { # Weight down for stress. + add = -30 + has_trait = forgiving + } + } + } +} + +################################################## +# Comfortable Accomodation +# by Ewan Cowhig Croft +# 0011 - 0020 +################################################## + +scripted_trigger fp1_prime_trade_partner_still_valid_trigger = { + exists = $RAIDER$.var:fp1_prime_trade_deal + $RAIDER$.var:fp1_prime_trade_deal = { + this = $RECIPIENT$ + is_alive = yes + is_landed = yes + # Make sure the truce hasn't been cancelled. + has_truce = $RAIDER$ + $RAIDER$ = { has_truce = var:fp1_prime_trade_deal } + # And that the characters haven't wound up in the same realm somehow. + NOT = { top_liege = $RAIDER$.top_liege } + } +} + +scripted_effect fp1_trade_events_trade_renewed_raider_perspective_effect = { + # Add the truce. + add_truce_both_ways = { + character = scope:recipient + days = fp1_trade_events_truce_length_value + name = TRUCE_TRADE_DEAL + } + # Nudge towards friendship. + progress_towards_friend_effect = { + CHARACTER = scope:recipient + OPINION = 30 + REASON = friend_fp1_renewed_trade_deal + } + # Gain some prestige. + add_prestige = major_prestige_gain + # Sort deal veterancy. + set_variable = { + name = fp1_renewed_trade_deal + value = scope:recipient + days = fp1_trade_events_truce_length_value + } +} + +scripted_effect fp1_trade_events_trade_renewed_defender_perspective_effect = { + # Truce added in scope:raider's perspective. + show_as_tooltip = { + add_truce_both_ways = { + character = scope:raider + days = fp1_trade_events_truce_length_value + name = TRUCE_TRADE_DEAL + } + } + # Nudge towards friendship. + show_as_tooltip = { + progress_towards_friend_effect = { + CHARACTER = scope:raider + OPINION = 30 + REASON = friend_fp1_renewed_trade_deal + } + } + # Since prestige is the independence reward, we give a little bit of static cash. + add_gold = 50 +} + +scripted_effect fp1_trade_events_trade_renewal_rejected_effect = { + add_prestige = minor_prestige_loss + custom_tooltip = fp1_trade_events.0011.b.tt +} + +# A trade ceasefire has expired and can be renewed. +fp1_trade_events.0011 = { + type = character_event + title = fp1_trade_events.0011.t + desc = { + first_valid = { + # Not your first renewal. + triggered_desc = { + trigger = { + exists = var:fp1_renewed_trade_deal + var:fp1_renewed_trade_deal = var:fp1_prime_trade_deal + } + desc = fp1_trade_events.0011.desc.subsequent_renewal + } + # First time renewing this particular deal. + desc = fp1_trade_events.0011.desc.first_renewal + } + desc = fp1_trade_events.0011.desc.outro + } + theme = stewardship + left_portrait = { + character = scope:raider + animation = personality_rational + } + right_portrait = { + character = scope:recipient + animation = personality_bold + } + override_background = { reference = market } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Standard checks. + is_landed = yes + # Scope:raider's prime trade deal must still be valid. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = scope:recipient + RAIDER = scope:raider + } + } + + # A grand offer! + option = { + name = fp1_trade_events.0011.a + # Make sure players in MP don't cheese anything. + trigger = { + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = scope:recipient + RAIDER = scope:raider + } + } + + # You offer a renewal to scope:recipient. + random_list = { + 100 = { + show_chance = no + desc = fp1_trade_events.0011.a.accepted + show_as_tooltip = { fp1_trade_events_trade_renewed_raider_perspective_effect = yes } + } + 100 = { + show_chance = no + desc = fp1_trade_events.0011.a.rejected + show_as_tooltip = { fp1_trade_events_trade_renewal_rejected_effect = yes } + } + } + scope:recipient = { trigger_event = fp1_trade_events.0012 } + + stress_and_fulfillment_impact = { + honest = minor_stress_impact_loss + arbitrary = medium_stress_impact_gain + fickle = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_honor = 0.5 + ai_sociability = 0.25 + ai_rationality = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = honest + } + modifier = { # Weight down for stress. + add = -20 + has_trait = arbitrary + } + modifier = { # Weight down for stress. + add = -20 + has_trait = fickle + } + } + } + + # This has run its course... + option = { + name = fp1_trade_events.0011.b + + # A bit of consolation prestige for your hard-work. + add_prestige = minor_prestige_gain + # Confirm that the deal will lapse as expected. + custom_tooltip = fp1_trade_events.0011.b.tt + + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + fickle = minor_stress_impact_loss + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_honor = -0.25 + ai_sociability = -0.25 + ai_rationality = -0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = arbitrary + } + modifier = { # Weight up for stress. + add = 10 + has_trait = fickle + } + modifier = { # Weight down for stress. + add = -10 + has_trait = honest + } + } + } +} + +# A trading partner proposes an extension. +fp1_trade_events.0012 = { + type = character_event + title = fp1_trade_events.0012.t + desc = { + first_valid = { + # Not your first renewal. + triggered_desc = { + trigger = { + exists = var:fp1_renewed_trade_deal + var:fp1_renewed_trade_deal = var:fp1_prime_trade_deal + } + desc = fp1_trade_events.0012.desc.subsequent_renewal + } + # First time renewing this particular deal. + desc = fp1_trade_events.0012.desc.first_renewal + } + desc = fp1_trade_events.0012.desc.outro + } + theme = stewardship + left_portrait = { + character = scope:recipient + animation = personality_rational + } + right_portrait = { + character = scope:raider + animation = admiration + } + override_background = { reference = market } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Scope:raider's prime trade deal must still be valid. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = scope:recipient + RAIDER = scope:raider + } + } + + # A most agreeable proposal. + option = { + name = fp1_trade_events.0012.a + # Make sure players in MP don't cheese anything. + trigger = { + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = scope:recipient + RAIDER = scope:raider + } + } + + # You agree to a renewal with scope:raider. + fp1_trade_events_trade_renewed_defender_perspective_effect = yes + # Inform scope:raider. + scope:raider = { + hidden_effect = { + send_interface_toast = { + title = fp1_trade_events.0012.a.tt_success + left_icon = scope:recipient + fp1_trade_events_trade_renewed_raider_perspective_effect = yes + } + } + } + + stress_and_fulfillment_impact = { + honest = minor_stress_impact_loss + arbitrary = medium_stress_impact_gain + fickle = medium_stress_impact_gain + } + ai_chance = { + base = 100 + opinion_modifier = { opinion_target = scope:raider} + ai_value_modifier = { + ai_honor = 0.5 + ai_sociability = 0.25 + ai_rationality = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = honest + } + modifier = { # Weight down for stress. + add = -20 + has_trait = arbitrary + } + modifier = { # Weight down for stress. + add = -20 + has_trait = fickle + } + } + } + + # I'm done with this GetWomanMan. + option = { + name = fp1_trade_events.0012.b + + # A bit of consolation prestige for your independence. + add_prestige = minor_prestige_gain + # Confirm that the deal will lapse as expected. + custom_tooltip = fp1_trade_events.0012.b.tt + # Inform scope:raider, who is disappointed. + scope:raider = { + add_opinion = { + target = scope:recipient + modifier = disappointed_opinion + opinion = -20 + } + hidden_effect = { + send_interface_toast = { + title = fp1_trade_events.0012.b.tt_failure + left_icon = scope:recipient + fp1_trade_events_trade_renewal_rejected_effect = yes + } + } + } + + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + fickle = minor_stress_impact_loss + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_honor = -0.25 + ai_sociability = -0.25 + ai_rationality = -0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = arbitrary + } + modifier = { # Weight up for stress. + add = 10 + has_trait = fickle + } + modifier = { # Weight down for stress. + add = -10 + has_trait = honest + } + } + } +} + +################################################## +# Visitors from Afar +# by Ewan Cowhig Croft +# 0021 - 0040 +################################################## + +scripted_effect fp1_trade_events_0021_acquire_courtier_effect = { + # Acquire selection and boost opinion. + add_courtier = $SELECTION$ + progress_towards_friend_effect = { + CHARACTER = $SELECTION$ + OPINION = 100 + REASON = friend_accepted_courtier + } + # Ditch the rest. + hidden_effect = { + scope:merchant = { + if = { + limit = { + NOT = { this = $SELECTION$ } + } + death = { death_reason = death_vanished } + } + } + scope:priest = { + if = { + limit = { + NOT = { this = $SELECTION$ } + } + death = { death_reason = death_vanished } + } + } + if = { + limit = { + exists = scope:spy + NOT = { scope:spy = $SELECTION$ } + } + scope:spy = { + death = { death_reason = death_vanished } + } + } + } +} + +# Courtiers swap between two places that trade with each other. +fp1_trade_events.0021 = { + type = character_event + title = fp1_trade_events.0021.t + desc = fp1_trade_events.0021.desc + theme = alliance + left_portrait = { + character = scope:merchant + animation = personality_greedy + } + right_portrait = { + character = scope:priest + animation = personality_zealous + } + lower_center_portrait = scope:spy + lower_right_portrait = var:fp1_prime_trade_deal + override_background = { reference = docks } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Standard checks. + ## Allow when commanding to be fairer to people out raiding, which we incentivise you to do personally to get pacts to begin with. + is_available_adult_or_is_commanding = yes + NOT = { has_character_flag = had_event_fp1_trade_events_0021 } + is_landed = yes + # Scope:raider's prime trade deal must still be valid. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = root.var:fp1_prime_trade_deal + RAIDER = root + } + } + + weight_multiplier = { + base = 1 + + # Weight up a little for certain lifestyle traits, as these spread stories of your success and accomplishments. + modifier = { + add = 0.25 + has_trait = diplomat + } + modifier = { + add = 0.25 + has_trait = avaricious + } + # Weight up for this being a renewed treaty. + modifier = { + add = 1 + exists = root.var:fp1_renewed_trade_deal + exists = root.var:fp1_prime_trade_deal + root.var:fp1_prime_trade_deal = root.var:fp1_renewed_trade_deal + } + } + + immediate = { + add_character_flag = { + flag = had_event_fp1_trade_events_0021 + days = 1825 + } + # Save some things for loc & future events. + save_scope_as = raider + var:fp1_prime_trade_deal = { save_scope_as = partner } + # Create our players. + ## A merchant. + create_character = { + template = fp1_trade_partner_merchant + location = root.capital_province + save_scope_as = merchant + } + ## A priest. + create_character = { + template = fp1_trade_partner_priest + location = root.capital_province + save_scope_as = priest + } + ## And a spy, if appropriate. + if = { + limit = { + NOT = { has_trait = trusting } + intrigue >= high_skill_rating + } + create_character = { + template = fp1_trade_partner_spy + location = root.capital_province + save_scope_as = spy + } + } + } + + # I could use someone to count my coin... + option = { + name = fp1_trade_events.0021.a + + # Select the merchant. + fp1_trade_events_0021_acquire_courtier_effect = { SELECTION = scope:merchant } + + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + generous = medium_stress_impact_gain + paranoid = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = 0.5 + ai_sociability = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight down for stress. + add = -20 + has_trait = generous + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + } + } + + # Welcome to my service, [priest.GetFirstName]! + option = { + name = fp1_trade_events.0021.b + + # Select the priest. + fp1_trade_events_0021_acquire_courtier_effect = { SELECTION = scope:priest } + + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + zealous = medium_stress_impact_gain + paranoid = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.25 + ai_zeal = -0.5 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight down for stress. + add = -20 + has_trait = zealous + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + } + } + + # And who is this accompanying you? + option = { + name = fp1_trade_events.0021.c + trigger = { exists = scope:spy } + skill = intrigue + + fp1_trade_events_0021_acquire_courtier_effect = { SELECTION = scope:spy } + + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_boldness = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + } + } + + # Move along, foreigners, my agreement is with [recipient.GetFirstName]. + option = { + name = fp1_trade_events.0021.d + + # Gain some prestige for your haughtiness. + add_prestige = medium_prestige_gain + # But annoy your trading partner. + reverse_add_opinion = { + target = var:fp1_prime_trade_deal + modifier = annoyed_opinion + opinion = -40 + } + # Dispose of the guests. + hidden_effect = { + scope:merchant = { + death = { death_reason = death_vanished } + } + scope:priest = { + death = { death_reason = death_vanished } + } + if = { + limit = { exists = scope:spy } + scope:spy = { + death = { death_reason = death_vanished } + } + } + } + + stress_and_fulfillment_impact = { + paranoid = medium_stress_impact_loss + shy = medium_stress_impact_loss + compassionate = minor_stress_impact_gain + gregarious = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = -0.25 + ai_sociability = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = paranoid + } + modifier = { # Weight up for stress. + add = 20 + has_trait = shy + } + modifier = { # Weight down for stress. + add = -10 + has_trait = compassionate + } + modifier = { # Weight down for stress. + add = -30 + has_trait = gregarious + } + } + } + + after = { + # Send a companion event to var:fp1_prime_trade_deal. + #var:fp1_prime_trade_deal = { trigger_event = fp1_trade_events.0031 } + var:fp1_prime_trade_deal = { + trigger_event = { + id = fp1_trade_events.0031 + days = 1 + } + } + } +} + +fp1_trade_events.0031 = { + type = character_event + title = fp1_trade_events.0031.t + desc = fp1_trade_events.0031.desc + theme = alliance + left_portrait = { + character = scope:warrior + animation = personality_bold + } + lower_right_portrait = scope:raider + override_background = { reference = throne_room } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Standard checks. + ## Allow when commanding - we want to make trading compacts a bit more equal. + is_available_adult = yes + NOT = { has_character_flag = had_event_fp1_trade_events_0031 } + is_landed = yes + # Scope:raider's prime trade deal must still be valid. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = scope:raider.var:fp1_prime_trade_deal + RAIDER = scope:raider + } + } + + immediate = { + add_character_flag = { + flag = had_event_fp1_trade_events_0031 + days = 1825 + } + # Create scope:warrior. + create_character = { + template = fp1_trade_partner_warrior + location = scope:raider.var:fp1_prime_trade_deal.capital_province + save_scope_as = warrior + } + } + + # We can always use another sword! + option = { + name = fp1_trade_events.0031.a + + # Gain the warrior, who's understandably pretty hyped. + add_courtier = scope:warrior + progress_towards_friend_effect = { + CHARACTER = scope:warrior + OPINION = 100 + REASON = friend_accepted_courtier + } + + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_boldness = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + } + } + + # Be gone, bandit. + option = { + name = fp1_trade_events.0031.b + + # Gain some prestige for your haughtiness. + add_prestige = medium_prestige_gain + # But annoy your trading partner, though not as much as snubbing an open delegation on the inverse. + reverse_add_opinion = { + target = scope:raider + modifier = annoyed_opinion + opinion = -20 + } + # Dispose of the guest. + hidden_effect = { + scope:warrior = { + death = { death_reason = death_vanished } + } + } + + stress_and_fulfillment_impact = { + paranoid = medium_stress_impact_loss + shy = medium_stress_impact_loss + compassionate = minor_stress_impact_gain + gregarious = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = -0.25 + ai_sociability = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = paranoid + } + modifier = { # Weight up for stress. + add = 20 + has_trait = shy + } + modifier = { # Weight down for stress. + add = -10 + has_trait = compassionate + } + modifier = { # Weight down for stress. + add = -30 + has_trait = gregarious + } + } + } +} + +################################################## +# Belligerents with Benefits +# by Ewan Cowhig Croft +# 0041 - 0060 +################################################## + +scripted_trigger fp1_trade_events_0041_advanced_culture_comparison_trigger = { + scope:raider.culture = { + # Must have separate cultures for one to be more advanced. + this != scope:partner.culture + # And scope:partner's must be in a later era than scope:raider's. + ## Tribal. + trigger_if = { + limit = { + NOT = { has_cultural_era_or_later = culture_era_early_medieval } + } + scope:partner.culture = { has_cultural_era_or_later = culture_era_early_medieval } + } + ## Early Medieval. + trigger_if = { + limit = { + NOT = { has_cultural_era_or_later = culture_era_high_medieval } + } + scope:partner.culture = { has_cultural_era_or_later = culture_era_high_medieval } + } + ## High Medieval. + trigger_if = { + limit = { + NOT = { has_cultural_era_or_later = culture_era_late_medieval } + } + scope:partner.culture = { has_cultural_era_or_later = culture_era_late_medieval } + } + ## And you can't be later than the Late Medieval, so we ignore that'un. + } +} + +scripted_trigger fp1_trade_events_0041_valid_partner_counties_trigger = { + has_county_modifier = recently_looted_modifier + NOT = { has_county_modifier = fp1_trade_events_raid_consultants_modifier } +} + +scripted_effect fp1_trade_events_0041_offer_consultation_deal_raider_perspective_effect = { + # You pay coin and get discounts to construction in your domain. + remove_treasury_or_gold = massive_gold_value + # Give a modifier with prosperity growth to underdeveloped holdings. + every_held_title = { + title_tier = county + limit = { + prosperity_level <= 15 + } + custom = fp1_trade_events.0041.foreign_architects_growth.tt + add_county_modifier = { + modifier = fp1_trade_events_foreign_architects_modifier + years = 20 + } + } + # And one without it to holdings that are adequately developed. + every_held_title = { + title_tier = county + limit = { + prosperity_level >= 16 + } + custom = fp1_trade_events.0041.foreign_architects_no_growth.tt + add_county_modifier = { + modifier = fp1_trade_events_foreign_architects_no_growth_modifier + years = 20 + } + } + # Plus stepped friendship with scope:partner. + progress_towards_friend_effect = { + CHARACTER = scope:partner + OPINION = 30 + REASON = friend_fp1_renewed_trade_deal + } + # Scope:partner gets some help with raiding. + custom_tooltip = fp1_trade_events.0041.partner_gets_raid_aid.tt +} + +scripted_effect fp1_trade_events_0041_offer_consultation_deal_partner_perspective_effect = { + # You pay coin and get raid protection increases in one duchy. + remove_treasury_or_gold = scandinavian_adventurer_fp1_0041_gold_value + # Give modifiers that make that duchy better able to withstand raids. + $TARGET_DUCHY$ = { + save_scope_as = target_duchy + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + holder = { + OR = { + any_liege_or_above = { this = scope:partner } + this = scope:partner + } + } + } + custom = fp1_trade_events.0041.partner.benefiting_counties.tt + add_county_modifier = { + modifier = fp1_trade_events_raid_consultants_modifier + years = 20 + } + # Grab the holders for happiness purposes. + holder = { + if = { + limit = { + this != scope:partner + } + add_to_list = happy_with_raid_proofing_list + } + } + } + } + # Anyone who holds lands here other than you is duly grateful. + every_in_list = { + list = happy_with_raid_proofing_list + add_opinion = { + target = scope:partner + modifier = grateful_opinion + opinion = 30 + } + } + # Plus, stepped friendship with scope:raider (actual effect handled scope:raider-side). + show_as_tooltip = { + progress_towards_friend_effect = { + CHARACTER = scope:raider + OPINION = 30 + REASON = friend_fp1_renewed_trade_deal + } + } + # Scope:raider gets help with civic works. + custom_tooltip = fp1_trade_events.0041.raider_gets_civic_aid.tt +} + +scripted_effect fp1_trade_events_0041_consultation_rejected_effect = { + # Lose a fair bit of prestige. + add_prestige = medium_prestige_loss +} + +# Beneficial modifiers are swapped between the capital and a foreign trade location. +fp1_trade_events.0041 = { + type = character_event + title = fp1_trade_events.0041.t + desc = fp1_trade_events.0041.desc + theme = alliance + left_portrait = { + character = scope:raider + animation = personality_forgiving + } + right_portrait = { + character = scope:partner + animation = personality_content + } + override_background = { reference = docks } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Standard checks. + ## Allow when commanding to be fairer to people out raiding, which we incentivise you to do personally to get pacts to begin with. + is_available_adult_or_is_commanding = yes + NOT = { has_character_flag = had_event_fp1_trade_events_0041 } + is_landed = yes + # Scope:raider's prime trade deal must still be valid & available. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = root.var:fp1_prime_trade_deal + RAIDER = root + } + root.var:fp1_prime_trade_deal = { is_available_adult_or_is_commanding = yes } + # And they've gotta be able to take the deal in some fashion. + root.var:fp1_prime_trade_deal = { + any_sub_realm_county = { fp1_trade_events_0041_valid_partner_counties_trigger = yes } + } + # Plus, there must be a trade to be made. + ## Meaning one must be tribal, the other feudal. + government_has_flag = government_is_tribal + root.var:fp1_prime_trade_deal = { + NOT = { government_has_flag = government_is_tribal } + } + ## And that scope:partner can't raid for some other reason. + root.var:fp1_prime_trade_deal = { can_raid_trigger = no } + } + + weight_multiplier = { + base = 1 + + # Weight up a little for certain lifestyle traits, as these spread stories of your success and accomplishments. + modifier = { + add = 0.25 + has_trait = diplomat + } + modifier = { + add = 0.25 + has_trait = avaricious + } + # Weight up for this being a renewed treaty. + modifier = { + add = 1 + exists = root.var:fp1_renewed_trade_deal + exists = root.var:fp1_prime_trade_deal + root.var:fp1_prime_trade_deal = root.var:fp1_renewed_trade_deal + } + } + + immediate = { + add_character_flag = { + flag = had_event_fp1_trade_events_0041 + days = 3625 + } + # Save some things for loc & future events. + save_scope_as = raider + var:fp1_prime_trade_deal = { save_scope_as = partner } + } + + # Could they build me a palace in the [partner.GetCulture] style? + option = { + name = { + trigger = { fp1_trade_events_0041_advanced_culture_comparison_trigger = yes } + text = fp1_trade_events.0041.a.advanced + } + name = { + trigger = { fp1_trade_events_0041_advanced_culture_comparison_trigger = no } + text = fp1_trade_events.0041.a.fallback + } + trigger = { + can_make_expensive_purchase_trigger = { PRICE = scandinavian_adventurer_fp1_0041_gold_value } + } + + # Show possible results depending on scope:partner's response. + random_list = { + 100 = { + show_chance = no + desc = fp1_trade_events.0041.a.offer_accepted + show_as_tooltip = { fp1_trade_events_0041_offer_consultation_deal_raider_perspective_effect = yes } + } + 100 = { + show_chance = no + desc = fp1_trade_events.0041.a.offer_rejected + show_as_tooltip = { fp1_trade_events_0041_consultation_rejected_effect = yes } + } + } + # And send scope:partner their event. + scope:partner = { trigger_event = fp1_trade_events.0051 } + + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_boldness = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + } + } + + # Let's keep this informal. + option = { + name = fp1_trade_events.0041.b + + # Stress loss; handled in stress_impact block. + + stress_and_fulfillment_impact = { + base = medium_stress_impact_loss + paranoid = medium_stress_impact_loss + gregarious = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = -0.25 + ai_sociability = -0.5 + } + modifier = { # Weight up for stress. + add = 20 + has_trait = paranoid + } + modifier = { # Weight down for stress. + add = -30 + has_trait = gregarious + } + } + } +} + +scripted_effect fp1_trade_events_0051_inform_scope_raider_effect = { + hidden_effect = { + scope:raider = { + send_interface_toast = { + title = fp1_trade_events.0051.offer_accepted + left_icon = scope:partner + fp1_trade_events_0041_offer_consultation_deal_raider_perspective_effect = yes + } + } + } +} + +fp1_trade_events.0051 = { + type = character_event + title = fp1_trade_events.0051.t + desc = fp1_trade_events.0051.desc + theme = alliance + left_portrait = { + character = scope:partner + animation = personality_forgiving + } + right_portrait = { + character = scope:raider + animation = personality_content + } + override_background = { reference = docks } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Standard checks done scope:raider's side. + # Scope:raider's prime trade deal must still be valid. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = scope:raider.var:fp1_prime_trade_deal + RAIDER = scope:raider + } + } + + immediate = { + # Build a list of valid duchies. + ## First, we sort through all valid counties and add their duchies to a list. + every_sub_realm_county = { + limit = { fp1_trade_events_0041_valid_partner_counties_trigger = yes } + duchy = { add_to_list = duchies_valid_for_raid_proofing_list } + } + ## Then we order the list to pick the largest duchies. + ordered_in_list = { + list = duchies_valid_for_raid_proofing_list + max = 3 + order_by = { + value = 0 + + # Then we add a point for every de jure county that's also de facto part of the sub-realm. + every_in_de_jure_hierarchy = { + limit = { + tier = tier_county + holder = { + OR = { + this = scope:partner + any_liege_or_above = { this = scope:partner } + } + } + } + add = 1 + + # And again for every one that has _also_ been raided recently, since that's a good indicator of raid-density. + if = { + limit = { + any_county_province = { has_province_modifier = recently_looted_modifier } + } + add = 1 + } + } + } + if = { + limit = { + NOT = { exists = scope:option_1 } + } + save_scope_as = option_1 + } + if = { + limit = { + NOT = { + this = scope:option_1 + exists = scope:option_2 + } + } + save_scope_as = option_2 + } + if = { + limit = { + NOT = { + this = scope:option_1 + this = scope:option_2 + exists = scope:option_3 + } + } + save_scope_as = option_3 + } + } + } + + # Scope:option_1 could use some experts... + option = { + name = fp1_trade_events.0051.a + + # Apply effects to scope:option_1. + fp1_trade_events_0041_offer_consultation_deal_partner_perspective_effect = { TARGET_DUCHY = scope:option_1 } + # Inform scope:raider of the decision. + fp1_trade_events_0051_inform_scope_raider_effect = yes + + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_loss + callous = medium_stress_impact_gain + sadistic = medium_stress_impact_gain + greedy = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_rationality = 0.5 + ai_greed = -0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = compassionate + } + modifier = { # Weight down for stress. + add = -20 + has_trait = callous + } + modifier = { # Weight down for stress. + add = -20 + has_trait = sadistic + } + modifier = { # Weight down for stress. + add = -30 + has_trait = greedy + } + } + } + + # Scope:option_2 might be a good place for them? + option = { + name = fp1_trade_events.0051.b + trigger = { exists = scope:option_2 } + + # Apply effects to scope:option_2. + fp1_trade_events_0041_offer_consultation_deal_partner_perspective_effect = { TARGET_DUCHY = scope:option_2 } + # Inform scope:raider of the decision. + fp1_trade_events_0051_inform_scope_raider_effect = yes + + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_loss + callous = medium_stress_impact_gain + sadistic = medium_stress_impact_gain + greedy = major_stress_impact_gain + } + ai_chance = { + # AI should always pick the first & mostly-best option. + base = 0 + } + } + + # I think I'd prefer to shore up scope:option_3. + option = { + name = fp1_trade_events.0051.c + trigger = { exists = scope:option_3 } + + # Apply effects to scope:option_3. + fp1_trade_events_0041_offer_consultation_deal_partner_perspective_effect = { TARGET_DUCHY = scope:option_3 } + # Inform scope:raider of the decision. + fp1_trade_events_0051_inform_scope_raider_effect = yes + + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_loss + callous = medium_stress_impact_gain + sadistic = medium_stress_impact_gain + greedy = major_stress_impact_gain + } + ai_chance = { + # AI should always pick the first & mostly-best option. + base = 0 + } + } + + # What an outrageous proposal! + option = { + name = fp1_trade_events.0051.d + + # Gain a little consolation prestige. + add_prestige = minor_prestige_gain + # Inform scope:raider of the decision. + hidden_effect = { + scope:raider = { + send_interface_toast = { + title = fp1_trade_events.0051.offer_rejected + left_icon = scope:partner + fp1_trade_events_0041_consultation_rejected_effect = yes + } + } + } + + stress_and_fulfillment_impact = { + callous = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + compassionate = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = -0.25 + ai_rationality = -0.25 + ai_compassion = -0.5 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = callous + } + modifier = { # Weight up for stress. + add = 10 + has_trait = sadistic + } + modifier = { # Weight down for stress. + add = -30 + has_trait = compassionate + } + } + } +} + + + + + + + + + + +################################################## +# SPECIAL TRADE EVENTS + +################################################## +# The Northerner Menace +# by Ewan Cowhig Croft +# 1131 - 1170 +################################################## + +# You buy off an SA's troops, or offer them a position under you. +fp1_trade_events.1131 = { + type = character_event + title = fp1_trade_events.1131.t + desc = fp1_trade_events.1131.desc + theme = war + left_portrait = { + character = scope:defender + animation = worry + } + right_portrait = { + character = scope:attacker + animation = personality_greedy + } + override_background = { reference = fp1_beached_longships } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Make sure the war is still ongoing + any_character_war = { + using_cb = fp1_scandi_adventurer_conquest + primary_attacker = scope:attacker + primary_defender = scope:defender + } + } + + immediate = { + # Grab the CB for general reference. + random_character_war = { + limit = { + using_cb = fp1_scandi_adventurer_conquest + primary_attacker = scope:attacker + primary_defender = scope:defender + } + save_scope_as = sa_war + } + } + + # Never! Back to your frozen hellscape of a home, scum! + option = { + name = fp1_trade_events.1131.a + + # Gain a bit of prestige for your boasting. + add_prestige = medium_prestige_gain + # Stress gain trade-off handled in stress impact. + # Clarify that this is merely another trade-off option. + custom_tooltip = fp1_trade_events.1131.d.tt + + stress_and_fulfillment_impact = { + base = medium_stress_gain + arrogant = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + stubborn = minor_stress_impact_loss + vengeful = minor_stress_impact_loss + humble = medium_stress_impact_gain + content = medium_stress_impact_gain + fickle = medium_stress_impact_gain + forgiving = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_vengefulness = 0.5 + ai_energy = 0.25 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = arrogant + } + modifier = { # Weight up for stress. + add = 10 + has_trait = ambitious + } + modifier = { # Weight up for stress. + add = 10 + has_trait = stubborn + } + modifier = { # Weight up for stress. + add = 10 + has_trait = vengeful + } + modifier = { # Weight down for stress. + add = -20 + has_trait = humble + } + modifier = { # Weight down for stress. + add = -20 + has_trait = content + } + modifier = { # Weight down for stress. + add = -20 + has_trait = fickle + } + modifier = { # Weight down for stress. + add = -20 + has_trait = forgiving + } + } + } + + # Well, if it's land they want... + option = { + name = fp1_trade_events.1131.b + trigger = { + # Must be able to vassalise a duke. + highest_held_title_tier >= tier_kingdom + # Target duchy doesn't contain a player that isn't scope:defender. + NOT = { + any_player = { + # First, see if they're a vassal of scope:defender. + any_liege_or_above = { this = scope:defender } + # And if they are, make sure they have no titles held within the appropriate lands. + save_temporary_scope_as = vassal_player + any_in_list = { + list = target_titles + holder = scope:vassal_player + } + } + } + # Scope:defender must control at least some lands outside of the target duchy. + any_held_title = { + NOT = { is_in_list = target_titles } + } + } + + # You allow them to win the war... + scope:sa_war = { end_war = attacker } + add_prestige = major_prestige_loss + # ... but then immediately vassalise them. + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + } + scope:attacker = { + change_liege = { + liege = scope:defender + change = scope:change + } + } + resolve_title_and_vassal_change = scope:change + # This also gives a nice long truce so that they can't immediately usurp you. + hidden_effect = { + cancel_truce_both_ways = scope:attacker + } + add_truce_both_ways = { + character = scope:attacker + days = 7300 + name = FP1_SCANDINAVIAN_ADVENTURER_VASSAL_TRUCE_NAME + } + # Plus we whack some opinion in there for good measure. + progress_towards_friend_effect = { + CHARACTER = scope:attacker + OPINION = 50 + REASON = friend_fp1_renewed_trade_deal + } + # Finally, add a breather before the next SA. + fp1_add_realm_size_appropriate_sa_reprieve_effect = yes + + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + humble = minor_stress_impact_loss + content = minor_stress_impact_loss + fickle = minor_stress_impact_loss + forgiving = minor_stress_impact_loss + greedy = major_stress_impact_gain + arrogant = major_stress_impact_gain + ambitious = major_stress_impact_gain + stubborn = major_stress_impact_gain + vengeful = major_stress_impact_gain + } + ai_chance = { + # Base 0 so that only a particular kind of AI will go for this. + base = 0 + ai_value_modifier = { + ai_rationality = 0.25 + ai_greed = -0.5 + ai_vengefulness = -0.75 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = generous + } + modifier = { # Weight up for stress. + add = 10 + has_trait = humble + } + modifier = { # Weight up for stress. + add = 10 + has_trait = content + } + modifier = { # Weight up for stress. + add = 10 + has_trait = fickle + } + modifier = { # Weight up for stress. + add = 10 + has_trait = forgiving + } + modifier = { # Weight down for stress. + add = -30 + has_trait = greedy + } + modifier = { # Weight down for stress. + add = -30 + has_trait = arrogant + } + modifier = { # Weight down for stress. + add = -30 + has_trait = ambitious + } + modifier = { # Weight down for stress. + add = -30 + has_trait = stubborn + } + modifier = { # Weight down for stress. + add = -30 + has_trait = vengeful + } + } + } + + # In my experience, soldiers prefer gold to glory. + option = { + name = fp1_trade_events.1131.c + trigger = { + can_make_expensive_purchase_trigger = { PRICE = monumental_gold_value } + } + + # Pay scope:attacker's troops to sod off... + custom_tooltip = fp1_trade_events.1131.c.tt + remove_treasury_or_gold = monumental_treasury_or_gold_value + # ... thereby winning the war. + scope:sa_war = { + set_variable = no_gold_reparations + end_war = defender + } + reverse_add_opinion = { + target = scope:attacker + modifier = humiliated_opinion + opinion = -50 + } + # Add a breather before the next SA. + fp1_add_realm_size_appropriate_sa_reprieve_effect = yes + + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + humble = minor_stress_impact_loss + content = minor_stress_impact_loss + fickle = minor_stress_impact_loss + forgiving = minor_stress_impact_loss + greedy = major_stress_impact_gain + arrogant = major_stress_impact_gain + ambitious = major_stress_impact_gain + stubborn = major_stress_impact_gain + vengeful = major_stress_impact_gain + } + ai_chance = { + # Base allowed to stay high, since the fiscal purchase here is pretty high and the AI usually won't make it anyway. + base = 100 + ai_value_modifier = { + ai_rationality = 0.25 + ai_greed = -0.5 + ai_vengefulness = -0.75 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = generous + } + modifier = { # Weight up for stress. + add = 10 + has_trait = humble + } + modifier = { # Weight up for stress. + add = 10 + has_trait = content + } + modifier = { # Weight up for stress. + add = 10 + has_trait = fickle + } + modifier = { # Weight up for stress. + add = 10 + has_trait = forgiving + } + modifier = { # Weight down for stress. + add = -30 + has_trait = greedy + } + modifier = { # Weight down for stress. + add = -30 + has_trait = arrogant + } + modifier = { # Weight down for stress. + add = -30 + has_trait = ambitious + } + modifier = { # Weight down for stress. + add = -30 + has_trait = stubborn + } + modifier = { # Weight down for stress. + add = -30 + has_trait = vengeful + } + } + } + + # Then we'll banish these Nords to the sea. + option = { + name = fp1_trade_events.1131.d + + # Opt-out. + custom_tooltip = fp1_trade_events.1131.d.tt + + # No stress impact for the opt-out. + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = -0.25 + ai_vengefulness = -0.25 + } + } + } +} + +################################################## +# A Holy Helping Hand +# by Ewan Cowhig Croft +# 1171 - 1180 +################################################## + +scripted_trigger fp1_trade_events_1171_child_can_marry_trigger = { + # Rule out some unlikely candidates. + is_available_healthy_ai_adult = yes + is_ruler = no + OR = { + is_courtier_of = root.var:fp1_prime_trade_deal + host ?= root.var:fp1_prime_trade_deal + + } + # Make sure they're compatible. + could_marry_character_trigger = { CHARACTER = root } +} + +scripted_effect fp1_trade_events_1171_marry_partner_child_effect = { + # Marry scope:prospective_spouse. + ## First, we divorce the old one. No need for checks, since we're basically regarding that marriage as invalid under the new faith. + if = { + limit = { is_married = yes } + every_spouse = { + save_temporary_scope_as = current_spouse + scope:raider = { + divorce_effect = { + DIVORCER = scope:raider + DIVORCEE = scope:current_spouse + } + } + } + } + ## Then we perform the new marriage. + if = { + limit = { + has_ep2_dlc_trigger = yes + } + create_grand_wedding_betrothal = { + SPOUSE_1 = root + SPOUSE_2 = scope:prospective_spouse + HOST = root + PROMISEE = scope:partner + } + } + else = { marry = scope:prospective_spouse } + create_alliance = { + target = scope:partner + allied_through_owner = scope:raider + allied_through_target = scope:prospective_spouse + } + # Convert to scope:partner's faith. + set_character_faith_with_conversion = scope:partner.faith + if = { + limit = { + scope:partner.faith = { has_doctrine = doctrine_monotheist } + } + custom_description_no_bullet = { text = mandala_monotheist_warning_tt } + } + # Do so in a very public and celebrated manner, gaining piety. + add_piety = massive_piety_gain + # Paid a dowry by scope:partner. + scope:partner = { + pay_short_term_gold = { + target = scope:raider + gold = massive_gold_value + } + } +} + +# Someone you have a raid-trade agreement with offers the hand of a child and conversion aid. +fp1_trade_events.1171 = { + type = character_event + title = fp1_trade_events.1171.t + desc = fp1_trade_events.1171.desc + theme = alliance + left_portrait = { + character = scope:raider + animation = personality_rational + } + right_portrait = { + character = scope:partner + animation = admiration + } + lower_center_portrait = scope:prospective_spouse + override_background = { reference = docks } + + trigger = { + # DLC check. + has_fp1_dlc_trigger = yes + # Standard checks. + ## Allow when commanding to be fairer to people out raiding, which we incentivise you to do personally to get pacts to begin with. + is_available_adult_or_is_commanding = yes + NOT = { has_character_flag = had_event_fp1_trade_events_1171 } + is_landed = yes + # Scope:raider's prime trade deal must still be valid & available. + fp1_prime_trade_partner_still_valid_trigger = { + RECIPIENT = root.var:fp1_prime_trade_deal + RAIDER = root + } + root.var:fp1_prime_trade_deal = { is_available_adult_or_is_commanding = yes } + # Must be of a disorganised faith and separate religion. + faith = { + has_doctrine_parameter = unreformed + NOT = { religion = root.var:fp1_prime_trade_deal.religion } + } + # Either root must be unmarried, or they can't have syncretic folk traditions (and so respect for their marriage). + OR = { + is_married = no + NOT = { rite = { rite_has_parameter = unreformed_syncretic_actor } } + } + # Plus, general considerations. + root.var:fp1_prime_trade_deal = { + # They must really like scope:raider. + opinion = { + target = root + value >= high_positive_opinion + } + # Have a free child. + any_child = { fp1_trade_events_1171_child_can_marry_trigger = yes } + # Not be cynical, so they may care about souls. + NOT = { has_trait = cynical } + # For the sake of sanity, filter out players. + is_ai = yes + # Since it's AI, and specific enough already, we're happy to let them plunge into debt over this. + } + # Finally, just double check the + NAND = { + has_variable_list = humsacd_hofs + is_target_in_variable_list = { + name = humsacd_hofs + target = root.var:fp1_prime_trade_deal.faith + } + } + } + weight_multiplier = { + base = 1 + + # Weight up a little for certain lifestyle traits, as these spread stories of your success and accomplishments. + modifier = { + add = 0.25 + has_trait = diplomat + } + modifier = { + add = 0.25 + has_trait = avaricious + } + # Weight up for this being a renewed treaty. + modifier = { + add = 1 + exists = root.var:fp1_renewed_trade_deal + exists = root.var:fp1_prime_trade_deal + root.var:fp1_prime_trade_deal = root.var:fp1_renewed_trade_deal + } + } + + immediate = { + # Once per lifetime. + add_character_flag = { flag = had_event_fp1_trade_events_1171 } + # Grab our actors. + save_scope_as = raider + var:fp1_prime_trade_deal = { save_scope_as = partner } + ## Including a suitable spouse. + scope:partner = { + random_child = { + limit = { fp1_trade_events_1171_child_can_marry_trigger = yes } + save_scope_as = prospective_spouse + } + } + } + + # SheHe _does_ make quite a compelling case... + option = { + name = fp1_trade_events.1171.a + + # Gain assorted mixed awesome benefits. + fp1_trade_events_1171_marry_partner_child_effect = yes + # Step friendship. + progress_towards_friend_effect = { + CHARACTER = scope:partner + OPINION = 50 + REASON = friend_fp1_converted_faith_married + } + + stress_and_fulfillment_impact = { + cynical = minor_stress_impact_loss + trusting = minor_stress_impact_loss + greedy = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + zealous = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 0.5 + ai_greed = 0.5 + ai_zeal = -0.75 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = cynical + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight up for stress. + add = 10 + has_trait = greedy + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + modifier = { # Weight down for stress. + add = -30 + has_trait = zealous + } + } + } + + # Let us swear an oath of fraternity! + option = { + name = fp1_trade_events.1171.b + trigger = { + can_set_relation_best_friend_trigger = { CHARACTER = scope:partner } + } + + # Gain assorted mixed awesome benefits. + hidden_effect = { fp1_trade_events_1171_marry_partner_child_effect = yes } + custom_tooltip = fp1_trade_events.1171.b.tt + # Also, become best friends. + set_relation_best_friend = { reason = best_friend_coverted_and_saved_my_soul copy_reason = friend target = scope:partner } + + stress_and_fulfillment_impact = { + cynical = minor_stress_impact_loss + trusting = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + shy = major_stress_impact_gain + zealous = major_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_boldness = 0.5 + ai_zeal = -0.75 + } + modifier = { # Weight up for stress. + add = 10 + has_trait = cynical + } + modifier = { # Weight up for stress. + add = 10 + has_trait = trusting + } + modifier = { # Weight up for stress. + add = 10 + has_trait = gregarious + } + modifier = { # Weight down for stress. + add = -20 + has_trait = paranoid + } + modifier = { # Weight down for stress. + add = -30 + has_trait = shy + } + modifier = { # Weight down for stress. + add = -30 + has_trait = zealous + } + } + } + + # No manner of bribes can tempt me away. + option = { + name = { + trigger = { has_trait = cynical } + text = fp1_trade_events.1171.c.cynical + } + name = { + trigger = { + NOT = { has_trait = cynical } + } + text = fp1_trade_events.1171.c.fallback + } + + # Needless to say, scope:partner is offended. + reverse_add_opinion = { + target = scope:partner + modifier = insulted_opinion + opinion = -40 + } + # But hey, what a thing to turn down, amirite? + add_prestige = major_prestige_gain + + # No stress for the opt-out. + ai_chance = { + base = 100 + ai_value_modifier = { + ai_zeal = 0.5 + ai_sociability = -0.5 + } + } + } +} + diff --git a/events/dlc/fp1/fp1_yearly_events.txt b/events/dlc/fp1/fp1_yearly_events.txt index 319f863cb..49237d1d4 100644 --- a/events/dlc/fp1/fp1_yearly_events.txt +++ b/events/dlc/fp1/fp1_yearly_events.txt @@ -2270,7 +2270,7 @@ fp1_yearly.0051 = { capital_county = { #Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } @@ -3397,7 +3397,7 @@ fp1_yearly.0071 = { capital_county = { # Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level # And ensure it doesn't already have a troll problem. NOT = { has_county_modifier = fp1_yearly_0071_troll_attacks_modifier } } @@ -3816,7 +3816,7 @@ fp1_yearly.0081 = { capital_county = { # Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } @@ -3974,7 +3974,7 @@ fp1_yearly.0082 = { capital_county = { # Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } @@ -4132,7 +4132,7 @@ fp1_yearly.0083 = { capital_county = { # Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } @@ -4290,7 +4290,7 @@ fp1_yearly.0084 = { capital_county = { # Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } @@ -4461,7 +4461,7 @@ fp1_yearly.0085 = { capital_county = { # Checking the capital, not the character, since it's a local superstition rather than something ye're insisiting on. culture = { has_cultural_pillar = heritage_north_germanic } - development_level <= terrible_development_level + prosperity_level <= terrible_prosperity_level } } @@ -14566,9 +14566,9 @@ fp1_yearly.1013 = { add_gold = scope:nithing_stolen_loot } #But they've made a powerful enemy! - set_relation_rival = { - target = root - reason = rival_nithing + set_relation_rival_effect = { + TARGET = root + REASON = rival_nithing } } diff --git a/events/dlc/fp1/fp1_yearly_events_oltner.txt b/events/dlc/fp1/fp1_yearly_events_oltner.txt index 223c7f83d..9b29ef55e 100644 --- a/events/dlc/fp1/fp1_yearly_events_oltner.txt +++ b/events/dlc/fp1/fp1_yearly_events_oltner.txt @@ -485,7 +485,7 @@ fp1_yearly.2003 = { character = scope:lover_of_child animation = disapproval } - override_background = { reference = market_tribal } + override_background = { reference = market } trigger = { @@ -544,7 +544,7 @@ fp1_yearly.2004 = { character = scope:lover_of_child animation = ecstasy } - override_background = { reference = market_tribal } + override_background = { reference = market } trigger = { @@ -718,24 +718,23 @@ fp1_yearly.2100 = { } if = { limit = { - NOR = { + NOT = { has_relation_rival = scope:lover_1 - has_relation_nemesis = scope:lover_1 } } if = { limit = { can_set_relation_nemesis_trigger = { CHARACTER = scope:lover_1 } } - set_relation_nemesis = { - target = scope:lover_1 - reason = rival_competing_lovers + set_relation_nemesis_effect = { + TARGET = scope:lover_1 + REASON = rival_competing_lovers } } else = { - set_relation_rival = { - target = scope:lover_1 - reason = rival_competing_lovers + set_relation_rival_effect = { + TARGET = scope:lover_1 + REASON = rival_competing_lovers } } } @@ -943,7 +942,7 @@ fp1_yearly.2101 = { animation = shock } } - override_background = { reference = market_tribal } + override_background = { reference = market } immediate = { if = { @@ -1123,7 +1122,7 @@ fp1_yearly.2200 = { character = scope:new_berserker animation = rage } - override_background = { reference = market_tribal } + override_background = { reference = market } trigger = { #DLC check. @@ -1438,7 +1437,7 @@ fp1_yearly.2203 = { character = scope:new_berserker animation = fear } - override_background = { reference = market_tribal } + override_background = { reference = market } trigger = { scope:new_berserker = { @@ -1527,7 +1526,7 @@ fp1_yearly.2204 = { character = scope:new_berserker animation = worry } - override_background = { reference = market_tribal } + override_background = { reference = market } trigger = { scope:new_berserker = { diff --git a/events/dlc/fp2/fp2_yearly_events.txt b/events/dlc/fp2/fp2_yearly_events.txt index 05cb5dcca..86e4609d9 100644 --- a/events/dlc/fp2/fp2_yearly_events.txt +++ b/events/dlc/fp2/fp2_yearly_events.txt @@ -779,9 +779,10 @@ fp2_yearly.1008 = { override_background = { reference = bp1_wine_cellar } left_portrait = { character = root - animation = ecstasy + animation = eating_salami } + override_effect_2d = { reference = flies } trigger = { any_character_artifact = { @@ -1127,8 +1128,8 @@ scripted_trigger rice_field_potential = { geographical_region = world_europe_west_iberia } capital_county = { - county_control >= 100 - development_level >= root.capital_county.development_level + county_control >= county_control_baseline + prosperity_level >= root.capital_county.prosperity_level } } @@ -4386,16 +4387,21 @@ fp2_yearly.8001 = { trigger = { has_fp2_dlc_trigger = yes - any_held_county = { any_county_province = { geographical_region = world_europe_west_iberia } } + + highest_held_title_tier >= tier_kingdom + + government_has_flag = government_is_feudal culture = { has_cultural_pillar = heritage_iberian } government_has_flag = government_is_feudal - highest_held_title_tier >= tier_kingdom + culture = { has_cultural_pillar = heritage_iberian } gold < medium_gold_value + any_held_county = { any_county_province = { geographical_region = world_europe_west_iberia } } + any_councillor = { people_loving_councillor_trigger = yes } } @@ -4574,7 +4580,6 @@ fp2_yearly.8002 = { trigger = { has_fp2_dlc_trigger = yes - any_realm_province = { is_coastal = yes } OR = { has_religion = religion:islam_religion @@ -4589,6 +4594,8 @@ fp2_yearly.8002 = { } } + any_realm_province = { is_coastal = yes } + any_held_title = { is_head_of_faith = no } exists = cp:councillor_court_chaplain @@ -5904,7 +5911,7 @@ scripted_trigger valid_grantable_county_barony = { title_province = { geographical_region = world_europe_west_iberia } - title_province = { has_building_or_higher = common_tradeport_01 } + title_province = { has_port_district = yes } is_holy_site = no county.holder = { any_held_title = { # Make sure it isn't revoking their last title @@ -6512,7 +6519,7 @@ fp2_yearly.9002 = { weight = { modifier = { # Low-dev counties should be more highly considered add = 50 - development_level <= medium_development_level + prosperity_level <= medium_prosperity_level } } save_scope_as = fp2_james_0003_province_to_convert @@ -6540,7 +6547,7 @@ fp2_yearly.9002 = { } } scope:fp2_james_0003_province_to_convert.county = { - change_development_level = 1 + change_prosperity_level = 1 if = { limit = { root = { diff --git a/events/dlc/fp3/fp3_heritage_events.txt b/events/dlc/fp3/fp3_heritage_events.txt index 19da3a52c..5b507fccf 100644 --- a/events/dlc/fp3/fp3_heritage_events.txt +++ b/events/dlc/fp3/fp3_heritage_events.txt @@ -69,6 +69,7 @@ fp3_yearly.8019 = { #standard sanity checks has_fp3_dlc_trigger = yes is_ruler = yes + is_landed = yes is_available_healthy_adult = yes @@ -591,10 +592,7 @@ fp3_yearly.8020 = { scope:pious_woman = { if = { limit = { - OR = { - has_relation_lover = root - has_relation_soulmate = root - } + has_relation_lover = root } add_opinion = { target = root @@ -808,6 +806,7 @@ fp3_yearly.8021 = { #standard sanity checks has_fp3_dlc_trigger = yes + is_ai = no #in order to not spam disfigured characters and upset vassals, we reserve this event for players only. is_ruler = yes is_available_healthy_adult = yes root.capital_province = { geographical_region = world_persian_empire } @@ -820,8 +819,6 @@ fp3_yearly.8021 = { fp3_not_super_relevant_yet_suitable_person_trigger = yes } } - - is_ai = no #in order to not spam disfigured characters and upset vassals, we reserve this event for players only. } cooldown = { years = 100 } @@ -942,9 +939,9 @@ fp3_yearly.8021 = { add_learning_lifestyle_xp = major_lifestyle_experience hidden_effect = { - set_relation_rival = { - target = scope:enthusiastic_alchemist - reason = rival_disfigured_me_in_lab + set_relation_rival_effect = { + TARGET = scope:enthusiastic_alchemist + REASON = rival_disfigured_me_in_lab } } } @@ -2427,10 +2424,7 @@ fp3_yearly.8032 = { scope:death_enthusiast = { if = { limit = { - OR = { - has_relation_lover = root - has_relation_soulmate = root - } + has_relation_lover = root } add_opinion = { target = root @@ -3365,7 +3359,7 @@ fp3_yearly.8036 = { any_held_county = { OR = { this = title:c_ardabil - development_level <= medium_development_level + prosperity_level <= medium_prosperity_level } } } @@ -3386,7 +3380,7 @@ fp3_yearly.8036 = { } else_if = { limit = { - development_level < medium_development_level + prosperity_level < medium_prosperity_level } save_scope_as = spooky_county } diff --git a/events/dlc/fp3/fp3_misc_decision_events.txt b/events/dlc/fp3/fp3_misc_decision_events.txt index ee60cba67..fe875b478 100644 --- a/events/dlc/fp3/fp3_misc_decision_events.txt +++ b/events/dlc/fp3/fp3_misc_decision_events.txt @@ -429,9 +429,9 @@ fp3_misc_decisions.0020 = { # Actor Duel Outcome(s) limit = { can_set_relation_rival_trigger = { CHARACTER = scope:house_challenger } } - set_relation_rival = { - target = scope:house_challenger - reason = rival_tried_to_kill_me + set_relation_rival_effect = { + TARGET = scope:house_challenger + REASON = rival_tried_to_kill_me } } add_opinion = { @@ -501,7 +501,7 @@ fp3_misc_decisions.0020 = { # Actor Duel Outcome(s) modifier = honored_opinion } house = { - add_clan_unity_interaction_effect = { + add_house_unity_interaction_effect = { CHARACTER = scope:actor TARGET = scope:recipient VALUE = miniscule_unity_gain # recover half of what was lost by challenge itself @@ -1817,9 +1817,9 @@ fp3_misc_decisions.0041 = { # Murder attempt outcome limit = { can_set_relation_rival_trigger = { CHARACTER = scope:house_challenger } } - set_relation_rival = { - target = scope:house_challenger - reason = rival_tried_to_kill_me + set_relation_rival_effect = { + TARGET = scope:house_challenger + REASON = rival_tried_to_kill_me } } } @@ -2575,7 +2575,7 @@ fp3_misc_decisions.0032 = { list = sub_realm_minority_cultures_county_pre_filter_list limit = { culture = scope:current_culture } order_by = { - value = development_level + value = prosperity_level # Weight down for places that don't follow the same HoF. if = { limit = { @@ -2583,7 +2583,7 @@ fp3_misc_decisions.0032 = { faith.religious_head ?= root.faith.religious_head } add = { - value = development_level + value = prosperity_level multiply = -0.1 } } @@ -2600,7 +2600,7 @@ fp3_misc_decisions.0032 = { } } add = { - value = development_level + value = prosperity_level multiply = -0.1 } } @@ -2615,7 +2615,7 @@ fp3_misc_decisions.0032 = { } } add = { - value = development_level + value = prosperity_level multiply = -0.25 } } @@ -2630,7 +2630,7 @@ fp3_misc_decisions.0032 = { } } add = { - value = development_level + value = prosperity_level multiply = -0.4 } } @@ -2867,7 +2867,7 @@ fp3_misc_decisions.0051 = { # Adopt Clan Government through House change_government = clan_government # Increase unity, uses this effect since both chars are not clan when script is evaluated house.house_head = { - apply_clan_unity_interaction_effect = { + apply_house_unity_interaction_effect = { CHARACTER = root TARGET = root.house.house_head DESC = clan_unity_adopt_clan.desc @@ -2887,7 +2887,7 @@ fp3_misc_decisions.0051 = { # Adopt Clan Government through House change_government = clan_government # Increase unity, uses this effect since both chars are not clan when script is evaluated house.house_head = { - apply_clan_unity_interaction_effect = { + apply_house_unity_interaction_effect = { CHARACTER = root TARGET = root.house.house_head DESC = clan_unity_adopt_clan.desc diff --git a/events/dlc/fp3/fp3_religious_decision_events.txt b/events/dlc/fp3/fp3_religious_decision_events.txt index 939a508ea..f342ec903 100644 --- a/events/dlc/fp3/fp3_religious_decision_events.txt +++ b/events/dlc/fp3/fp3_religious_decision_events.txt @@ -370,9 +370,8 @@ fp3_decision.0002 = { name = fp3_decision.0002.b trigger = { scope:occupant = { - NOR = { + NOT = { has_relation_rival = root - has_relation_nemesis = root } } } @@ -749,9 +748,8 @@ fp3_decision.0013 = { if = { limit = { scope:righteous_caliph = { - NOR = { + NOT = { has_relation_rival = root - has_relation_nemesis = root } } } diff --git a/events/dlc/fp3/fp3_yearly_events_ola_batch_1.txt b/events/dlc/fp3/fp3_yearly_events_ola_batch_1.txt index 8140d18de..dfb16ca2c 100644 --- a/events/dlc/fp3/fp3_yearly_events_ola_batch_1.txt +++ b/events/dlc/fp3/fp3_yearly_events_ola_batch_1.txt @@ -295,16 +295,17 @@ fp3_yearly.8001 = { #Frontier Fortress Benefactor trigger = { has_fp3_dlc_trigger = yes is_ruler = yes + + is_healthy = yes #the councillor's request wouldn't make much sense otherwise + + root.capital_province ?= { geographical_region = world_persian_empire } #so that this inside-to-outside worldview makes sense + any_held_county = { any_county_province = { fp3_yearly.8001_outlying_province_trigger = yes } } - is_healthy = yes #the councillor's request wouldn't make much sense otherwise - - root.capital_province = { geographical_region = world_persian_empire } #so that this inside-to-outside worldview makes sense - faith = { NOT = { has_doctrine_parameter = unreformed # Unreformed Pagans don't need frontier fortresses, generally speaking @@ -702,14 +703,15 @@ fp3_yearly.8002 = { #Faith at the Frontier has_fp3_dlc_trigger = yes age >= 12 is_ruler = yes + + root.capital_province ?= { geographical_region = world_persian_empire } #so that this inside-to-outside worldview makes sense + any_held_county = { any_county_province = { fp3_yearly.8001_outlying_province_trigger = yes } } - root.capital_province = { geographical_region = world_persian_empire } #so that this inside-to-outside worldview makes sense - #so that the plot makes sense faith = { NOT = { has_doctrine_parameter = unreformed } } # Unreformed Pagans don't need frontier fortresses, generally speaking rite = { NOT = { rite_has_doctrine = doctrine_pluralism_pluralistic } } @@ -1315,7 +1317,6 @@ fp3_yearly.8003 = { #Exotic Espand limit = { OR = { has_relation_lover = root - has_relation_soulmate = root has_trait = forgiving } } @@ -1367,10 +1368,7 @@ fp3_yearly.8003 = { #Exotic Espand scope:superstitious_consort = { if = { limit = { - OR = { - has_relation_lover = root - has_relation_soulmate = root - } + has_relation_lover = root } add_opinion = { target = root @@ -1699,7 +1697,7 @@ fp3_yearly.8004 = { #The Frontier Beckons character = scope:worried_relation animation = grief } - override_background = { reference = market_east } + override_background = { reference = market } trigger = { diff --git a/events/dlc/gdp/gdp_burgher_events.txt b/events/dlc/gdp/gdp_burgher_events.txt new file mode 100644 index 000000000..5a9223029 --- /dev/null +++ b/events/dlc/gdp/gdp_burgher_events.txt @@ -0,0 +1,655 @@ +namespace = gdp_burgher + +gdp_burgher.0001 = { + type = letter_event + opening = gdp_burgher.0001.opening + sender = scope:burgher_petitioner + + desc = gdp_burgher.0001.desc + + trigger = { + exists = scope:faction + exists = scope:burgher_county + } + + immediate = { + burgher_resolve_county_effect = { FACTION = scope:faction } + + if = { + limit = { exists = scope:burgher_county } + burgher_select_demand_effect = { COUNTY = scope:burgher_county } + burgher_find_petitioner_effect = { + FACTION = scope:faction + COUNTY = scope:burgher_county + } + } + } + + option = { + name = gdp_burgher.0001.a + + burgher_settle_demand_effect = { FACTION = scope:faction } + + scope:faction = { + burgher_notify_sponsor_effect = { + FACTION = this + TOAST_TYPE = event_toast_effect_good + TITLE = burgher_sponsor_privilege_toast + EFFECT = "custom_tooltip = burgher_sponsor_privilege_toast_desc" + } + burgher_sponsor_charter_spoils_effect = { FACTION = this } + + destroy_faction = yes + } + + add_prestige = minor_prestige_loss + + faction_accept_demand_legitimacy_effect = yes + + stress_and_fulfillment_impact = { + arrogant = medium_stress_impact_gain + generous = minor_stress_impact_loss + just = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = arrogant + } + modifier = { + factor = 0 + scope:faction = { faction_power < 50 } + } + } + } + + option = { + name = gdp_burgher.0001.b + + add_internal_flag = dangerous + + if = { + limit = { exists = scope:burgher_county } + burgher_refuse_demand_effect = { + FACTION = scope:faction + COUNTY = scope:burgher_county + } + } + + scope:faction = { + burgher_notify_sponsor_effect = { + FACTION = this + TOAST_TYPE = event_toast_effect_bad + TITLE = burgher_sponsor_refused_toast + EFFECT = "custom_tooltip = burgher_sponsor_refused_toast_desc" + } + } + + add_prestige = minor_prestige_gain + + stress_and_fulfillment_impact = { + just = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + arrogant = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + OR = { + has_trait = just + has_trait = compassionate + } + } + modifier = { + factor = 0 + scope:faction = { faction_power > 110 } + } + modifier = { + factor = 0 + is_at_war = yes + } + } + } + + after = { + scope:burgher_petitioner ?= { + if = { + limit = { has_character_flag = burgher_petitioner_created } + + if = { + limit = { has_variable = burgher_leader_of } + remove_character_flag = burgher_petitioner_created + } + else = { + silent_disappearance_effect = yes + } + } + } + } +} + +gdp_burgher.0010 = { + type = letter_event + opening = gdp_burgher.0001.opening + desc = gdp_burgher.0010.desc + sender = scope:faction.special_character + + trigger = { + exists = scope:faction + exists = scope:burgher_county + } + + immediate = { + burgher_resolve_county_effect = { FACTION = scope:faction } + scope:faction ?= { setup_burgher_leader_effect = yes } + } + + option = { + name = gdp_burgher.0010.a + + trigger = { + exists = scope:burgher_county + exists = scope:burgher_leader + } + + scope:faction ?= { + burgher_notify_sponsor_effect = { + FACTION = this + TOAST_TYPE = event_toast_effect_good + TITLE = burgher_sponsor_self_rule_toast + EFFECT = "custom_tooltip = burgher_sponsor_self_rule_toast_desc" + } + + every_faction_county_member = { + set_variable = { + name = burgher_faction_cooldown + years = burgher_concede_cooldown_years_value + } + } + } + + custom_tooltip = burgher_concede_cooldown_tt + + burgher_win_self_rule_effect = { + LEADER = scope:burgher_leader + COUNTY = scope:burgher_county + } + + burgher_sponsor_republic_type_effect = { + FACTION = scope:faction + RULER = scope:burgher_leader + } + + scope:faction ?= { + burgher_sponsor_spoils_effect = { FACTION = this } + } + + scope:faction ?= { destroy_faction = yes } + + add_prestige = medium_prestige_loss + + if = { + limit = { is_valid_for_legitimacy_change = yes } + add_legitimacy = medium_legitimacy_loss + } + + stress_and_fulfillment_impact = { + arrogant = major_stress_impact_gain + ambitious = medium_stress_impact_gain + content = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + OR = { + has_trait = arrogant + has_trait = ambitious + } + } + modifier = { + factor = 0 + scope:faction = { faction_power <= 120 } + } + } + } + + option = { + name = gdp_burgher.0010.b + + add_internal_flag = dangerous + + scope:faction = { + burgher_notify_sponsor_effect = { + FACTION = this + TOAST_TYPE = event_toast_effect_neutral + TITLE = burgher_sponsor_refused_toast + EFFECT = "custom_tooltip = burgher_sponsor_refused_toast_desc" + } + + faction_start_war = {} + } + + stress_and_fulfillment_impact = { + craven = medium_stress_impact_gain + brave = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = craven + } + modifier = { + factor = 0 + scope:faction = { faction_power > 120 } + } + } + } +} + +gdp_burgher.0020 = { + type = character_event + window = big_event_window + title = gdp_burgher.0020.t + desc = { + first_valid = { + triggered_desc = { + trigger = { gdp_is_assembly_head_trigger = yes } + desc = gdp_burgher.0020.desc.assembly_head + } + desc = gdp_burgher.0020.desc + } + } + theme = republic + + left_portrait = { + character = root + animation = personality_greedy + } + right_portrait = { + trigger = { exists = scope:burgher_ruler } + character = scope:burgher_ruler + animation = happiness + } + + trigger = { + exists = scope:burgher_ruler + exists = scope:freed_county + scope:burgher_ruler != root + } + + option = { + name = gdp_burgher.0020.a + + trigger = { + custom_tooltip = { + text = gdp_burgher_agitator_not_republic_head_tt + burgher_agitator_can_take_seat_trigger = yes + } + scope:burgher_ruler = { + trigger_if = { + limit = { is_independent_ruler = no } + burgher_commune_liege_outranks_agitator_trigger = { AGITATOR = root } + } + } + } + + burgher_agitator_takes_commune_effect = yes + + add_prestige = major_prestige_gain + + stress_and_fulfillment_impact = { + ambitious = major_stress_impact_loss + humble = medium_stress_impact_gain + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + OR = { + has_trait = humble + has_trait = content + } + } + } + } + + option = { + name = gdp_burgher.0020.b + + trigger = { + gdp_is_assembly_head_trigger = no + custom_tooltip = { + text = gdp_burgher_agitator_outranks_republic_head_tt + burgher_agitator_can_join_commune_trigger = { LEADER = scope:burgher_ruler } + } + } + show_as_unavailable = { gdp_is_assembly_head_trigger = no } + + burgher_agitator_joins_commune_effect = { LEADER = scope:burgher_ruler } + + add_prestige = medium_prestige_gain + + scope:burgher_ruler = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 30 + } + } + + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_loss + ambitious = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = ambitious + } + } + } + + option = { + name = gdp_burgher.0020.c + + add_prestige = minor_prestige_gain + + scope:freed_county = { + add_popular_opinion = 20 + } + + scope:burgher_ruler = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + + if = { + limit = { gdp_is_assembly_head_trigger = no } + stress_and_fulfillment_impact = { + humble = medium_stress_impact_loss + ambitious = medium_stress_impact_gain + } + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = ambitious + gdp_is_assembly_head_trigger = no + } + } + } +} + +gdp_burgher.0030 = { + hidden = yes + + trigger = { + has_variable = burgher_leader_of + joined_faction ?= var:burgher_leader_of + + scope:war ?= { + using_cb = burgher_war + primary_defender = scope:previous_controller + } + } + + immediate = { + scope:county = { + change_county_control = -10 + } + + if = { + limit = { + scope:county = { burgher_county_is_urban_trigger = yes } + } + + spawn_army = { + name = burgher_militia_army_name + levies = { + value = scope:county.burgher_county_militia_value + multiply = 0.5 + } + men_at_arms = { + type = pikemen_militia + stacks = 1 + } + location = scope:barony.title_province + war = scope:war + inheritable = no + war_keep_on_attacker_victory = yes + } + + if = { + limit = { + scope:county = { + burgher_county_faction_on_cooldown_trigger = no + } + var:burgher_leader_of = { + NOT = { + any_faction_county_member = { this = scope:county } + } + } + } + scope:county = { + title_join_faction = root.var:burgher_leader_of + } + + save_scope_value_as = { + name = burgher_siege_joined + value = yes + } + } + } + + if = { + limit = { exists = scope:burgher_siege_joined } + + var:burgher_leader_of.var:merchant_sponsor ?= { + if = { + limit = { is_alive = yes } + send_interface_toast = { + type = event_toast_effect_good + title = burgher_sponsor_siege_join_toast + left_icon = this + right_icon = scope:county + custom_tooltip = burgher_sponsor_siege_join_toast_desc + } + } + } + } + } +} + +gdp_burgher.0090 = { + hidden = yes + + immediate = { + if = { + limit = { is_at_war = yes } + remove_character_flag = burgher_leader_dissolving + add_character_flag = burgher_leader_pending_dissolve + } + else_if = { + limit = { + is_alive = yes + is_landed = no + } + remove_character_flag = burgher_leader_pending_dissolve + if = { + limit = { gold > 0 } + remove_long_term_gold = gold + } + + death = { + death_reason = death_vanished + } + } + else = { + remove_character_flag = burgher_leader_dissolving + remove_character_flag = burgher_leader_pending_dissolve + + if = { + limit = { has_variable = burgher_title } + burgher_dissolve_leader_effect = yes + } + else = { + remove_variable = burgher_leader_of + remove_character_flag = burgher_spawned_leader + } + } + } +} + +namespace = gdp_hanseatic + +gdp_hanseatic.0010 = { + type = letter_event + opening = gdp_hanseatic.0010.opening + sender = scope:monopoly_asker + + desc = gdp_hanseatic.0010.desc + + trigger = { + any_trade_monopoly_for_character = { count > 0 } + OR = { + AND = { + gdp_is_assembly_head_trigger = no + liege ?= { + government_has_flag = government_is_republic + is_hanseatic_league_member_trigger = yes + this != root + } + } + AND = { + is_hanseatic_league_member_trigger = yes + confederation ?= { + has_leading_title = yes + exists = leading_title.holder + leading_title.holder != root + } + } + } + } + + immediate = { + if = { + limit = { is_confederation_member = yes } + confederation = { save_scope_as = the_league } + } + else = { + liege.confederation ?= { save_scope_as = the_league } + } + + if = { + limit = { + gdp_is_assembly_head_trigger = no + liege ?= { + government_has_flag = government_is_republic + is_hanseatic_league_member_trigger = yes + this != root + } + } + liege = { save_scope_as = monopoly_asker } + } + else = { + confederation.leading_title.holder = { save_scope_as = monopoly_asker } + } + + if = { + limit = { + gdp_is_assembly_head_trigger = no + liege ?= { government_has_flag = government_is_republic } + } + liege.capital_county ?= { save_scope_as = hanse_city_title } + } + else_if = { + limit = { exists = capital_county } + capital_county = { save_scope_as = hanse_city_title } + } + else = { + domicile.domicile_location.county ?= { save_scope_as = hanse_city_title } + } + } + + option = { + name = gdp_hanseatic.0010.a + hanseatic_convert_personal_monopolies_effect = { + OWNER_PARAM = owning_confederation + OWNER = scope:the_league + } + scope:the_league = { change_cohesion = hanseatic_monopoly_league_cohesion_value } + add_prestige = medium_prestige_gain + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = greedy + } + } + } + + option = { + name = gdp_hanseatic.0010.b + + trigger = { exists = scope:hanse_city_title } + + hanseatic_convert_personal_monopolies_effect = { + OWNER_PARAM = owning_title + OWNER = scope:hanse_city_title + } + scope:the_league = { change_cohesion = hanseatic_monopoly_city_cohesion_value } + ai_chance = { + base = 100 + } + } + + option = { + name = gdp_hanseatic.0010.c + + add_internal_flag = dangerous + + scope:the_league = { change_cohesion = hanseatic_monopoly_keep_cohesion_value } + + stress_and_fulfillment_impact = { + just = medium_stress_impact_gain + generous = medium_stress_impact_gain + greedy = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + OR = { + has_trait = just + has_trait = generous + } + } + } + } +} diff --git a/events/dlc/gdp/gdp_civic_agitation_scheme_events.txt b/events/dlc/gdp/gdp_civic_agitation_scheme_events.txt new file mode 100644 index 000000000..3aa9cd844 --- /dev/null +++ b/events/dlc/gdp/gdp_civic_agitation_scheme_events.txt @@ -0,0 +1,263 @@ +namespace = gdp_civic_agitation + +gdp_civic_agitation.0005 = { + hidden = yes + + immediate = { + save_scope_as = owner + scope:scheme.scheme_target_title ?= { save_scope_as = target } + + save_scope_value_as = { + name = discovery_chance + value = { + value = 100 + subtract = scope:scheme.scheme_secrecy + } + } + + random = { + chance = scope:discovery_chance + save_scope_value_as = { + name = scheme_exposed_this_execution + value = yes + } + scope:scheme ?= { expose_scheme = yes } + add_character_modifier = { + modifier = gdp_caught_agitating_modifier + years = 10 + } + scope:target.holder ?= { + add_opinion = { + modifier = angry_opinion + target = root + opinion = -40 + } + } + } + + random = { + chance = gdp_civic_agitation_resolution_chance_value + save_scope_value_as = { + name = scheme_successful + value = yes + } + } + + if = { + limit = { exists = scope:scheme_successful } + trigger_event = { on_action = gdp_civic_agitation_scheme_success } + } + else = { + trigger_event = { on_action = gdp_civic_agitation_scheme_failure } + } + + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_civic_agitation.0001 = { + type = character_event + window = scheme_successful_event + title = gdp_civic_agitation.0001.t + + desc = gdp_civic_agitation.0001.desc + + theme = intrigue + + left_portrait = { + character = root + animation = personality_cynical + } + right_portrait = { + trigger = { exists = scope:target.holder } + character = scope:target.holder + animation = disapproval + } + + trigger = { + exists = scope:target + } + + option = { + name = gdp_civic_agitation.0001.a + + set_variable = burgher_sponsor_joins_war + + gdp_civic_agitation_success_effect = { + COUNTY = scope:target + SPONSOR = root + } + + custom_tooltip = gdp_civic_agitation_sponsor_joins_war_tt + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = craven + } + modifier = { + factor = 0 + is_at_war = yes + } + } + } + + option = { + name = gdp_civic_agitation.0001.b + + trigger = { + gold >= major_gold_value + } + + show_as_unavailable = { + gold < major_gold_value + } + + remove_short_term_gold = major_gold_value + set_variable = burgher_sponsor_war_chest + + gdp_civic_agitation_success_effect = { + COUNTY = scope:target + SPONSOR = root + } + + custom_tooltip = gdp_civic_agitation_sponsor_war_chest_tt + + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + has_trait = greedy + } + } + } + + option = { + name = { + trigger = { exists = scope:scheme_exposed_this_execution } + text = gdp_civic_agitation.0001.c.exposed + } + name = { + trigger = { + NOT = { exists = scope:scheme_exposed_this_execution } + } + text = gdp_civic_agitation.0001.c + } + + gdp_civic_agitation_success_effect = { + COUNTY = scope:target + SPONSOR = root + } + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_gain + brave = minor_stress_impact_gain + craven = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + + modifier = { + factor = 0 + OR = { + has_trait = ambitious + has_trait = brave + } + } + } + } +} + +gdp_civic_agitation.0002 = { + type = character_event + window = scheme_failed_event + title = gdp_civic_agitation.0002.t + + desc = gdp_civic_agitation.0002.desc + + theme = intrigue + + left_portrait = { + character = root + animation = disappointed + } + right_portrait = { + trigger = { exists = scope:factor } + character = scope:factor + animation = dismissal + } + + immediate = { + if = { + limit = { NOT = { exists = scope:target } } + scope:scheme.scheme_target_title ?= { save_scope_as = target } + } + + if = { + limit = { NOT = { exists = scope:factor } } + if = { + limit = { + cp:councillor_spymaster ?= { + is_available_ai_adult = yes + this != root + } + } + cp:councillor_spymaster = { save_scope_as = factor } + } + else_if = { + limit = { + cp:councillor_chancellor ?= { + is_available_ai_adult = yes + this != root + } + } + cp:councillor_chancellor = { save_scope_as = factor } + } + else_if = { + limit = { + any_councillor = { + is_available_ai_adult = yes + this != root + } + } + random_councillor = { + limit = { + is_available_ai_adult = yes + this != root + } + save_scope_as = factor + } + } + else = { + random_courtier = { + limit = { + is_available_ai_adult = yes + this != root + } + save_scope_as = factor + } + } + } + + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + greedy = medium_stress_impact_gain + ambitious = minor_stress_impact_gain + patient = minor_stress_impact_loss + content = minor_stress_impact_loss + } + } + + option = { + name = gdp_civic_agitation.0002.a + } +} diff --git a/events/dlc/gdp/gdp_decision_events.txt b/events/dlc/gdp/gdp_decision_events.txt new file mode 100644 index 000000000..a0398221b --- /dev/null +++ b/events/dlc/gdp/gdp_decision_events.txt @@ -0,0 +1,950 @@ +namespace = gdp_decision + +# abuse_charter_authority_decision + +gdp_decision.1000 = { # consequences + type = character_event + theme = merchant + title = gdp_decision.1000.t + desc = gdp_decision.1000.desc + right_portrait = { + character = scope:patron + animation = war_over_win + } + artifact = { + target = scope:charter_artifact + position = lower_center_portrait + } + override_background = { reference = throne_room } + + immediate = { + random_equipped_character_artifact = { + limit = { + root = { can_benefit_from_artifact = prev } + var:charter_patron ?= { + is_alive = yes + root.suzerain ?= this + } + } + save_scope_as = charter_artifact + var:charter_patron ?= { save_scope_as = patron } + } + scope:patron = { save_scope_as = bg_override_char } + } + + option = { #whoooops + name = gdp_decision.1000.a + add_character_flag = no_more_charter_abuse + reverse_add_opinion = { + target = scope:patron + modifier = abused_charter_authority_patron_opinion + } + custom_tooltip = charter_destroyed_upon_imprisonment_tt + reveal_dealbreaker_secret_effect = { REVEAL_TO = scope:patron } + } + + option = { #its a prank bro + name = gdp_decision.1000.b + trigger = { + scope:patron = { is_ai = yes } + } + add_prestige_level = -1 + duel = { + skill = diplomacy + target = scope:patron + 30 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_decision.1000.b.success + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_decision.1000.b.success + left_icon = scope:patron + custom_tooltip = gdp_decision.1000.a.survived_patrons_wrath + reverse_add_opinion = { + target = scope:patron + modifier = angry_opinion + opinion = -30 + } + } + } + 70 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_decision.1000.b.failure + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_decision.1000.b.failure + left_icon = scope:patron + add_character_flag = no_more_charter_abuse + reverse_add_opinion = { + target = scope:patron + modifier = gravely_abused_charter_authority_opinion + } + custom_tooltip = charter_destroyed_upon_imprisonment_tt + reveal_dealbreaker_secret_effect = { REVEAL_TO = scope:patron } + every_close_family_member = { + custom = yearly_persian.1101.every_family + reverse_add_opinion = { + target = scope:patron + modifier = abused_charter_authority_family_opinion + } + } + } + } + } + } +} + +gdp_decision.1010 = { # consequences decision for a player + type = character_event + theme = merchant + title = gdp_decision.1010.t + desc = gdp_decision.1010.desc + left_portrait = { + character = root + animation = anger + } + lower_right_portrait = scope:merchant + artifact = { + target = scope:charter_artifact + position = lower_center_portrait + } + override_background = { reference = throne_room } + + trigger = { + NOT = { has_character_flag = refused_charter_abuse_notifications } + } + + immediate = { + scope:market_county = { + merchant_charter_abuse_authority_county_effect = { + MERCHANT = scope:merchant + CUT = flag:no + } + } + scope:merchant = { + reveal_dealbreaker_secret_effect = { REVEAL_TO = scope:patron } + } + } + + option = { #take action + name = gdp_decision.1010.a + custom_tooltip = gdp_decision.1010.a.tt + custom_tooltip = charter_destroyed_upon_imprisonment_tt + reveal_dealbreaker_secret_effect = { REVEAL_TO = scope:patron } + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_decision.1010.t + left_icon = scope:patron + reverse_add_opinion = { + target = scope:patron + modifier = gravely_abused_charter_authority_opinion + } + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:patron + modifier = angry_opinion + opinion = -15 + } + } + } + } + } + + option = { #not for now + name = gdp_decision.1010.b + hidden_effect = { + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_decision.1010.t + left_icon = scope:patron + custom_tooltip = merchant_charter_abuse_counter_indifferent + } + } + } + } + + option = { #forgery! + name = gdp_decision.1010.d + trigger = { + scope:charter_artifact.var:forger ?= scope:merchant + } + reveal_dealbreaker_secret_effect = { REVEAL_TO = scope:patron } + send_interface_toast = { + type = event_toast_effect_neutral + title = forgery_detected_title + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_bad + title = forgery_detected_title + left_icon = scope:patron + scope:patron = { + add_prestige = medium_prestige_loss + add_opinion = { + modifier = forged_charter_opinion + target = scope:merchant + } + } + } + } + } + } + + option = { #do not notify me ever again (ever for like, 10 years) + name = gdp_decision.1010.c + flavor = gdp_decision.1010.c.flavor + add_character_flag = { + flag = refused_charter_abuse_notifications + years = 10 + } + } +} + +gdp_decision.1020 = { # abuse opening + type = character_event + theme = merchant + title = gdp_decision.1020.t + desc = { + desc = gdp_decision.1020.opening + triggered_desc = { + trigger = { exists = scope:market_holder } + desc = gdp_decision.1020.market_holder + } + desc = gdp_decision.1020.closing + } + left_portrait = { + character = root + animation = dismissal + } + right_portrait = { + character = scope:market_holder + animation = anger + } + lower_right_portrait = scope:patron + artifact = { + target = scope:charter_artifact + position = lower_center_portrait + } + override_background = { reference = market } + + option = { #yeah, go for it + name = gdp_decision.1020.a + merchant_charter_abuse_counter_effect = { + PATRON = scope:patron + MERCHANT = root + } + scope:market_county = { + merchant_charter_abuse_authority_county_effect = { + MERCHANT = root + CUT = flag:no + } + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 1 + } + } + } + + option = { #try to be sneaky about it + name = gdp_decision.1020.b + trigger = { + exists = scope:market_holder + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:market_holder } + } + } + show_as_unavailable = { exists = scope:market_holder } + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:market_holder.ai_greed + add = "scope:market_holder.opinion(root)" + subtract = scope:market_holder.ai_honor + divide = 10 + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_decision.1020.b.success + send_interface_toast = { + type = event_toast_effect_good + title = mpo_decisions_events.0110.b.success + left_icon = root + right_icon = scope:charter_patron + scope:market_county = { + merchant_charter_abuse_authority_county_effect = { + MERCHANT = root + CUT = flag:yes + } + } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_decision.1020.b.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_decision.1020.b.failure + left_icon = root + right_icon = scope:patron + scope:market_holder ?= { + add_opinion = { + target = scope:merchant_temp + modifier = abused_charter_authority_opinion + opinion = -30 + } + } + merchant_charter_abuse_counter_effect = { + PATRON = scope:patron + MERCHANT = root + } + } + } + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = -1 + } + } + } +} + +# benevolent_charter_authority_decision + +scripted_effect merchant_charter_benevolent_reward_effect = { + if = { + limit = { + has_hook_of_type = { + target = scope:patron + type = indebted_hook + } + } + hidden_effect = { + remove_hook = { + target = scope:patron + type = indebted_hook + } + } + add_hook = { + target = scope:patron + type = strong_indebted_hook + } + } + else_if = { + limit = { + can_add_hook = { + target = scope:patron + type = indebted_hook + } + } + add_hook = { + target = scope:patron + type = indebted_hook + } + } + else = { add_gold = medium_gold_value } + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:patron + modifier = grateful_opinion + opinion = 15 + } + } +} + +gdp_decision.1200 = { # consequences + type = character_event + theme = merchant + title = gdp_decision.1200.t + desc = gdp_decision.1200.desc + right_portrait = { + character = scope:patron + animation = war_over_tie + camera = camera_event_very_right + } + artifact = { + target = scope:charter_artifact + position = lower_center_portrait + } + override_background = { reference = throne_room } + + immediate = { + random_equipped_character_artifact = { + limit = { + save_temporary_scope_as = charter_temp + root = { can_benefit_from_artifact = scope:charter_temp } + var:charter_patron ?= { + is_alive = yes + root.suzerain ?= this + } + } + save_scope_as = charter_artifact + var:charter_patron ?= { save_scope_as = patron } + } + scope:patron = { save_scope_as = bg_override_char } + add_prestige = medium_prestige_value + } + + option = { #cheers boss + name = gdp_decision.1200.a + reverse_add_opinion = { + target = scope:patron + modifier = charitable_charter_authority_opinion + opinion = 15 + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_greed = -0.5 + ai_boldness = -0.5 + } + } + } + + option = { #senpai uwu + name = gdp_decision.1200.b + flavor = gdp_decision.1200.b.flavor + duel = { + skill = diplomacy + target = scope:patron + 40 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + "scope:patron.opinion(root)" > 0 + add = { + value = "scope:patron.opinion(root)" + multiply = 0.3 + } + } + min = 10 + desc = gdp_decision.1200.b.success + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_decision.1200.b.success + left_icon = scope:patron + merchant_charter_benevolent_reward_effect = yes + } + } + 60 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + "scope:patron.opinion(root)" < 0 + add = { + value = "scope:patron.opinion(root)" + multiply = 0.3 + } + } + min = 10 + desc = gdp_decision.1200.b.failure + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_decision.1200.b.failure + left_icon = scope:patron + reverse_add_opinion = { + target = scope:patron + modifier = disrespect_opinion + opinion = -15 + } + } + } + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_greed = 0.5 + ai_boldness = 0.5 + } + } + } +} + +gdp_decision.1210 = { # consequences decision for a player + type = character_event + theme = merchant + title = gdp_decision.1210.t + desc = gdp_decision.1210.desc + left_portrait = { + character = root + animation = thinking + } + lower_right_portrait = scope:merchant + artifact = { + target = scope:charter_artifact + position = lower_center_portrait + } + override_background = { reference = throne_room } + + trigger = { + NOT = { has_character_flag = refused_charter_benevolent_notifications } + } + + immediate = { + show_as_tooltip = { + scope:market_county = { + merchant_charter_benevolent_authority_county_effect = { MERCHANT = scope:merchant } + } + } + } + + option = { #reward + name = gdp_decision.1210.a + custom_tooltip = gdp_decision.1210.a.tt + add_character_flag = { + flag = merchant_charter_benevolent_rewarded + years = 10 + } + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_decision.1210.t + left_icon = scope:patron + merchant_charter_benevolent_reward_effect = yes + } + } + } + + option = { #do nothing + name = gdp_decision.1210.b + hidden_effect = { + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_decision.1210.t + left_icon = scope:patron + custom_tooltip = merchant_charter_benefit_counter_indifferent + } + } + } + } + + option = { #do not notify me ever again (ever for like, 10 years) + name = gdp_decision.1210.c + flavor = gdp_decision.1210.c.flavor + add_character_flag = { + flag = refused_charter_benevolent_notifications + years = 10 + } + } +} + +gdp_decision.1220 = { # intervention opening + type = character_event + theme = merchant + title = gdp_decision.1220.t + desc = { + desc = gdp_decision.1220.opening + triggered_desc = { + trigger = { exists = scope:market_holder } + desc = gdp_decision.1220.market_holder + } + desc = gdp_decision.1220.closing + } + left_portrait = { + character = root + animation = survey + } + right_portrait = { + character = scope:market_holder + animation = interested + } + lower_right_portrait = scope:patron + artifact = { + target = scope:charter_artifact + position = lower_center_portrait + } + override_background = { reference = market } + + option = { #yeah, go for it + name = gdp_decision.1220.a + merchant_charter_benefit_counter_effect = { + PATRON = scope:patron + MERCHANT = root + } + scope:market_county = { + merchant_charter_benevolent_authority_county_effect = { MERCHANT = root } + } + ai_chance = { + base = 100 + } + } +} + +# forge_charter_decision + +gdp_decision.2000 = { # forgery + type = character_event + theme = merchant + title = gdp_decision.2000.t + desc = gdp_decision.2000.desc + left_portrait = { + character = scope:merchant + animation = chancellor + } + lower_right_portrait = scope:patron + artifact = { + target = scope:created_charter + position = lower_center_portrait + } + override_background = { reference = study } + override_sound = { reference = "event:/DLC/EP5/SFX/Stingers/ep5_mx_sting_obtaining_charter" } + + immediate = { + save_scope_as = merchant + suzerain = { save_scope_as = patron } + create_merchant_charter_artifact_effect = { + PATRON = scope:patron + MERCHANT = scope:merchant + } + add_dealbreaker_secret_effect = yes + scope:created_charter = { + set_variable = { + name = forger + value = scope:merchant + } + hidden_effect = { + set_max_durability = { + value = { + value = 5 + if = { + limit = { scope:merchant = { has_perk = accomplished_forger_perk } } + add = 5 + } + if = { + limit = { scope:merchant = { has_perk = digging_for_dirt_perk } } + add = 5 + } + } + } + } + } + } + + option = { + name = gdp_decision.2000.a + } +} + +# invite_merchants_decision + +gdp_decision.3000 = { + type = letter_event + opening = gdp_decision.3000.opening + desc = gdp_decision.3000.desc + sender = scope:new_patron + + trigger = { + exists = domicile + government_has_flag = government_is_merchant + trigger_if = { + limit = { var:enticed_merchant ?= var:enticed_merchant } # error suppression + } + } + + immediate = { + save_scope_as = new_client + add_to_variable_list = { + name = entice_merchant_cooldown + target = scope:new_patron + years = 10 + } + if = { + limit = { is_ai = no } + add_character_flag = { + flag = entice_merchant_invited + months = 4 + } + } + # Select arrival location + scope:new_patron ?= { + capital_province ?= { + save_scope_as = new_domicile_location + barony.trade_market ?= { save_scope_as = new_market } + } + } + } + + option = { + name = gdp_decision.3000.a + # Move warnings + if = { + limit = { + exists = scope:new_market + scope:new_market = { + any_character_in_market = { + NOR = { + this = root + house ?= root.house + } + trade_competitiveness > root.trade_competitiveness + } + } + } + custom_tooltip = move_company_interaction.low_competitiveness + } + gdp_move_company_invalidate_trade_effect = yes + if = { + limit = { + exists = scope:new_patron + NOT = { suzerain ?= scope:new_patron } + } + custom_tooltip = move_company_interaction.patron_alert + } + if = { + limit = { + exists = scope:new_patron + trigger_if = { + limit = { has_realm_law = company_size_huge } + scope:new_patron.highest_held_title_tier < tier_kingdom + } + trigger_else_if = { + limit = { has_realm_law = company_size_large } + scope:new_patron.highest_held_title_tier < tier_duchy + } + trigger_else = { always = no } + } + custom_tooltip = move_company_interaction.size_alert + } + add_internal_flag = special + # Add cooldown + add_character_flag = { + flag = entice_merchant_cooldown + years = 10 + } + # End Patron relationship and send message if relevant + suzerain = { + save_scope_as = old_patron + if = { + limit = { + is_ai = no + NOT = { this = scope:new_patron } + } + send_interface_toast = { + type = event_merchant_bad + title = merchant_enticed_title + left_icon = scope:new_client + right_icon = scope:new_client.primary_title + scope:new_client = { end_tributary = yes } + } + } + } + # Inform new Patron and grant enticements + if = { + limit = { + exists = scope:new_client + exists = scope:new_domicile_location + } + scope:new_client = { + send_interface_message = { + type = msg_merchant_enticed + title = merchant_enticed_title + left_icon = scope:new_patron + right_icon = scope:new_domicile_location.county + scope:new_patron ?= { + send_interface_message = { + type = msg_merchant_enticed + title = merchant_enticed_title + left_icon = scope:new_client + right_icon = scope:new_client.primary_title + scope:new_client = { + add_short_term_gold = scope:new_patron.minor_gold_value + add_prestige = medium_prestige_value + domicile = { move_domicile = scope:new_domicile_location } + # Start new Patron relationship + hidden_effect = { + start_tributary_interaction_effect = { + TRIBUTARY = scope:new_client + SUZERAIN = scope:new_patron + } + } + scope:new_market = { + add_competitiveness_modifier_for_character = { + character = scope:new_client + modifier = gdp_enticed_merchant_market_modifier + years = 5 + } + } + } + if = { + limit = { + scope:old_patron = { + is_ai = yes + is_alive = yes + } + NOT = { this = scope:old_patron } + } + reverse_add_opinion = { + target = scope:old_patron + modifier = annoyed_opinion + opinion = -15 + } + } + } + } + } + } + if = { + limit = { + scope:old_patron = { + is_ai = yes + is_alive = yes + } + NOT = { scope:new_patron = scope:old_patron } + NOT = { this = scope:old_patron } + } + reverse_add_opinion = { + target = scope:old_patron + modifier = annoyed_opinion + opinion = -15 + } + } + } + } + + option = { + name = gdp_decision.3000.b + trigger = { is_ai = no } + reverse_add_opinion = { + target = scope:new_patron + modifier = annoyed_opinion + opinion = -15 + } + } + + option = { + name = gdp_decision.3000.c + trigger = { is_ai = no } + add_character_flag = entice_merchant_permanent_refusal + custom_tooltip = gdp_decision.3000.c.tt + reverse_add_opinion = { + target = scope:new_patron + modifier = annoyed_opinion + opinion = -15 + } + } +} + +gdp_decision.3001 = { + type = character_event + hidden = yes + + immediate = { + create_character = { + template = merchant_template + culture = root.culture + faith = root.faith + location = root.capital_province + dynasty = generate + save_temporary_scope_as = merchant_temp + } + scope:merchant_temp = { + add_character_flag = { + flag = entice_merchant_blocker + months = 2 + } + set_variable = { + name = enticed_merchant + value = scope:new_patron + } + create_merchant_title_effect = { + REASON = flag:historical + FLAVOR_CHAR = root + } + trigger_event = gdp_decision.3000 + } + } +} + +# gdp_sponsor_merchant_company_decision + +gdp_decision.3010 = { + type = character_event + title = gdp_decision.3010.t + desc = gdp_decision.3010.desc + theme = merchant + left_portrait = { + character = root + animation = steward + } + right_portrait = { + character = scope:sponsored_courtier + animation = happiness + } + + trigger = { + scope:sponsored_courtier ?= { + gdp_sponsor_merchant_company_candidate_trigger = { SPONSOR = root } + } + } + + option = { # Aspiring Business + name = gdp_decision.3010.a + trigger = { gold >= gdp_sponsor_merchant_company_cost_small_value } + show_as_unavailable = { always = yes } + gdp_sponsor_merchant_company_effect = { SIZE = small } + ai_chance = { base = 10 } + } + + option = { # Trade Establishment + name = gdp_decision.3010.b + trigger = { gold >= gdp_sponsor_merchant_company_cost_medium_value } + show_as_unavailable = { always = yes } + gdp_sponsor_merchant_company_effect = { SIZE = medium } + ai_chance = { base = 20 } + } + + option = { # Prominent Company + name = gdp_decision.3010.c + trigger = { gold >= gdp_sponsor_merchant_company_cost_large_value } + show_as_unavailable = { always = yes } + gdp_sponsor_merchant_company_effect = { SIZE = large } + ai_chance = { base = 30 } + } + + option = { # Trade Empire + name = gdp_decision.3010.d + trigger = { gold >= gdp_sponsor_merchant_company_cost_huge_value } + show_as_unavailable = { always = yes } + gdp_sponsor_merchant_company_effect = { SIZE = huge } + ai_chance = { base = 40 } + } + + option = { # Change of mind, no cost or cooldown + name = gdp_decision.3010.e + ai_chance = { base = 0 } + } +} diff --git a/events/dlc/gdp/gdp_guelph_ghibelline_events.txt b/events/dlc/gdp/gdp_guelph_ghibelline_events.txt new file mode 100644 index 000000000..f16bd7ea4 --- /dev/null +++ b/events/dlc/gdp/gdp_guelph_ghibelline_events.txt @@ -0,0 +1,864 @@ +# NEOW 2555: Historical Guelph/Ghibelline political conflict (original source retained as comments). +#namespace = gdp_guelph_ghibelline + +############ INTRO +# gdp_guelph_ghibelline.0500 - Hello World! +# +############ INTERACTIONS +# gdp_guelph_ghibelline.5000 - Denied Recruit Partisan +# +############ HISTORY +# gdp_guelph_ghibelline.6500 - Pope initiates Concordat of Worms +# gdp_guelph_ghibelline.6505 - HRE gets a letter from the Pope +# +#### +# gdp_guelph_ghibelline.7000 - Want to start the Lombard League? +# gdp_guelph_ghibelline.7005 - Want to join the Lombard League? +# gdp_guelph_ghibelline.7010 - HRE is a player: Do you want to start a war against the Lombard League? +# +############ END DECISION/S +# gdp_guelph_ghibelline.8500 - Compromise! +# gdp_guelph_ghibelline.8510 - The other party declined +# gdp_guelph_ghibelline.8520 - Notify players +# +### +# gdp_guelph_ghibelline.9000 - End the Situation! +# gdp_guelph_ghibelline.9010 - Notify players +# +### + + +########### INTRO + +#Hello World! +#gdp_guelph_ghibelline.0500 = { +# type = character_event +# window = fullscreen_event +# queue_icon = "gfx/interface/icons/situation_types/guelph_ghibelline.dds" +# queue_name = guelph_ghibelline +# title = gdp_guelph_ghibelline.0500.t +# desc = { +# triggered_desc = { +# trigger = { +# is_guelph_leader_trigger = no +# is_ghibelline_leader_trigger = no +# } +# desc = gdp_guelph_ghibelline.0500.intro.all +# } +# first_valid = { +# triggered_desc = { +# trigger = { is_guelph_leader_trigger = yes } +# desc = gdp_guelph_ghibelline.0500.desc.guelph_leader +# } +# triggered_desc = { +# trigger = { is_ghibelline_leader_trigger = yes } +# desc = gdp_guelph_ghibelline.0500.desc.ghibelline_leader +# } +# triggered_desc = { +# trigger = { is_guelph_trigger = yes } +# desc = gdp_guelph_ghibelline.0500.desc.guelph_member +# } +# triggered_desc = { +# trigger = { is_ghibelline_trigger = yes } +# desc = gdp_guelph_ghibelline.0500.desc.ghibelline_member +# } +# desc = gdp_guelph_ghibelline.0500.desc.unaligned +# } +# } +# theme = guelph_ghibelline +# override_background = { reference = gdp_fullscreen_gg_start } +# cooldown = { days = 1 } + +# widgets = { +# widget = { +# gui = "event_window_widget_situation_info_guelph_ghibelline" +# container = "dynamic_content_widget" +# controller = situation_info +# setup_scope = { situation:guelph_ghibelline = { save_scope_as = situation } } +# } +# } + +# trigger = { +# is_ai = no +# NOT = { has_character_flag = had_gg_intro_event } +# OR = { +# has_variable = ghibelline_leader +# has_variable = guelph_leader +# any_held_title = { +# OR = { +# this = title:k_venice +# title_province = { geographical_region = gdp_guelph_ghibelline_northern_italy_region } +# } +# } +# top_overlord ?= { +# any_held_title = { +# OR = { +# this = title:k_venice +# title_province = { geographical_region = gdp_guelph_ghibelline_northern_italy_region } +# } +# } +# } +# } +# } + +# immediate = { +# add_character_flag = had_gg_intro_event +# situation:guelph_ghibelline ?= { +# #Popero +# random_situation_participant = { +# limit = { +# any_held_title = { this = title:k_papal_state } +# } +# save_scope_as = pope_scope +# } +# #Guelph Leader +# random_situation_participant = { +# limit = { has_variable = guelph_leader } +# save_scope_as = guelph_leader +# } +# #Ghibelline Leader +# random_situation_participant = { +# limit = { has_variable = ghibelline_leader } +# save_scope_as = ghibelline_leader +# } +# } +# } +# #:ohok: +# option = { +# name = gdp_guelph_ghibelline.0500.a +# } +#} + +########### FLAVOR + +#You have recruited a bunch of people to your side +#gdp_guelph_ghibelline.1000 = { +# type = letter_event +# opening = gdp_guelph_ghibelline.1000.opening +# desc = gdp_guelph_ghibelline.1000.desc +# sender = { +# character = scope:gg_leader +# animation = admiration +# } + +# immediate = { +# if = { +# limit = { is_guelph_trigger = yes } +# situation:guelph_ghibelline ?= { +# random_situation_participant = { +# limit = { is_guelph_leader_trigger = yes } +# save_scope_as = gg_leader +# } +# } +# } +# else = { +# situation:guelph_ghibelline ?= { +# random_situation_participant = { +# limit = { is_ghibelline_leader_trigger = yes } +# save_scope_as = gg_leader +# } +# } +# } +# #Randomize reward somewhat +# random_list = { +# 10 = { +# dynasty = { +# add_dynasty_prestige = { +# value = minor_dynasty_prestige_gain +# multiply = { +# add = { +# value = root.var:gg_involvement +# divide = 25 +# } +# } +# } +# } +# } +# 10 = { +# add_gold = { +# value = medium_gold_value +# multiply = { +# add = { +# value = var:gg_involvement +# divide = 25 +# } +# } +# } +# } +# 10 = { +# add_prestige = { +# value = medium_prestige_gain +# multiply = { +# add = { +# value = var:gg_involvement +# divide = 25 +# } +# } +# } +# } +# 10 = { +# trigger = { gg_has_medium_involvement_trigger = yes } +# if = { +# limit = { is_guelph_trigger = yes } +# add_character_modifier = { +# modifier = guelph_efforts_recognized_modifier +# years = 10 +# } +# } +# else = { +# add_character_modifier = { +# modifier = ghibelline_efforts_recognized_modifier +# years = 10 +# } +# } +# } +# } +# } +# #Yes, I did good didn't I! +# option = { +# name = gdp_guelph_ghibelline.1000.a +# scope:gg_leader = { +# add_hook = { +# target = root +# type = loyalty_hook +# years = 5 +# } +# } +# if = { +# limit = { is_ai = yes } +# add_opinion = { +# target = scope:gg_leader +# modifier = feeling_appreciated_opinion +# opinion = 30 +# } +# } +# if = { +# limit = { +# scope:gg_leader = { is_ai = yes } +# } +# scope:gg_leader = { +# add_opinion = { +# target = root +# modifier = appreciation_opinion +# opinion = 30 +# } +# } +# } +# #And reset the counter +# remove_variable = recruited_guelphs_num +# remove_variable = recruited_ghibelline_num +# } +#} + +########### INTERACTIONS + +#Denied Recruit Partisan +#gdp_guelph_ghibelline.5000 = { +# type = letter_event +# opening = gdp_guelph_ghibelline.5000.opening +# desc = gdp_guelph_ghibelline.5000.desc +# sender = { +# character = scope:recipient +# animation = dismissal +# } + +# immediate = { +# show_as_tooltip = { +# scope:recipient = { +# add_opinion = { +# modifier = gg_recruit_partisan_denied_opinion # this opinion also acts as a built-in cooldown +# target = scope:actor +# } +# custom_tooltip = gg_recruit_partisan_interaction_cooldown_tt +# } +# } +# } + +# option = { +# name = gdp_guelph_ghibelline.5000.a +# } +#} + +#Banishment cleanup +#gdp_guelph_ghibelline.5010 = { +# hidden = yes +# immediate = { +# remove_character_flag = is_currently_being_banished +# } +#} + + +########### HISTORY + +#Pope initiates Concordat of Worms +#gdp_guelph_ghibelline.6500 = { +# type = character_event +# title = gdp_guelph_ghibelline.6500.t +# desc = gdp_guelph_ghibelline.6500.desc +# theme = guelph_ghibelline +# override_background = { reference = council_chamber } +# left_portrait = { +# character = root +# animation = contemplating +# } +# lower_right_portrait = { +# character = scope:ghibelline_leader +# animation = dismissal +# } +# immediate = { +# situation:guelph_ghibelline ?= { +# random_situation_participant = { +# limit = { has_variable = ghibelline_leader } +# save_scope_as = ghibelline_leader +# } +# set_variable = had_concordat_of_worms +# } +# } +# #Alright, let's peace out +# option = { +# name = gdp_guelph_ghibelline.6500.a +# scope:ghibelline_leader = { +# if = { +# limit = { is_ai = no } +# custom_tooltip = { +# text = hre_decides_the_outcome.tt +# trigger_event = gdp_guelph_ghibelline.6505 +# } +# } +# else = { +# fulfill_concordat_of_worms_effect = { NEW_PHASE = repose } +# } +# } +# } +# #NEVER +# option = { +# name = gdp_guelph_ghibelline.6500.b +# #Actual effect +# actual_abandon_concordat_of_worms_effect = yes +# #Notification effect +# abandon_concordat_of_worms_effect = yes +# } +#} + +#HRE gets a letter from the Pope +#gdp_guelph_ghibelline.6505 = { +# type = letter_event +# opening = gdp_guelph_ghibelline.6505.opening +# desc = gdp_guelph_ghibelline.6505.desc +# sender = scope:guelph_leader +# immediate = { +# situation:guelph_ghibelline ?= { +# random_situation_participant = { +# limit = { has_variable = guelph_leader } +# save_scope_as = guelph_leader +# } +# set_variable = had_concordat_of_worms +# } +# } +# #Alright, let's peace out +# option = { +# name = gdp_guelph_ghibelline.6505.a +# fulfill_concordat_of_worms_effect = { NEW_PHASE = repose } +# } +# #NEVER +# option = { +# name = gdp_guelph_ghibelline.6505.b +# #Actual effect +# actual_abandon_concordat_of_worms_effect = yes +# #Notification effect +# abandon_concordat_of_worms_effect = yes +# } +#} + +### + +#♬ Do you want to build a trade lee-ague? ♪ +#gdp_guelph_ghibelline.7000 = { +# type = character_event +# title = gdp_guelph_ghibelline.7000.t +# desc = { +# desc = gdp_guelph_ghibelline.7000.desc +# first_valid = { +# triggered_desc = { +# trigger = { +# scope:new_confederation = { +# any_confederation_member = { count > num_lombard_league_members } +# } +# } +# desc = gdp_guelph_ghibelline.7000.desc.all +# } +# triggered_desc = { +# trigger = { +# scope:new_confederation = { +# any_confederation_member = { count > num_half_lombard_league_titles } +# } +# } +# desc = gdp_guelph_ghibelline.7000.desc.more_than_half +# } +# desc = gdp_guelph_ghibelline.7000.desc.less_than_half +# } +# } +# theme = guelph_ghibelline +# override_background = { reference = council_chamber } +# left_portrait = { +# character = root +# animation = personality_bold +# } +# lower_right_portrait = { +# character = scope:hre_kaiser +# } +# immediate = { +# title:e_hre.holder ?= { save_scope_as = hre_kaiser } +# #These need to match whatever is in the form_lombard_league_decision-effect +# add_character_modifier = lombard_founder_modifier +# #We save the league_creator scope/identifier in the Situation before we call this event +# create_lombard_league_effect = yes +# gg_involvement_decision_effect = yes +# } +# #LET'S GOOOO ... and I'll have a Republic, thank you +# option = { +# name = gdp_guelph_ghibelline.7000.a +# trigger = { +# NOT = { government_has_flag = government_is_republic } +# } +# gdp_found_a_republic_effect = yes +# } +# #LET'S GOOOO +# option = { +# name = gdp_guelph_ghibelline.7000.b +# } +#} + +#♬ Come on let's go out and pla-ay ♪ +#gdp_guelph_ghibelline.7005 = { +# type = character_event +# title = gdp_guelph_ghibelline.7005.t +# desc = gdp_guelph_ghibelline.7005.desc +# theme = guelph_ghibelline +# override_background = { reference = council_chamber } +# left_portrait = { +# character = root +# animation = contemplating +# } +# lower_center_portrait = { +# character = scope:league_creator +# } +# lower_right_portrait = { +# character = scope:hre_kaiser +# } +# immediate = { +# title:e_hre.holder ?= { save_scope_as = hre_kaiser } +# random_confederation = { +# limit = { has_variable = is_lombard_league } +# save_scope_as = lombard_league_conf +# } +# } +# #I'll join ... and I'll have a Republic, thank you +# option = { +# name = gdp_guelph_ghibelline.7005.a +# trigger = { +# NOT = { government_has_flag = government_is_republic } +# } +# gdp_found_a_republic_effect = yes +# scope:lombard_league_conf = { +# actual_add_to_lombard_league_effect = { TITLE = root.primary_title } +# } +# } +# #I'll join +# option = { +# name = gdp_guelph_ghibelline.7005.b +# scope:lombard_league_conf = { +# actual_add_to_lombard_league_effect = { TITLE = root.primary_title } +# } +# } +# #Nah, I'm good +# option = { +# name = gdp_guelph_ghibelline.7005.c +# } +#} + +#HRE is a player: Do you want to start a war against the Lombard League? +#gdp_guelph_ghibelline.7010 = { +# type = character_event +# title = gdp_guelph_ghibelline.7010.t +# desc = gdp_guelph_ghibelline.7010.desc +# theme = guelph_ghibelline +# override_background = { reference = council_chamber } +# left_portrait = { +# character = root +# animation = rage +# } +# lower_right_portrait = { +# character = scope:league_creator +# } +# immediate = { +# random_confederation = { +# limit = { has_variable = is_lombard_league } +# save_scope_as = lombard_league_conf +# } +# custom_tooltip = league_creator_created_lombard_league.tt +# } +# #I'll crush them once and for all! +# option = { +# name = gdp_guelph_ghibelline.7010.a +# add_prestige = major_prestige_gain +# start_war = { +# casus_belli = "dissolve_lombard_league_cb" +# target = scope:league_creator +# } +# } +# #Nah, I'm good +# option = { +# name = gdp_guelph_ghibelline.7010.b +# stress_impact = { +# base = minor_stress_impact_loss +# lazy = major_stress_impact_loss +# arbitrary = minor_stress_impact_loss +# craven = minor_stress_impact_loss +# paranoid = major_stress_impact_gain +# vengeful = major_stress_impact_gain +# } +# } +#} + +#Request to join LL rejected +#gdp_guelph_ghibelline.7015 = { +# type = letter_event +# sender = scope:recipient +# opening = { +# desc = gdp_guelph_ghibelline.7015.opening +# } +# desc = gdp_guelph_ghibelline.7015.desc +# immediate = { +# set_variable = { +# name = rejected_from_lombard_league +# years = 5 +# } +# } +# #Accept +# option = { +# name = gdp_guelph_ghibelline.7015.a +# } +#} + +########### END DECISION/S + +# Compromise! +#gdp_guelph_ghibelline.8500 = { +# type = character_event +# window = fullscreen_event +# queue_icon = "gfx/interface/icons/situation_types/guelph_ghibelline.dds" +# title = gdp_guelph_ghibelline.8500.t +# desc = gdp_guelph_ghibelline.8500.desc +# theme = guelph_ghibelline +# override_background = { reference = gdp_fullscreen_gg_compromise } + +# immediate = { +# if = { +# limit = { +# scope:actor = { has_variable = guelph_leader } +# } +# scope:actor = { save_scope_as = guelph_leader } +# scope:recipient = { save_scope_as = ghibelline_leader } +# } +# else = { +# scope:actor = { save_scope_as = ghibelline_leader } +# scope:recipient = { save_scope_as = guelph_leader } +# } +# if = { +# limit = { scope:actor = this } +# if = { +# limit = { has_variable = guelph_leader } +# gg_situation_compromise_actual_effect = { GUELPH_LEADER = scope:actor GHIBELLINE_LEADER = scope:recipient } +# } +# else = { +# gg_situation_compromise_actual_effect = { GUELPH_LEADER = scope:recipient GHIBELLINE_LEADER = scope:actor } +# } +# custom_description_no_bullet = { +# text = gg_end_situation_tt +# situation:guelph_ghibelline = { end_situation = yes } +# } +# } +# else = { +# show_as_tooltip = { +# if = { +# limit = { has_variable = guelph_leader } +# gg_situation_compromise_actual_effect = { GUELPH_LEADER = scope:actor GHIBELLINE_LEADER = scope:recipient } +# } +# else = { +# gg_situation_compromise_actual_effect = { GUELPH_LEADER = scope:recipient GHIBELLINE_LEADER = scope:actor } +# } +# } +# custom_description_no_bullet = { text = gg_end_situation_tt } +# } +# } +# #:ohok: +# option = { +# name = gdp_guelph_ghibelline.8500.a +# custom_description_no_bullet = { +# text = gg_compromise_leader_involvement_effect +# dynasty ?= { add_dynasty_prestige = root.gg_compromise_leader_involvement_renown } +# } +# } +# after = { +# if = { +# limit = { scope:actor = this } +# #Actually end the situation +# trigger_event = { +# id = gdp_guelph_ghibelline.9001 +# days = 1 +# } +# } +# } +#} + +# The other party declined +#gdp_guelph_ghibelline.8510 = { +# type = letter_event +# opening = gdp_guelph_ghibelline.8510.opening +# desc = gdp_guelph_ghibelline.8510.desc +# sender = { +# character = scope:recipient +# animation = dismissal +# } +# immediate = { +# custom_tooltip = gdp_guelph_ghibelline.8510.tt +# } +# #How can this be! +# option = { +# name = gdp_guelph_ghibelline.8510.a +# } +#} + +#Notify players +#gdp_guelph_ghibelline.8520 = { +# type = character_event +# title = gdp_guelph_ghibelline.8520.t +# desc = gdp_guelph_ghibelline.8520.desc +# theme = guelph_ghibelline +# left_portrait = { +# character = root +# animation = contemplating +# } +# override_background = { reference = council_chamber } +# immediate = { +# scope:actor = { +# if = { +# limit = { has_variable = guelph_leader } +# save_scope_as = guelph_leader +# scope:recipient = { save_scope_as = ghibelline_leader } +# } +# else = { +# save_scope_as = ghibelline_leader +# scope:recipient = { save_scope_as = guelph_leader } +# } +# show_as_tooltip = { +# if = { +# limit = { has_variable = guelph_leader } +# gg_situation_compromise_actual_effect = { GUELPH_LEADER = scope:actor GHIBELLINE_LEADER = scope:recipient } +# } +# else = { +# gg_situation_compromise_actual_effect = { GUELPH_LEADER = scope:recipient GHIBELLINE_LEADER = scope:actor } +# } +# } +# } +# } +# #:seemsgood: +# option = { +# name = gdp_guelph_ghibelline.8520.a +# custom_description_no_bullet = { +# text = gg_victory_member_involvement_effect +# dynasty ?= { add_dynasty_prestige = root.gg_supporter_involvement_renown } +# } +# } +#} + +### + +# End the Situation! +#gdp_guelph_ghibelline.9000 = { +# type = character_event +# window = fullscreen_event +# queue_icon = "gfx/interface/icons/situation_types/guelph_ghibelline.dds" +# title = gdp_guelph_ghibelline.9000.t +# desc = { +# first_valid = { +# triggered_desc = { +# trigger = { is_guelph_trigger = yes } +# desc = gdp_guelph_ghibelline.9000.desc.guelph +# } +# desc = gdp_guelph_ghibelline.9000.desc.ghibelline +# } +# } +# theme = guelph_ghibelline +# override_background = { +# trigger = { is_guelph_trigger = yes } +# reference = gdp_fullscreen_guelph_victory +# } +# override_background = { reference = gdp_fullscreen_ghibelline_victory } +# override_effect_2d = { reference = legend_glow } + +# immediate = { +# if = { +# limit = { is_guelph_trigger = yes } +# gg_guelph_situation_victory_effect = yes +# create_character_memory = { type = guelph_won_gg_memory } +# } +# else = { +# gg_ghibelline_situation_victory_effect = yes +# create_character_memory = { type = ghibelline_won_gg_memory } +# } +# } + +# option = { +# name = gdp_guelph_ghibelline.9000.a + +# } + +# after = { +# # Notify & End Struggle +# #save_scope_as = fp2_loc_struggle_ender # Loc used to use root, this fixes it +# #every_player = { +# # limit = { fp2_does_this_player_care_about_the_fate_of_iberia = yes } # Needs to be checked before the struggle ends due to race condition #issues +# # add_to_list = player_to_notify # Making a list so stuff is tiggered after the struggle ends, to make extra sure I don't break anything. +# #} + +# #Actually end the situation +# trigger_event = { +# id = gdp_guelph_ghibelline.9001 +# days = 1 +# } +# } +#} + +#gdp_guelph_ghibelline.9001 = { +# hidden = yes +# immediate = { +# situation:guelph_ghibelline = { end_situation = yes } +# if = { +# limit = { exists = scope:guelph_win } +# remove_global_variable = processing_guelph_win +# } +# if = { +# limit = { exists = scope:ghibelline_win } +# remove_global_variable = processing_ghibelline_win +# } +# } +#} + +#Notify players +#gdp_guelph_ghibelline.9010 = { +# type = character_event +# title = { +# first_valid = { +# triggered_desc = { +# trigger = { +# OR = { +# AND = { +# is_guelph_trigger = yes +# exists = scope:guelph_win +# } +# AND = { +# is_ghibelline_trigger = yes +# exists = scope:ghibelline_win +# } +# } +# } +# desc = gdp_guelph_ghibelline.9010.t +# } +# desc = gdp_guelph_ghibelline.9010.t.defeat +# } +# } +# desc = { +# first_valid = { +# triggered_desc = { +# trigger = { +# OR = { +# AND = { +# is_guelph_trigger = yes +# exists = scope:guelph_win +# } +# AND = { +# is_ghibelline_trigger = yes +# exists = scope:ghibelline_win +# } +# } +# } +# desc = gdp_guelph_ghibelline.9010.desc.win +# } +# desc = gdp_guelph_ghibelline.9010.desc.lose +# } +# } +# theme = guelph_ghibelline +# left_portrait = { +# character = root +# triggered_animation = { +# trigger = { +# is_guelph_trigger = yes +# exists = scope:guelph_win +# } +# animation = personality_zealous +# } +# triggered_animation = { +# trigger = { +# is_ghibelline_trigger = yes +# exists = scope:ghibelline_win +# } +# animation = happiness +# } +# animation = stress +# } +# lower_left_portrait = { +# character = scope:victorious_leader +# } +# override_background = { +# trigger = { is_guelph_trigger = yes } +# reference = temple +# } +# override_background = { reference = council_chamber } + +# immediate = { +# if = { +# limit = { exists = scope:guelph_win } +# situation:guelph_ghibelline = { +# situation_participant_group:guelph_leader = { +# random_situation_group_participant = { save_scope_as = victorious_leader } +# } +# } +# show_as_tooltip = { gg_guelph_situation_victory_effect = yes } +# } +# else = { +# situation:guelph_ghibelline = { +# situation_participant_group:ghibelline_leader = { +# random_situation_group_participant = { save_scope_as = victorious_leader } +# } +# } +# show_as_tooltip = { gg_ghibelline_situation_victory_effect = yes } +# } +# } +# #:seemsgood: +# option = { +# name = { +# text = { +# first_valid = { +# triggered_desc = { +# trigger = { +# OR = { +# AND = { +# is_guelph_trigger = yes +# exists = scope:guelph_win +# } +# AND = { +# is_ghibelline_trigger = yes +# exists = scope:ghibelline_win +# } +# } +# } +# desc = gdp_guelph_ghibelline.9010.a.win +# } +# desc = gdp_guelph_ghibelline.9010.a.lose +# } +# } +# } +# } +#} diff --git a/events/dlc/gdp/gdp_guelph_ghibelline_scheme_events.txt b/events/dlc/gdp/gdp_guelph_ghibelline_scheme_events.txt new file mode 100644 index 000000000..75be8ef68 --- /dev/null +++ b/events/dlc/gdp/gdp_guelph_ghibelline_scheme_events.txt @@ -0,0 +1,923 @@ +# NEOW 2555: Historical Guelph/Ghibelline political schemes (original source retained as comments). +#namespace = gdp_guelph_ghibelline_scheme + +############ +# gdp_guelph_ghibelline_scheme.1000 - Align/Switch Sides: Look! Isn't my side great! +# gdp_guelph_ghibelline_scheme.1010 - Claim Leadership: Turn the partisans against the current leader +# gdp_guelph_ghibelline_scheme.1020 - Have an agent at the target's court assist your scheme +# gdp_guelph_ghibelline_scheme.1030 - Replace Ruler: Tarnish target's reputation +# + +########### + +#Align/Switch Sides: Look! Isn't my side great! +#gdp_guelph_ghibelline_scheme.1000 = { +# type = character_event +# title = gdp_guelph_ghibelline_scheme.1000.t +# desc = gdp_guelph_ghibelline_scheme.1000.desc +# theme = guelph_ghibelline +# override_background = { reference = market_crowd } +# left_portrait = { +# character = root +# animation = flirtation +# } +# right_portrait = { +# character = scope:target +# animation = contemplating +# } +# widget = { +# gui = "event_window_widget_scheme" +# container = "custom_widgets_container" +# } +# trigger = { +# NOT = { +# scope:scheme = { exists = var:had_gg_scheme_1000 } +# } +# scope:target = { is_available = yes } +# is_available = yes +# #Same location, or nearby at least +# OR = { +# location = scope:target.location +# location = { +# any_neighboring_province = { this = scope:target.location } +# } +# } +# } +# immediate = { +# scope:scheme = { +# set_variable = had_gg_scheme_1000 +# } +# } +# #Roll to get a better outcome +# option = { +# name = gdp_guelph_ghibelline_scheme.1000.a +# duel = { +# skills = { diplomacy intrigue } +# target = scope:target +# #Success +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = 3.5 +# } +# desc = gdp_guelph_ghibelline_scheme.1000.a.desc.success +# send_interface_toast = { +# type = event_toast_text_and_effect_good +# title = gdp_guelph_ghibelline_scheme.1000.t.success +# desc = gdp_guelph_ghibelline_scheme.1000.a.desc.success +# left_icon = root +# scope:scheme = { +# add_scheme_modifier = { type = scheme_clever_coaxing_modifier } +# } +# } +# } +# #Failure +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = -3.5 +# min = 10 +# } +# desc = gdp_guelph_ghibelline_scheme.1000.a.desc.failure +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1000.t.failure +# desc = gdp_guelph_ghibelline_scheme.1000.a.desc.failure +# left_icon = root +# stress_and_fulfillment_impact = { +# base = medium_stress_impact_gain +# } +# } +# } +# } +# ai_chance = { +# base = 10 +# modifier = { +# diplomacy > scope:target.diplomacy +# intrigue > scope:target.intrigue +# add = 20 +# } +# } +# } +# #Pay some resource for a guaranteed outcome +# option = { +# name = gdp_guelph_ghibelline_scheme.1000.b +# remove_short_term_gold = minor_gold_value +# scope:scheme = { +# add_scheme_modifier = { type = scheme_innocent_knickknack_modifier } +# } +# ai_chance = { +# base = 20 +# modifier = { +# short_term_gold <= minor_gold_value +# factor = 0 +# } +# } +# } +# #I'm good +# option = { +# name = gdp_guelph_ghibelline_scheme.1000.c +# ai_chance = { +# base = 25 +# } +# } +#} + +#Claim Leadership: Turn the partisans against the current leader +#gdp_guelph_ghibelline_scheme.1010 = { +# type = character_event +# title = gdp_guelph_ghibelline_scheme.1010.t +# desc = gdp_guelph_ghibelline_scheme.1010.desc +# theme = guelph_ghibelline +# override_background = { reference = council_chamber } +# left_portrait = { +# character = root +# animation = scheme +# } +# right_portrait = { +# character = scope:target +# animation = stress +# } +# widget = { +# gui = "event_window_widget_scheme" +# container = "custom_widgets_container" +# } +# trigger = { +# NOT = { +# scope:scheme = { exists = var:had_gg_scheme_1010 } +# } +# scope:target = { is_available = yes } +# is_available = yes +# } +# immediate = { +# scope:scheme = { +# set_variable = had_gg_scheme_1010 +# } +# } +# #Renown check +# option = { +# name = gdp_guelph_ghibelline_scheme.1010.b +# trigger = { +# dynasty = { dynasty_prestige_level >= medium_dynasty_prestige_level } +# } +# show_as_unavailable = { always = yes } +# reason = renown +# scope:scheme = { +# add_scheme_modifier = { +# type = scheme_resplendent_letter_modifier +# days = 300 +# } +# } +# ai_chance = { +# base = 100 +# } +# } +# #Roll! +# option = { +# name = gdp_guelph_ghibelline_scheme.1010.a +# custom_tooltip = gdp_guelph_ghibelline_scheme.1010.a.tt +# duel = { +# skills = { diplomacy learning } +# target = scope:target +# #Success +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = 3.5 +# } +# modifier = { +# exists = var:gg_involvement +# add = var:gg_involvement +# } +# desc = gdp_guelph_ghibelline_scheme.1010.a.desc.success +# send_interface_toast = { +# type = event_toast_text_and_effect_good +# title = gdp_guelph_ghibelline_scheme.1010.t.success +# desc = gdp_guelph_ghibelline_scheme.1010.a.desc.success +# left_icon = root +# scope:scheme = { +# add_scheme_modifier = { +# type = scheme_convincing_letter_modifier +# days = 300 +# } +# } +# } +# } +# #Failure +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = -3.5 +# min = 10 +# } +# desc = gdp_guelph_ghibelline_scheme.1010.a.desc.failure +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1010.t.failure +# desc = gdp_guelph_ghibelline_scheme.1010.a.desc.failure +# left_icon = root +# stress_and_fulfillment_impact = { +# base = minor_stress_impact_gain +# } +# scope:scheme = { +# add_scheme_modifier = { +# type = scheme_intercepted_letter_modifier +# days = 300 +# } +# } +# } +# } +# } +# ai_chance = { +# base = 25 +# modifier = { +# diplomacy > scope:target.diplomacy +# learning > scope:target.learning +# add = 25 +# } +# modifier = { +# exists = var:gg_involvement +# var:gg_involvement >= gg_involvement_major_value +# add = 20 +# } +# } +# } +# #I'm good +# option = { +# name = gdp_guelph_ghibelline_scheme.1010.c +# ai_chance = { +# base = 10 +# } +# } +#} + +#Have an agent at the target's court assist your scheme +#gdp_guelph_ghibelline_scheme.1020 = { +# type = character_event +# title = gdp_guelph_ghibelline_scheme.1020.t +# desc = { +# first_valid = { +# triggered_desc = { +# trigger = { +# scope:scheme = { scheme_type = gg_replace_ruler } +# } +# desc = gdp_guelph_ghibelline_scheme.1020.intro.replace_ruler +# } +# triggered_desc = { +# trigger = { +# scope:scheme = { scheme_type = gg_claim_leadership } +# } +# desc = gdp_guelph_ghibelline_scheme.1020.intro.claim_leadership +# } +# desc = gdp_guelph_ghibelline_scheme.1020.intro +# } +# desc = gdp_guelph_ghibelline_scheme.1020.segway +# triggered_desc = { +# trigger = { +# scope:scheme = { scheme_type = gg_replace_ruler } +# } +# desc = gdp_guelph_ghibelline_scheme.1020.outro.replace_ruler +# } +# triggered_desc = { +# trigger = { +# scope:scheme = { scheme_type = gg_claim_leadership } +# } +# desc = gdp_guelph_ghibelline_scheme.1020.outro.promote_character +# } +# triggered_desc = { +# trigger = { +# scope:scheme = { +# OR = { +# scheme_type = gg_align_undecided +# scheme_type = gg_switch_sides +# } +# } +# } +# desc = gdp_guelph_ghibelline_scheme.1020.outro.promote_scheme +# } +# } +# theme = guelph_ghibelline +# override_background = { reference = throne_room } +# left_portrait = { +# character = scope:court_agent +# triggered_animation = { +# trigger = { +# scope:scheme = { scheme_type = gg_claim_leadership } +# } +# animation = scheme +# } +# animation = flirtation +# } +# right_portrait = { +# character = scope:target +# trigger = { +# scope:scheme = { +# NOR = { +# scheme_type = gg_replace_ruler +# scheme_type = gg_claim_leadership +# } +# } +# } +# animation = contemplating +# } +# lower_left_portrait = { +# character = root +# trigger = { +# scope:scheme = { +# OR = { +# scheme_type = gg_replace_ruler +# scheme_type = gg_claim_leadership +# } +# } +# } +# animation = thinking +# } +# lower_right_portrait = { +# character = scope:target +# trigger = { +# scope:scheme = { +# OR = { +# scheme_type = gg_replace_ruler +# scheme_type = gg_claim_leadership +# } +# } +# } +# animation = contemplating +# } +# widget = { +# gui = "event_window_widget_scheme" +# container = "custom_widgets_container" +# } +# trigger = { +# NOT = { +# scope:scheme = { exists = var:had_gg_scheme_1020 } +# } +# scope:target = { is_available = yes } +# scope:scheme = { +# any_scheme_agent_character = { is_available = yes } +# } +# } +# immediate = { +# scope:scheme = { +# set_variable = had_gg_scheme_1020 +# random_scheme_agent_character = { +# limit = { is_available = yes } +# save_scope_as = court_agent +# } +# } +# } +# #Leverage your Involvement +# option = { +# name = gdp_guelph_ghibelline_scheme.1020.a +# trigger = { gg_has_medium_involvement_trigger = yes } +# show_as_unavailable = { always = yes } +# reason = gg_involvement +# scope:scheme = { +# if = { +# limit = { +# scheme_agent_charges <= { +# value = opportunity_cap_value +# subtract = 2 +# } +# } +# change_opportunities = 2 +# } +# if = { +# limit = { +# scope:scheme = { +# OR = { +# scheme_type = gg_replace_ruler +# scheme_type = gg_claim_leadership +# } +# } +# } +# add_scheme_modifier = { type = scheme_leverage_involvement_rr_modifier } +# } +# else = { +# add_scheme_modifier = { type = scheme_leverage_involvement_modifier } +# } +# } +# ai_chance = { +# base = 100 +# } +# } +# #Replace Ruler: Exchange secrecy for success chance +# option = { +# name = gdp_guelph_ghibelline_scheme.1020.b +# trigger = { +# scope:scheme = { scheme_type = gg_replace_ruler } +# } +# scope:scheme = { +# add_scheme_modifier = { type = scheme_shady_characters_modifier } +# } +# random = { +# chance = { +# add = { +# value = scope:target.intrigue +# multiply = 2 +# } +# subtract = { +# value = scope:court_agent.intrigue +# multiply = 2 +# } +# } +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1020.prestige +# desc = gdp_guelph_ghibelline_scheme.1020.prestige.desc +# left_icon = root +# add_prestige = minor_prestige_loss +# } +# } +# ai_chance = { +# base = 10 +# modifier = { +# scope:court_agent.intrigue > scope:target.intrigue +# add = 30 +# } +# } +# } +# #Roll agent's intrigue against target's intrigue +# option = { +# name = gdp_guelph_ghibelline_scheme.1020.c +# trigger = { +# OR = { +# scope:scheme = { scheme_type = gg_replace_ruler } +# AND = { +# scope:scheme = { +# NOT = { scheme_type = gg_replace_ruler } +# } +# NAND = { +# prestige_level >= high_prestige_level +# piety_level >= high_piety_level +# } +# } +# } +# } +# scope:court_agent = { +# duel = { +# skill = intrigue +# target = scope:target +# #Success +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = 3.5 +# } +# modifier = { +# exists = var:gg_involvement +# add = var:gg_involvement +# } +# desc = gdp_guelph_ghibelline_scheme.1020.c.desc.success +# root = { +# send_interface_toast = { +# type = event_toast_text_and_effect_good +# title = gdp_guelph_ghibelline_scheme.1020.t.success +# desc = gdp_guelph_ghibelline_scheme.1020.c.desc.success +# left_icon = root +# scope:scheme = { +# if = { +# limit = { +# scope:scheme = { +# OR = { +# scheme_type = gg_replace_ruler +# scheme_type = gg_claim_leadership +# } +# } +# } +# add_scheme_modifier = { type = scheme_behind_the_scenes_rr_modifier } +# } +# else = { +# add_scheme_modifier = { type = scheme_behind_the_scenes_modifier } +# } +# } +# } +# } +# } +# #Failure +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = -3.5 +# min = 10 +# } +# desc = gdp_guelph_ghibelline_scheme.1020.c.desc.failure +# root = { +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1020.t.failure +# desc = gdp_guelph_ghibelline_scheme.1020.c.desc.failure +# left_icon = root +# scope:court_agent = { +# stress_and_fulfillment_impact = { +# base = minor_stress_impact_gain +# } +# } +# add_prestige = minor_prestige_loss +# } +# } +# } +# } +# } +# ai_chance = { +# base = 10 +# modifier = { +# scope:court_agent.intrigue > scope:target.intrigue +# add = 20 +# } +# modifier = { +# exists = var:gg_involvement +# var:gg_involvement >= gg_involvement_major_value +# add = 20 +# } +# } +# } +# #Leverage prestige +# option = { +# name = gdp_guelph_ghibelline_scheme.1020.d +# trigger = { +# scope:scheme = { +# NOT = { scheme_type = gg_replace_ruler } +# } +# prestige_level >= high_prestige_level +# } +# reason = prestige_level +# scope:scheme = { +# if = { +# limit = { +# scheme_agent_charges <= { +# value = opportunity_cap_value +# subtract = 1 +# } +# } +# change_opportunities = 1 +# } +# add_scheme_modifier = { type = scheme_revered_reputation_modifier } +# } +# random = { +# chance = { +# add = 10 +# add = { +# value = scope:target.diplomacy +# multiply = 2 +# } +# subtract = { +# value = diplomacy +# multiply = 2 +# } +# } +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1020.prestige +# desc = gdp_guelph_ghibelline_scheme.1020.prestige.desc +# left_icon = root +# add_prestige = minor_prestige_loss +# } +# } +# ai_chance = { +# base = 10 +# modifier = { +# diplomacy > scope:target.diplomacy +# add = 20 +# } +# } +# } +# #Leverage piety +# option = { +# name = gdp_guelph_ghibelline_scheme.1020.e +# trigger = { +# scope:scheme = { +# NOT = { scheme_type = gg_replace_ruler } +# } +# piety_level >= high_piety_level +# } +# reason = piety_level +# scope:scheme = { +# if = { +# limit = { +# scheme_agent_charges <= { +# value = opportunity_cap_value +# subtract = 1 +# } +# } +# change_opportunities = 1 +# } +# add_scheme_modifier = { type = scheme_dazzling_devoutness_modifier } +# } +# random = { +# chance = { +# add = 10 +# add = { +# value = scope:target.learning +# multiply = 2 +# } +# subtract = { +# value = learning +# multiply = 2 +# } +# } +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1020.piety +# desc = gdp_guelph_ghibelline_scheme.1020.piety.desc +# left_icon = root +# add_piety = minor_piety_loss +# } +# } +# ai_chance = { +# base = 10 +# modifier = { +# learning > scope:target.learning +# add = 20 +# } +# } +# } +# #I'm good +# option = { +# name = gdp_guelph_ghibelline_scheme.1020.f +# } +#} + +#scripted_effect 1030_duel_effect = { +# duel = { +# skill = $SKILL$ +# target = scope:target +# #Success +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = 3.5 +# } +# desc = gdp_guelph_ghibelline_scheme.1030.b.desc.success +# send_interface_toast = { +# type = event_toast_text_and_effect_good +# title = gdp_guelph_ghibelline_scheme.1030.t.success +# desc = gdp_guelph_ghibelline_scheme.1030.b.desc.success +# left_icon = root +# scope:scheme = { +# add_scheme_modifier = { type = scheme_undermined_ruler_modifier } +# } +# } +# } +# #Failure +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = -3.5 +# min = 10 +# } +# desc = gdp_guelph_ghibelline_scheme.1030.b.desc.failure +# send_interface_toast = { +# type = event_toast_text_and_effect_bad +# title = gdp_guelph_ghibelline_scheme.1030.t.failure +# desc = gdp_guelph_ghibelline_scheme.1030.b.desc.failure +# left_icon = root +# stress_and_fulfillment_impact = { +# base = medium_stress_impact_gain +# } +# random = { +# chance = { +# add = 40 +# subtract = $SKILL$ +# } +# add_prestige = minor_prestige_loss +# } +# } +# } +# } +#} + +#Replace Ruler: Tarnish target's reputation +#gdp_guelph_ghibelline_scheme.1030 = { +# type = character_event +# title = gdp_guelph_ghibelline_scheme.1030.t +# desc = { +# first_valid = { +# triggered_desc = { +# trigger = { exists = scope:sly_character } +# desc = gdp_guelph_ghibelline_scheme.1030.desc.sly_character +# } +# desc = gdp_guelph_ghibelline_scheme.1030.desc +# } +# } +# theme = guelph_ghibelline +# override_background = { reference = council_chamber } +# left_portrait = { +# character = root +# triggered_animation = { +# trigger = { +# NOT = { exists = scope:sly_character } +# } +# animation = scheme +# } +# animation = contemplating +# } +# right_portrait = { +# trigger = { exists = scope:sly_character } +# character = scope:sly_character +# animation = scheme +# } +# lower_right_portrait = { +# character = scope:target +# animation = dismissal +# } +# widget = { +# gui = "event_window_widget_scheme" +# container = "custom_widgets_container" +# } +# trigger = { +# NOT = { +# scope:scheme = { exists = var:had_gg_scheme_1030 } +# } +# } +# immediate = { +# scope:scheme = { +# set_variable = had_gg_scheme_1030 +# } +# scope:target = { +# random_list = { +# 1 = { +# trigger = { lowest_skill = diplomacy } +# save_scope_value_as = { +# name = target_skill_flag +# value = flag:diplomacy +# } +# save_scope_value_as = { +# name = target_skill +# value = diplomacy +# } +# } +# 1 = { +# trigger = { lowest_skill = martial } +# save_scope_value_as = { +# name = target_skill_flag +# value = flag:martial +# } +# save_scope_value_as = { +# name = target_skill +# value = martial +# } +# } +# 1 = { +# trigger = { lowest_skill = stewardship } +# save_scope_value_as = { +# name = target_skill_flag +# value = flag:stewardship +# } +# save_scope_value_as = { +# name = target_skill +# value = stewardship +# } +# } +# 1 = { +# trigger = { lowest_skill = intrigue } +# save_scope_value_as = { +# name = target_skill_flag +# value = flag:intrigue +# } +# save_scope_value_as = { +# name = target_skill +# value = intrigue +# } +# } +# 1 = { +# trigger = { lowest_skill = learning } +# save_scope_value_as = { +# name = target_skill_flag +# value = flag:learning +# } +# save_scope_value_as = { +# name = target_skill +# value = learning +# } +# } +# } +# } +# random_courtier_or_guest = { +# limit = { +# this != root +# is_available_ai_adult = yes +# is_of_major_or_minor_interest_trigger = { CHARACTER = root } +# NOR = { +# has_trait = compassionate +# has_trait = honest +# gg_first_and_second_are_opposite_sides_trigger = { FIRST = root SECOND = prev } +# } +# } +# weight = { +# base = 1 +# modifier = { +# gg_first_and_second_are_same_side_trigger = { FIRST = root SECOND = prev } +# add = 10 +# } +# modifier = { +# has_trait = deceitful +# add = 5 +# } +# modifier = { +# has_trait = callous +# add = 5 +# } +# modifier = { +# has_trait = sadistic +# add = 5 +# } +# } +# save_scope_as = sly_character +# } +# } +# #Leverage your Involvement +# option = { +# name = gdp_guelph_ghibelline_scheme.1030.a +# trigger = { gg_has_minor_involvement_trigger = yes } +# show_as_unavailable = { always = yes } +# reason = gg_involvement +# scope:scheme = { +# if = { +# limit = { +# scheme_agent_charges <= { +# value = opportunity_cap_value +# subtract = 2 +# } +# } +# change_opportunities = 2 +# } +# add_scheme_modifier = { type = scheme_leverage_involvement_rr_modifier } +# } +# ai_chance = { +# base = 100 +# } +# } +# #Roll for the skill check +# option = { +# name = gdp_guelph_ghibelline_scheme.1030.b +# switch = { +# trigger = scope:target_skill_flag +# flag:diplomacy = { +# 1030_duel_effect = { SKILL = diplomacy } +# } +# flag:martial = { +# 1030_duel_effect = { SKILL = martial } +# } +# flag:stewardship = { +# 1030_duel_effect = { SKILL = stewardship } +# } +# flag:intrigue = { +# 1030_duel_effect = { SKILL = intrigue } +# } +# flag:learning = { +# 1030_duel_effect = { SKILL = learning } +# } +# } +# ai_chance = { +# base = 10 +# modifier = { +# scope:target_skill_flag = flag:diplomacy +# diplomacy > scope:target_skill +# add = 20 +# } +# modifier = { +# scope:target_skill_flag = flag:martial +# martial > scope:target_skill +# add = 20 +# } +# modifier = { +# scope:target_skill_flag = flag:stewardship +# stewardship > scope:target_skill +# add = 20 +# } +# modifier = { +# scope:target_skill_flag = flag:intrigue +# intrigue > scope:target_skill +# add = 20 +# } +# modifier = { +# scope:target_skill_flag = flag:learning +# learning > scope:target_skill +# add = 20 +# } +# } +# } +# #Pay some resource for a guaranteed outcome +# option = { +# name = gdp_guelph_ghibelline_scheme.1030.c +# remove_short_term_gold = minor_gold_value +# scope:scheme = { +# add_scheme_modifier = { type = scheme_rumor_mill_modifier } +# } +# ai_chance = { +# base = 20 +# modifier = { +# short_term_gold <= minor_gold_value +# factor = 0 +# } +# } +# } +# #I'm good +# option = { +# name = gdp_guelph_ghibelline_scheme.1030.d +# ai_chance = { +# base = 15 +# } +# } +#} diff --git a/events/dlc/gdp/gdp_incite_unrest_scheme_events.txt b/events/dlc/gdp/gdp_incite_unrest_scheme_events.txt new file mode 100644 index 000000000..72b2ffd72 --- /dev/null +++ b/events/dlc/gdp/gdp_incite_unrest_scheme_events.txt @@ -0,0 +1,178 @@ +################################################## +# Events for the Republic Incite Unrest scheme +################################################## +namespace = gdp_incite_unrest_scheme_event + +### Outcome events + +# Success : unrest spreads in the liege's capital +gdp_incite_unrest_scheme_event.0001 = { + hidden = yes + + immediate = { + if = { + limit = { + scope:target = { is_alive = yes } + scope:owner = { is_alive = yes } + } + scope:target = { gdp_incite_unrest_apply_effect = yes } + scope:owner = { + trigger_event = { id = gdp_incite_unrest_scheme_event.0005 } + } + scope:scheme = { + every_scheme_agent_character = { + limit = { is_ai = no } + trigger_event = { id = gdp_incite_unrest_scheme_event.0005 } + } + end_scheme = yes + } + scope:target = { + trigger_event = { id = gdp_incite_unrest_scheme_event.0006 } + } + } + } +} + +# Failure : scheme fizzles, no lasting effect +gdp_incite_unrest_scheme_event.0002 = { + hidden = yes + + immediate = { + if = { + limit = { scope:owner = { is_alive = yes } } + scope:owner = { + send_interface_message = { + type = gdp_incite_unrest_scheme_failure_message + title = gdp_incite_unrest_scheme_failure_t + left_icon = scope:target + custom_tooltip = gdp_incite_unrest_scheme_failure_desc + } + } + } + } +} + +# Discovered : scheme exposed; schemer loses candidacy standing and house rating +gdp_incite_unrest_scheme_event.0003 = { + hidden = yes + + immediate = { + if = { + limit = { scope:owner = { is_alive = yes } } + scope:owner = { + # Immediate candidacy hit + liege = { + primary_title = { + if = { + limit = { has_order_of_succession = appointment } + change_appointment_investment = { + target = scope:owner + value = { + value = appointment_score_major_value + multiply = -1 + } + } + } + } + } + # 10-year house disgrace modifier + add_character_modifier = { + modifier = gdp_caught_inciting_unrest_modifier + years = 10 + } + send_interface_message = { + type = gdp_incite_unrest_scheme_discovered_message + title = gdp_incite_unrest_scheme_discovered_t + left_icon = scope:target + + show_as_tooltip = { + liege = { + primary_title = { + if = { + limit = { has_order_of_succession = appointment } + change_appointment_investment = { + target = scope:owner + value = { + value = appointment_score_major_value + multiply = -1 + } + } + } + } + } + add_character_modifier = { + modifier = gdp_caught_inciting_unrest_modifier + years = 10 + } + } + } + } + } + } +} + +# Resolution : rolled when the player chooses to execute from the scheme prep popup +gdp_incite_unrest_scheme_event.0004 = { + hidden = yes + + immediate = { + random = { + chance = scope:scheme.scheme_success_chance + save_scope_value_as = { + name = scheme_successful + value = yes + } + } + scope:owner = { + if = { + limit = { exists = scope:scheme_successful } + trigger_event = { on_action = gdp_incite_unrest_scheme_success } + } + else = { + trigger_event = { on_action = gdp_incite_unrest_scheme_failure } + } + } + } +} + +# Success : notification to player agents who participated +gdp_incite_unrest_scheme_event.0005 = { + type = character_event + title = gdp_incite_unrest_scheme_success_t + desc = gdp_incite_unrest_scheme_event.0005.desc + theme = intrigue + left_portrait = { + character = scope:owner + animation = scheme + } + right_portrait = { + character = scope:target + animation = worry + } + + option = { + name = gdp_incite_unrest_scheme_event.0005.a + show_as_tooltip = { + scope:target = { gdp_incite_unrest_apply_effect = yes } + } + } +} + +# Success : notification to the liege whose capital suffers unrest +gdp_incite_unrest_scheme_event.0006 = { + type = character_event + title = gdp_incite_unrest_scheme_success_liege_t + desc = gdp_incite_unrest_scheme_event.0006.desc + theme = intrigue + left_portrait = { + character = root + animation = worry + } + + option = { + name = gdp_incite_unrest_scheme_event.0006.a + show_as_tooltip = { + gdp_incite_unrest_apply_effect = yes + } + } +} diff --git a/events/dlc/gdp/gdp_merchant_activity_events.txt b/events/dlc/gdp/gdp_merchant_activity_events.txt new file mode 100644 index 000000000..d4b90f44b --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_activity_events.txt @@ -0,0 +1,1580 @@ +namespace = gdp_merchant_activity_events + +################################################################################### +## By Axel Näslund +## gdp_merchant_activity_events.0001 - Activity host has skimped on food options +## gdp_merchant_activity_events.0005 - Host wants to hear about your exotic domicile artifact +## gdp_merchant_activity_events.0010 - Gift-giving war with other merchant family +## gdp_merchant_activity_events.0015 - Peasants outside of the activity are hungry +## gdp_merchant_activity_events.0020 - Host boasts counterfeit artifact +## gdp_merchant_activity_events.0025 - Swap tales of luxury contracts with another merchant +################################################################################### + + +# Activity host has skimped on food options +gdp_merchant_activity_events.0001 = { + type = activity_event + title = gdp_merchant_activity_events.0001.t + desc = { + desc = gdp_merchant_activity_events.0001.desc + first_valid = { + triggered_desc = { + trigger = { scope:activity.activity_host = root } + desc = gdp_merchant_activity_events.0001.host + } + desc = gdp_merchant_activity_events.0001.guest + } + } + + theme = feast_activity + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left_crowning_observation + } + right_portrait = { + character = scope:guest + animation = eyeroll + } + lower_right_portrait = { + character = scope:host + trigger = { + NOT = { this = root } + } + } + + cooldown = { years = 1 } + + trigger = { + government_has_flag = government_is_merchant + scope:activity = { + OR = { + has_activity_option = { + category = feast_option_food + option = feast_food_bad + } + has_activity_option = { + category = feast_option_food + option = feast_food_normal + } + has_activity_option = { + category = feast_option_courses + option = feast_courses_bad + } + has_activity_option = { + category = feast_option_courses + option = feast_courses_normal + } + } + any_attending_character = { + this != root + this != scope:host + house != root.house + NOT = { liege = root } + } + } + } + + immediate = { + scope:activity = { + activity_host = { save_scope_as = host } + random_attending_character = { + limit = { + this != root + this != scope:host + house != root.house + NOT = { liege = root } + } + weight = { + base = 1 + modifier = { + is_ruler = yes + add = 1 + } + } + save_scope_as = guest + } + } + scope:guest = { assign_quirk_effect = yes } + } + + option = { # I will donate from the goodness of my heart + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { this = scope:host } + desc = gdp_merchant_activity_events.0001.a.host + } + desc = gdp_merchant_activity_events.0001.a + } + } + } + trigger = { short_term_gold >= massive_gold_value } + show_as_unavailable = { short_term_gold < massive_gold_value } + if = { + limit = { this = scope:host } + remove_short_term_gold = medium_gold_value + } + else = { remove_short_term_gold = massive_gold_value } + add_prestige = medium_prestige_gain + if = { + limit = { + NOT = { this = scope:host } + } + reverse_add_opinion = { + modifier = kindness_opinion + target = scope:host + opinion = 30 + } + } + else = { + scope:activity = { + every_attending_character = { + limit = { this != root } + custom = every_guest_scope_tt + add_opinion = { + target = root + modifier = respect_opinion + opinion = 10 + } + } + } + } + stress_and_fulfillment_impact = { + fickle = minor_stress_impact_loss + generous = minor_stress_impact_loss + compassionate = minor_stress_impact_loss + greedy = medium_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + add = 25 + OR = { + has_trait = generous + has_trait = compassionate + } + } + modifier = { + OR = { + has_trait = greedy + short_term_gold < monumental_gold_value + } + factor = 0 + } + } + } + + option = { # I will donate... for a hook + name = gdp_merchant_activity_events.0001.b + trigger = { + NOR = { + this = scope:host + has_hook_of_type = { + target = scope:host + type = strong_indebted_hook + } + } + short_term_gold >= medium_gold_value + can_add_hook = { + target = scope:host + type = indebted_hook + } + } + show_as_unavailable = { + NOT = { + this = scope:host + short_term_gold < medium_gold_value + can_add_hook = { + target = scope:host + type = indebted_hook + } + } + } + remove_short_term_gold = medium_gold_value + add_hook = { + target = scope:host + type = indebted_hook + } + stress_and_fulfillment_impact = { + honest = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_honor = -1 + ai_boldness = 1 + } + modifier = { + add = 75 + has_trait = ambitious + } + modifier = { + OR = { + has_trait = honest + short_term_gold < massive_gold_value + } + factor = 0 + } + } + } + + option = { #I am an luxury merchant! + name = gdp_merchant_activity_events.0001.e + trigger = { + this = scope:host + government_has_flag = government_is_merchant + custom_tooltip = { + text = trade_category_comforts_trade_route_trigger + any_trade_route_and_market_with_goods_category_produced_trigger = { CATEGORY = comforts } + } + } + reason = have_comforts_route + show_as_unavailable = { government_has_flag = government_is_merchant } + save_random_trade_route_and_market_with_goods_category_produced_effect = { CATEGORY = comforts } + scope:goods_market ?= { + add_trade_market_modifier = { + modifier = activity_used_trade_market_comforts_modifier + years = 10 + } + } + add_prestige = medium_prestige_gain + reverse_add_opinion = { + target = scope:guest + modifier = impressed_opinion + opinion = 20 + } + ai_chance = { + base = 50 + modifier = { + add = 50 + has_trait = ambitious + } + } + } + + option = { # Out out + name = gdp_merchant_activity_events.0001.d + trigger = { + this = scope:host + NOT = { scope:activity.special_guest:honorary_guest ?= scope:guest } + } + add_prestige = { + value = miniscule_prestige_gain + multiply = scope:guest.highest_held_title_tier + min = miniscule_prestige_gain + } + scope:guest = { + remove_from_activity = scope:activity + if = { + limit = { + can_set_relation_rival_trigger = { CHARACTER = scope:host } + } + progress_towards_rival_effect = { + REASON = rival_feast_thrown_out + CHARACTER = scope:host + OPINION = default_rival_opinion + } + } + else = { + add_opinion = { + target = scope:host + modifier = insult_opinion + opinion = -25 + } + } + house = { + change_house_relation_effect = { + HOUSE = scope:host.house + VALUE = house_relation_damage_minor_value + REASON = feast_decrease + CHAR = scope:host + TARGET_CHAR = scope:guest + TITLE = scope:dummy_gender + } + } + } + stress_and_fulfillment_impact = { + forgiving = minor_stress_impact_gain + craven = minor_stress_impact_gain + humble = minor_stress_impact_gain + calm = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1 + } + opinion_modifier = { + opinion_target = scope:guest + multiplier = -1 + } + } + } + + option = { # Be thankful you dolt + name = gdp_merchant_activity_events.0001.c + if = { + limit = { this = scope:host } + reverse_add_opinion = { + modifier = annoyed_opinion + target = scope:guest + opinion = -10 + } + } + else = { + reverse_add_opinion = { + modifier = kindness_opinion + target = scope:host + opinion = 5 + } + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = -1 + } + } + } +} + +# Host wants to hear about your exotic domicile artifact +gdp_merchant_activity_events.0005 = { + type = activity_event + title = gdp_merchant_activity_events.0005.t + desc = { + desc = gdp_merchant_activity_events.0005.desc + first_valid = { + triggered_desc = { + trigger = { + OR = { + prestige_level >= 3 + scope:admirer = { + opinion = { + target = root + value >= 50 + } + } + has_relation_friend = scope:admirer + } + } + desc = gdp_merchant_activity_events.0005.desc_esteemed + } + desc = gdp_merchant_activity_events.0005.desc_fallback + } + desc = gdp_merchant_activity_events.0005.desc_outro + } + + theme = feast_activity + override_background = { reference = courtyard } + + left_portrait = { + character = root + triggered_animation = { + trigger = { + NOT = { has_trait = arrogant } + OR = { + prestige_level >= 3 + scope:admirer = { + opinion = { + target = root + value >= 50 + } + } + has_relation_friend = scope:admirer + } + } + animation = admiration + } + animation = war_over_win + } + + center_portrait = { + character = scope:guest + animation = interested_left + camera = camera_event_center_pointing_forward_fov35 + } + + right_portrait = { + character = scope:admirer + animation = storyteller + } + + artifact = { + target = scope:luxury_artifact + position = lower_center_portrait + } + + # Fairly rare + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_merchant + any_character_artifact = { + NOT = { + has_variable = used_in_activity_event + } + OR = { + artifact_slot_type = library + artifact_slot_type = creature + artifact_slot_type = curio + } + } + scope:activity = { + any_attending_character = { + count >= 2 + NOT = { this = root } + } + } + } + + immediate = { + scope:activity = { + random_attending_character = { + limit = { + this = scope:activity.activity_host + this != root + } + alternative_limit = { this != root } + weight = { # Fetch relevant guest character + base = 1 + is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root } + is_of_major_interest_to_weight_up_modifier = { CHARACTER = root } + } + save_scope_as = admirer + } + random_attending_character = { + limit = { + this != root + this != scope:admirer + } + weight = { # Fetch relevant guest character + base = 1 + is_of_minor_interest_to_weight_up_modifier = { CHARACTER = scope:host } + is_of_major_interest_to_weight_up_modifier = { CHARACTER = scope:host } + } + save_scope_as = guest + } + } + random_character_artifact = { + limit = { + OR = { + artifact_slot_type = library + artifact_slot_type = creature + artifact_slot_type = curio + } + } + weight = { # Fetch relevant artifact + base = 1 + # Rare is better + modifier = { + add = 5 + OR = { + rarity = illustrious + rarity = famed + rarity = masterwork + } + } + # Creatures are always more prestigious + modifier = { + add = 10 + artifact_slot_type = creature + } + } + save_scope_as = luxury_artifact + set_variable = used_in_activity_event + } + } + + option = { # Imma blow your minds, lyrical-style + name = gdp_merchant_activity_events.0005.c + trigger = { has_trait = lifestyle_poet } + show_as_unavailable = { always = yes } + trait = lifestyle_poet + add_internal_flag = special + add_prestige = medium_prestige_gain + add_trait_xp = { + trait = lifestyle_poet + value = { 5 10 } + } + reverse_add_opinion = { + modifier = pleased_opinion + target = scope:admirer + opinion = 15 + } + ai_chance = { + # Special option - should always be taken + base = 1000 + } + } + + option = { # I can't believe I made it out alive! + name = gdp_merchant_activity_events.0005.b + duel = { + skill = intrigue + target = scope:admirer + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_activity_events.0005.b.success + send_interface_toast = { + title = gdp_merchant_activity_events.0005.b.success + left_icon = scope:admirer + add_prestige = medium_prestige_gain + reverse_add_opinion = { + modifier = pleased_opinion + target = scope:admirer + opinion = 15 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_activity_events.0005.b.failure + send_interface_toast = { + title = gdp_merchant_activity_events.0005.b.failure + left_icon = scope:admirer + stress_and_fulfillment_impact = { + base = medium_stress_impact_gain + } + } + } + } + stress_and_fulfillment_impact = { + honest = medium_stress_impact_gain + humble = medium_stress_impact_gain + shy = medium_stress_impact_gain + deceitful = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 1 + } + modifier = { + intrigue >= good_skill_level + add = 20 + } + modifier = { + stress_level > 1 + factor = 0 + } + } + } + + option = { # It was nothing, really + name = gdp_merchant_activity_events.0005.a + add_prestige = minor_prestige_gain + reverse_add_opinion = { + modifier = irritated_opinion + target = scope:admirer + opinion = -10 + } + stress_and_fulfillment_impact = { + arrogant = medium_stress_impact_gain + gregarious = medium_stress_impact_gain + humble = minor_stress_impact_loss + shy = minor_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = -1 + } + } + } + + option = { # What about my trade market tho + name = gdp_merchant_activity_events.0005.d + add_character_modifier = { + modifier = gdp_boasted_market_competence_modifier + years = 5 + } + reverse_add_opinion = { + modifier = irritated_opinion + target = scope:admirer + opinion = -10 + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1 + } + } + } +} + +# Gift-giving war with other merchant family +gdp_merchant_activity_events.0010 = { + type = activity_event + title = gdp_merchant_activity_events.0010.t + desc = gdp_merchant_activity_events.0010.desc + theme = feast_activity + left_portrait = { + character = root + animation = dismissal + } + right_portrait = { + character = scope:receiver + animation = interested_left + } + center_portrait = { + character = scope:merchant + animation = steward + } + + cooldown = { years = 1 } + + trigger = { + government_has_flag = government_is_merchant + scope:activity = { + any_attending_character = { + this != root + this != scope:host + exists = house + house = { this != root.house } + government_has_flag = government_is_merchant + exists = domicile + any_trade_route = { count >= 1 } + } + } + } + + immediate = { + scope:activity = { + activity_host = { save_scope_as = host } + random_attending_character = { + limit = { + this != root + this != scope:host + exists = house + house = { this != root.house } + government_has_flag = government_is_merchant + any_trade_route = { count >= 1 } + } + save_scope_as = merchant + } + if = { + limit = { root != scope:host } + scope:host = { save_scope_as = receiver } + } + else = { + random_attending_character = { + limit = { + this != root + this != scope:merchant + root.suzerain ?= this + } + alternative_limit = { + this != root + this != scope:merchant + is_landed = yes + } + alternative_limit = { + this != root + this != scope:merchant + is_ruler = yes + } + alternative_limit = { + this != root + this != scope:merchant + } + weight = { + base = 1 + modifier = { add = highest_held_title_tier } + } + save_scope_as = receiver + } + + } + } + scope:merchant = { + random_trade_route = { + random_traded_good = { save_scope_as = good } + } + add_character_flag = { + flag = gdp_merchant_activity_events.0010_cooldown + years = 1 + } + } + } + + option = { # Out-gift them + name = gdp_merchant_activity_events.0010.a + trigger = { short_term_gold >= scope:merchant.massive_gold_value } + show_as_unavailable = { always = yes } + remove_short_term_gold = scope:merchant.massive_gold_value + add_prestige = medium_prestige_gain + reverse_add_opinion = { + modifier = insulted_opinion + target = scope:merchant + opinion = -15 + } + reverse_add_opinion = { + modifier = kindness_opinion + target = scope:receiver + opinion = 15 + } + house ?= { + if = { + limit = { + NOT = { has_house_relation_with = scope:merchant.house } + } + scope:merchant = { save_scope_as = char } + root = { save_scope_as = target_char } + set_house_relation = { + target = scope:merchant.house + level = quarrel + description = house_relation_reason_feast_decrease_desc + } + } + else = { + change_house_relation_effect = { + HOUSE = scope:merchant.house + VALUE = house_relation_damage_minor_value + REASON = feast_decrease + CHAR = scope:merchant + TARGET_CHAR = root + TITLE = scope:dummy_gender + } + } + } + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + greedy = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = -1 + ai_boldness = 1 + } + modifier = { + add = 25 + has_trait = generous + } + modifier = { + OR = { + has_trait = greedy + short_term_gold < scope:merchant.monumental_gold_value + } + factor = 0 + } + } + } + + option = { # Schmooze + name = gdp_merchant_activity_events.0010.d + trigger = { has_activity_intent = schmooze_intent } + duel = { + skill = diplomacy + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_activity_events.0010.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_activity_events.0010.b.success + left_icon = scope:merchant + right_icon = scope:receiver + gdp_log_schmooze_successful_effect = { + CHAR = root + TARGET = scope:receiver + MARKET = scope:province.barony.trade_market + } + scope:activity = { + every_attending_character = { + limit = { + this != scope:host + this != scope:receiver + this != root + is_alive = yes + has_no_particular_noble_roots_trigger = no + } + custom = custom.every_attending_noble + add_opinion = { + modifier = pleased_opinion + target = root + opinion = 5 + } + } + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_activity_events.0010.b.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_activity_events.0010.b.failure + left_icon = scope:merchant + right_icon = scope:receiver + add_prestige = medium_prestige_loss + reverse_add_opinion = { + modifier = contempt_opinion + target = scope:receiver + opinion = -10 + } + } + } + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_rationality = 0.5 + ai_sociability = 0.5 + } + modifier = { + has_trait = shrewd + add = 10 + } + modifier = { + has_trait = humble + add = 10 + } + } + } + + option = { # Compliment the gift + name = gdp_merchant_activity_events.0010.b + reverse_add_opinion = { + modifier = grateful_opinion + target = scope:merchant + opinion = 15 + } + house ?= { + if = { + limit = { + NOT = { has_house_relation_with = scope:merchant.house } + } + scope:merchant = { save_scope_as = char } + root = { save_scope_as = target_char } + set_house_relation = { + target = scope:merchant.house + level = cordial + description = house_relation_reason_feast_increase_desc + } + } + else = { + change_house_relation_effect = { + HOUSE = scope:merchant.house + VALUE = house_relation_improve_minor_value + REASON = feast_increase + CHAR = scope:merchant + TARGET_CHAR = root + TITLE = scope:dummy_gender + } + } + } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_loss + arrogant = medium_stress_impact_gain + ambitious = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 1 + } + modifier = { + has_trait = compassionate + add = 20 + } + modifier = { + has_trait = arrogant + factor = 0 + } + } + } + + option = { # Opt out + name = gdp_merchant_activity_events.0010.c + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + shy = minor_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = -1 + } + } + } +} + +# Peasants outside the activity are hungry +gdp_merchant_activity_events.0015 = { + type = activity_event + title = gdp_merchant_activity_events.0015.t + desc = gdp_merchant_activity_events.0015.desc + + theme = feast_activity + override_background = { reference = alley_night } + + left_portrait = { + character = root + animation = pondering + } + + center_portrait = { + character = scope:peasant_2 + animation = holding_crutch + hide_info = yes + camera = camera_event_center_pointing_left + } + + right_portrait = { + character = scope:peasant + animation = beg + hide_info = yes + } + + lower_right_portrait = { + character = scope:host + trigger = { NOT = { this = root } } + } + + cooldown = { years = 1 } + + trigger = { government_has_flag = government_is_merchant } + + immediate = { + scope:activity.activity_host = { save_scope_as = host } + # Create some scene-setting characters + create_character = { + template = tournament_locale_character + dynasty = none + location = scope:activity.activity_location + save_scope_as = peasant + after_creation = { add_character_flag = peasant_outfit } + } + create_character = { + template = tournament_locale_character + age = { 50 55 } + dynasty = none + location = scope:activity.activity_location + save_scope_as = peasant_2 + after_creation = { add_character_flag = peasant_outfit } + } + } + + option = { # Great PR opportunity + name = gdp_merchant_activity_events.0015.a + trigger = { short_term_gold >= massive_gold_value } + show_as_unavailable = { always = yes } + remove_short_term_gold = massive_gold_value + add_prestige = medium_prestige_gain + scope:activity.activity_location.county = { add_popular_opinion = 10 } + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + compassionate = minor_stress_impact_loss + greedy = medium_stress_impact_gain + arrogant = minor_stress_impact_gain + callous = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + add = 25 + OR = { + has_trait = generous + has_trait = compassionate + } + } + modifier = { + OR = { + has_trait = greedy + has_trait = arrogant + has_trait = callous + short_term_gold < monumental_gold_value + } + factor = 0 + } + } + } + + option = { # I'm more interested in making friends over here + name = { + text = { + random_valid = { + triggered_desc = { + trigger = { + OR = { + has_trait = drunkard + drinks_alcohol_trigger = yes + } + } + desc = gdp_merchant_activity_events.0015.b.alcohol + } + desc = gdp_merchant_activity_events.0015.b + } + } + } + trigger = { has_activity_intent = schmooze_intent } + flavor = available_because_of_intent + remove_short_term_gold = minor_gold_value + gdp_log_schmooze_successful_empty_effect = { + CHAR = root + MARKET = scope:province.barony.trade_market + } + scope:activity = { + every_attending_character = { + limit = { + this != scope:host + this != root + has_no_particular_noble_roots_trigger = no + } + custom = custom.every_attending_noble + add_opinion = { + modifier = pleased_opinion + target = root + opinion = 5 + } + } + } + if = { + limit = { + can_set_relation_friend_trigger = { CHARACTER = scope:host } + } + progress_towards_friend_effect = { + REASON = friend_feast_talking_and_laughing + CHARACTER = scope:host + OPINION = default_friend_opinion + } + } + stress_and_fulfillment_impact = { + shy = medium_stress_impact_gain + craven = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 1 + ai_boldness = 1 + } + modifier = { + has_trait = shy + factor = 0 + } + } + } + + option = { # _these_ are my people + name = gdp_merchant_activity_events.0015.c + if = { + limit = { + NOT = { has_trait = lifestyle_merchant } + } + add_trait = lifestyle_merchant + } + else = { + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = 2 + } + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 1 + ai_boldness = -1 + } + } + } + + option = { # away! + name = gdp_merchant_activity_events.0015.d + trigger = { this = scope:host } + add_prestige = miniscule_prestige_gain + scope:activity.activity_location.county = { add_popular_opinion = -10 } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + generous = minor_stress_impact_gain + callous = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = -1 + ai_boldness = 1 + } + } + } + after = { + # Event cleanup + scope:peasant = { silent_disappearance_effect = yes } + scope:peasant_2 = { silent_disappearance_effect = yes } + } +} + +# Someone boasts counterfeit artifact +gdp_merchant_activity_events.0020 = { + type = activity_event + title = gdp_merchant_activity_events.0020.t + desc = gdp_merchant_activity_events.0020.desc + theme = feast_activity + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:other + animation = admiration + } + artifact = { + target = scope:fake_artifact + position = lower_center_portrait + } + cooldown = { years = 1 } + + trigger = { + government_has_flag = government_is_merchant + has_realm_law = company_purpose_artisan + scope:activity = { + trigger_if = { + limit = { + NOT = { activity_host = root } + } + any_attending_character = { + NOT = { this = root } + is_ruler = yes + } + } + } + } + + immediate = { + if = { + limit = { + NOT = { this = scope:activity.activity_host } + } + scope:activity.activity_host = { save_scope_as = other } + } + else = { + scope:activity = { + random_attending_character = { + limit = { + NOT = { this = root } + is_ruler = yes + } + save_scope_as = other + } + } + } + scope:other = { assign_quirk_effect = yes } + + # First we generate some far-off merchant who created the artifact + random_empire = { + limit = { + any_de_jure_county = { culture != root.culture } + } + random_de_jure_county = { + limit = { culture != root.culture } + save_scope_as = foreign_trader_home + } + } + create_character = { + template = generic_peasant_character + location = root.location + dynasty = none + culture = scope:foreign_trader_home.culture + faith = scope:foreign_trader_home.faith + save_scope_as = foreigner + } + scope:host = { + hidden_effect = { + create_artifact = { + name = fake_artifact_name + description = fake_artifact_desc + modifier = artifact_attraction_opinion_1_modifier + creator = scope:foreigner + type = miscellaneous + visuals = necklace + save_scope_as = fake_artifact + } + } + } + } + + option = { # Publicly expose the counterfeit artifact + name = gdp_merchant_activity_events.0020.a + add_prestige = medium_prestige_gain + if = { + limit = { + can_set_relation_rival_trigger = { CHARACTER = scope:other } + } + scope:other = { + progress_towards_rival_effect = { + REASON = rival_public_embarrasment + CHARACTER = root + OPINION = default_rival_opinion + } + } + } + else = { + reverse_add_opinion = { + target = scope:other + modifier = annoyed_opinion + opinion = -15 + } + } + stress_and_fulfillment_impact = { + shy = medium_stress_impact_gain + compassionate = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1 + ai_sociability = -1 + } + modifier = { # There's already bad blood + add = 20 + scope:other = { + opinion = { + target = root + value <= -50 + } + } + } + modifier = { # Relationship is good + add = -50 + has_relation_friend = scope:other + } + modifier = { # Shy or compassionate characters would never + OR = { + has_trait = shy + has_trait = compassionate + } + factor = 0 + } + } + } + + option = { # Let me... handle that for you. + name = gdp_merchant_activity_events.0020.b + send_interface_toast = { + title = gdp_merchant_activity_events.0020.b.equipped_tt + left_icon = root + right_icon = scope:fake_artifact + scope:fake_artifact = { + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 1 + } + set_owner = { + target = root + history = { + location = scope:activity.activity_location + actor = scope:other + recipient = root + type = given + } + } + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + + } + ai_chance = { + base = 100 + ai_value_modifier = { + # Greedy chars always want more + ai_greed = 1 + ai_sociability = 1 + } + } + } + + option = { # Very impressive! + name = gdp_merchant_activity_events.0020.c + reverse_add_opinion = { + target = scope:other + modifier = pleased_opinion + opinion = 10 + } + stress_and_fulfillment_impact = { + loyal = minor_stress_impact_loss + content = minor_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = -1 + } + modifier = { + add = 20 + OR = { + has_trait = loyal + has_trait = content + } + } + } + } + + after = { + # Event cleanup + scope:foreigner = { silent_disappearance_effect = yes } + hidden_effect = { + if = { + limit = { + NOT = { + any_character_artifact = { this = scope:fake_artifact } + } + } + destroy_artifact = scope:fake_artifact + } + } + } +} + +scripted_trigger gdp_merchant_activity_events_0025_artifact_trigger = { + OR = { + artifact_slot_type = curio + artifact_slot_type = library + AND = { + artifact_slot_type = creature + var:animal_type ?= { + OR = { + this = flag:parrot + this = flag:cockatoo + this = flag:monkey + } + } + } + } +} + +# Swap tales of luxury contracts with another merchant +gdp_merchant_activity_events.0025 = { + type = activity_event + title = gdp_merchant_activity_events.0025.t + desc = { + desc = gdp_merchant_activity_events.0025.desc + first_valid = { + triggered_desc = { + trigger = { + scope:luxury_artifact = { var:animal_type = flag:monkey } + } + desc = gdp_merchant_activity_events.0025.desc_ape + } + desc = gdp_merchant_activity_events.0025.desc_bird + } + desc = gdp_merchant_activity_events.0025.desc_cont + } + theme = feast_activity + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:merchant + animation = storyteller + } + artifact = { + target = scope:luxury_artifact + position = lower_center_portrait + } + + # We don't want to spawn too many luxury contracts + cooldown = { years = 20 } + + trigger = { + government_has_flag = government_is_merchant + can_create_task_contract = { type_name = menagerie_acquisition } + scope:activity = { + any_attending_character = { + NOT = { has_character_flag = gdp_merchant_activity_events.0010_cooldown } + this != root + house ?= { this != root.house } + government_has_flag = government_is_merchant + any_character_artifact = { gdp_merchant_activity_events_0025_artifact_trigger = yes } + } + } + } + + immediate = { + scope:activity = { + random_attending_character = { + limit = { + NOT = { has_character_flag = gdp_merchant_activity_events.0010_cooldown } + this != root + house ?= { this != root.house } + government_has_flag = government_is_merchant + any_character_artifact = { gdp_merchant_activity_events_0025_artifact_trigger = yes } + } + save_scope_as = merchant + } + scope:merchant = { + assign_quirk_effect = yes + random_artifact = { + limit = { gdp_merchant_activity_events_0025_artifact_trigger = yes } + save_scope_as = luxury_artifact + } + } + } + } + + option = { # You have the caravaneer company purpose + name = gdp_merchant_activity_events.0025.a + trigger = { has_realm_law = company_purpose_caravaneer } + reason = purpose_caravaneer + add_internal_flag = special + scope:luxury_artifact = { + switch = { + trigger = artifact_slot_type + creature = { + root = { + trigger_event = { on_action = gdp_menagerie_acquisition } + custom_tooltip = gdp_merchant_activity_events.0025.tt.menagerie + } + } + fallback = { + root = { + trigger_event = { on_action = gdp_find_curio } + custom_tooltip = gdp_merchant_activity_events.0025.tt.curio + } + } + } + } + ai_chance = { # Special option should always be picked + base = 1000 + } + } + + option = { # Fallback duel + name = gdp_merchant_activity_events.0025.b + trigger = { + NOT = { has_realm_law = company_purpose_caravaneer } + } + duel = { + skill = diplomacy + target = scope:merchant + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_activity_events.0025.b.success + send_interface_toast = { + title = gdp_merchant_activity_events.0025.b.success + left_icon = scope:merchant + scope:luxury_artifact = { + switch = { + trigger = artifact_slot_type + creature = { + root = { + trigger_event = { on_action = gdp_menagerie_acquisition } + custom_tooltip = gdp_merchant_activity_events.0025.tt.menagerie + } + } + fallback = { + root = { + trigger_event = { on_action = gdp_find_curio } + custom_tooltip = gdp_merchant_activity_events.0025.tt.curio + } + } + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_activity_events.0025.b.failure + send_interface_toast = { + title = gdp_merchant_activity_events.0025.b.failure + left_icon = scope:merchant + stress_and_fulfillment_impact = { + base = medium_stress_impact_gain + } + } + } + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 1 + ai_boldness = 1 + } + modifier = { + diplomacy >= good_skill_level + add = 20 + } + modifier = { + stress_level > 1 + factor = 0 + } + } + } + + option = { # Tell me more about this place! + name = gdp_merchant_activity_events.0025.c + if = { + limit = { + NOT = { + has_trait = lifestyle_traveler + } + } + add_trait = lifestyle_traveler + } + add_trait_xp = { + trait = lifestyle_traveler + track = travel + value = 5 + } + stress_and_fulfillment_impact = { + content = minor_stress_impact_loss + lazy = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + OR = { + has_trait = content + has_trait = lazy + } + add = 25 + } + } + } +} diff --git a/events/dlc/gdp/gdp_merchant_events.txt b/events/dlc/gdp/gdp_merchant_events.txt new file mode 100644 index 000000000..67f69b160 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_events.txt @@ -0,0 +1,9503 @@ +namespace = gdp_merchant + +#### +## Systemic/player onboarding events +# gdp_merchant.0001-0003 - Become Merchant - Voluntary +# gdp_merchant.0010 - Associate asks to be adopted +# gdp_merchant.0015 - No Trader chosen on Trade Route created +# gdp_merchant.0060-0061 - Stressed trader asks to be recalled +# gdp_merchant.0020 - Associates struggle for empty/ineffectual Partner position +# gdp_merchant.0025 - Artisan Purpose Recruitment Opportunity +# gdp_merchant.0030 - Creditor Purpose Recruitment Opportunity +# gdp_merchant.0035 - Caravaneer Purpose Recruitment Opportunity +# gdp_merchant.0101-0103 - Purchase Land - Merchant +# gdp_merchant.0110-0111 - Merge Company interaction outcome letters +# gdp_merchant.1001-1002 - Generating starting courtiers for player and AI characters +# gdp_merchant.1003 - Select a starting company focus. +# gdp_merchant.1004 - Generating starting courtiers for player patricians +# gdp_merchant.1200-1201 - Associate requests +## Monopoly and Charter events +# gdp_merchant.2000 - Bare Market +# gdp_merchant.2010 - Monopoly: The Craftsman +# gdp_merchant.2015 - The Price of X +# gdp_merchant.2020 - A Seat at the Table +# gdp_merchant.2025 - The Lesser Merchant +# gdp_merchant.3000-3100 - Court position boons +# gdp_merchant.4000 - 4100 - Silk Road Merchant events +### Usury Events +# gdp_merchant.5000-5040 - Disguised Usury handling and events +# gdp_merchant.8001-8100 - Merchant company capstones +# gdp_merchant.9005 - Merchant Eviction Event + +# Become Merchant - Voluntary +gdp_merchant.0001 = { + type = character_event + window = fullscreen_event + queue_icon = "gfx/interface/icons/splash_icons/splash_merchant.dds" + title = gdp_merchant.0001.t + desc = { + desc = gdp_merchant.0001.desc + first_valid = { + triggered_desc = { + trigger = { + exists = scope:laamp_heir + scope:old_primary_title ?= { holder ?= scope:laamp_inheritor } + } + desc = gdp_merchant.0001.heir + } + triggered_desc = { + trigger = { + exists = scope:laamp_liege + scope:old_primary_title ?= { holder ?= scope:laamp_inheritor } + } + desc = gdp_merchant.0001.liege + } + triggered_desc = { + trigger = { scope:old_primary_title ?= { holder ?= scope:laamp_inheritor } } + desc = gdp_merchant.0001.new + } + } + } + theme = realm + left_portrait = { + character = root + animation = steward + } + lower_right_portrait = { + character = scope:laamp_inheritor + trigger = { exists = scope:laamp_inheritor } + } + override_background = { reference = gdp_fullscreen_merchant_positive } + cooldown = { days = 5 } + + trigger = { + OR = { + exists = scope:laamp_inheritor + government_has_flag = government_is_landless_adventurer + } + } + + immediate = { + if = { + limit = { exists = scope:laamp_inheritor } + scope:laamp_inheritor = { save_scope_as = become_merchant_flavor_char } + } + else = { save_scope_as = become_merchant_flavor_char } + # Create Merchant + create_merchant_title_effect = { + REASON = flag:voluntary + FLAVOR_CHAR = scope:become_merchant_flavor_char + } + scope:laamp_inheritor ?= { + # Tooltip for player + custom_tooltip = become_landless_adventurer_decision_title_scope_tt + # Create a loving family so inheritance isn't so borked + if = { + limit = { has_character_flag = new_laamp_inheritor } + trigger_event = game_rule.1001 + remove_character_flag = new_laamp_inheritor + } + } + save_scope_as = merchant + scope:old_liege ?= { trigger_event = gdp_merchant.0002 } + adventurer_prestige_reset_effect = yes + trigger_event = gdp_merchant.1001 + stress_impact = { + craven = minor_stress_impact_gain + content = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + } + + option = { + name = gdp_merchant.0001.a + add_character_modifier = { + modifier = gdp_voluntary_merchant_modifier + years = 5 + } + } +} + +# Liege event +gdp_merchant.0002 = { + type = letter_event + opening = gdp_merchant.0002.opening + desc = gdp_merchant.0002.desc + sender = scope:merchant + + trigger = { is_ai = no } + + immediate = { + scope:merchant = { create_landless_adventurer_title_tooltip_effect = yes } + } + + option = { + name = gdp_merchant.0002.a + } +} + +# Associate asks to be adopted +gdp_merchant.0010 = { + type = character_event + title = gdp_merchant.0010.t + desc = { + desc = gdp_merchant.0010.desc + first_valid = { + triggered_desc = { + trigger = { + scope:associate = { has_character_flag = generated_starting_character } + } + desc = gdp_merchant.0010.desc.starting + } + desc = gdp_merchant.0010.desc.starting_fallback + } + desc = gdp_merchant.0010.desc.cont + first_valid = { + triggered_desc = { + trigger = { exists = scope:heir } + desc = gdp_merchant.0010.desc.children + } + desc = gdp_merchant.0010.desc.no_children + } + desc = gdp_merchant.0010.desc.outro + } + theme = merchant + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:associate + animation = nervous + } + + cooldown = { years = 100 } + + trigger = { + # Mechanical Player Guidance event + is_ai = no + # Only for merchants + government_has_flag = government_is_merchant + # Relevant conditions + is_adult = yes + NOT = { + any_child = { is_adult = yes } # includes having no children at all + } + any_courtier = { + NOR = { + is_spouse_of = root + is_close_family_of = root + has_trait = adopted_no_inheritance + house ?= root.house + } + } + # Some time should have passed + years_from_game_start >= 2 + } + + weight_multiplier = { + base = 1 + modifier = { # Increase weight as time goes on, per ruler + # If we're in China/Korea, there is Confucian content we want to expedite instead + location = { + NOR = { + geographical_region = world_asia_china + geographical_region = world_asia_korea + } + } + add = { + value = years_as_ruler + multiply = 10 + min = 0 # avoid -1 + } + } + } + + immediate = { + random_courtier = { + limit = { + can_be_child_of = root + NOR = { + is_spouse_of = root + is_close_family_of = root + has_trait = adopted_no_inheritance + house ?= root.house + } + } + alternative_limit = { + age <= root.age + NOR = { + is_spouse_of = root + is_close_family_of = root + has_trait = adopted_no_inheritance + house ?= root.house + } + } + alternative_limit = { + NOR = { + is_spouse_of = root + is_close_family_of = root + has_trait = adopted_no_inheritance + house ?= root.house + } + } + weight = { + base = 1 + modifier = { + factor = 2 + has_character_flag = generated_starting_character + } + } + save_scope_as = associate + } + # Saving any children for loc + if = { + limit = { + any_child = { count >= 1 } + } + primary_heir = { save_scope_as = heir } + } + } + + option = { # MY DAUGHTER/SON + name = gdp_merchant.0010.a + custom_tooltip = merchant_adoption_event_tt + merchant_adopt_effect = { + CHILD = scope:associate + ADOPTER = root + } + create_character_memory = { + type = merchant_family_adopted + participants = { adoptee = scope:associate } + } + scope:new_memory = { + set_variable = { + name = adopted_house + value = root.house + } + } + scope:associate = { + create_character_memory = { + type = was_merchant_family_adopted + participants = { adopter = root } + } + scope:new_memory = { + set_variable = { + name = adopted_house + value = root.house + } + } + } + reverse_add_opinion = { + target = scope:associate + modifier = grateful_opinion + opinion = 30 + } + house = { + add_unity_value = { + value = medium_unity_loss + character = root + desc = merchant_unity_adoption_loss + } + } + stress_impact = { + callous = minor_stress_impact_gain + arrogant = medium_stress_impact_gain + compassionate = medium_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 1 + ai_compassion = 1 + ai_zeal = -1 + } + modifier = { + has_trait = compassionate + add = 20 + } + modifier = { + OR = { + has_trait = callous + has_trait = arrogant + } + factor = 0 + } + } + } + + option = { # Maybe you should do more. + name = gdp_merchant.0010.b + scope:associate = { + add_character_modifier = { + modifier = gdp_driven_by_motivation_modifier + years = 10 + } + } + reverse_add_opinion = { + modifier = irritated_opinion + target = scope:associate + opinion = -10 + } + house = { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_unity_adoption_loss + } + } + stress_impact = { + ambitious = medium_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1 + ai_energy = 1 + } + modifier = { + has_trait = ambitious + add = 50 + } + } + } + + option = { # I'm good + name = gdp_merchant.0010.c + reverse_add_opinion = { + modifier = insulted_opinion + target = scope:associate + opinion = -5 + } + stress_impact = { + content = minor_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = -1 + } + } + } +} + +scripted_effect gdp_merchant_event_0015_appoint_effect = { + $CHOSEN$ = { save_temporary_scope_as = new_trader } + trade_route_trader_opinion_effect = { TRADER = scope:new_trader } + scope:new_trader = { + show_as_tooltip = { + if = { + limit = { + NOT = { has_trait = lifestyle_merchant } + } + add_trait = lifestyle_merchant # actually added by appointment on_action + } + add_trait_xp = { # always rewarded by this event + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_medium_value + } + } + hidden_effect = { + if = { + limit = { has_trait = lifestyle_merchant } # added by appointment on_action, but prevent errors + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_medium_value + } + } + } + } + hidden_effect = { + while = { + count = 3 + trigger_event = { on_action = spawn_trade_opportunity_contract_on_action } + } + } +} + +# No Trader chosen on Trade Route created +gdp_merchant.0015 = { + type = character_event + title = gdp_merchant.0015.t + desc = { + desc = gdp_merchant.0015.desc + first_valid = { + triggered_desc = { + trigger = { + scope:courtier_1 = { sum_of_all_skills_value >= sum_of_all_skills_threshold_good } + } + desc = gdp_merchant.0015.desc_good_intellect + } + triggered_desc = { + trigger = { + scope:courtier_1 = { sum_of_all_skills_value >= sum_of_all_skills_threshold_excellent } + } + desc = gdp_merchant.0015.desc_excellent_intellect + } + desc = gdp_merchant.0015.desc_poor_intellect + } + } + theme = merchant + left_portrait = { + character = root + animation = chancellor + } + right_portrait = { + character = scope:courtier_1 + animation = flirtation + } + lower_left_portrait = scope:courtier_2 + lower_center_portrait = scope:courtier_3 + + trigger = { + # Only players get this event - AI chars automatically assign traders + is_ai = no + is_adult = yes + government_allows = profit_trade_routes + scope:trade_route = { + is_commission_route = no + has_trader = no # stop this firing if you assigned a trader yourself + } + any_courtier = { + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + is_trader = no + trigger_if = { + limit = { + root = { government_has_flag = government_is_republic } + } + is_councillor = no + } + } + } + + immediate = { + ordered_courtier = { + limit = { + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + is_trader = no + trigger_if = { + limit = { + root = { government_has_flag = government_is_republic } + } + is_councillor = no + } + NOR = { + scope:courtier_1 ?= this + scope:courtier_2 ?= this + scope:courtier_3 ?= this + } + } + max = 3 + check_range_bounds = no + assign_quirk_effect = yes + if = { + limit = { exists = scope:courtier_2 } + save_scope_as = courtier_3 + } + else_if = { + limit = { exists = scope:courtier_1 } + save_scope_as = courtier_2 + } + else = { save_scope_as = courtier_1 } + } + } + + option = { # I choose you!! + name = gdp_merchant.0015.a + scope:trade_route = { + assign_random_trader_find_highest_task_effect = { CHAR = scope:courtier_1 } + } + gdp_merchant_event_0015_appoint_effect = { CHOSEN = scope:courtier_1 } + # No stress for mechanical events + } + + option = { # You'll do I guess + name = gdp_merchant.0015.b + trigger = { exists = scope:courtier_2 } + scope:trade_route = { + assign_random_trader_find_highest_task_effect = { CHAR = scope:courtier_2 } + } + gdp_merchant_event_0015_appoint_effect = { CHOSEN = scope:courtier_2 } + # No stress for mechanical events + } + + option = { # Or you + name = gdp_merchant.0015.c + trigger = { exists = scope:courtier_3 } + scope:trade_route = { + assign_random_trader_find_highest_task_effect = { CHAR = scope:courtier_3 } + } + gdp_merchant_event_0015_appoint_effect = { CHOSEN = scope:courtier_3 } + # No stress for mechanical events + } + + option = { # Nah let me do my thing + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + scope:courtier_1 = { + OR = { + sum_of_all_skills_value >= sum_of_all_skills_threshold_good + sum_of_all_skills_value >= sum_of_all_skills_threshold_excellent + } + } + } + desc = gdp_merchant.0015.c + } + desc = gdp_merchant.0015.c.fallback + } + } + } + custom_tooltip = gdp_merchant.0015.c.tt + # No stress for mechanical events + } +} + + scripted_trigger gdp_merchant_event_0020_better_partners_trigger = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + can_be_employed_as = partner_court_position + "aptitude(partner_court_position)" >= 2 + NOR = { + scope:candidate_1 ?= this + scope:candidate_2 ?= this + scope:candidate_3 ?= this + has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = root } + } + opinion = { + target = root + value >= -25 + } + # We keep disloyal and loyalty-hooked characters out, for tone + NOR = { + has_trait = disloyal + root = { has_strong_hook = prev } + } +} + +scripted_effect gdp_merchant_0020_apply_appointment_effect = { + reverse_add_opinion = { + target = $CHOSEN$ + modifier = grateful_opinion + opinion = 50 + } + every_in_list = { + list = candidates + limit = { + NOT = { this = $CHOSEN$ } + } + custom = gdp_merchant.0020.a.custom + add_opinion = { + target = $EMPLOYER$ + modifier = annoyed_opinion + opinion = -10 + } + } + if = { + limit = { NOT = { has_hook = $CHOSEN$ } } + add_hook = { + target = $CHOSEN$ + type = loyalty_hook + } + } + # House Unity impact + house ?= { + if = { + limit = { $CHOSEN$.house ?= this } + add_unity_value = { + value = medium_unity_gain + character = $EMPLOYER$ + desc = merchant_unity_partner_gain + } + } + else = { + add_unity_value = { + value = medium_unity_loss + character = $EMPLOYER$ + desc = merchant_unity_partner_loss + } + } + } +} + +# Associates struggle for empty/ineffectual Partner position +gdp_merchant.0020 = { + type = character_event + title = gdp_merchant.0020.t + desc = { + desc = gdp_merchant.0020.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:old_holder } + desc = gdp_merchant.0020.desc.partner_exists + } + desc = gdp_merchant.0020.desc.fallback + } + desc = gdp_merchant.0020.desc.body + first_valid = { + triggered_desc = { + trigger = { exists = scope:candidate_3 } + desc = gdp_merchant.0020.desc.outro_three + } + triggered_desc = { + trigger = { exists = scope:candidate_2 } + desc = gdp_merchant.0020.desc.outro_two + } + desc = gdp_merchant.0020.desc.outro_one + } + } + theme = merchant + override_background = { reference = study } + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + trigger = { exists = scope:old_holder } + character = scope:old_holder + animation = stressed_teacher + } + lower_left_portrait = scope:candidate_1 + lower_center_portrait = scope:candidate_2 + lower_right_portrait = scope:candidate_3 + + cooldown = { years = 10 } + + trigger = { + # Only for merchants + government_has_flag = government_is_merchant + # Either you don't have a Partner, or your Partner sucks. + OR = { + can_employ_court_position_type = partner_court_position + AND = { + employs_court_position = partner_court_position + any_court_position_holder = { + type = partner_court_position + "aptitude(partner_court_position)" <= 1 + } + } + } + # Standard checks. + is_adult = yes + is_available_allow_travelling = yes + # Make sure we're on dry land. + is_location_valid_for_travel_event_on_land = yes + # Squabbles shouldn't happen in concerted households + NOT = { + house ?= { has_house_unity_stage = ennobled_cs } + } + # You have at least one characters who'd be better. + any_courtier = { + gdp_merchant_event_0020_better_partners_trigger = yes + } + } + + weight_multiplier = { + modifier = { # Increase weight early on + # If we're in China/Korea, there is Confucian content we want to expedite instead + location = { + NOR = { + geographical_region = world_asia_china + geographical_region = world_asia_korea + } + } + add = { + value = 100 + subtract = { + value = years_as_ruler + multiply = 10 + } + min = 0 # avoid -1 + } + } + modifier = { # Increase weight if partner honks + employs_court_position = partner_court_position + any_court_position_holder = { + type = partner_court_position + } + add = { + value = 5 + subtract = "court_position:partner_court_position.aptitude(partner_court_position)" + multiply = 10 + } + } + } + + immediate = { + # Is the spot vacant, or merely incompetent? + court_position_old_holder_effect = { POS = partner EMPLOYER = root } + # Available options + ordered_courtier = { + limit = { gdp_merchant_event_0020_better_partners_trigger = yes } + order_by = { + value = "aptitude(partner_court_position)" + # Stewardship only breaks ties, so we add a little of it after scaling aptitude + multiply = 10 + add = { + add = stewardship + divide = 10 + ceiling = yes + } + # then ai_energy + add = { + value = ai_energy + multiply = 0.1 + } + } + check_range_bounds = no + max = 3 + if = { + limit = { exists = scope:candidate_2 } + save_scope_as = candidate_3 + } + else_if = { + limit = { exists = scope:candidate_1 } + save_scope_as = candidate_2 + } + else = { save_scope_as = candidate_1 } + add_to_list = candidates + } + } + + # Choose scope:candidate_1 + option = { + name = gdp_merchant.0020.a + court_position_grant_effect = { + POS = partner + CANDIDATE = scope:candidate_1 + EMPLOYER = root + } + gdp_merchant_0020_apply_appointment_effect = { + CHOSEN = scope:candidate_1 + EMPLOYER = root + } + ai_chance = { + base = 1 + modifier = { + add = { + value = "scope:candidate_1.aptitude(partner_court_position)" + multiply = 10 + } + } + opinion_modifier = { opinion_target = scope:candidate_1 multiplier = 0.25 } + opinion_modifier = { + trigger = { exists = scope:old_holder } + opinion_target = scope:old_holder + multiplier = -0.25 + } + } + } + + # Choose scope:candidate_2 + option = { + name = gdp_merchant.0020.b + trigger = { exists = scope:candidate_2 } + court_position_grant_effect = { + POS = partner + CANDIDATE = scope:candidate_2 + EMPLOYER = root + } + gdp_merchant_0020_apply_appointment_effect = { + CHOSEN = scope:candidate_2 + EMPLOYER = root + } + ai_chance = { + base = 1 + modifier = { + add = { + value = "scope:candidate_2.aptitude(partner_court_position)" + multiply = 10 + } + } + opinion_modifier = { opinion_target = scope:candidate_2 multiplier = 0.25 } + opinion_modifier = { + trigger = { exists = scope:old_holder } + opinion_target = scope:old_holder + multiplier = -0.25 + } + } + } + + # Choose scope:candidate_3 + option = { + name = gdp_merchant.0020.c + trigger = { exists = scope:candidate_3 } + court_position_grant_effect = { + POS = partner + CANDIDATE = scope:candidate_3 + EMPLOYER = root + } + gdp_merchant_0020_apply_appointment_effect = { + CHOSEN = scope:candidate_3 + EMPLOYER = root + } + ai_chance = { + base = 1 + modifier = { + add = { + value = "scope:candidate_3.aptitude(partner_court_position)" + multiply = 10 + } + } + opinion_modifier = { opinion_target = scope:candidate_3 multiplier = 0.25 } + opinion_modifier = { + trigger = { exists = scope:old_holder } + opinion_target = scope:old_holder + multiplier = -0.25 + } + } + } + + # Post remains vacant/partner keeps post + option = { + name = gdp_merchant.0020.d + # Consolation prestige. + add_prestige = minor_prestige_gain + scope:old_holder ?= { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 30 + } + } + every_in_list = { + list = candidates + custom = gdp_merchant.0020.d.custom + add_opinion = { + target = root + modifier = insulted_opinion + opinion = -10 + } + } + # Lose stress if we're playing to our reputation + it's appropriate. + if = { + limit = { exists = scope:old_holder } + stress_and_fulfillment_impact = { loyal = medium_stress_loss } + } + ai_chance = { + base = 1 + ai_value_modifier = { ai_energy = -0.25 } + opinion_modifier = { + trigger = { exists = scope:old_holder } + opinion_target = scope:old_holder + multiplier = 0.25 + } + } + } +} + +scripted_effect gdp_merchant_traveler_impressed_opinion_offset_effect = { + # We want them to actually be impressed by us + hidden_effect = { + scope:traveler = { + if = { + limit = { + opinion = { + target = root + value < 0 + } + } + add_opinion = { + target = root + modifier = impressed_opinion + opinion = { + value = "opinion(root)" + multiply = -1 + } + } + } + } + } +} + +scripted_effect gdp_merchant_hire_traveler_effect = { + add_courtier = scope:traveler + reverse_add_opinion = { + target = scope:traveler + modifier = recruited_me_opinion + opinion = 50 + } + scope:traveler = { remove_character_flag = created } +} + +# Artisan Purpose Recruitment Opportunity +gdp_merchant.0025 = { + type = character_event + title = gdp_merchant.0025.t + desc = gdp_merchant.0025.desc + + theme = merchant + override_background = gdp_tannery + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left_to_the_left + } + + right_portrait = { + character = scope:traveler + animation = hunting_carcass_start + } + + trigger = { + # Only for merchant house heads + government_has_flag = government_is_merchant + is_house_head = yes + # Artisan track level 2 + has_trait_xp = { + trait = lifestyle_merchant + track = artisan + value >= 65 + } + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_0025 } + } + } + + immediate = { + if = { + limit = { + any_pool_character = { + province = root.location + is_physically_able_adult = yes + has_trait = lifestyle_hunter + } + } + random_pool_character = { + province = root.location + limit = { + is_physically_able_adult = yes + has_trait = lifestyle_hunter + } + save_scope_as = traveler + } + } + else = { + create_character = { + template = trader_stewardship_template + location = root.location + culture = root.location.culture + faith = root.location.faith + learning = { 5 8 } + prowess = { 5 10 } + save_scope_as = traveler + after_creation = { + add_trait = lifestyle_hunter + add_trait_xp = { + trait = lifestyle_hunter + track = hunter + value = 50 + } + add_character_flag = created + } + } + } + gdp_merchant_traveler_impressed_opinion_offset_effect = yes + primary_title ?= { set_variable = had_event_gdp_merchant_0025 } + } + + option = { # Glad to have you! + name = gdp_merchant.0025.a + gdp_merchant_hire_traveler_effect = yes + house ?= { + add_unity_value = { + value = medium_unity_loss + character = root + desc = merchant_unity_artisan_recruit_loss + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + add = 25 + has_trait = gregarious + } + modifier = { + factor = 0 + OR = { + has_trait = shy + has_trait = paranoid + } + } + } + } + + option = { # No... actually, we're good. + name = gdp_merchant.0025.b + primary_title = { + add_trade_good_category_xp = { + target = trade_good_category:trade_category_clothes + value = trade_expertise_xp_monumental_value + } + } + house ?= { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_unity_artisan_recruit_decline_gain + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 25 + has_trait = diligent + } + } + } + + after = { + scope:traveler = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# Creditor Purpose Recruitment Opportunity +gdp_merchant.0030 = { + type = character_event + title = gdp_merchant.0030.t + desc = gdp_merchant.0030.desc + + theme = merchant + override_background = gdp_smithy_workshop + + left_portrait = { + character = root + animation = thinking + camera = camera_event_left_to_the_left + } + + right_portrait = { + character = scope:traveler + animation = hero_flex + camera = camera_event_right_forward + } + + trigger = { + government_has_flag = government_is_merchant + is_house_head = yes + has_trait_xp = { + trait = lifestyle_merchant + track = creditor + value >= 65 + } + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_0030 } + } + } + + immediate = { + if = { + limit = { + any_pool_character = { + province = root.location + is_physically_able_adult = yes + is_potential_knight = yes + OR = { + has_trait = education_martial + has_trait = education_intrigue + } + } + } + random_pool_character = { + province = root.location + limit = { + is_physically_able_adult = yes + is_potential_knight = yes + OR = { + has_trait = education_martial + has_trait = education_intrigue + } + } + save_scope_as = traveler + } + } + else = { + create_character = { + template = trader_martial_template + location = root.location + culture = root.location.culture + faith = root.location.faith + prowess = { 8 12 } + save_scope_as = traveler + after_creation = { + add_character_flag = created + } + } + } + gdp_merchant_traveler_impressed_opinion_offset_effect = yes + primary_title ?= { set_variable = had_event_gdp_merchant_0030 } + } + + option = { # Glad to have you! + name = gdp_merchant.0030.a + gdp_merchant_hire_traveler_effect = yes + scope:traveler = { set_knight_status = force } + house ?= { + add_unity_value = { + value = medium_unity_loss + character = root + desc = merchant_unity_creditor_recruit_loss + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + add = 25 + has_trait = gregarious + } + modifier = { + factor = 0 + OR = { + has_trait = shy + has_trait = paranoid + } + } + } + } + + option = { # No... actually, we're good. + name = gdp_merchant.0030.b + primary_title = { + add_trade_good_category_xp = { + target = trade_good_category:trade_category_precious_metals + value = trade_expertise_xp_monumental_value + } + } + house ?= { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_unity_creditor_recruit_decline_gain + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 25 + has_trait = diligent + } + } + } + + after = { + scope:traveler = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# Caravaneer Purpose Recruitment Opportunity +gdp_merchant.0035 = { + type = character_event + title = gdp_merchant.0035.t + desc = gdp_merchant.0035.desc + + theme = merchant + override_background = gdp_artisan_street + + right_portrait = { + character = scope:traveler + animation = holding_scales_horse + camera = camera_event_horse_left_forward + } + + trigger = { + government_has_flag = government_is_merchant + is_house_head = yes + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value >= 65 + } + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_0035 } + } + } + + immediate = { + # We want them to be traveling + random_empire = { + limit = { + any_de_jure_county = { + culture != root.culture + culture = { has_cultural_parameter = unlock_voluntary_mercantilism } + "squared_distance(root.location)" < squared_distance_large + } + } + random_de_jure_county = { + limit = { + culture != root.culture + culture = { has_cultural_parameter = unlock_voluntary_mercantilism } + "squared_distance(root.location)" < squared_distance_large + } + save_scope_as = foreign_merchant_home + } + } + if = { + limit = { NOT = { exists = scope:foreign_merchant_home } } + root.location = { save_scope_as = foreign_merchant_home } + } + create_character = { + template = trader_diplomacy_template + location = root.location + culture = scope:foreign_merchant_home.culture + faith = scope:foreign_merchant_home.faith + learning = { 5 8 } + prowess = { 5 10 } + save_scope_as = traveler + after_creation = { + add_character_flag = created + set_location = root.location + } + } + gdp_merchant_traveler_impressed_opinion_offset_effect = yes + primary_title ?= { set_variable = had_event_gdp_merchant_0035 } + } + + option = { # Glad to have you! + name = gdp_merchant.0035.a + gdp_merchant_hire_traveler_effect = yes + house ?= { + add_unity_value = { + value = medium_unity_loss + character = root + desc = merchant_unity_caravaneer_recruit_loss + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + paranoid = medium_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + add = 25 + has_trait = gregarious + } + modifier = { + factor = 0 + OR = { + has_trait = shy + has_trait = paranoid + } + } + } + } + + option = { # No... actually, we're good. + name = gdp_merchant.0035.b + primary_title = { + add_trade_good_category_xp = { + target = trade_good_category:trade_category_luxury_consumption + value = trade_expertise_xp_monumental_value + } + } + house ?= { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_unity_caravaneer_recruit_decline_gain + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 25 + has_trait = diligent + } + } + } + + after = { + scope:traveler = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# A stressed trader asks the route owner to call the envoys home. +# scope:associate = the trader who wrote. +gdp_merchant.0060 = { + type = letter_event + opening = gdp_merchant.0060.opening + desc = gdp_merchant.0060.desc + sender = scope:associate + + trigger = { + is_ai = no + exists = scope:associate + scope:associate = { is_alive = yes } + } + + option = { + name = gdp_merchant.0060.a + trigger = { + government_has_flag = government_has_merchant_company + NOT = { has_character_flag = gdp_trade_envoys_recalled } + NOT = { has_variable = gdp_trade_envoys_return_promise } + } + custom_tooltip = gdp_merchant.0060.a.tt + set_variable = { + name = gdp_trade_envoys_return_promise + value = scope:associate + months = 25 + } + trigger_event = { + id = gdp_merchant.0061 + years = 2 + } + } + + option = { + name = gdp_merchant.0060.b + custom_tooltip = gdp_merchant.0060.b.tt + } +} + +# Hidden. Fires two years after the promise. Does nothing if Return Trade Envoys already cleared it. +gdp_merchant.0061 = { + hidden = yes + + trigger = { + has_variable = gdp_trade_envoys_return_promise + } + + immediate = { + if = { + limit = { + var:gdp_trade_envoys_return_promise ?= { + is_alive = yes + is_trader = yes + } + } + var:gdp_trade_envoys_return_promise = { save_scope_as = associate } + } + if = { + limit = { exists = scope:associate } + send_interface_message = { + type = event_generic_bad + title = gdp_trade_envoys_return_promise_broken_title + desc = gdp_trade_envoys_return_promise_broken_desc + left_icon = scope:associate + scope:associate = { + add_opinion = { + modifier = gdp_trader_broken_return_promise_opinion + target = root + } + } + } + } + remove_variable = gdp_trade_envoys_return_promise + } +} + +### +# gdp_merchant.0101-0103 - Purchase Land - Merchant +gdp_merchant.0101 = { + type = character_event + title = gdp_merchant.0101.t + desc = { + desc = gdp_merchant.0101.desc_republic + first_valid = { + triggered_desc = { + trigger = { exists = scope:new_liege } + desc = gdp_merchant.0101.liege + } + desc = gdp_merchant.0101.independent + } + desc = gdp_merchant.0101.republic + } + theme = republic + left_portrait = { + character = root + animation = chancellor + } + right_portrait = { + character = scope:recipient + animation = steward + } + lower_left_portrait = scope:portrait_1 + lower_center_portrait = scope:portrait_2 + lower_right_portrait = scope:portrait_3 + override_background = { + trigger = { scope:republic = yes } + reference = market + } + + immediate = { + save_scope_as = merchant + purchase_land_interaction_effect = { + TITLE_RECEIVER = scope:actor + TITLE_GIVER = scope:recipient + } + if = { + limit = { + exists = scope:new_liege + scope:recipient != scope:new_liege + } + scope:new_liege = { save_scope_as = portrait_1 } + } + scope:recipient = { trigger_event = gdp_merchant.0102 } + } + + option = { + name = gdp_merchant.0101.a + if = { # Vassal obligations + limit = { scope:vassal_obligation = yes } + vassal_contract_set_obligation_level = { type = feudal_government_taxes level = 4 } + vassal_contract_set_obligation_level = { type = feudal_government_levies level = 4 } + } + # DISPLAY + every_in_list = { + list = new_arrivals + custom_tooltip = new_republic_population_effect_tt + } + } +} + +gdp_merchant.0102 = { + type = letter_event + opening = ep3_laamps.0101.opening + desc = { + desc = gdp_merchant.0102.desc + first_valid = { + triggered_desc = { + trigger = { scope:new_liege ?= scope:recipient } + desc = gdp_merchant.0102.liege + } + triggered_desc = { + trigger = { exists = scope:new_liege } + desc = gdp_merchant.0102.top_liege + } + desc = gdp_merchant.0102.independent + } + } + sender = scope:actor + + immediate = { + show_as_tooltip = { + purchase_land_interaction_effect = { + TITLE_RECEIVER = scope:actor + TITLE_GIVER = scope:recipient + } + } + if = { + limit = { + top_liege != this + scope:actor.liege != root + } + hidden_effect = { + liege = { + send_interface_message = { + type = event_landless_adventurer_neutral + title = ep3_laamps.0101.liege_message.title + left_icon = scope:actor + right_icon = scope:recipient + show_as_tooltip = { + purchase_land_interaction_effect = { + TITLE_RECEIVER = scope:actor + TITLE_GIVER = scope:recipient + } + } + } + } + } + } + } + + option = { + name = ep3_laamps.0101.a + trigger = { scope:new_liege ?= scope:recipient } + } + + option = { + name = ep3_laamps.0101.b + trigger = { + exists = scope:new_liege + NOT = { scope:new_liege ?= scope:recipient } + } + } + + option = { + name = ep3_laamps.0101.c + trigger = { + NOT = { exists = scope:new_liege } + } + } +} + +gdp_merchant.0103 = { + type = letter_event + opening = ep3_laamps.0102.opening + desc = gdp_merchant.0103.desc + sender = scope:actor + + option = { name = ep3_laamps.0102.a } +} + +# Merge Company — acceptance event +gdp_merchant.0110 = { + type = character_event + title = gdp_merchant.0110.t + desc = { + desc = gdp_merchant.0110.desc + first_valid = { + triggered_desc = { + trigger = { scope:personality = flag:ai_honor } + desc = gdp_merchant.0110.desc.personality.ai_honor + } + triggered_desc = { + trigger = { scope:personality = flag:ai_zeal } + desc = gdp_merchant.0110.desc.personality.ai_zeal + } + triggered_desc = { + trigger = { scope:personality = flag:ai_greed } + desc = gdp_merchant.0110.desc.personality.ai_greed + } + triggered_desc = { + trigger = { scope:personality = flag:ai_compassion } + desc = gdp_merchant.0110.desc.personality.ai_compassion + } + triggered_desc = { + trigger = { scope:personality = flag:ai_boldness } + desc = gdp_merchant.0110.desc.personality.ai_boldness + } + triggered_desc = { + trigger = { scope:personality = flag:ai_rationality } + desc = gdp_merchant.0110.desc.personality.ai_rationality + } + triggered_desc = { + trigger = { scope:personality = flag:ai_vengefulness } + desc = gdp_merchant.0110.desc.personality.ai_vengefulness + } + triggered_desc = { + trigger = { scope:personality = flag:ai_energy } + desc = gdp_merchant.0110.desc.personality.ai_energy + } + triggered_desc = { + trigger = { scope:personality = flag:ai_sociability } + desc = gdp_merchant.0110.desc.personality.ai_sociability + } + triggered_desc = { + trigger = { scope:personality = flag:ai_personality_fallback } + desc = gdp_merchant.0110.desc.personality.ai_personality_fallback + } + desc = gdp_merchant.0110.desc.personality.ai_personality_fallback + } + desc = gdp_merchant.0110.desc.closing + } + left_portrait = { + character = scope:actor + animation = happiness + } + right_portrait = { + character = scope:recipient + animation = war_over_win + } + theme = merchant + + immediate = { + scope:recipient = { + select_merchant_personality_type_effect = yes + } + gdp_merge_company_effect = { + MERGER = scope:actor + SUBSUMED = scope:recipient + } + } + + option = { + name = gdp_merchant.0110.a + } +} + +# Merge Company — decline letter +gdp_merchant.0111 = { + type = letter_event + opening = gdp_merchant.0111.opening + desc = gdp_merchant.0111.desc + sender = scope:recipient + + trigger = { + is_ai = no + } + + option = { + name = gdp_merchant.0111.a + progress_towards_rival_effect = { + REASON = rival_proposed_merge_company + CHARACTER = scope:actor + OPINION = default_rival_opinion + } + } +} + +# Patron construction promise unfulfilled +gdp_merchant.0200 = { + type = character_event + hidden = yes + + trigger = { + government_has_flag = government_is_merchant + exists = var:merchant_patron_fund_buildings_promise + suzerain ?= var:merchant_patron_fund_buildings_promise + var:merchant_patron_fund_buildings_year = current_year + } + + immediate = { + save_scope_as = merchant + var:merchant_patron_fund_buildings_promise = { save_scope_as = patron } + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_patron_fund_buildings_promise_unfulfilled_toast + right_icon = scope:patron + scope:patron = { + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_patron_fund_buildings_promise_unfulfilled_toast + right_icon = scope:merchant + scope:merchant = { add_prestige = medium_prestige_loss } + if = { + limit = { is_ai = yes } + add_opinion = { + target = scope:merchant + modifier = angry_opinion + opinion = -20 + } + } + } + } + } + remove_variable = merchant_patron_fund_buildings_promise + remove_variable = merchant_patron_fund_buildings_year + } +} + +### +# We generate some starting courtiers for you so that you don't get irredeemably screwed as a basic merchant. + +scripted_effect generate_stewardship_associates = { + while = { + count = 2 + create_character = { + template = pool_repopulate_stewardship + dynasty = none + employer = root + culture = root.culture + faith = root.faith + diplomacy = { + min_template_average_skill + max_template_average_skill + } + martial = { + min_template_average_skill + max_template_average_skill + } + stewardship = { + min_template_decent_skill + max_template_decent_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_generated_associates_effect = yes +} + +scripted_effect generate_diplomacy_associates = { + while = { + count = 2 + create_character = { + template = pool_repopulate_diplomacy + dynasty = none + employer = root + culture = root.culture + faith = root.faith + diplomacy = { + min_template_decent_skill + max_template_decent_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_generated_associates_effect = yes +} + +scripted_effect generate_learning_associates = { + while = { + count = 2 + create_character = { + template = pool_repopulate_learning + dynasty = none + employer = root + culture = root.culture + faith = root.faith + 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_decent_skill + max_template_decent_skill + } + prowess = { + min_template_average_skill + max_template_average_skill + } + after_creation = { add_to_list = spawned_chars_list } + } + } + add_generated_associates_effect = yes +} + +scripted_effect generate_intrigue_associates = { + while = { + count = 2 + create_character = { + template = pool_repopulate_intrigue + dynasty = none + employer = root + culture = root.culture + faith = root.faith + 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_decent_skill + max_template_decent_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_generated_associates_effect = yes +} + +scripted_effect generate_martial_associates = { + while = { + count = 2 + create_character = { + template = pool_repopulate_martial + dynasty = none + employer = root + culture = root.culture + faith = root.faith + diplomacy = { + min_template_average_skill + max_template_average_skill + } + martial = { + min_template_decent_skill + max_template_decent_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_generated_associates_effect = yes +} + +scripted_effect add_generated_associates_effect = { + every_in_list = { + list = spawned_chars_list + limit = { liege != root } + root = { add_courtier = prev } + # Improve their opinion of us. + add_opinion = { + target = root + modifier = respect_opinion + opinion = 100 + } + add_opinion = { + target = root + modifier = recruited_me_opinion + opinion = 50 + } + # Add a cheeky variable for future content + add_character_flag = { + flag = generated_starting_character + years = 10 + } + } +} + +### For historical and AI characters +gdp_merchant.1001 = { + type = character_event + hidden = yes + + trigger = { + government_has_flag = government_is_merchant + # Must be on land or else we don't know where to take our locals from. + exists = location.county + } + + on_trigger_fail = { + if = { + limit = { government_has_flag = government_is_merchant } + trigger_event = { + id = gdp_merchant.1001 + months = { 1 3 } + } + } + } + + cooldown = { years = 20 } + + immediate = { + add_character_flag = got_starting_courtiers + generate_stewardship_associates = yes + } +} + +### For player patricians, who need courtiers to assign as traders +gdp_merchant.1004 = { + type = character_event + hidden = yes + + trigger = { + government_has_flag = government_is_republic + NOT = { has_character_flag = got_starting_courtiers } + } + + immediate = { + add_character_flag = got_starting_courtiers + generate_stewardship_associates = yes + } +} + +## If you made a custom Merchant character you should get the chance to choose your own courtiers. +gdp_merchant.1002 = { + type = character_event + title = gdp_merchant.1002.t + desc = gdp_merchant.1002.desc + window = big_event_window + theme = merchant + override_background = { reference = study } + + left_portrait = { + character = root + animation = personality_rational + } + + cooldown = { years = 20 } + + trigger = { + government_has_flag = government_is_merchant + # Must be on land or else we don't know where to take our locals from. + exists = location.county + } + + on_trigger_fail = { + if = { + limit = { government_has_flag = government_is_merchant } + trigger_event = { + id = gdp_merchant.1002 + months = { 1 3 } + } + } + } + + immediate = { + hidden_effect = { + random_list = { + pick = 2 + unique = yes + 25 = { # Martial + modifier = { + OR = { + martial >= excellent_skill_level + number_of_commander_traits >= 1 + } + add = 25 + } + save_scope_as = martial_char + } + 25 = { # Diplomacy + modifier = { + OR = { + diplomacy >= excellent_skill_level + culture = { has_cultural_tradition = tradition_caravaneers } + } + add = 25 + } + save_scope_as = diplo_char + } + 25 = { # Learning + modifier = { + OR = { + learning >= excellent_skill_level + culture = { has_cultural_tradition = tradition_artisans } + } + add = 25 + } + save_scope_as = learning_char + } + 25 = { # Intrigue + modifier = { + intrigue >= excellent_skill_level + add = 25 + } + save_scope_as = intrigue_char + } + } + } + } + + option = { # Stewardship chars always relevant for Merchants + name = gdp_merchant.1002.a + skill = stewardship + custom_tooltip = gdp_merchant.1002.a.tt + hidden_effect = { generate_stewardship_associates = yes } + } + + option = { # Martial + name = gdp_merchant.1002.b + trigger = { exists = scope:martial_char } + skill = martial + custom_tooltip = gdp_merchant.1002.b.tt + hidden_effect = { generate_martial_associates = yes } + } + + option = { # Diplomacy + name = gdp_merchant.1002.c + trigger = { exists = scope:diplo_char } + skill = diplomacy + custom_tooltip = gdp_merchant.1002.c.tt + hidden_effect = { generate_diplomacy_associates = yes } + } + + option = { # Learning + name = gdp_merchant.1002.d + trigger = { exists = scope:learning_char } + skill = learning + custom_tooltip = gdp_merchant.1002.d.tt + hidden_effect = { generate_learning_associates = yes } + } + + option = { # Intrigue + name = gdp_merchant.1002.e + trigger = { exists = scope:intrigue_char } + skill = intrigue + custom_tooltip = gdp_merchant.1002.e.tt + hidden_effect = { generate_intrigue_associates = yes } + } + + option = { # Opt out + name = gdp_merchant.1002.f + + if = { + limit = { + any_courtier = { count <= 0 } + } + custom_tooltip = gdp_merchant.1002.f.tt.difficulty + } + else = { custom_tooltip = gdp_merchant.1002.f.tt.associates } + } +} + +## Select a starting company focus. +gdp_merchant.1003 = { + type = character_event + title = gdp_merchant.1003.t + desc = gdp_merchant.1003.desc + window = big_event_window + theme = merchant + override_background = market_crowd + + left_portrait = { + character = root + animation = holding_scales + } + right_portrait = { + character = scope:merchant + hide_info = yes + triggered_animation = { + trigger = { + location ?= { geographical_region = world_europe } + } + animation = merchant_gesturing + camera = camera_ruler_designer_body_side + } + animation = holding_yoke + } + lower_left_portrait = { + character = suzerain + trigger = { + root = { + can_create_task_contract = { type_name = patron_hobnob } + } + } + } + + cooldown = { years = 20 } + + trigger = { + government_has_flag = government_is_merchant + # Must be on land or else we don't know where to take our locals from. + exists = location.county + } + + on_trigger_fail = { + if = { + limit = { government_has_flag = government_is_merchant } + trigger_event = { + id = gdp_merchant.1003 + months = { 1 3 } + } + } + } + + immediate = { + if = { + limit = { is_ai = no } + create_character = { + template = tgp_concubine_template + location = root.location + gender = male + save_scope_as = merchant + } + } + hidden_effect = { + # Generate starting characters + switch = { + trigger = has_trait + education_diplomacy = { + generate_diplomacy_associates = yes + } + education_martial = { + generate_martial_associates = yes + } + education_stewardship = { + generate_stewardship_associates = yes + } + education_intrigue = { + generate_intrigue_associates = yes + } + education_learning = { + generate_learning_associates = yes + } + } + } + # The route search is expensive, so the AI only runs it when it picks option c + if = { + limit = { is_ai = no } + every_top_trade_good_in_range = { + selection_count = 1 + trade_good_need_category ?= { + save_scope_as = top_trade_category + } + } + } + } + + option = { # Capacity + name = gdp_merchant.1003.a + add_character_modifier = { + modifier = gdp_merchant_starting_capacity_modifier + years = 10 + } + ai_chance = { + base = 0 + } + } + + option = { # Mingle with Patron + name = gdp_merchant.1003.b + trigger = { + can_create_task_contract = { type_name = patron_hobnob } + } + highlight_portrait = suzerain + custom_tooltip = gdp_merchant.1003.b.tt + hidden_effect = { + trigger_event = { on_action = gdp_patron_hobnob } + } + ai_chance = { + base = 0 + } + } + + option = { # Profit + name = gdp_merchant.1003.c + trigger = { + OR = { + is_ai = yes + exists = scope:top_trade_category + } + } + if = { + limit = { is_ai = yes } + every_top_trade_good_in_range = { + selection_count = 1 + trade_good_need_category ?= { + save_scope_as = top_trade_category + } + } + } + if = { + limit = { exists = scope:top_trade_category } + primary_title = { + add_trade_good_category_xp = { + target = scope:top_trade_category + value = trade_expertise_xp_massive_value + } + } + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = medium_chance_impact_positive_ai_value + } + modifier = { + has_trait = greedy + add = 50 + } + modifier = { + has_trait = ambitious + add = 25 + } + } + } +} + +scripted_trigger gdp_merchant_1100_family_trigger = { + OR = { + house ?= root.house + is_spouse_of = root + is_close_family_of = root + } +} + +scripted_trigger gdp_merchant_1100_crowding_associate_trigger = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + trigger_if = { + limit = { exists = house } + NOT = { house = root.house } + } + save_temporary_scope_as = crowding_associate + NOR = { + has_any_court_position = yes + is_councillor_of = root + is_knight_of = root + has_variable = associate_request_type + has_opinion_modifier = { + target = root + modifier = recruited_me_opinion + } + has_relation_friend = root + has_relation_lover = root + is_spouse_of = root + is_concubine_of = root + is_close_family_of = root + any_spouse = { + OR = { + house ?= root.house + is_close_or_extended_family_of = root + is_great_grandparent_of = root + is_great_grandchild_of = root + any_sibling = { is_spouse_of = root } + } + } + any_former_spouse = { + even_if_dead = yes + OR = { + house ?= root.house + is_close_or_extended_family_of = root + is_great_grandparent_of = root + is_great_grandchild_of = root + any_sibling = { is_spouse_of = root } + } + } + root = { + any_spouse = { + OR = { + is_close_or_extended_family_of = scope:crowding_associate + is_great_grandparent_of = scope:crowding_associate + is_great_grandchild_of = scope:crowding_associate + } + } + any_former_spouse = { + even_if_dead = yes + OR = { + is_close_or_extended_family_of = scope:crowding_associate + is_great_grandparent_of = scope:crowding_associate + is_great_grandchild_of = scope:crowding_associate + } + } + } + } +} + +scripted_effect gdp_merchant_1100_crowding_duel_effect = { + $WINNER$ = { + custom_tooltip = { + text = gdp_merchant.1100.b.tt + merchant_adopt_effect = { + CHILD = $WINNER$ + ADOPTER = root + } + every_in_list = { + list = associates + limit = { + NOT = { this = $WINNER$ } + } + add_opinion = { + target = root + modifier = upset_opinion + opinion = -25 + } + } + } + } +} + +# Overcrowded +gdp_merchant.1100 = { + type = character_event + title = gdp_merchant.1100.t + desc = gdp_merchant.1100.desc + left_portrait = { + character = root + animation = personality_rational + } + right_portrait = { + character = scope:plaintiff + animation = interested + } + lower_left_portrait = scope:associate_2 + lower_center_portrait = scope:associate_1 + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + government_has_flag = government_is_merchant + is_available_quick = { + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + domicile ?= { is_domicile_type = merchant_company } + any_courtier = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + gdp_merchant_1100_family_trigger = yes + save_temporary_scope_as = plaintiff_temp + } + any_courtier = { + # Outsiders must outnumber adult family, and there must be at least 8 of them + count >= { + value = 1 + root = { + every_courtier = { + limit = { + is_adult = yes + gdp_merchant_1100_family_trigger = yes + } + add = 1 + } + } + min = 8 + } + NOT = { this = scope:plaintiff_temp } + gdp_merchant_1100_crowding_associate_trigger = yes + } + } + + immediate = { + random_courtier = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + gdp_merchant_1100_family_trigger = yes + } + weight = { + base = 25 + modifier = { + add = 200 + is_of_major_interest_trigger = { CHARACTER = root } + } + } + save_scope_as = plaintiff + } + hidden_effect = { + while = { + count = 2 + random_courtier = { + limit = { + NOR = { + scope:plaintiff ?= this + scope:associate_1 ?= this + } + is_trader = no + gdp_merchant_1100_crowding_associate_trigger = yes + } + alternative_limit = { + NOR = { + scope:plaintiff ?= this + scope:associate_1 ?= this + } + gdp_merchant_1100_crowding_associate_trigger = yes + } + weight = { + base = 50 + modifier = { + add = { + value = sum_of_all_skills_value + multiply = -1 + } + } + } + if = { + limit = { exists = scope:associate_1 } + save_scope_as = associate_2 + } + else = { save_scope_as = associate_1 } + } + } + } + } + + option = { + name = gdp_merchant.1100.a + scope:associate_2 = { + move_to_pool = yes + add_opinion = { + target = root + modifier = insulted_opinion + opinion = -25 + } + } + house = { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_overcrowding_fired_gain + } + } + ai_chance = { + base = 20 + modifier = { + house.house_unity_value < 100 + add = 20 + } + modifier = { add = scope:associate_1.sum_of_all_skills_value } + opinion_modifier = { + opinion_target = scope:associate_1 + multiplier = 0.2 + } + } + } + + option = { + name = gdp_merchant.1100.b + scope:associate_1 = { + move_to_pool = yes + add_opinion = { + target = root + modifier = insulted_opinion + opinion = -25 + } + } + house = { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_overcrowding_fired_gain + } + } + ai_chance = { + base = 20 + modifier = { + house.house_unity_value < 50 + add = 20 + } + modifier = { add = scope:associate_2.sum_of_all_skills_value } + opinion_modifier = { + opinion_target = scope:associate_2 + multiplier = 0.2 + } + } + } + + option = { + name = gdp_merchant.1100.c + scope:associate_2 = { + move_to_pool = yes + add_opinion = { + target = root + modifier = insulted_opinion + opinion = -25 + } + } + scope:associate_1 = { + move_to_pool = yes + add_opinion = { + target = root + modifier = insulted_opinion + opinion = -25 + } + } + house = { + add_unity_value = { + value = massive_unity_gain + character = root + desc = merchant_overcrowding_yeet_gain + } + } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_gain + } + ai_chance = { + base = 20 + modifier = { + house.house_unity_value < 50 + add = 20 + } + opinion_modifier = { + opinion_target = scope:associate_1 + multiplier = -0.2 + } + opinion_modifier = { + opinion_target = scope:associate_2 + multiplier = -0.2 + } + } + } + + option = { + name = gdp_merchant.1100.d + house = { + add_unity_value = { + value = massive_unity_loss + character = root + desc = merchant_overcrowding_ignored_loss + } + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 20 + modifier = { + house.house_unity_value > 150 + add = 20 + } + opinion_modifier = { + opinion_target = scope:associate_1 + multiplier = 0.2 + } + opinion_modifier = { + opinion_target = scope:associate_2 + multiplier = 0.2 + } + } + } +} + +scripted_trigger gdp_merchant_1200_requester_trigger = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + age < 61 + health > poor_health + NOR = { + has_character_flag = associate_request_cooldown + has_variable = associate_request_type + has_opinion_modifier = { + target = root + modifier = recruited_me_opinion + } + } +} + +scripted_trigger gdp_merchant_1200_close_requester_trigger = { + OR = { + has_relation_friend = root + house ?= root.house + is_spouse_of = root + is_close_family_of = root + any_spouse = { + OR = { + house ?= root.house + is_close_or_extended_family_of = root + } + } + any_close_or_extended_family_member = { is_spouse_of = root } + } +} + +scripted_trigger gdp_merchant_1200_valid_requester_trigger = { + gdp_merchant_1200_requester_trigger = yes + trigger_if = { + limit = { gdp_merchant_1200_close_requester_trigger = no } + root = { + NOT = { has_character_flag = gdp_merchant_1200_distant_request_cooldown } + } + } +} + +# Associate Requests +gdp_merchant.1200 = { + type = character_event + title = gdp_merchant.1200.t + desc = { + desc = gdp_merchant.1200.desc + first_valid = { + triggered_desc = { + trigger = { scope:associate_request_type = flag:luxury_contract } + desc = gdp_merchant.1200.desc.luxury_contract + } + triggered_desc = { + trigger = { scope:associate_request_type = flag:activity } + desc = gdp_merchant.1200.desc.activity + } + desc = gdp_merchant.1200.desc.artifact + } + } + + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:requester + animation = interested + } + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + is_available_quick = { + ai = no + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + government_has_flag = government_is_merchant + domicile ?= { is_domicile_type = merchant_company } + num_taken_task_contracts < 1 + any_courtier = { gdp_merchant_1200_valid_requester_trigger = yes } + } + + immediate = { + random_courtier = { + limit = { gdp_merchant_1200_valid_requester_trigger = yes } + weight = { + base = 25 + modifier = { + add = 50 + is_of_major_interest_trigger = { CHARACTER = root } + } + modifier = { + add = 25 + is_of_minor_interest_trigger = { CHARACTER = root } + } + } + save_scope_as = requester + add_character_flag = { + flag = associate_request_cooldown + years = 10 + } + if = { + limit = { gdp_merchant_1200_close_requester_trigger = no } + root = { + add_character_flag = { + flag = gdp_merchant_1200_distant_request_cooldown + years = 10 + } + } + } + } + # Type + random_list = { + 10 = { + trigger = { + any_character_artifact = { + is_equipped = no + artifact_can_be_gift_to_trigger = { RECIPIENT = scope:requester } + } + } + modifier = { + add = -9 + OR = { + has_character_flag = associate_request_recent_artifact + any_in_list = { + variable = associate_requests + var:associate_request_type ?= flag:artifact + } + } + } + save_scope_value_as = { + name = associate_request_type + value = flag:artifact + } + } + 10 = { + trigger = { + NOT = { is_activity_type_on_cooldown = activity_feast } + } + modifier = { + add = -9 + OR = { + has_character_flag = associate_request_recent_activity + any_in_list = { + variable = associate_requests + var:associate_request_type ?= flag:activity + } + } + } + save_scope_value_as = { + name = associate_request_type + value = flag:activity + } + } + 10 = { + trigger = { + OR = { + any_available_task_contract = { has_task_contract_group = merchant_luxury_contract_group } + # Fallback so the list is never empty + is_activity_type_on_cooldown = activity_feast + } + } + modifier = { + add = -9 + OR = { + has_character_flag = associate_request_recent_luxury_contract + any_in_list = { + variable = associate_requests + var:associate_request_type ?= flag:luxury_contract + } + } + } + modifier = { + any_available_task_contract = { has_task_contract_group = merchant_luxury_contract_group } + factor = 2 + } + save_scope_value_as = { + name = associate_request_type + value = flag:luxury_contract + } + } + } + switch = { + trigger = scope:associate_request_type + flag:artifact = { + add_character_flag = { + flag = associate_request_recent_artifact + years = 10 + } + } + flag:activity = { + add_character_flag = { + flag = associate_request_recent_activity + years = 10 + } + } + flag:luxury_contract = { + add_character_flag = { + flag = associate_request_recent_luxury_contract + years = 10 + } + } + } + } + + option = { + name = gdp_merchant.1200.a + switch = { + trigger = scope:associate_request_type + flag:artifact = { + custom_description_no_bullet = { + text = gdp_merchant_1200_a_tt_artifact + object = scope:requester + } + } + flag:activity = { + custom_description_no_bullet = { text = gdp_merchant_1200_a_tt_activity } + } + flag:luxury_contract = { + custom_description_no_bullet = { text = gdp_merchant_1200_a_tt_luxury_contract } + } + } + show_as_tooltip = { + reverse_add_opinion = { + target = scope:requester + modifier = pleased_opinion + opinion = 20 + } + house = { + add_unity_value = { + value = major_unity_gain + character = root + desc = merchant_associate_request_fulfill_gain + } + } + } + custom_tooltip = action_associate_request_help + add_to_variable_list = { + name = associate_requests + target = scope:requester + years = 5 + } + scope:requester = { + set_variable = { + name = associate_request_type + value = scope:associate_request_type + } + set_variable = { + name = associate_request_merchant + value = root + years = 6 + } + trigger_event = { + id = gdp_merchant.1201 + years = 5 + } + } + } + + option = { + name = gdp_merchant.1200.b + reverse_add_opinion = { + target = scope:requester + modifier = disappointed_opinion + opinion = -20 + } + house = { + add_unity_value = { + value = major_unity_loss + character = root + desc = merchant_associate_request_reject_loss + } + } + } +} + +gdp_merchant.1201 = { + type = character_event + hidden = yes + + trigger = { + is_ruler = no + exists = var:associate_request_type + var:associate_request_merchant ?= employer + } + + immediate = { + save_scope_as = associate + employer = { + save_scope_as = request_merchant + send_interface_toast = { + type = event_toast_effect_bad + title = associate_request_failed_title + right_icon = root + switch = { + trigger = var:associate_request_type + flag:artifact = { custom_tooltip = associate_request_type_artifact_fail } + flag:activity = { custom_tooltip = associate_request_type_activity_fail } + flag:luxury_contract = { custom_tooltip = associate_request_type_luxury_contract_fail } + flag:silk_road_market = { custom_tooltip = associate_request_type_silk_road_market_fail } + } + house ?= { + add_unity_value = { + value = major_unity_loss + character = scope:request_merchant + desc = merchant_associate_request_fail_loss + } + } + } + } + if = { + limit = { var:associate_request_type ?= flag:silk_road_market } + remove_variable = associate_request_type + remove_variable = associate_request_target_market + remove_variable = associate_request_target_location + } + remove_variable = associate_request_merchant + } +} + +############################### +# MONOPOLY AND CHARTER EVENTS # +############################### + +scripted_trigger gdp_merchant_starving_monopoly_trigger = { + monopoly_type = exploitative + is_trade_monopoly_for_trade_good_category = trade_category_$CATEGORY$ + monopoly_trade_market = { + any_trade_good_with_need = { has_category = trade_good_category:trade_category_$CATEGORY$ } + NOT = { any_trade_good_with_surplus = { has_category = trade_good_category:trade_category_$CATEGORY$ } } + } +} + +scripted_trigger gdp_merchant_starving_food_monopoly_trigger = { + OR = { + gdp_merchant_starving_monopoly_trigger = { CATEGORY = cereals } + gdp_merchant_starving_monopoly_trigger = { CATEGORY = meat } + } +} + +# Bare Market - the people starve under an exploitative food monopoly +gdp_merchant.2000 = { + type = character_event + title = gdp_merchant.2000.t + desc = { + desc = gdp_merchant.2000.desc.intro + first_valid = { + triggered_desc = { + trigger = { + scope:starving_county ?= { + any_county_situation = { + tgp_natural_disaster_situation_is_disaster_trigger = yes + NOT = { situation_current_phase = recovery } + } + } + } + desc = gdp_merchant.2000.desc.disaster + } + triggered_desc = { + trigger = { scope:local_ruler ?= { is_at_war = yes } } + desc = gdp_merchant.2000.desc.war + } + triggered_desc = { + trigger = { scope:starving_province ?= { any_province_epidemic = { always = yes } } } + desc = gdp_merchant.2000.desc.plague + } + triggered_desc = { + trigger = { scope:starving_county ?= { county_control < medium_county_control } } + desc = gdp_merchant.2000.desc.unrest + } + } + desc = gdp_merchant.2000.desc.stalls + } + theme = trade + left_portrait = { + character = scope:starving_citizen + animation = beg + camera = camera_event_left_away_3_4_small + } + right_portrait = { + character = root + animation = pondering + } + override_background = { reference = market } + override_effect_2d = { + trigger = { + scope:starving_county ?= { + any_county_situation = { + situation_type = natural_disaster_flood + NOT = { situation_current_phase = recovery } + } + } + } + reference = rain + } + override_effect_2d = { + trigger = { + scope:starving_county ?= { + any_county_situation = { + situation_type = natural_disaster_earthquake + NOT = { situation_current_phase = recovery } + } + } + } + reference = smoke + } + override_effect_2d = { + reference = flies + } + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + is_available = yes + government_has_flag = government_is_merchant + any_trade_monopoly_for_character = { + gdp_merchant_starving_food_monopoly_trigger = yes + } + } + + weight_multiplier = { + base = 1 + modifier = { # war, disaster, or plague is already battering the market + factor = 2 + any_trade_monopoly_for_character = { + gdp_merchant_starving_food_monopoly_trigger = yes + monopoly_trade_market = { upheaval_market_modifier_trigger = yes } + } + } + modifier = { # the local ruler has lost his grip + factor = 1.5 + any_trade_monopoly_for_character = { + gdp_merchant_starving_food_monopoly_trigger = yes + monopoly_trade_market = { + trade_market_owner.county ?= { + county_control < medium_county_control + } + } + } + } + } + + immediate = { + random_trade_monopoly_for_character = { + limit = { gdp_merchant_starving_food_monopoly_trigger = yes } + save_scope_as = starving_monopoly + monopoly_trade_market = { + save_scope_as = starving_market + random_trade_good_with_need = { + limit = { + OR = { + has_category = trade_good_category:trade_category_cereals + has_category = trade_good_category:trade_category_meat + } + } + save_scope_as = needed_good + } + trade_market_owner.title_province = { + save_scope_as = starving_province + county ?= { + save_scope_as = starving_county + holder ?= { save_scope_as = local_ruler } + } + } + } + } + random_pool_character = { + province = scope:starving_province + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + alternative_limit = { always = yes } + save_scope_as = starving_citizen + } + if = { + limit = { + exists = scope:starving_province + NOT = { exists = scope:starving_citizen } + } + create_character = { + template = generic_peasant_character + location = scope:starving_province + culture = scope:starving_province.culture + faith = scope:starving_province.faith + save_scope_as = starving_citizen + } + } + } + # Hoard what little is left + option = { + name = gdp_merchant.2000.a + add_character_modifier = { + modifier = gdp_merchant_full_larder_modifier + years = 5 + } + if = { + limit = { + exists = scope:starving_county + trigger_if = { + limit = { exists = scope:local_ruler } + } + } + scope:starving_county = { change_county_control = -15 } + } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + generous = minor_stress_impact_gain + greedy = medium_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = generous + } + } + modifier = { + factor = 2 + has_trait = greedy + } + } + } + # The people will look for someone to blame + option = { + name = gdp_merchant.2000.b + add_character_modifier = { + modifier = gdp_merchant_staying_vigilant + years = 10 + } + add_intrigue_lifestyle_xp = medium_lifestyle_xp + stress_and_fulfillment_impact = { + paranoid = minor_stress_impact_gain + craven = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 2 + OR = { + has_trait = paranoid + has_trait = craven + } + } + } + } + + option = { # This is not my problem + name = gdp_merchant.2000.c + add_dread = medium_dread_gain + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + callous = minor_stress_impact_loss + arbitrary = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = compassionate + } + } + } +} + +scripted_trigger gdp_merchant_craft_monopoly_trigger = { + monopoly_type = normal + is_complete_monopoly = no + is_trade_monopoly_for_trade_good_category = trade_category_$CATEGORY$ +} + +scripted_trigger gdp_merchant_craft_category_monopoly_trigger = { + OR = { + gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } + gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } + gdp_merchant_craft_monopoly_trigger = { CATEGORY = carpentry_supplies } + gdp_merchant_craft_monopoly_trigger = { CATEGORY = clothes } + gdp_merchant_craft_monopoly_trigger = { CATEGORY = luxury_items } + } +} + +# Monopoly: The Craftsman - a local expert in one good you hold monopoly on +gdp_merchant.2010 = { + type = character_event + title = { + desc = gdp_merchant.2010.t + first_valid = { + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } } + } + desc = gdp_merchant.2010.t.smith + } + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } } + } + desc = gdp_merchant.2010.t.goldsmith + } + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = carpentry_supplies } } + } + desc = gdp_merchant.2010.t.carpenter + } + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = clothes } } + } + desc = gdp_merchant.2010.t.tanner + } + desc = gdp_merchant.2010.t.potter + } + } + desc = { + desc = gdp_merchant.2010.desc.intro + first_valid = { + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } } + } + desc = gdp_merchant.2010.desc.weapon + } + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } } + } + desc = gdp_merchant.2010.desc.chalice + } + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = carpentry_supplies } } + } + desc = gdp_merchant.2010.desc.box + } + triggered_desc = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = clothes } } + } + desc = gdp_merchant.2010.desc.saddle + } + desc = gdp_merchant.2010.desc.vase + } + desc = gdp_merchant.2010.desc.craftsmanship + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } } + } + animation = admiration + camera = camera_event_center_pointing_right + } + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } } + } + animation = toast_goblet + camera = camera_event_left + } + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = clothes } } + } + animation = admiration + camera = camera_event_center_pointing_right + } + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = carpentry_supplies } } + } + animation = admiration + camera = camera_event_right_wedding + } + animation = happiness + camera = camera_event_left + } + right_portrait = { + character = scope:craftsman + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } } + } + animation = inspect_weapon + } + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } } + } + animation = crowning + camera = camera_event_standing_with_horse_right + } + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = carpentry_supplies } } + } + animation = merchant_box + camera = camera_event_right_pointing_right + } + triggered_animation = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = clothes } } + } + animation = standing_horse + camera = camera_event_center_pointing_very_left + } + animation = serving_tray + } + lower_center_portrait = { + character = scope:associate + } + override_background = { + trigger = { + scope:craft_monopoly ?= { + OR = { + gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } + gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } + } + } + location = { + geographical_region = world_europe + } + } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { + scope:craft_monopoly ?= { + OR = { + gdp_merchant_craft_monopoly_trigger = { CATEGORY = base_metals } + gdp_merchant_craft_monopoly_trigger = { CATEGORY = precious_metals } + } + } + } + reference = gdp_artisan_street_crowd + } + override_background = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = carpentry_supplies } } + } + reference = gdp_carpentry_workshop + } + override_background = { + trigger = { + scope:craft_monopoly ?= { gdp_merchant_craft_monopoly_trigger = { CATEGORY = clothes } } + } + reference = gdp_tannery + } + override_background = { reference = gdp_artisan_street_crowd } + + trigger = { + is_house_head = yes + is_available = yes + government_has_flag = government_is_merchant + primary_title ?= { NOT = { has_variable = had_event_gdp_merchant_2010 } } + any_trade_monopoly_for_character = { + gdp_merchant_craft_category_monopoly_trigger = yes + } + OR = { + any_close_family_member = { is_available_ai_adult = yes } + any_courtier = { is_available_ai_adult = yes } + } + } + + immediate = { + primary_title ?= { set_variable = had_event_gdp_merchant_2010 } + random_trade_monopoly_for_character = { + limit = { gdp_merchant_craft_category_monopoly_trigger = yes } + save_scope_as = craft_monopoly + monopoly_trade_market = { + save_scope_as = craft_market + trade_market_owner.title_province = { save_scope_as = workshop_province } + } + } + create_character = { + template = gdp_master_craftsman_template + location = scope:workshop_province + culture = scope:workshop_province.culture + faith = scope:workshop_province.faith + trait = shy + save_scope_as = craftsman + } + # Prioritize family + random_close_family_member = { + limit = { + is_available_ai_adult = yes + is_courtier_of = root + } + alternative_limit = { is_available_ai_adult = yes } + save_scope_as = associate + } + if = { + limit = { NOT = { exists = scope:associate } } + random_courtier = { + limit = { is_available_ai_adult = yes } + save_scope_as = associate + } + } + } + + # Such hands belong in my court + option = { + name = gdp_merchant.2010.a + trigger = { short_term_gold >= major_gold_value } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:craftsman + gold = major_gold_value + } + add_courtier = scope:craftsman + reverse_add_opinion = { + target = scope:craftsman + modifier = recruited_me_opinion + opinion = 50 + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 1.5 + has_trait = ambitious + } + } + } + + # Perhaps you could teach my associate a thing or two + option = { + name = gdp_merchant.2010.b + scope:associate = { + add_character_modifier = { + modifier = gdp_merchant_master_craft_tutelage_modifier + years = 10 + } + if = { + limit = { + NOT = { has_trait = lifestyle_merchant } + } + add_trait = lifestyle_merchant + } + else = { + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_medium_value + } + } + } + reverse_add_opinion = { + target = scope:associate + modifier = grateful_opinion + opinion = 15 + } + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 1.5 + has_trait = generous + } + } + } + + # I should take a moment to learn from the craftsman + option = { + name = gdp_merchant.2010.c + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_medium_value + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + factor = 2 + has_trait = diligent + } + } + } + + after = { + scope:craftsman = { silent_disappear_ai_if_not_hired = yes } + } +} + +scripted_trigger gdp_merchant_category_expertise_trigger = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + root.primary_title = { + trade_good_category_xp = { + target = scope:category_temp + value >= 300 + } + } +} + +# The Price of X - your Patron asks your advice about a trade good +gdp_merchant.2015 = { + type = character_event + title = gdp_merchant.2015.t + desc = gdp_merchant.2015.desc + theme = merchant + override_background = throne_room + + left_portrait = { + character = scope:patron + animation = pondering + camera = camera_event_very_left + } + right_portrait = { + character = root + animation = obsequious_bow + camera = camera_event_right_to_the_right + } + + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + is_available = yes + government_has_flag = government_is_merchant + character_has_trade_monopoly = no + exists = suzerain + short_term_gold >= { + value = suzerain.major_gold_value + multiply = { + value = suzerain.highest_held_title_tier + add = -1 + } + multiply = 0.5 + } + suzerain = { + is_available_quick = { adult = yes } + any_held_trade_market = { + any_trade_route_in_market = { + trade_route_owner = { this = root } + any_traded_good = { + any_trade_category = { + gdp_merchant_category_expertise_trigger = yes + } + } + } + } + } + } + + immediate = { + suzerain = { + save_scope_as = patron + get_quirk_character_effect = yes + random_held_trade_market = { + limit = { + any_trade_route_in_market = { + trade_route_owner = { this = root } + any_traded_good = { + any_trade_category = { + gdp_merchant_category_expertise_trigger = yes + } + } + } + } + save_scope_as = patron_market + } + } + scope:patron_market = { + random_trade_route_in_market = { + limit = { + trade_route_owner = { this = root } + any_traded_good = { + any_trade_category = { + gdp_merchant_category_expertise_trigger = yes + } + } + } + random_traded_good = { + limit = { + any_trade_category = { + gdp_merchant_category_expertise_trigger = yes + } + } + save_scope_as = counsel_good + } + } + } + scope:counsel_good = { + random_trade_category = { + limit = { + gdp_merchant_category_expertise_trigger = yes + } + save_scope_as = counsel_category + } + } + save_scope_value_as = { + name = monopoly_opinion_acceptance + value = { + value = 20 + multiply = 0.5 + add = 25 + } + } + save_scope_value_as = { + name = monopoly_acceptance + value = { + value = 10 + multiply = 0.5 + add = 5 + add = { + value = "root.primary_title.trade_good_category_xp(scope:counsel_category)" + add = 300 + divide = trade_expertise_xp_five_levels_value + floor = yes + subtract = { + value = "root.primary_title.trade_good_category_xp(scope:counsel_category)" + divide = trade_expertise_xp_five_levels_value + floor = yes + } + multiply = 2 + } + if = { + limit = { "root.primary_title.trade_good_category_level(scope:counsel_category)" < merchant_monopoly_trade_expertise_level_low_value } + subtract = merchant_monopoly_trade_expertise_bonus_negative_value + } + if = { + limit = { + "root.primary_title.trade_good_category_xp(scope:counsel_category)" < { + value = trade_expertise_xp_five_levels_value + divide = 5 + multiply = merchant_monopoly_trade_expertise_level_low_value + subtract = 300 + } + } + add = merchant_monopoly_trade_expertise_bonus_negative_value + } + } + } + } + + # I happen to be the expert on this very trade good + option = { + name = gdp_merchant.2015.a + trigger = { + custom_tooltip = { + text = gdp_merchant.2015.a.tt + primary_title = { + trade_good_category_level = { + target = scope:counsel_category + value >= merchant_monopoly_trade_expertise_level_medium_value + } + } + } + } + show_as_unavailable = { always = yes } + reverse_add_opinion = { + target = scope:patron + modifier = impressed_opinion + opinion = 20 + } + custom_tooltip = gdp_merchant.2015.a.monopoly.tt + set_variable = { + name = showed_expertise_patron + value = scope:patron + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 0.5 + ai_greed = 0.5 + } + } + } + + # Pretend to know what you are talking about + option = { + name = gdp_merchant.2015.b + duel = { + skill = intrigue + target = scope:patron + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_merchant.2015.b.success + hidden_effect = { + primary_title = { + add_trade_good_category_xp = { + target = scope:counsel_category + value = 300 + } + } + } + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant.2015.b.success + right_icon = scope:patron + show_as_tooltip = { + primary_title = { + add_trade_good_category_xp = { + target = scope:counsel_category + value = 300 + } + } + } + custom_tooltip = gdp_merchant.2015.b.monopoly.tt + set_variable = { + name = showed_some_expertise_patron + value = scope:patron + } + reverse_add_opinion = { + target = scope:patron + modifier = impressed_opinion + opinion = 10 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_merchant.2015.b.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant.2015.b.failure + right_icon = scope:patron + reverse_add_opinion = { + target = scope:patron + modifier = disappointed_opinion + opinion = -15 + } + } + } + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 50 + modifier = { + factor = 2 + has_trait = deceitful + } + modifier = { + factor = 0.25 + has_trait = honest + } + ai_value_modifier = { + ai_boldness = 0.5 + ai_honor = -0.5 + } + } + } + + # The trade good is not mine to speak about + option = { + name = gdp_merchant.2015.c + trigger = { + NOT = { + primary_title = { + trade_good_category_level = { + target = scope:counsel_category + value >= merchant_monopoly_trade_expertise_level_medium_value + } + } + } + } + add_prestige = minor_prestige_gain + ai_chance = { + base = 50 + modifier = { + factor = 2 + has_trait = humble + } + ai_value_modifier = { + ai_honor = 0.5 + ai_boldness = -0.5 + } + } + } +} + +# A Seat at the Table - your Patron seats you among dignitaries +gdp_merchant.2020 = { + type = character_event + title = gdp_merchant.2020.t + desc = gdp_merchant.2020.desc + theme = merchant + override_background = feast + + left_portrait = { + character = scope:courtier_1 + animation = disapproval + } + right_portrait = { + character = scope:patron + animation = toast_goblet + camera = camera_event_right_crowner_crowning + } + + trigger = { + is_house_head = yes + is_available = yes + government_has_flag = government_is_merchant + primary_title ?= { NOT = { has_variable = had_event_gdp_merchant_2020 } } + OR = { + character_has_trade_monopoly = yes + merchant_has_any_charter_trigger = yes + } + exists = suzerain + suzerain = { + is_available_quick = { adult = yes } + any_courtier_or_guest = { + this != root + is_available_ai_adult = yes + is_lowborn = no + NOT = { + government_has_flag = government_is_merchant + } + } + } + } + + immediate = { + primary_title ?= { set_variable = had_event_gdp_merchant_2020 } + suzerain = { + save_scope_as = patron + ordered_courtier_or_guest = { + order_by = highest_held_title_tier + limit = { + this != root + is_available_ai_adult = yes + is_lowborn = no + NOT = { + government_has_flag = government_is_merchant + } + } + max = 1 + check_range_bounds = no + save_scope_as = courtier_1 + } + } + } + + # Splendid, we should do this again sometime + option = { + name = gdp_merchant.2020.a + if = { + limit = { + scope:patron = { is_ai = yes } + } + custom_tooltip = gdp_merchant.2020.a.feast.tt + hidden_effect = { + scope:patron = { + add_character_flag = { flag = feast_ai_override } + ai_attempt_to_host_activity = activity_feast + } + } + } + reverse_add_opinion = { + target = scope:patron + modifier = grateful_opinion + opinion = 10 + } + stress_and_fulfillment_impact = { + gregarious = medium_stress_impact_loss + shy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 1.0 + } + } + } + + # My house has come far to earn a seat at this table + option = { + name = gdp_merchant.2020.b + dynasty ?= { add_dynasty_prestige = miniscule_dynasty_prestige_gain } + house ?= { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_merchant.2020.b.unity_gain.desc + } + } + reverse_add_opinion = { + target = scope:patron + modifier = impressed_opinion + opinion = 15 + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + humble = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + factor = 2 + has_trait = ambitious + } + modifier = { + factor = 0.25 + has_trait = humble + } + } + } + + # Titles and toasts are fine, but what of business? + option = { + name = gdp_merchant.2020.c + reverse_add_opinion = { + target = scope:patron + modifier = impressed_opinion + opinion = 20 + } + house ?= { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant.2020.c.unity_loss.desc + } + } + add_character_modifier = { + modifier = gdp_full_attention_modifier + years = 10 + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + diligent = minor_stress_impact_loss + gregarious = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = 1.0 + ai_sociability = -0.5 + } + } + } +} + +# The Lesser Merchant - a weaker Merchant holds the Charter you have earned +gdp_merchant.2025 = { + type = character_event + title = gdp_merchant.2025.t + desc = gdp_merchant.2025.desc + theme = merchant + override_background = study + + left_portrait = { + character = scope:patron + animation = contemplating + } + right_portrait = { + character = root + animation = stressed_teacher + camera = camera_event_right_to_the_right + } + lower_center_portrait = scope:charter_rival + + trigger = { + is_house_head = yes + is_available = yes + government_has_flag = government_is_merchant + primary_title ?= { NOT = { has_variable = had_event_gdp_merchant_2025 } } + character_has_trade_monopoly = yes + exists = suzerain + NOT = { + any_character_artifact = { var:charter_patron ?= root.suzerain } + } + trigger_if = { + limit = { suzerain.highest_held_title_tier >= tier_empire } + has_realm_law = company_size_huge + } + trigger_else_if = { + limit = { suzerain.highest_held_title_tier >= tier_kingdom } + OR = { + has_realm_law = company_size_large + has_realm_law = company_size_huge + } + } + trigger_else = { + OR = { + has_realm_law = company_size_medium + has_realm_law = company_size_large + has_realm_law = company_size_huge + } + } + suzerain = { + is_available_quick = { adult = yes } + highest_held_title_tier >= tier_duchy + any_tributary = { + this != root + government_has_flag = government_is_merchant + any_character_artifact = { + var:charter_patron ?= root.suzerain + NOT = { exists = var:forger } + } + sum_of_all_skills_value < root.sum_of_all_skills_value + } + } + } + + immediate = { + primary_title ?= { set_variable = had_event_gdp_merchant_2025 } + suzerain = { + save_scope_as = patron + ordered_tributary = { + limit = { + this != root + government_has_flag = government_is_merchant + any_character_artifact = { + var:charter_patron ?= root.suzerain + NOT = { exists = var:forger } + } + sum_of_all_skills_value < root.sum_of_all_skills_value + } + order_by = sum_of_all_skills_value + save_scope_as = charter_rival + } + } + scope:charter_rival ?= { + random_character_artifact = { + limit = { var:charter_patron ?= scope:patron } + save_scope_as = rival_charter + } + } + save_scope_value_as = { + name = charter_opinion_acceptance + value = { + value = 25 + multiply = 0.4 + } + } + } + + # Since I am so good, why not hand me that charter? + option = { + name = gdp_merchant.2025.a + custom_tooltip = gdp_merchant.2025.a.charter.tt + reverse_add_opinion = { + target = scope:patron + modifier = impressed_opinion + opinion = 25 + } + scope:patron = { + add_opinion = { + target = scope:charter_rival + modifier = suspicion_opinion + opinion = -20 + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + craven = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1.0 + ai_greed = 0.5 + } + } + } + + # Defer to the Patron's judgement on the charter + option = { + name = gdp_merchant.2025.b + house ?= { + add_unity_value = { + value = major_unity_gain + character = root + desc = gdp_merchant.2025.b.unity_gain.desc + } + } + add_prestige = minor_prestige_gain + reverse_add_opinion = { + target = scope:patron + modifier = flattered_opinion + opinion = 15 + } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_loss + ambitious = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_boldness = -0.5 + } + } + } +} + +# Court position events +scripted_trigger gdp_merchant_court_pos_booner_trigger = { + is_available_healthy_ai_adult = yes + aptitude = { + court_position = $POS$_court_position + value >= 3 + } + trigger_if = { + limit = { exists = employer } + opinion = { + target = employer + value >= -50 + } + } + trigger_else = { always = yes } +} + +gdp_merchant.3000 = { # Translator + type = character_event + title = gdp_merchant.3000.t + desc = gdp_merchant.3000.desc + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:translator + animation = writing + } + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + is_house_head = yes + is_available_quick = { + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + is_landless_merchant = yes + any_court_position_holder = { + type = translator_court_position + gdp_merchant_court_pos_booner_trigger = { POS = translator } + save_temporary_scope_as = translator_temp + } + any_culture_global = { + culture_number_of_counties != 0 + NOT = { has_same_culture_language = root.culture } + any_culture_duchy = { + title_province ?= { + squared_distance = { + target = root.domicile.domicile_location + value < squared_distance_large # more than adventurers + } + barony.trade_market = { + any_trade_good_with_surplus = { + any_trade_category = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "root.primary_title.trade_good_category_level(scope:category_temp)" < 55 + } + } + } + } + } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = "court_position:translator_court_position.aptitude(translator_court_position)" + subtract = 3 + } + } + } + + immediate = { + random_court_position_holder = { + type = translator_court_position + limit = { + gdp_merchant_court_pos_booner_trigger = { POS = translator } + } + save_scope_as = translator + } + every_culture_global = { + limit = { + culture_number_of_counties != 0 + NOT = { has_same_culture_language = root.culture } + } + every_culture_duchy = { + limit = { + title_province ?= { + exists = barony.trade_market + squared_distance = { + target = root.domicile.domicile_location + value < squared_distance_large # more than adventurers + } + } + } + title_province.barony.trade_market = { + add_to_temporary_list = known_markets + } + } + } + # Save Market + ordered_in_list = { + list = known_markets + limit = { + any_trade_good_with_surplus = { + any_trade_category = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "root.primary_title.trade_good_category_level(scope:category_temp)" < 55 + } + } + } + order_by = { + value = 1 + every_trade_good_with_surplus = { + limit = { + any_trade_category = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "root.primary_title.trade_good_category_level(scope:category_temp)" < 55 + } + } + add = 1 + } + } + position = 0 + check_range_bounds = no + save_scope_as = market + } + ordered_culture_global = { + limit = { + culture_number_of_counties != 0 + NOT = { has_same_culture_language = root.culture } + any_culture_duchy = { + title_province ?= { barony.trade_market ?= scope:market } + } + } + order_by = culture_number_of_counties + save_scope_as = saved_culture + } + scope:market = { + every_trade_good_with_surplus = { + limit = { + any_trade_category = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "root.primary_title.trade_good_category_level(scope:category_temp)" < 55 + NOT = { is_in_list = categories } + } + } + add_to_list = goods + } + } + random_in_global_list = { + variable = merchants_tally + limit = { + holder ?= { + culture = scope:saved_culture + save_temporary_scope_as = merchant_temp + } + scope:market = { + any_character_in_market = { this = scope:merchant_temp } + } + gdp_merchant_diplo_range_trigger = { + TARGET = scope:merchant_temp + MERCHANT = root + } + } + alternative_limit = { + holder ?= { + culture = scope:saved_culture + save_temporary_scope_as = merchant_temp + } + gdp_merchant_diplo_range_trigger = { + TARGET = scope:merchant_temp + MERCHANT = root + } + } + weight = { + base = 1 + modifier = { + holder ?= { + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + } + add = 100 + } + } + save_scope_as = culture_merchant + } + every_in_list = { + list = goods + random_trade_category = { + limit = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "root.primary_title.trade_good_category_level(scope:category_temp)" < 55 + NOT = { is_in_list = categories } + } + add_to_list = categories + } + } + } + + option = { + name = gdp_merchant.3000.a + custom_tooltip = gdp_merchant.3000.a.tt + every_in_list = { + list = categories + root.primary_title = { + add_trade_good_category_xp = { + target = prev + value = { + value = 200 + multiply = "scope:translator.aptitude(translator_court_position)" + divide = list_size:categories + } + } + } + } + ai_chance = { + base = 75 + } + } + + option = { + name = gdp_merchant.3000.b + trigger = { + exists = scope:culture_merchant + can_start_scheme = { type = learn_language target_character = scope:culture_merchant.holder } + } + start_scheme = { + type = learn_language + target_character = scope:culture_merchant.holder + } + custom_tooltip = { + text = gdp_merchant.3000.b.tt + random_scheme = { + type = learn_language + limit = { scheme_target_character = scope:culture_merchant.holder } + add_scheme_modifier = { type = gdp_merchant_translator_buff_modifier } + + } + } + stress_and_fulfillment_impact = { + lazy = medium_stress_impact_gain + } + ai_chance = { + base = 25 + modifier = { + factor = 0 + has_trait = lazy + } + } + } + + option = { + name = gdp_merchant.3000.d + trigger = { + NOT = { + scope:translator = { knows_language_of_culture = scope:saved_culture } + } + } + show_as_unavailable = { always = yes } + scope:translator = { learn_language_of_culture = scope:saved_culture } + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + impatient = minor_stress_impact_gain + } + ai_chance = { + base = 25 + modifier = { + factor = 0 + has_trait = greedy + } + } + } + + option = { + name = gdp_merchant.3000.c + add_short_term_gold = minor_gold_value + } +} + +scripted_trigger fixer_scheme_trigger = { + hostile_scheme_trigger = yes + scheme_owner = { is_ai = yes } + save_temporary_scope_as = scheme + scheme_progress >= scheme_progress_33 +} + +scripted_trigger fixer_secret_trigger = { + OR = { + is_shunned_for = secret_owner + AND = { + NOT = { + is_blackmailable_secret_trigger = { + PARTICIPANT = secret_owner + BLACKMAILER = root + } + } + secret_is_always_interesting_trigger = yes + } + } + NOT = { is_known_by = root } + # Spymaster should not reveal secrets targeting themselves unless it is a murder attempt + trigger_if = { + limit = { + exists = secret_target + NOT = { secret_type = secret_murder_attempt } + } + secret_target != $FIXER$ + } + # If the spymaster is the father of a secret bastard, don't reveal that + trigger_if = { + limit = { + OR = { + secret_type = secret_disputed_heritage + secret_type = secret_unmarried_illegitimate_child + } + exists = secret_target.real_father + } + secret_target.real_father != $FIXER$ + } + NOT = { + any_secret_participant = { + OR = { + this = $FIXER$ + this = root + } + } + } + save_temporary_scope_as = suitable_secret + trigger_if = { + limit = { + secret_type = secret_disputed_heritage + exists = secret_target + } + NOT = { secret_target = { has_trait = legitimized_bastard } } + } + OR = { + secret_is_always_interesting_trigger = yes + is_blackmailable_secret_trigger = { BLACKMAILER = root PARTICIPANT = scope:suitable_secret.secret_owner } + } +} + +gdp_merchant.3010 = { # Fixer + type = character_event + title = gdp_merchant.3010.t + desc = { + desc = gdp_merchant.3010.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:secret } + desc = gdp_merchant.3010.desc.secret + } + desc = gdp_merchant.3010.desc.scheme + } + } + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:fixer + animation = trade_deal + } + lower_right_portrait = scope:secret_haver + lower_left_portrait = scope:scheme_owner + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + is_house_head = yes + is_available_quick = { + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + is_landless_merchant = yes + any_court_position_holder = { + type = fixer_court_position + gdp_merchant_court_pos_booner_trigger = { POS = fixer } + save_temporary_scope_as = fixer_temp + } + OR = { + any_targeting_scheme = { fixer_scheme_trigger = yes } + suzerain = { + any_secret = { + fixer_secret_trigger = { FIXER = scope:fixer_temp } + } + } + any_trade_route = { + any_trade_market_on_route = { + any_character_in_market = { + any_secret = { + fixer_secret_trigger = { FIXER = scope:fixer_temp } + } + } + } + } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = "court_position:fixer_court_position.aptitude(fixer_court_position)" + subtract = 3 + } + } + } + + immediate = { + random_court_position_holder = { + type = fixer_court_position + limit = { + gdp_merchant_court_pos_booner_trigger = { POS = fixer } + } + save_scope_as = fixer + } + hidden_effect = { + random_list = { + 50 = { + trigger = { + any_targeting_scheme = { fixer_scheme_trigger = yes } + } + random_targeting_scheme = { + limit = { fixer_scheme_trigger = yes } + save_scope_as = scheme + scheme_owner = { save_scope_as = scheme_owner } + } + } + 25 = { + trigger = { + suzerain = { + any_secret = { + fixer_secret_trigger = { FIXER = scope:fixer } + } + } + } + suzerain = { + save_scope_as = secret_haver + random_secret = { + limit = { + fixer_secret_trigger = { FIXER = scope:fixer } + } + save_scope_as = secret + } + } + } + 25 = { + trigger = { + any_trade_route = { + any_trade_market_on_route = { + any_character_in_market = { + any_secret = { + fixer_secret_trigger = { FIXER = scope:fixer } + } + } + } + } + } + every_trade_route = { + every_trade_market_on_route = { + every_character_in_market = { + limit = { + any_secret = { + fixer_secret_trigger = { FIXER = scope:fixer } + } + } + add_to_list = secret_havers + } + } + } + } + } + if = { + limit = { + any_in_list = { list = secret_havers } + } + random_in_list = { + list = secret_havers + weight = { + base = 1 + modifier = { + is_landless_merchant = yes + add = 5 + } + modifier = { + house ?= { + any_house_relation = { + any_relation_house = { this = root.house } + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + add = 5 + } + } + save_scope_as = secret_haver + random_secret = { + limit = { + fixer_secret_trigger = { FIXER = scope:fixer } + } + save_scope_as = secret + } + } + } + } + } + + option = { + name = gdp_merchant.3010.d + trigger = { + OR = { + has_trait = journaller + has_trait = lifestyle_poet + has_trait = violet_poet + } + } + if = { + limit = { exists = scope:secret } + scope:secret ?= { reveal_to = root } + } + else = { + scope:scheme ?= { expose_scheme = yes } + } + add_character_modifier = { + modifier = ep3_inspired_by_life + years = 15 + } + stress_and_fulfillment_impact = { + journaller = medium_stress_impact_loss + lifestyle_poet = medium_stress_impact_loss + violet_poet = medium_stress_impact_loss + deceitful = medium_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = deceitful + } + modifier = { + factor = 2 + OR = { + has_trait = journaller + has_trait = lifestyle_poet + has_trait = violet_poet + } + } + } + } + + option = { + name = gdp_merchant.3010.a + if = { + limit = { exists = scope:secret } + scope:secret ?= { reveal_to = root } + } + else = { + scope:scheme ?= { expose_scheme = yes } + } + random = { + chance = 50 + scope:fixer = { add_intrigue_skill = 1 } + } + ai_chance = { + base = 50 + modifier = { + factor = 2 + has_trait = deceitful + } + } + } + + option = { + name = gdp_merchant.3010.b + trigger = { + can_add_hook = { + target = scope:fixer + type = favor_hook + } + } + add_hook = { + target = scope:fixer + type = favor_hook + } + reverse_add_opinion = { + target = scope:fixer + modifier = upset_opinion + opinion = -10 + } + if = { + limit = { exists = scope:secret } + scope:secret ?= { reveal_to = root } + } + else = { + scope:scheme ?= { expose_scheme = yes } + } + stress_and_fulfillment_impact = { + paranoid = medium_stress_impact_loss + trusting = medium_stress_impact_gain + } + ai_chance = { + base = 25 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = trusting + } + } + modifier = { + factor = 2 + OR = { + has_trait = callous + has_trait = paranoid + } + } + } + } + + option = { + name = gdp_merchant.3010.c + add_piety = minor_piety_gain + reverse_add_opinion = { + target = scope:fixer + modifier = insulted_opinion + opinion = -10 + } + stress_and_fulfillment_impact = { + zealous = medium_stress_impact_loss + deceitful = medium_stress_impact_gain + callous = medium_stress_impact_gain + } + ai_chance = { + base = 25 + modifier = { + factor = 0 + OR = { + has_trait = deceitful + has_trait = callous + } + } + modifier = { + factor = 2 + has_trait = zealous + } + } + } +} + +scripted_trigger gdp_merchant_3020_shared_loan_trigger = { + story_type = story_cycle_loan + story_owner = { + is_ai = yes + is_at_war = no + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + } + var:lender ?= $MERCHANT$ + exists = var:amount_owed + # 2 years since loan + exists = var:years_since + var:years_since >= 2 + # not recently asked + NOT = { exists = var:bailiff_cooldown } +} + +scripted_trigger gdp_merchant_3020_pressure_debtor_trigger = { + any_owned_story = { + gdp_merchant_3020_pressure_loan_trigger = { MERCHANT = $MERCHANT$ } + } + NOR = { + scope:demand_debtor_1 ?= this + scope:demand_debtor_2 ?= this + scope:pressure_debtor_1 ?= this + scope:pressure_debtor_2 ?= this + } +} + +scripted_trigger gdp_merchant_3020_pressure_loan_trigger = { + gdp_merchant_3020_shared_loan_trigger = { MERCHANT = $MERCHANT$ } + # has some gold... + story_owner.gold > story_owner.minor_gold_value + # ...but cannot actually repay yet... + var:amount_owed > story_owner.gold + # ...and stop remainder becoming tiny by a thousand cuts + var:amount_owed > story_owner.major_gold_value +} + +scripted_effect gdp_merchant_3020_pressure_loan_effect = { + $LOAN$ = { save_temporary_scope_as = loan_temp } + scope:loan_temp = { + set_variable = { + name = bailiff_cooldown + years = 5 + } + story_owner = { + add_opinion = { + modifier = annoyed_opinion + opinion = -10 + target = root + } + pay_short_term_gold = { + target = root + gold = minor_gold_value + } + custom_tooltip = gdp_merchant.3020.a.tt + } + root = { gdp_merchant_creditor_loan_acumen_effect = { GOLD = scope:loan_temp.story_owner.minor_gold_value } } + change_variable = { + name = amount_owed + add = { + value = story_owner.minor_gold_value + multiply = -1 + } + } + save_scope_value_as = { + name = outstanding + value = var:amount_owed + } + } + hidden_effect = { + send_interface_toast = { + title = ho_loan_reduced_title + right_icon = scope:loan_temp.story_owner + scope:loan_temp ?= { custom_tooltip = gdp_merchant_3020_pressure_tt } + } + } +} + +scripted_trigger gdp_merchant_3020_demand_debtor_trigger = { + any_owned_story = { + gdp_merchant_3020_demand_loan_trigger = { MERCHANT = $MERCHANT$ } + } + NOR = { + scope:demand_debtor_1 ?= this + scope:demand_debtor_2 ?= this + scope:pressure_debtor_1 ?= this + scope:pressure_debtor_2 ?= this + } +} + +scripted_trigger gdp_merchant_3020_demand_loan_trigger = { + gdp_merchant_3020_shared_loan_trigger = { MERCHANT = $MERCHANT$ } + # can repay now right now this very second + var:amount_owed < story_owner.gold +} + +scripted_effect gdp_merchant_3020_save_effect = { + if = { + limit = { exists = scope:$TYPE$_debtor_2 } + save_scope_as = $TYPE$_debtor_3 + } + else_if = { + limit = { exists = scope:$TYPE$_debtor_1 } + save_scope_as = $TYPE$_debtor_2 + } + else = { save_scope_as = $TYPE$_debtor_1 } + if = { + limit = { exists = scope:portrait_2 } + save_scope_as = portrait_3 + } + else_if = { + limit = { exists = scope:portrait_1 } + save_scope_as = portrait_2 + } + else = { save_scope_as = portrait_1 } + random_owned_story = { + limit = { + gdp_merchant_3020_$TYPE$_loan_trigger = { MERCHANT = root } + } + if = { + limit = { exists = scope:$TYPE$_loan_2 } + save_scope_as = $TYPE$_loan_3 + } + else_if = { + limit = { exists = scope:$TYPE$_loan_1 } + save_scope_as = $TYPE$_loan_2 + } + else = { save_scope_as = $TYPE$_loan_1 } + add_to_list = loan_list + } +} + +scripted_effect gdp_merchant_3020_demand_loan_effect = { + $LOAN$ = { save_temporary_scope_as = loan_temp } + random_list = { + 1 = { + modifier = { + "scope:bailiff.aptitude(bailiff_court_position)" >= 3 + add = 10 + } + modifier = { + "scope:bailiff.aptitude(bailiff_court_position)" >= 4 + add = 25 + } + opinion_modifier = { + who = scope:loan_temp.story_owner + opinion_target = root + multiplier = 0.2 + } + scope:loan_temp = { repay_and_end_loan_story_effect = yes } # use this effect to show relevant tooltips + save_temporary_scope_as = loan_repaid + } + 50 = { + gdp_merchant_3020_pressure_loan_effect = { LOAN = scope:loan_temp } + } + } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_gain + generous = minor_stress_impact_gain + } +} + +gdp_merchant.3020 = { # Bailiff + type = character_event + title = gdp_merchant.3020.t + desc = { + desc = gdp_merchant.3020.desc + triggered_desc = { + trigger = { exists = scope:pressure_debtor_1 } + desc = gdp_merchant.3020.pressure + } + triggered_desc = { + trigger = { exists = scope:demand_debtor_1 } + desc = gdp_merchant.3020.demand + } + triggered_desc = { + trigger = { exists = scope:portrait_3 } + desc = gdp_merchant.3020.third + } + } + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:bailiff + animation = steward + } + lower_left_portrait = scope:portrait_1 + lower_center_portrait = scope:portrait_2 + lower_right_portrait = scope:portrait_3 + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + is_house_head = yes + is_available_quick = { + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + is_landless_merchant = yes + any_court_position_holder = { + type = bailiff_court_position + gdp_merchant_court_pos_booner_trigger = { POS = bailiff } + } + OR = { + any_in_list = { + variable = owes_me_money + any_owned_story = { + gdp_merchant_3020_demand_loan_trigger = { MERCHANT = root } + } + } + any_in_list = { + variable = owes_me_money + any_owned_story = { + gdp_merchant_3020_pressure_loan_trigger = { MERCHANT = root } + } + } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = "court_position:bailiff_court_position.aptitude(bailiff_court_position)" + subtract = 3 + } + } + } + + immediate = { + random_court_position_holder = { + type = bailiff_court_position + limit = { + gdp_merchant_court_pos_booner_trigger = { POS = bailiff } + } + save_scope_as = bailiff + } + # Pressure + ordered_in_list = { + variable = owes_me_money + limit = { + gdp_merchant_3020_pressure_debtor_trigger = { MERCHANT = root } + } + order_by = gold + gdp_merchant_3020_save_effect = { TYPE = pressure } + } + # Demand + ordered_in_list = { + variable = owes_me_money + limit = { + gdp_merchant_3020_demand_debtor_trigger = { MERCHANT = root } + } + order_by = gold + gdp_merchant_3020_save_effect = { TYPE = demand } + } + hidden_effect = { + while = { + count = 2 + random_list = { + # Pressure + 10 = { + trigger = { + any_in_list = { + variable = owes_me_money + gdp_merchant_3020_pressure_debtor_trigger = { MERCHANT = root } + } + } + ordered_in_list = { + variable = owes_me_money + limit = { + gdp_merchant_3020_pressure_debtor_trigger = { MERCHANT = root } + } + order_by = gold + gdp_merchant_3020_save_effect = { TYPE = pressure } + } + } + # Demand + 10 = { + trigger = { + any_in_list = { + variable = owes_me_money + gdp_merchant_3020_demand_debtor_trigger = { MERCHANT = root } + } + } + ordered_in_list = { + variable = owes_me_money + limit = { + gdp_merchant_3020_demand_debtor_trigger = { MERCHANT = root } + } + order_by = gold + gdp_merchant_3020_save_effect = { TYPE = demand } + } + } + } + } + } + } + + option = { # Pressure 1 + name = gdp_merchant.3020.a + trigger = { + scope:pressure_loan_1.story_owner ?= { gold > minor_gold_value } + } + gdp_merchant_3020_pressure_loan_effect = { LOAN = scope:pressure_loan_1 } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_gain + generous = minor_stress_impact_gain + } + ai_chance = { + base = 50 + opinion_modifier = { + opinion_target = scope:pressure_loan_1.story_owner + multiplier = -0.25 + } + modifier = { + add = { + value = scope:pressure_loan_1.var:years_since + multiply = 5 + } + } + modifier = { + has_trait = generous + add = -25 + } + modifier = { + has_trait = patient + add = -25 + } + } + } + + option = { # Demand 1 + name = gdp_merchant.3020.b + trigger = { exists = scope:demand_loan_1 } + gdp_merchant_3020_demand_loan_effect = { LOAN = scope:demand_loan_1 } + ai_chance = { + base = 50 + opinion_modifier = { + opinion_target = scope:demand_loan_1.story_owner + multiplier = -0.25 + } + modifier = { + add = { + value = scope:demand_loan_1.var:years_since + multiply = 5 + } + } + modifier = { + has_trait = generous + add = -25 + } + modifier = { + has_trait = patient + add = -25 + } + } + } + + option = { # Pressure 2 + name = gdp_merchant.3020.c + trigger = { + scope:pressure_loan_2.story_owner ?= { gold > minor_gold_value } + } + gdp_merchant_3020_pressure_loan_effect = { LOAN = scope:pressure_loan_2 } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_gain + generous = minor_stress_impact_gain + } + ai_chance = { + base = 50 + opinion_modifier = { + opinion_target = scope:pressure_loan_2.story_owner + multiplier = -0.25 + } + modifier = { + add = { + value = scope:pressure_loan_2.var:years_since + multiply = 5 + } + } + modifier = { + has_trait = generous + add = -25 + } + modifier = { + has_trait = patient + add = -25 + } + } + } + + option = { # Demand 2 + name = gdp_merchant.3020.d + trigger = { exists = scope:demand_loan_2 } + gdp_merchant_3020_demand_loan_effect = { LOAN = scope:demand_loan_2 } + ai_chance = { + base = 50 + opinion_modifier = { + opinion_target = scope:demand_loan_2.story_owner + multiplier = -0.25 + } + modifier = { + add = { + value = scope:demand_loan_2.var:years_since + multiply = 5 + } + } + modifier = { + has_trait = generous + add = -25 + } + modifier = { + has_trait = patient + add = -25 + } + } + } + + option = { # Pressure 3 + name = gdp_merchant.3020.e + trigger = { + scope:pressure_loan_3.story_owner ?= { gold > minor_gold_value } + } + gdp_merchant_3020_pressure_loan_effect = { LOAN = scope:pressure_loan_3 } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_gain + generous = minor_stress_impact_gain + } + ai_chance = { + base = 50 + opinion_modifier = { + opinion_target = scope:pressure_loan_3.story_owner + multiplier = -0.25 + } + modifier = { + add = { + value = scope:pressure_loan_3.var:years_since + multiply = 5 + } + } + modifier = { + has_trait = generous + add = -25 + } + modifier = { + has_trait = patient + add = -25 + } + } + } + + option = { # Demand 3 + name = gdp_merchant.3020.f + trigger = { exists = scope:demand_loan_3 } + gdp_merchant_3020_demand_loan_effect = { LOAN = scope:demand_loan_3 } + ai_chance = { + base = 50 + opinion_modifier = { + opinion_target = scope:demand_loan_3.story_owner + multiplier = -0.25 + } + modifier = { + add = { + value = scope:demand_loan_3.var:years_since + multiply = 5 + } + } + modifier = { + has_trait = generous + add = -25 + } + modifier = { + has_trait = patient + add = -25 + } + } + } + + option = { # Shrug + name = gdp_merchant.3020.g + add_prestige = minor_prestige_gain + stress_and_fulfillment_impact = { + patient = minor_stress_impact_loss + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_loss + } + ai_chance = { + base = 50 + modifier = { + factor = 0.5 + has_trait = impatient + } + modifier = { + factor = 2 + has_trait = patient + } + modifier = { + factor = 2 + has_trait = content + } + modifier = { + factor = 2 + gold < minor_gold_value + } + modifier = { + factor = 2 + prestige < minor_prestige_value + } + } + } +} + +gdp_merchant.3030 = { # Market Agent + type = character_event + hidden = yes + cooldown = { years = 5 } + + trigger = { + is_house_head = yes + is_available_quick = { + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + is_landless_merchant = yes + any_court_position_holder = { + type = market_agent_court_position + gdp_merchant_court_pos_booner_trigger = { POS = market_agent } + } + any_trade_route = { + has_trader = yes + any_trade_market_on_route = {} + } + OR = { + can_create_task_contract = { type_name = challenge_competitor } + can_create_task_contract = { type_name = promote_goods } + can_create_task_contract = { type_name = market_investment } + can_create_task_contract = { type_name = exploit_upheaval } + can_create_task_contract = { type_name = support_guilds } + can_create_task_contract = { type_name = seek_debtors } + can_create_task_contract = { type_name = sabotage_competition } + can_create_task_contract = { type_name = build_category_connections } + can_create_task_contract = { type_name = disrupt_charter } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = "court_position:market_agent_court_position.aptitude(market_agent_court_position)" + subtract = 3 + } + } + } + + immediate = { + random_court_position_holder = { + type = market_agent_court_position + limit = { + gdp_merchant_court_pos_booner_trigger = { POS = market_agent } + } + save_scope_as = market_agent + } + set_variable = { + name = market_agent_opportunity + value = scope:market_agent + days = 1 + } + hidden_effect = { + random_list = { + 10 = { + trigger = { + can_create_task_contract = { type_name = challenge_competitor } + } + trigger_event = { on_action = gdp_challenge_competitor } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = promote_goods } + } + trigger_event = { on_action = gdp_promote_goods } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = market_investment } + } + trigger_event = { on_action = gdp_market_investment } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = exploit_upheaval } + } + trigger_event = { on_action = gdp_exploit_upheaval } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = support_guilds } + } + trigger_event = { on_action = gdp_support_guilds } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = seek_debtors } + } + trigger_event = { on_action = gdp_seek_debtors } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = sabotage_competition } + } + trigger_event = { on_action = gdp_sabotage_competition } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = build_category_connections } + } + trigger_event = { on_action = gdp_build_category_connections } + } + 10 = { + trigger = { + can_create_task_contract = { type_name = disrupt_charter } + } + trigger_event = { on_action = gdp_disrupt_charter } + } + } + } + } +} + +gdp_merchant.3031 = { + type = character_event + title = gdp_merchant.3031.t + desc = gdp_merchant.3031.desc + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:market_agent + animation = holding_tally_stick + } + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + exists = scope:trade_opportunity + exists = var:market_agent_opportunity + } + + immediate = { + var:market_agent_opportunity = { save_scope_as = market_agent } + } + + option = { + name = gdp_merchant.3031.a + custom_tooltip = gdp_merchant.3031.a.tt + ai_chance = { + base = 10 + } + } + option = { + name = gdp_merchant.3031.b + if = { + limit = { + NOT = { has_trait = lifestyle_merchant } + } + add_trait = lifestyle_merchant + } + else = { + if = { + limit = { has_realm_law = company_purpose_creditor } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = 3 + } + } + else_if = { + limit = { has_realm_law = company_purpose_artisan } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = 3 + } + } + else_if = { + limit = { has_realm_law = company_purpose_caravaneer } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = 3 + } + } + else = { + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = 1 + } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = 1 + } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = 1 + } + } + } + reverse_add_opinion = { + modifier = annoyed_opinion + target = scope:market_agent + opinion = -10 + } + scope:trade_opportunity = { invalidate_contract = yes } + ai_chance = { + base = 0 + } + } + + after = { + remove_variable = market_agent_opportunity + } +} + +gdp_merchant.3040 = { # Antiquarian + type = character_event + title = gdp_merchant.3040.t + desc = { + desc = gdp_merchant.3040.desc + } + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:antiquarian + triggered_animation = { + trigger = { + scope:artifact = { artifact_slot_type = creature } + } + animation = thinking + } + triggered_animation = { + trigger = { + scope:artifact = { artifact_slot_type = curio } + } + animation = merchant_box + } + animation = page_flipping + } + artifact = { + position = lower_center_portrait + target = scope:artifact + trigger = { exists = scope:artifact } + } + theme = trade + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + is_house_head = yes + is_available_quick = { + adult = yes + activity = no + travel = no + imprisoned = no + incapable = no + } + is_landless_merchant = yes + any_court_position_holder = { + type = antiquarian_court_position + gdp_merchant_court_pos_booner_trigger = { POS = antiquarian } + } + any_equipped_character_artifact = { + OR = { + artifact_slot_type = creature + artifact_slot_type = curio + artifact_slot_type = library + } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = "court_position:antiquarian_court_position.aptitude(antiquarian_court_position)" + subtract = 3 + } + } + } + + immediate = { + random_court_position_holder = { + type = antiquarian_court_position + limit = { + gdp_merchant_court_pos_booner_trigger = { POS = antiquarian } + } + save_scope_as = antiquarian + } + random_equipped_character_artifact = { + limit = { + OR = { + artifact_slot_type = creature + artifact_slot_type = curio + artifact_slot_type = library + } + NOT = { exists = var:curator_cooldown } + artifact_durability < artifact_max_durability + } + alternative_limit = { + OR = { + artifact_slot_type = creature + artifact_slot_type = curio + artifact_slot_type = library + } + NOT = { exists = var:curator_cooldown } + } + weight = { + base = 1 + modifier = { + add = { + value = 100 + divide = artifact_max_durability + multiply = artifact_durability + subtract = 100 + multiply = -1 + } + } + modifier = { + rarity = masterwork + factor = 0.75 + } + modifier = { + rarity = famed + factor = 0.5 + } + modifier = { + rarity = illustrious + factor = 0.25 + } + } + set_variable = { + name = curator_cooldown + years = 5 + } + save_scope_as = artifact + } + } + + option = { + name = gdp_merchant.3040.b + add_short_term_gold = { + gold = { + value = 0 + if = { + limit = { + scope:artifact = { rarity = illustrious } + } + add = 25 + } + else_if = { + limit = { + scope:artifact = { rarity = famed } + } + add = 15 + } + else_if = { + limit = { + scope:artifact = { rarity = masterwork } + } + add = 8 + } + else = { + add = 4 + } + + # Boost the value up to something meaningful (merchants) + multiply = { + value = 5 + } + + # multiply by durability percentage + multiply = { + add = scope:artifact.artifact_durability + divide = scope:artifact.artifact_max_durability + divide = 2 + add = 0.5 + } + + # More than just destroying + if = { + limit = { "scope:antiquarian.aptitude(antiquarian_court_position)" = 4 } + multiply = 2 + } + else_if = { + limit = { "scope:antiquarian.aptitude(antiquarian_court_position)" = 3 } + multiply = 1.75 + } + else = { multiply = 1.5 } + } + } + if = { + limit = { + scope:artifact = { artifact_type = creature } + } + scope:artifact = { save_scope_as = sold_creature } + custom_tooltip = { + text = sell_creature_artifact_effect + destroy_owned_artifact = scope:artifact + } + } + else = { + destroy_owned_artifact = scope:artifact + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + } + ai_chance = { + base = 25 + modifier = { + has_trait = greedy + add = 25 + } + modifier = { + gold < minor_gold_value + add = 25 + } + modifier = { + scope:artifact = { artifact_slot_type = library } + NOT = { + any_character_artifact = { + is_equipped = no + artifact_slot_type = library + } + } + add = -25 + } + modifier = { + scope:artifact = { artifact_slot_type = curio } + NOT = { + any_character_artifact = { + is_equipped = no + artifact_slot_type = curio + } + } + add = -25 + } + modifier = { + scope:artifact = { artifact_slot_type = creature } + NOT = { + any_character_artifact = { + is_equipped = no + artifact_slot_type = creature + } + } + add = -25 + } + modifier = { + scope:artifact = { rarity = common } + add = 25 + } + modifier = { + scope:artifact = { rarity = masterwork } + add = 15 + } + modifier = { + scope:artifact = { rarity = famed } + add = -15 + } + modifier = { + scope:artifact = { rarity = illustrious } + add = -25 + } + } + } + + option = { + name = gdp_merchant.3040.c + trigger = { + custom_tooltip = { + text = gdp_merchant.3040.c.tt.creature + NOT = { + scope:artifact = { artifact_slot_type = creature } + } + } + custom_tooltip = { + text = gdp_merchant.3040.c.tt + scope:artifact.artifact_durability < scope:artifact.artifact_max_durability + } + } + show_as_unavailable = { always = yes } + scope:artifact = { add_durability = 10 } + scope:antiquarian = { + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + } + ai_chance = { + base = 25 + modifier = { + has_trait = diligent + add = 25 + } + modifier = { + scope:artifact = { rarity = common } + add = -25 + } + modifier = { + scope:artifact = { rarity = masterwork } + add = -15 + } + modifier = { + scope:artifact = { rarity = famed } + add = 15 + } + modifier = { + scope:artifact = { rarity = illustrious } + add = 25 + } + } + } + + option = { + name = gdp_merchant.3040.d + add_prestige = minor_prestige_gain + stress_and_fulfillment_impact = { + content = minor_stress_impact_loss + lazy = minor_stress_impact_loss + } + ai_chance = { + base = 25 + modifier = { + has_trait = content + add = 25 + } + modifier = { + has_trait = lazy + add = 25 + } + modifier = { + factor = 2 + prestige < minor_prestige_value + } + } + } +} + +################################ +# POOL CHARACTER INTO MERCHANT # +################################ +gdp_merchant.4001 = { + hidden = yes + trigger = { + gdp_should_spawn_new_merchant_company_trigger = yes + is_pool_character = yes # Can cease to be in the pool between it queuing and executing + gdp_pool_character_valid_for_merchant_company_trigger = yes + pool_character_is_pruneable_trigger = no # Avoid promoting uninteresting characters + gdp_merchant_family_has_no_ruler_trigger = yes # No ruling dynasty / close or extended family + } + + immediate = { + create_merchant_title_effect = { + REASON = flag:historical + FLAVOR_CHAR = root + } + } +} + +gdp_merchant.4002 = { + hidden = yes + trigger = { + exists = global_var:gdp_minority_merchant_spawn_quota + global_var:gdp_minority_merchant_spawn_quota > 0 + is_pool_character = yes + gdp_minority_merchant_candidate_trigger = yes + gdp_merchant_companies_below_cap_trigger = yes + gdp_pool_character_valid_for_merchant_company_trigger = yes + pool_character_is_pruneable_trigger = no + gdp_merchant_family_has_no_ruler_trigger = yes + } + + immediate = { + change_global_variable = { + name = gdp_minority_merchant_spawn_quota + add = -1 + } + gdp_minority_merchant_found_company_effect = yes + } +} + +gdp_merchant.4003 = { + hidden = yes + trigger = { + gdp_minority_merchant_host_trigger = yes + gdp_merchant_companies_below_cap_trigger = yes + } + + immediate = { + while = { + count = 3 + if = { + limit = { NOT = { exists = scope:minority_merchant_founder } } + create_character = { + template = pool_repopulate_local_flavor + location = root.capital_province + save_scope_as = minority_merchant + } + scope:minority_merchant = { + if = { + limit = { gdp_minority_merchant_candidate_trigger = yes } + create_dynasty = { + spread_to_descendants = yes + } + } + if = { + limit = { + gdp_minority_merchant_candidate_trigger = yes + gdp_pool_character_valid_for_merchant_company_trigger = yes + } + save_scope_as = minority_merchant_founder + gdp_minority_merchant_found_company_effect = yes + } + else = { + silent_disappearance_effect = yes + } + } + } + } + } +} + +# You are a Merchant in China who isn't Confucian +gdp_merchant.4000 = { + type = character_event + title = gdp_merchant.4000.t + desc = { + desc = gdp_merchant.4000.desc.intro + first_valid = { + triggered_desc = { + trigger = { + scope:patron = { this = scope:market_character } + } + desc = gdp_merchant.4000.desc.patron + } + desc = gdp_merchant.4000.desc.patron_representative + } + desc = gdp_merchant.4000.desc.body + first_valid = { + triggered_desc = { + trigger = { + scope:patron = { this = scope:market_character } + } + desc = gdp_merchant.4000.desc.body.patron + } + desc = gdp_merchant.4000.desc.body.patron_representative + } + desc = gdp_merchant.4000.desc.outro + } + + theme = merchant + + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + has_trait = arbitrary + has_trait = arrogant + has_trait = ambitious + } + } + animation = anger + } + triggered_animation = { + trigger = { + OR = { + has_trait = shy + has_trait = craven + } + } + animation = worry + } + animation = disbelief + camera = camera_event_crowd + } + + right_portrait = { + character = scope:market_character + animation = disapproval + } + + trigger = { + is_house_head = yes + is_available_adult = yes + government_has_flag = government_is_merchant + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_4000 } + } + location = { + OR = { + geographical_region = world_asia_china + geographical_region = world_asia_korea + } + } + NOT = { + has_trait = confucian_education + } + suzerain = { + government_has_flag = government_has_merit + NOT = { + has_any_good_relationship_with_character_trigger = { CHARACTER = root } + } + OR = { + AND = { + is_available_ai_adult = yes + highest_held_title_tier < tier_kingdom + } + any_councillor = { + is_available_ai_adult = yes + this != root + } + any_courtier = { is_available_ai_adult = yes } + } + } + } + + weight_multiplier = { + modifier = { # Increase weight early on + add = { + value = 100 + subtract = { + value = years_as_ruler + multiply = 10 + } + min = 0 # avoid -1 + } + } + } + + immediate = { + suzerain = { + save_scope_as = patron + if = { + limit = { + is_available_ai_adult = yes + highest_held_title_tier < tier_kingdom + } + save_scope_as = market_character + } + else_if = { + limit = { + any_councillor = { + is_available_ai_adult = yes + this != root + } + } + random_councillor = { + limit = { + is_available_ai_adult = yes + this != root + } + weight = { + base = 1 + modifier = { + factor = 2 + is_lowborn = no + } + modifier = { + factor = 2 + has_trait = confucian_education + } + } + save_scope_as = market_character + } + } + else = { + random_courtier = { + limit = { is_available_ai_adult = yes } + save_scope_as = market_character + } + } + } + # Put a cooldown on the primary title - the effects are pretty OP so let's not dole them out willy nilly + primary_title ?= { set_variable = had_event_gdp_merchant_4000 } + } + + option = { # I should learn about the Way + name = gdp_merchant.4000.b + custom_tooltip = gdp_merchant.4000.b.tt + add_character_flag = gdp_merchant_confucian_university_discount + if = { + limit = { + NOT = { knows_language_of_culture = scope:market_character.culture } + } + start_scheme = { + type = learn_language + target_character = scope:market_character + } + } + else_if = { + limit = { has_trait = confucian_education } + add_trait_xp = { + trait = confucian_education + value = { 1 3 } + } + } + else = { + random = { + chance = root.learning + add_trait = confucian_education + } + } + stress_and_fulfillment_impact = { + base = medium_stress_impact_gain + diligent = medium_stress_impact_loss + patient = medium_stress_impact_loss + impatient = medium_stress_impact_gain + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_energy = 1 + } + modifier = { + OR = { + has_trait = impatient + has_trait = arrogant + } + factor = 0 + } + } + } + + option = { # I will focus all my efforts on the study of trade, thank you very much. + name = gdp_merchant.4000.c + add_character_modifier = { + modifier = dedicated_trade_studies + years = 10 + } + reverse_add_opinion = { + modifier = insulted_opinion + target = scope:market_character + } + stress_and_fulfillment_impact = { + stubborn = medium_stress_impact_loss + callous = medium_stress_impact_loss + shy = medium_stress_impact_gain + craven = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_vengefulness = 1 + } + modifier = { + OR = { + has_trait = shy + has_trait = craven + } + factor = 0 + } + } + } +} + +# You're a Merchant in China/Korea who hasn't taken the exam +gdp_merchant.4010 = { + type = character_event + title = gdp_merchant.4010.t + desc = gdp_merchant.4010.desc + + theme = merchant + override_background = tavern + + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + has_trait = arbitrary + has_trait = arrogant + has_trait = ambitious + } + } + animation = anger + } + triggered_animation = { + trigger = { + OR = { + has_trait = shy + has_trait = craven + } + } + animation = worry + } + animation = disbelief + camera = camera_event_crowd + } + + right_portrait = { + character = scope:student + animation = dismissal + } + + trigger = { + is_house_head = yes + is_available_adult = yes + government_has_flag = government_is_merchant + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_4010 } + } + location = { + OR = { + geographical_region = world_asia_china + geographical_region = world_asia_korea + } + } + NOR = { + has_character_flag = passed_provincial_exam + has_character_flag = passed_metropolitan_exam + has_character_flag = passed_palace_exam + } + } + + immediate = { + if = { + limit = { + any_pool_character = { + is_available_ai_adult = yes + province = root.location + OR = { + has_character_flag = passed_provincial_exam + has_character_flag = passed_metropolitan_exam + } + } + } + random_pool_character = { + province = root.location + limit = { + is_available_ai_adult = yes + OR = { + has_character_flag = passed_provincial_exam + has_character_flag = passed_metropolitan_exam + } + } + save_scope_as = student + } + } + else = { + root.location.county.holder ?= { save_scope_as = host } + create_character = { + template = tgp_examiner_learning_template + dynasty = none + location = root.location + faith = root.location.faith + culture = root.location.culture + gender = male + save_scope_as = student + after_creation = { + add_character_flag = created + add_character_flag = passed_provincial_exam + } + } + } + # Put a cooldown on the primary title - the effects are pretty OP so let's not dole them out willy nilly + primary_title ?= { set_variable = had_event_gdp_merchant_4010 } + } + + option = { # Maybe I should take that exam... + name = gdp_merchant.4010.a + trigger = { has_tgp_dlc_trigger = yes } + custom_tooltip = preparatory.imperial_examination.advantage.tt + imperial_examination_adjust_advantage_variable_effect = yes + if = { + limit = { has_trait = confucian_education } + add_trait_xp = { + trait = confucian_education + value = { 1 3 } + } + } + else = { + random = { + chance = root.learning + add_trait = confucian_education + } + } + stress_and_fulfillment_impact = { + base = medium_stress_impact_gain + diligent = medium_stress_impact_loss + patient = medium_stress_impact_loss + impatient = medium_stress_impact_gain + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 0.5 + ai_energy = 1 + } + modifier = { + OR = { + has_trait = impatient + has_trait = arrogant + } + factor = 0 + } + } + } + + option = { # And whose tea are you drinking? + name = gdp_merchant.4010.b + trigger = { + any_trade_route = { + any_traded_good = { this = trade_good_type:trade_good_tea } + } + } + add_prestige = medium_prestige_gain + stress_and_fulfillment_impact = { + stubborn = medium_stress_impact_loss + callous = medium_stress_impact_loss + shy = medium_stress_impact_gain + craven = medium_stress_impact_gain + } + ai_chance = { + base = 1000 + } + } + + option = { # Ignore them. + name = gdp_merchant.4010.c + trigger = { + NOT = { + any_trade_route = { + any_traded_good = { this = trade_good_type:trade_good_tea } + } + } + } + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + ai_value_modifier = { + ai_vengefulness = 1 + } + modifier = { + OR = { + has_trait = shy + has_trait = craven + } + factor = 0 + } + } + } + + after = { + scope:student = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# You join the Silk Road +gdp_merchant.4020 = { + type = character_event + title = gdp_merchant.4020.t + desc = { + desc = gdp_merchant.4020.desc + first_valid = { + triggered_desc = { + trigger = { + scope:silk_road_sub_region = { + sub_region_current_phase = phase_exceptional_bounty + } + } + desc = gdp_merchant.4020.desc.exceptional_bounty + } + triggered_desc = { + trigger = { + scope:silk_road_sub_region = { + sub_region_current_phase = phase_hardship + } + } + desc = gdp_merchant.4020.desc.hardship + } + desc = gdp_merchant.4020.desc.steady_trading + } + } + + theme = silk_road + override_effect_2d = { + trigger = { + scope:silk_road_sub_region = { + OR = { + sub_region_current_phase = phase_exceptional_bounty + sub_region_current_phase = phase_steady_trading + } + } + } + reference = legend_glow + } + override_sound = { reference = "event:/DLC/EP5/SFX/Stingers/ep5_mx_sting_merchant_joins_silk_road" } + + left_portrait = { + character = root + animation = steward + } + + trigger = { + is_ai = no + current_date_is_start_date_trigger = no # Only for Merchants who reach the Silk Road during play + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_4020 } + } + exists = scope:silk_road_sub_region + } + + immediate = { + primary_title ?= { set_variable = had_event_gdp_merchant_4020 } + } + + option = { + name = gdp_merchant.4020.a + } +} + +# You're a Merchant outside of the Silk Road hearing about it +gdp_merchant.4030 = { + type = character_event + title = gdp_merchant.4030.t + desc = { + desc = gdp_merchant.4030.desc.intro + # Fetch an inticing trade good + first_valid = { + triggered_desc = { + trigger = { + scope:rumoured_good ?= { this = trade_good_type:trade_good_silk } + } + desc = gdp_merchant.4030.desc.silk + } + triggered_desc = { + trigger = { + scope:rumoured_good ?= { this = trade_good_type:trade_good_spices } + } + desc = gdp_merchant.4030.desc.spice + } + triggered_desc = { + trigger = { + scope:rumoured_good ?= { this = trade_good_type:trade_good_jade } + } + desc = gdp_merchant.4030.desc.jade + } + triggered_desc = { + trigger = { + scope:rumoured_good ?= { this = trade_good_type:trade_good_ivory } + } + desc = gdp_merchant.4030.desc.ivory + } + } + desc = gdp_merchant.4030.desc.outro + } + + theme = merchant + override_background = study + + left_portrait = { + character = root + animation = merchant_box + } + + right_portrait = { + character = scope:associate + animation = storyteller + } + + artifact = { + trigger = { exists = scope:rumoured_curio } + target = scope:rumoured_curio + position = lower_right_portrait + } + + trigger = { + is_house_head = yes + is_available_adult = yes + government_has_flag = government_is_merchant + years_from_game_start >= 2 + num_taken_task_contracts < 1 + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_4030 } + } + # We gotta have a messenger + any_courtier = { gdp_merchant_1200_requester_trigger = yes } + exists = situation:silk_road_situation + # Not on the road already + NOR = { + situation:silk_road_situation ?= { + any_participant_group = { + participant_group_type = silk_road_merchant + participant_group_has_character = root + } + } + any_trade_route = { + any_trade_market_on_route = { + is_target_in_global_variable_list = { + name = silk_road_markets + target = this + } + } + } + } + # There has to be a good worth rumouring about + any_in_global_list = { + variable = silk_road_markets + is_rumourable_entrepot_market_trigger = { MERCHANT = root } + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 3 + any_trade_route = { + any_traded_good = { is_interesting_entrepot_good_trigger = yes } + } + } + } + + immediate = { + if = { + limit = { + any_courtier = { + has_court_position = partner_court_position + gdp_merchant_1200_requester_trigger = yes + } + } + random_courtier = { + limit = { + has_court_position = partner_court_position + gdp_merchant_1200_requester_trigger = yes + } + save_scope_as = associate + } + } + else = { + ordered_courtier = { + limit = { gdp_merchant_1200_requester_trigger = yes } + order_by = "opinion(root)" + save_scope_as = associate + } + } + domicile.domicile_location = { save_scope_as = company_location } + # Any market on the Silk Road can be the one tempting us away, not just the great entrepots. + every_in_global_list = { + variable = silk_road_markets + limit = { is_rumourable_entrepot_market_trigger = { MERCHANT = root } } + add_to_list = rumourable_markets + } + situation:silk_road_situation ?= { + every_situation_county = { + limit = { + title_province.barony.trade_market ?= { + is_rumourable_entrepot_market_trigger = { MERCHANT = root } + } + } + title_province.barony.trade_market ?= { add_to_list = rumourable_markets } + } + } + ordered_in_list = { + list = rumourable_markets + order_by = { # Ordered lists take the highest value first, so invert the distance + value = "trade_market_owner.title_province.squared_distance(scope:company_location)" + multiply = -1 + } + position = 0 + check_range_bounds = no + save_scope_as = rumoured_market + trade_market_owner.title_province = { save_scope_as = rumoured_market_location } + trade_market_owner.holder ?= { save_scope_as = rumoured_market_owner } + random_trade_good_with_surplus = { + limit = { is_interesting_entrepot_good_trigger = yes } + save_scope_as = rumoured_good + } + } + # The Associate bought the curio, so it is theirs until we ask for it + scope:associate = { + hidden_effect = { + switch = { + trigger = scope:rumoured_good + trade_good_type:trade_good_silk = { + create_artifact = { + name = gdp_merchant.4030.artifact.silk + description = gdp_merchant.4030.artifact.silk.desc + type = miscellaneous + visuals = fabric_roll + modifier = artifact_monthly_prestige_2_modifier + wealth = 50 + quality = 50 + max_durability = 30 + generate_history = no + save_scope_as = rumoured_curio + } + } + trade_good_type:trade_good_spices = { + create_artifact = { + name = gdp_merchant.4030.artifact.spice + description = gdp_merchant.4030.artifact.spice.desc + type = miscellaneous + visuals = pouch + modifier = artifact_monthly_prestige_2_modifier + wealth = 50 + quality = 50 + max_durability = 30 + generate_history = no + save_scope_as = rumoured_curio + } + } + trade_good_type:trade_good_jade = { + create_artifact = { + name = gdp_merchant.4030.artifact.jade + description = gdp_merchant.4030.artifact.jade.desc + type = miscellaneous + visuals = small_box + modifier = artifact_monthly_prestige_2_modifier + wealth = 50 + quality = 50 + max_durability = 30 + generate_history = no + save_scope_as = rumoured_curio + } + } + trade_good_type:trade_good_ivory = { + create_artifact = { + name = gdp_merchant.4030.artifact.ivory + description = gdp_merchant.4030.artifact.ivory.desc + type = miscellaneous + visuals = small_box + modifier = artifact_monthly_prestige_2_modifier + wealth = 50 + quality = 50 + max_durability = 30 + generate_history = no + save_scope_as = rumoured_curio + } + } + } + } + } + primary_title ?= { set_variable = had_event_gdp_merchant_4030 } + } + + option = { + name = gdp_merchant.4030.a + custom_tooltip = gdp_merchant_4030_a_tt + show_as_tooltip = { + reverse_add_opinion = { + target = scope:associate + modifier = pleased_opinion + opinion = 20 + } + house = { + add_unity_value = { + value = major_unity_gain + character = root + desc = merchant_associate_request_fulfill_gain + } + } + } + custom_tooltip = action_associate_request_help + add_to_variable_list = { + name = associate_requests + target = scope:associate + years = 5 + } + scope:associate = { + add_character_flag = { + flag = associate_request_cooldown + years = 10 + } + set_variable = { + name = associate_request_type + value = flag:silk_road_market + } + set_variable = { + name = associate_request_merchant + value = root + years = 6 + } + set_variable = { + name = associate_request_target_market + value = scope:rumoured_market + years = 5 + } + set_variable = { + name = associate_request_target_location + value = scope:rumoured_market_location + years = 5 + } + trigger_event = { + id = gdp_merchant.1201 + years = 5 + } + } + + stress_and_fulfillment_impact = { + ambitious = medium_stress_impact_loss + greedy = minor_stress_impact_loss + content = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1 + ai_greed = 1 + } + modifier = { + add = 50 + has_trait = ambitious + } + modifier = { + factor = 0.5 + has_trait = content + } + modifier = { # Even the closest market can be a world away + factor = 0.25 + scope:rumoured_market_location = { + squared_distance = { + target = scope:company_location + value > squared_distance_massive + } + } + } + } + } + + option = { # Nice artifact, lemme have it. + name = gdp_merchant.4030.b + trigger = { exists = scope:rumoured_curio } + scope:rumoured_curio = { set_owner = root } + + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + generous = minor_stress_impact_gain + } + ai_chance = { + base = 150 + ai_value_modifier = { + ai_greed = 1 + ai_boldness = -1 + } + } + } + + option = { # We have important business here actually + name = gdp_merchant.4030.c + add_character_modifier = { + modifier = gdp_local_business_modifier + years = 5 + } + house ?= { + add_unity_value = { + value = minor_unity_loss + character = root + desc = merchant_unity_local_business + } + } + + stress_and_fulfillment_impact = { + content = minor_stress_impact_loss + craven = minor_stress_impact_loss + ambitious = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = -1 + ai_energy = -1 + } + modifier = { + add = 50 + has_trait = content + } + modifier = { + factor = 0.5 + has_trait = ambitious + } + } + } +} + +# gdp_merchant.5000 - Usurer's Penance + +# Accuser's rite treats this loan as a religious offense. +scripted_trigger gdp_usury_penance_shunned_doctrine_trigger = { + OR = { + rite = { rite_has_parameter = usury_forbidden } + AND = { + rite = { rite_has_parameter = usury_outsiders_only } + religion = root.religion + } + } +} + +scripted_trigger gdp_usury_penance_discouraged_doctrine_trigger = { + rite = { rite_has_parameter = usury_discouraged } +} + +scripted_trigger gdp_usury_penance_accepted_doctrine_trigger = { + gdp_usury_penance_shunned_doctrine_trigger = no + gdp_usury_penance_discouraged_doctrine_trigger = no +} + +scripted_effect gdp_usury_penance_cast_fallback_clergy_effect = { + if = { + limit = { + NOT = { exists = scope:accuser } + } + random_pool_character = { + province = scope:debtor.location + limit = { + is_adult = yes + faith = scope:debtor.faith + rite = scope:debtor.rite + OR = { + has_trait = cleric + has_trait = devoted + has_trait = education_learning_1 + has_trait = education_learning_2 + has_trait = education_learning_3 + has_trait = education_learning_4 + } + } + save_scope_as = accuser + } + } + if = { + limit = { NOT = { exists = scope:accuser } } + scope:debtor = { save_scope_as = monk_employer } + create_character = { + location = scope:debtor.location + template = pam_monk_courtier_template + save_scope_as = accuser + after_creation = { + add_character_flag = created + } + } + } +} + +# Usurer's Penance +gdp_merchant.5000 = { + type = character_event + title = gdp_merchant.5000.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + var:gdp_usury_penance_accuser_type = flag:debtor + scope:debtor = { has_trait = paranoid } + } + desc = gdp_merchant.5000.desc.debtor_paranoid + } + triggered_desc = { + trigger = { var:gdp_usury_penance_accuser_type = flag:debtor } + desc = gdp_merchant.5000.desc.debtor + } + triggered_desc = { + trigger = { var:gdp_usury_penance_accuser_type = flag:steward } + desc = gdp_merchant.5000.desc.steward + } + triggered_desc = { + trigger = { var:gdp_usury_penance_accuser_type = flag:bishop } + desc = gdp_merchant.5000.desc.bishop + } + desc = gdp_merchant.5000.desc.clergy + } + desc = gdp_merchant.5000.desc.break + first_valid = { + triggered_desc = { + trigger = { + var:gdp_usury_penance_accuser_type = flag:debtor + scope:accuser = { gdp_usury_penance_shunned_doctrine_trigger = yes } + } + desc = gdp_merchant.5000.desc.shunned.debtor + } + triggered_desc = { + trigger = { + var:gdp_usury_penance_accuser_type = flag:debtor + scope:accuser = { gdp_usury_penance_discouraged_doctrine_trigger = yes } + } + desc = gdp_merchant.5000.desc.discouraged.debtor + } + triggered_desc = { + trigger = { + var:gdp_usury_penance_accuser_type = flag:steward + scope:accuser = { gdp_usury_penance_shunned_doctrine_trigger = yes } + } + desc = gdp_merchant.5000.desc.shunned.steward + } + triggered_desc = { + trigger = { + var:gdp_usury_penance_accuser_type = flag:steward + scope:accuser = { gdp_usury_penance_discouraged_doctrine_trigger = yes } + } + desc = gdp_merchant.5000.desc.discouraged.steward + } + triggered_desc = { + trigger = { + scope:accuser = { gdp_usury_penance_shunned_doctrine_trigger = yes } + } + desc = gdp_merchant.5000.desc.shunned + } + triggered_desc = { + trigger = { + scope:accuser = { gdp_usury_penance_discouraged_doctrine_trigger = yes } + } + desc = gdp_merchant.5000.desc.discouraged + } + triggered_desc = { + trigger = { + var:gdp_usury_penance_accuser_type = flag:steward + } + desc = gdp_merchant.5000.desc.accepted.steward + } + desc = gdp_merchant.5000.desc.accepted + } + } + theme = merchant + override_background = corridor_night + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + has_trait = arrogant + has_trait = stubborn + } + } + animation = dismissal + } + animation = worry + } + right_portrait = { + character = scope:accuser + triggered_animation = { + trigger = { scope:accuser = { has_trait = paranoid } } + animation = paranoia + } + triggered_animation = { + trigger = { scope:accuser = { has_trait = vengeful } } + animation = personality_vengeful + } + triggered_animation = { + trigger = { scope:accuser = { has_trait = wrathful } } + animation = anger + } + triggered_animation = { + trigger = { scope:accuser = { has_trait = cynical } } + animation = personality_cynical + } + triggered_animation = { + trigger = { + root = { + OR = { + var:gdp_usury_penance_accuser_type = flag:bishop + var:gdp_usury_penance_accuser_type = flag:clergy + } + } + } + animation = anger + } + animation = disapproval + } + lower_right_portrait = { + character = scope:debtor + trigger = { this != scope:accuser } + } + + trigger = { + is_alive = yes + exists = var:gdp_usury_penance_debtor + exists = var:gdp_usury_penance_loan + var:gdp_usury_penance_debtor = { + is_alive = yes + is_ai = yes + } + var:gdp_usury_penance_loan = { + exists = var:instrument + var:instrument = flag:disguised + var:lender = root + } + } + + immediate = { + play_music_cue = "mx_cue_negative" + var:gdp_usury_penance_debtor = { save_scope_as = debtor } + var:gdp_usury_penance_loan = { save_scope_as = loan } + scope:debtor = { + # We're not letting clergy speak for the debtor if they have a different faith from us or if they accept usury. + if = { + limit = { + OR = { + faith != root.faith + gdp_usury_penance_accepted_doctrine_trigger = yes + } + } + # But they have to be available, actually. And not waaay above our station. + if = { + limit = { + highest_held_title_tier < tier_empire + is_available_ai_adult = yes + } + save_scope_as = accuser + root = { + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:debtor + } + set_variable = gdp_usury_penance_accuser_is_debtor + } + } + # If they send a representative, we prefer the steward. + else = { + if = { + limit = { + cp:councillor_steward ?= { + is_available_adult = yes + this != root + this != scope:debtor + } + } + cp:councillor_steward ?= { save_scope_as = accuser } + } + else = { + ordered_courtier = { + limit = { + is_available_healthy_ai_adult = yes + this != root + } + order_by = stewardship + save_scope_as = accuser + } + } + root = { + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:steward + } + } + } + } + # Even if the debtor shares our faith, they might want to handle the matter themselves. + else_if = { + limit = { + is_adult = yes + is_available = yes + OR = { + has_trait = paranoid + has_trait = vengeful + has_trait = wrathful + has_trait = cynical + } + } + save_scope_as = accuser + root = { + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:debtor + } + set_variable = gdp_usury_penance_accuser_is_debtor + } + } + # Find a suitable religious char + else = { + capital_county.clerical_region_title.holder ?= { + if = { + limit = { + is_available_adult = yes + rite = scope:debtor.rite + this != root + this != scope:debtor + } + save_scope_as = accuser + } + } + if = { + limit = { + NOT = { exists = scope:accuser } + } + cp:councillor_court_chaplain ?= { + if = { + limit = { + is_available_adult = yes + rite = scope:debtor.rite + this != root + this != scope:debtor + } + save_scope_as = accuser + } + } + } + if = { + limit = { NOT = { exists = scope:accuser } } + gdp_usury_penance_cast_fallback_clergy_effect = yes + } + # Bishop for theocracies, priest otherwise. To reference in loc. + root = { + if = { + limit = { + scope:accuser = { government_has_flag = government_is_theocracy } + } + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:bishop + } + } + else = { + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:clergy + } + } + } + } + # Steward and courtier picks can both miss. Cast clergy so the portrait, loc, and duel have a target. + if = { + limit = { NOT = { exists = scope:accuser } } + gdp_usury_penance_cast_fallback_clergy_effect = yes + root = { + if = { + limit = { + scope:accuser = { government_has_flag = government_is_theocracy } + } + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:bishop + } + } + else = { + set_variable = { + name = gdp_usury_penance_accuser_type + value = flag:clergy + } + } + } + } + } + } + + # My patron's charter puts me above this. + option = { + name = { + trigger = { scope:accuser = root.suzerain } + text = gdp_merchant.5000.a.debtor + } + name = { + trigger = { scope:accuser != root.suzerain } + text = gdp_merchant.5000.a + } + trigger = { + merchant_has_charter_from_patron_trigger = { + EQUIPPED = no + INCLUDE_FORGERIES = no + } + } + reason = charter + custom_tooltip = gdp_usury_penance_loan_stands_tt + # Same patron reaction as abuse_charter_authority_decision. + if = { + limit = { exists = domicile.domicile_location } + merchant_charter_authority_scope_effect = { + PATRON = root.suzerain + MERCHANT = root + } + } + merchant_charter_abuse_counter_effect = { + PATRON = root.suzerain + MERCHANT = root + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + humble = minor_stress_impact_gain + greedy = minor_stress_impact_loss + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_greed = 0.5 + ai_boldness = 0.25 + ai_honor = -0.5 + } + } + } + + # Settle in goods, keep the debt. + option = { + name = gdp_merchant.5000.b + custom_tooltip = gdp_usury_penance_loan_stands_tt + add_character_modifier = { + modifier = gdp_usury_penance_seized_goods_modifier + years = 10 + } + add_prestige = medium_prestige_loss + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + generous = minor_stress_impact_gain + cynical = minor_stress_impact_loss + zealous = minor_stress_impact_gain + } + ai_chance = { + base = 20 + ai_value_modifier = { + ai_greed = 0.75 + ai_honor = 0.25 + } + } + } + + option = { # Check the fine print, actually... + name = gdp_merchant.5000.c + # Regardless of outcome, this will sting piety-wise + if = { + limit = { + gdp_usury_forbids_loan_trigger = { BORROWER = scope:debtor } + } + add_piety = medium_piety_loss + } + else_if = { + limit = { + gdp_usury_condemns_loan_trigger = { BORROWER = scope:debtor } + } + add_piety = minor_piety_loss + } + duel = { + skills = { diplomacy stewardship } + target = scope:accuser + 45 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -35 + } + modifier = { + add = -15 + scope:accuser = { + gdp_usury_condemns_loan_trigger = { BORROWER = scope:debtor } + } + } + modifier = { + add = -15 + faith = scope:debtor.faith + } + desc = gdp_merchant.5000.c.success + custom_tooltip = gdp_usury_penance_loan_stands_tt + } + 40 = { + compare_modifier = { + value = scope:duel_value + multiplier = -1.75 + min = -30 + } + desc = gdp_merchant.5000.c.failure + scope:loan = { + save_temporary_scope_value_as = { + name = principal_temp + value = gdp_loan_disguised_principal_value + } + set_variable = { + name = amount_owed + value = scope:principal_temp + } + set_variable = { + name = instrument + value = flag:free + } + } + custom_description = { + text = gdp_usury_penance_forgive_interest_tt + subject = root + object = scope:debtor + value = scope:principal_temp + } + if = { + limit = { + any_secret = { + type = secret_disguised_usury + secret_target = scope:debtor + } + } + random_secret = { + type = secret_disguised_usury + limit = { secret_target = scope:debtor } + remove_secret = yes + } + } + } + 15 = { + compare_modifier = { + value = scope:duel_value + multiplier = -1.75 + min = -10 + } + modifier = { + add = 10 + scope:accuser = { + gdp_usury_condemns_loan_trigger = { BORROWER = scope:debtor } + } + } + modifier = { + add = 10 + faith = scope:debtor.faith + } + desc = gdp_merchant.5000.c.critical + if = { + limit = { + NOT = { has_trait = dealbreaker } + } + add_trait = dealbreaker + } + if = { + limit = { faith = scope:debtor.faith } + add_character_modifier = { + modifier = gdp_usury_penance_same_faith_scandal_modifier + years = 10 + } + } + hidden_effect = { + if = { + limit = { + any_secret = { + type = secret_disguised_usury + secret_target = scope:debtor + } + } + random_secret = { + type = secret_disguised_usury + limit = { secret_target = scope:debtor } + remove_secret = yes + } + } + } + scope:loan = { forgive_loan_effect = yes } + } + } + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + honest = minor_stress_impact_gain + arrogant = minor_stress_impact_loss + craven = minor_stress_impact_gain + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_boldness = 0.5 + ai_rationality = 0.25 + ai_honor = -0.25 + } + modifier = { + factor = 0.5 + faith = scope:debtor.faith + } + } + } + + # Forgive the interest, keep the principal. Hidden unless the rite accepts usury. + option = { + name = gdp_merchant.5000.d + trigger = { + scope:debtor = { gdp_usury_penance_accepted_doctrine_trigger = yes } + } + # The forgiving + scope:loan = { + save_temporary_scope_value_as = { + name = principal_temp + value = gdp_loan_disguised_principal_value + } + set_variable = { + name = amount_owed + value = scope:principal_temp + } + set_variable = { + name = instrument + value = flag:free + } + } + custom_description = { + text = gdp_usury_penance_forgive_interest_tt + subject = root + object = scope:debtor + value = scope:principal_temp + } + hidden_effect = { + if = { + limit = { + any_secret = { + type = secret_disguised_usury + secret_target = scope:debtor + } + } + random_secret = { + type = secret_disguised_usury + limit = { secret_target = scope:debtor } + remove_secret = yes + } + } + } + stress_and_fulfillment_impact = { + honest = minor_stress_impact_loss + deceitful = minor_stress_impact_gain + generous = minor_stress_impact_loss + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 40 + ai_value_modifier = { + ai_honor = 0.5 + ai_rationality = 0.5 + ai_greed = -0.25 + } + } + } + + # Wipe the debt. Only when the rite shuns or discourages usury. + option = { + name = gdp_merchant.5000.e + trigger = { + scope:debtor = { + OR = { + gdp_usury_penance_shunned_doctrine_trigger = yes + gdp_usury_penance_discouraged_doctrine_trigger = yes + } + } + } + scope:debtor = { + add_opinion = { + target = root + modifier = gdp_interest_free_loan_opinion + opinion = low_positive_opinion + } + } + if = { + limit = { faith = scope:debtor.faith } + add_piety = minor_piety_gain + } + # Cancel loan + hidden_effect = { + if = { + limit = { + any_secret = { + type = secret_disguised_usury + secret_target = scope:debtor + } + } + random_secret = { + type = secret_disguised_usury + limit = { secret_target = scope:debtor } + remove_secret = yes + } + } + } + scope:loan = { forgive_loan_effect = yes } + stress_and_fulfillment_impact = { + generous = medium_stress_impact_loss + greedy = medium_stress_impact_gain + zealous = minor_stress_impact_loss + cynical = minor_stress_impact_gain + compassionate = minor_stress_impact_loss + callous = minor_stress_impact_gain + } + ai_chance = { + base = 15 + ai_value_modifier = { + ai_compassion = 0.75 + ai_honor = 0.5 + ai_greed = -1 + } + } + } + + on_trigger_fail = { + remove_variable = gdp_usury_penance_debtor + remove_variable = gdp_usury_penance_loan + } + + after = { + remove_variable = gdp_usury_penance_debtor + remove_variable = gdp_usury_penance_loan + remove_variable = gdp_usury_penance_accuser_type + remove_variable = gdp_usury_penance_accuser_is_debtor + scope:accuser ?= { + silent_disappearance_ai_if_created_effect = yes + } + } +} + +# gdp_merchant.5010 - The debtor discovers the hidden interest. +gdp_merchant.5010 = { + type = character_event + title = gdp_merchant.5010.t + desc = gdp_merchant.5010.desc + theme = merchant + override_background = { reference = study } + left_portrait = { + character = root + animation = chancellor + } + lower_right_portrait = scope:lender + + trigger = { + is_alive = yes + exists = var:gdp_usury_debtor_discover_lender + exists = var:gdp_usury_debtor_discover_loan + var:gdp_usury_debtor_discover_lender = { is_alive = yes } + var:gdp_usury_debtor_discover_loan = { + exists = var:instrument + var:instrument = flag:disguised + } + any_known_secret = { # Prevent firing if player exposed immediately via UI + secret_type = secret_disguised_usury + secret_owner = root.var:gdp_usury_debtor_discover_lender + secret_target = root + } + } + + immediate = { + var:gdp_usury_debtor_discover_lender = { save_scope_as = lender } + var:gdp_usury_debtor_discover_loan = { save_scope_as = loan } + save_scope_as = debtor + hidden_effect = { + scope:loan = { set_variable = gdp_usury_known } + } + } + + # Keep the disguised interest a secret. + option = { + name = gdp_merchant.5010.a + custom_tooltip = gdp_usury_debtor_keep_secret_tt + if = { + limit = { scope:lender = { is_ai = no } } + scope:lender = { + send_interface_message = { + type = event_secret_neutral + title = gdp_usury_debtor_kept_secret_message + desc = gdp_usury_debtor_kept_secret_message_desc + left_icon = scope:debtor + } + } + } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_loss + lazy = minor_stress_impact_loss + impatient = minor_stress_impact_gain + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_boldness = -0.5 + ai_energy = -0.5 + ai_vengefulness = -0.25 + } + } + } + + # The creditor pays the hidden interest back. + option = { + name = { # Have paid back interest already + text = gdp_merchant.5010.b + trigger = { scope:loan.var:amount_owed < scope:loan.gdp_loan_less_interest_value } + } + name = { # Have not paid back interest + text = gdp_merchant.5010.b.wipe + trigger = { scope:loan.var:amount_owed >= scope:loan.gdp_loan_less_interest_value } + } + gdp_usury_debtor_discover_interest_tooltip_effect = yes + if = { + limit = { scope:lender = { is_ai = no } } + custom_tooltip = gdp_usury_debtor_demand_repayment_tt + custom_tooltip = gdp_usury_debtor_inform_creditor_tt + scope:lender = { + trigger_event = gdp_merchant.5020 + } + } + else = { + scope:lender = { + save_scope_value_as = { + name = usury_skip_pay_toast + value = yes + } + gdp_usury_pay_back_disguised_interest_effect = yes + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + just = minor_stress_impact_loss + arbitrary = minor_stress_impact_gain + generous = minor_stress_impact_gain + } + ai_chance = { + base = 40 + ai_value_modifier = { + ai_greed = 1 + ai_vengefulness = 0.5 + ai_honor = 0.25 + } + } + } + + # Refuse the debt outright. + option = { + name = gdp_merchant.5010.c + if = { + limit = { scope:lender = { is_ai = no } } + scope:loan = { + var:lender ?= { save_scope_as = repudiated_lender } + story_owner = { save_scope_as = repudiating_borrower } + } + custom_tooltip = repudiate_loan_tt + custom_tooltip = gdp_repudiate_usurious_loan_credit_tt + custom_tooltip = gdp_usury_debtor_inform_creditor_tt + scope:lender = { trigger_event = gdp_merchant.5040 } + } + else = { + scope:loan = { gdp_usury_repudiate_loan_effect = yes } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + generous = minor_stress_impact_gain + content = minor_stress_impact_gain + } + ai_chance = { + base = 20 + ai_value_modifier = { + ai_greed = 0.5 + ai_vengefulness = 0.5 + ai_honor = -0.75 + } + } + } + + after = { + remove_variable = gdp_usury_debtor_discover_lender + remove_variable = gdp_usury_debtor_discover_loan + } +} + +# gdp_merchant.5020 - The creditor answers a demand to repay the hidden interest. +gdp_merchant.5020 = { + type = letter_event + opening = gdp_merchant.5020.opening + desc = gdp_merchant.5020.desc + sender = scope:debtor + + trigger = { + is_alive = yes + exists = scope:debtor + scope:debtor = { is_alive = yes } + exists = scope:loan + scope:loan = { + exists = var:instrument + var:instrument = flag:disguised + var:lender = root + } + } + + option = { + name = gdp_merchant.5020.a + gdp_usury_pay_back_disguised_interest_effect = yes + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + just = minor_stress_impact_loss + greedy = medium_stress_impact_gain + arbitrary = minor_stress_impact_gain + } + ai_chance = { + base = 50 + ai_value_modifier = { + ai_honor = 0.5 + ai_compassion = 0.25 + ai_greed = -1 + } + } + } +} + +# gdp_merchant.5040 - The debtor repudiates the loan. +gdp_merchant.5040 = { + type = letter_event + opening = gdp_merchant.5040.opening + desc = gdp_merchant.5040.desc + sender = scope:debtor + + trigger = { + is_alive = yes + exists = scope:debtor + scope:debtor = { is_alive = yes } + exists = scope:loan + scope:loan = { + exists = var:instrument + var:instrument = flag:disguised + var:lender = root + } + } + + option = { + name = gdp_merchant.5040.a + save_scope_value_as = { + name = usury_skip_repudiate_toast + value = yes + } + scope:loan = { gdp_usury_repudiate_loan_effect = yes } + } +} + +# Caravaneer capstone +gdp_merchant.8000 = { + type = character_event + title = gdp_merchant.8000.t + desc = gdp_merchant.8000.desc + theme = merchant + left_portrait = { + character = root + animation = dromedary_holding + } + override_background = { reference = wilderness } + + immediate = { + merchant_caravaneer_capstone_reward_effect = yes + } + + option = { + name = gdp_merchant.8000.a + if = { + limit = { exists = scope:nickname_choice } + give_nickname = nick_the_caravaneer + } + ai_chance = { base = 100 } + } + + option = { + trigger = { exists = scope:nickname_choice } + name = gdp_merchant.8000.b + ai_chance = { base = 0 } + } +} + +# Artisan capstone +gdp_merchant.8001 = { + type = character_event + title = gdp_merchant.8001.t + desc = gdp_merchant.8001.desc + theme = merchant + left_portrait = { + character = root + animation = merchant_box + } + + immediate = { + merchant_artisan_capstone_reward_effect = yes + } + + option = { + name = gdp_merchant.8001.a + if = { + limit = { exists = scope:nickname_choice } + give_nickname = nick_the_artisan + } + ai_chance = { base = 100 } + } + + option = { + trigger = { exists = scope:nickname_choice } + name = gdp_merchant.8001.b + ai_chance = { base = 0 } + } +} + +# Creditor capstone +gdp_merchant.8002 = { + type = character_event + title = gdp_merchant.8002.t + desc = gdp_merchant.8002.desc + theme = merchant + left_portrait = { + character = root + animation = steward + } + + immediate = { + merchant_creditor_capstone_reward_effect = yes + } + + option = { + name = gdp_merchant.8002.a + if = { + limit = { exists = scope:nickname_choice } + give_nickname = nick_the_lender + } + ai_chance = { base = 100 } + } + + option = { + trigger = { exists = scope:nickname_choice } + name = gdp_merchant.8002.b + ai_chance = { base = 0 } + } +} + +# Caravaneer: Write Travelogue Start +gdp_merchant.8010 = { + type = character_event + title = gdp_merchant.8010.t + desc = gdp_merchant.8010.desc + theme = merchant + override_background = { reference = study } + left_portrait = { + character = root + animation = writing + } + + trigger = { + is_landless_merchant = yes + exists = primary_title.var:merchant_company_caravaneer_capstone_unlocked + } + + immediate = { + random_in_list = { + variable = visited_poi + limit = { + "squared_distance(root.domicile.domicile_location)" > squared_distance_large + save_temporary_scope_as = poi_temp + NOT = { + root = { + is_target_in_variable_list = { + name = travelogue_poi + target = scope:poi_temp + } + } + } + } + weight = { + base = 1 + modifier = { add = "squared_distance(root.domicile.domicile_location)" } + modifier = { factor = province_size_level } + } + save_scope_as = poi + } + add_to_variable_list = { + name = travelogue_poi + target = scope:poi + } + hidden_effect = { + random_list = { + 5 = { + modifier = { + add = 10 + scope:poi.county.holder.top_liege.highest_held_title_tier = tier_duchy + } + set_variable = { + name = poi_title + value = scope:poi.duchy + years = 2 + } + } + 5 = { + modifier = { + add = 10 + scope:poi.county.holder.top_liege.highest_held_title_tier = tier_kingdom + } + set_variable = { + name = poi_title + value = scope:poi.kingdom + years = 2 + } + } + 5 = { + modifier = { + add = 10 + scope:poi.county.holder.top_liege.highest_held_title_tier = tier_empire + } + set_variable = { + name = poi_title + value = scope:poi.empire + years = 2 + } + } + 20 = { + trigger = { scope:poi.county.holder.top_liege.highest_held_title_tier = tier_hegemony } + set_variable = { + name = poi_title + value = scope:poi.county.holder.top_liege.primary_title + } + } + 1 = { + set_variable = { + name = poi_title + value = scope:poi.barony + years = 2 + } + } + } + } + } + + option = { + name = gdp_merchant.8010.a # Customs + custom_tooltip = gdp_merchant.8010.a.tt + set_variable = { + name = travelogue_topic + value = flag:travelogue_customs + } + } + + option = { + name = gdp_merchant.8010.b # Markets + custom_tooltip = gdp_merchant.8010.a.tt + set_variable = { + name = travelogue_topic + value = flag:travelogue_markets + } + } + + option = { + name = gdp_merchant.8010.c # Places + custom_tooltip = gdp_merchant.8010.a.tt + set_variable = { + name = travelogue_topic + value = flag:travelogue_places + } + } + + after = { + add_character_modifier = { + modifier = writing_travelogue + years = 1 + } + trigger_event = { + id = gdp_merchant.8011 + years = 1 + } + stress_and_fulfillment_impact = { + base = major_stress_impact_gain + lazy = minor_stress_impact_gain + journaller = minor_stress_impact_loss #offsets penalty a bit + lifestyle_scholar = minor_stress_impact_loss #offsets penalty a bit + } + } +} + +# Caravaneer: Write Travelogue End +gdp_merchant.8011 = { + type = character_event + title = gdp_merchant.8011.t + desc = { + desc = gdp_merchant.8011.intro + triggered_desc = { + trigger = { scope:quality_of_artifact = flag:weak } + desc = gdp_merchant.8011.weak + } + triggered_desc = { + trigger = { scope:quality_of_artifact = flag:mid } + desc = gdp_merchant.8011.mid + } + triggered_desc = { + trigger = { scope:quality_of_artifact = flag:great } + desc = gdp_merchant.8011.great + } + } + theme = merchant + override_background = { reference = study } + + left_portrait = { + character = root + animation = writing #We change the background in each event but not the animation, the background is what root is writing about + } + artifact = { # To display the artifact in the event-window + trigger = { exists = scope:newly_created_artifact } + target = scope:newly_created_artifact + position = lower_right_portrait + } + + trigger = { + is_landless_merchant = yes + exists = primary_title.var:merchant_company_caravaneer_capstone_unlocked + } + + immediate = { + save_scope_as = author + #First we make the artifact, then we assign effects and descriptions. + hidden_effect = { + if = { + limit = { artifacts_use_indian_books_trigger = yes } + create_artifact = { + name = TODO #This is replaced below + type = journal + creator = root + description = TODO #This is replaced below + visuals = indian_book + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = 50 + quality = 50 + } + } + else = { + create_artifact = { + name = TODO #This is replaced below + type = journal + creator = root + description = TODO #This is replaced below + visuals = book + modifier = artifact_placeholder_modifier + save_scope_as = newly_created_artifact + wealth = 50 + quality = 50 + } + } + } + #Common effect for adding modifiers! + hidden_effect_new_object = { + #Decide the skill level: + random_list = { + 33 = { + trigger = { + OR = { + NOT = { has_trait = lifestyle_traveler } + has_trait_xp = { + trait = lifestyle_traveler + track = travel + value < 60 + } + NOT = { has_trait = lifestyle_merchant } + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value < 60 + } + } + } + modifier = { + has_trait = journaller + add = -10 + } + modifier = { + has_trait = lifestyle_traveler + add = -10 + } + modifier = { + has_trait = lifestyle_merchant + add = -10 + } + modifier = { + has_trait_xp = { + trait = lifestyle_traveler + track = travel + value > 20 + } + add = -10 + } + modifier = { + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value > 20 + } + add = -10 + } + modifier = { + has_trait_xp = { + trait = lifestyle_traveler + track = travel + value > 40 + } + add = -10 + } + modifier = { + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value > 40 + } + add = -10 + } + save_scope_value_as = { + name = quality_of_artifact + value = flag:weak + } + } + 33 = { + save_scope_value_as = { + name = quality_of_artifact + value = flag:mid + } + } + 33 = { + trigger = { + OR = { + has_trait_xp = { + trait = lifestyle_traveler + track = travel + value > 40 + } + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value > 40 + } + } + } + modifier = { + has_trait = journaller + add = 10 + } + modifier = { + has_trait_xp = { + trait = lifestyle_traveler + track = travel + value > 60 + } + add = 17 + } + modifier = { + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value > 60 + } + add = 17 + } + modifier = { + has_trait_xp = { + trait = lifestyle_traveler + track = travel + value > 80 + } + add = 20 + } + modifier = { + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value > 80 + } + add = 20 + } + save_scope_value_as = { + name = quality_of_artifact + value = flag:great + } + } + } + scope:newly_created_artifact = { + #And now we give modifiers: + switch = { + trigger = scope:quality_of_artifact + flag:weak = { + set_artifact_rarity_common = yes + switch = { + trigger = root.var:travelogue_topic + flag:travelogue_customs = { + random_list = { + 70 = { + add_artifact_modifier = artifact_diplomacy_1_modifier + } + 30 = { + modifier = { + add = root.diplomacy + } + add_artifact_modifier = artifact_diplomacy_2_modifier + } + } + } + flag:travelogue_markets = { + random_list = { + 70 = { + add_artifact_modifier = artifact_stewardship_1_modifier + } + 30 = { + modifier = { + add = root.stewardship + } + add_artifact_modifier = artifact_stewardship_2_modifier + } + } + } + flag:travelogue_places = { + random_list = { + 70 = { + add_artifact_modifier = artifact_learning_1_modifier + } + 30 = { + modifier = { + add = root.learning + } + add_artifact_modifier = artifact_learning_2_modifier + } + } + } + } + add_artifact_modifier = artifact_monthly_prestige_2_modifier + random_list = { + 80 = { } + 10 = { add_artifact_modifier = artifact_trait_track_travel_xp_gain_mult_1_modifier } + } + random_list = { + 80 = { } + 10 = { add_artifact_modifier = artifact_trait_track_caravaneer_xp_gain_mult_1_modifier } + } + } + flag:mid = { + #Influence & Confucian Education Gain + set_artifact_rarity_masterwork = yes + switch = { + trigger = root.var:travelogue_topic + flag:travelogue_customs = { + random_list = { + 70 = { + add_artifact_modifier = artifact_diplomacy_1_modifier + } + 30 = { + modifier = { + add = root.diplomacy + } + add_artifact_modifier = artifact_diplomacy_2_modifier + } + } + } + flag:travelogue_markets = { + random_list = { + 70 = { + add_artifact_modifier = artifact_stewardship_1_modifier + } + 30 = { + modifier = { + add = root.stewardship + } + add_artifact_modifier = artifact_stewardship_2_modifier + } + } + } + flag:travelogue_places = { + random_list = { + 70 = { + add_artifact_modifier = artifact_learning_1_modifier + } + 30 = { + modifier = { + add = root.learning + } + add_artifact_modifier = artifact_learning_2_modifier + } + } + } + } + add_artifact_modifier = artifact_monthly_prestige_4_modifier + random_list = { + 40 = { add_artifact_modifier = artifact_trait_track_travel_xp_gain_mult_1_modifier } + 60 = { + modifier = { + add = root.learning + } + add_artifact_modifier = artifact_trait_track_travel_xp_gain_mult_2_modifier + } + } + random_list = { + 40 = { add_artifact_modifier = artifact_trait_track_caravaneer_xp_gain_mult_1_modifier } + 60 = { + modifier = { + add = root.learning + } + add_artifact_modifier = artifact_trait_track_caravaneer_xp_gain_mult_2_modifier + } + } + } + flag:great = { + #Influence & Confucian Education Gain + set_artifact_rarity_famed = yes + switch = { + trigger = root.var:travelogue_topic + flag:travelogue_customs = { + random_list = { + 70 = { + add_artifact_modifier = artifact_diplomacy_1_modifier + } + 30 = { + modifier = { + add = root.diplomacy + } + add_artifact_modifier = artifact_diplomacy_2_modifier + } + } + } + flag:travelogue_markets = { + random_list = { + 70 = { + add_artifact_modifier = artifact_stewardship_1_modifier + } + 30 = { + modifier = { + add = root.stewardship + } + add_artifact_modifier = artifact_stewardship_2_modifier + } + } + } + flag:travelogue_places = { + random_list = { + 70 = { + add_artifact_modifier = artifact_learning_1_modifier + } + 30 = { + modifier = { + add = root.learning + } + add_artifact_modifier = artifact_learning_2_modifier + } + } + } + } + add_artifact_modifier = artifact_monthly_prestige_6_modifier + add_artifact_modifier = artifact_trait_track_travel_xp_gain_mult_2_modifier + add_artifact_modifier = artifact_trait_track_caravaneer_xp_gain_mult_2_modifier + } + } + set_artifact_description = travelogue_description_full + random_list = { + 10 = { + set_artifact_name = travelogue_name_1 + } + 10 = { + set_artifact_name = travelogue_name_2 + } + 10 = { + set_artifact_name = travelogue_name_3 + } + 10 = { + set_artifact_name = travelogue_name_4 + } + 10 = { + set_artifact_name = travelogue_name_5 + } + 10 = { + set_artifact_name = travelogue_name_6 + } + 10 = { + set_artifact_name = travelogue_name_7 + } + 1 = { + set_artifact_name = travelogue_name_8 + } + 20 = { + trigger = { root.var:travelogue_topic ?= flag:travelogue_customs } + set_artifact_name = travelogue_name_9 + } + 10 = { + trigger = { root.var:travelogue_topic ?= flag:travelogue_places } + set_artifact_name = travelogue_name_10 + } + 1 = { + set_artifact_name = travelogue_name_11 + } + 10 = { + set_artifact_name = travelogue_name_12 + } + 10 = { + set_artifact_name = travelogue_name_13 + } + 10 = { + set_artifact_name = travelogue_name_14 + } + } + } + } + show_as_tooltip = { + scope:newly_created_artifact = { set_owner = root } + remove_character_modifier = writing_travelogue + } + } + + option = { + name = gdp_merchant.8011.a + } + + option = { + name = gdp_merchant.8011.b + scope:newly_created_artifact = { + custom_tooltip = { + text = reforge_artifact_library_item_tt + reforge_artifact = { type = library_item } + } + } + } + + after = { + remove_variable = travelogue_topic + remove_variable = poi_title + } +} + +scripted_trigger gdp_merchant_8020_merchant_trigger = { + is_landless_merchant = yes + NOT = { has_character_flag = gdp_merchant_8021_cooldown } + is_available_quick = { + adult = yes + activity = no + travel = no + incapable = no + imprisoned = no + } + domicile = { has_domicile_parameter = company_curiosity_visitors } + any_equipped_character_artifact = { + OR = { + artifact_slot_type = library + artifact_slot_type = creature + artifact_slot_type = curio + } + } +} + +scripted_trigger gdp_merchant_8020_visitor_trigger = { + NOT = { has_character_flag = gdp_merchant_8021_cooldown } + is_available_quick = { + ai = yes + adult = yes + incapable = no + imprisoned = no + in_army = no + } + NOR = { + liege ?= root + employer ?= root + court_owner ?= root + has_relation_rival = root + } + save_temporary_scope_as = visitor_temp + root = { + NOT = { + is_target_in_variable_list = { + name = gdp_merchant_8020_cooldown + target = scope:visitor_temp + } + } + } +} + +# Caravaneer: Merchant Visitor Selection +gdp_merchant.8020 = { + hidden = yes + + trigger = { gdp_merchant_8020_merchant_trigger = yes } + + immediate = { + random_list = { + 10 = { + trigger = { + any_pool_character = { + province = root.domicile.domicile_location + gdp_merchant_8020_visitor_trigger = yes + } + } + random_pool_character = { + province = root.domicile.domicile_location + limit = { gdp_merchant_8020_visitor_trigger = yes } + save_scope_as = visitor + } + } + 50 = { + trigger = { + suzerain = { gdp_merchant_8020_visitor_trigger = yes } + } + suzerain = { save_scope_as = visitor } + } + 25 = { + trigger = { + any_in_global_list = { + variable = merchants_tally + holder ?= { + gdp_merchant_8020_visitor_trigger = yes + gdp_merchant_diplo_range_trigger = { TARGET = this MERCHANT = root } + } + } + } + random_in_global_list = { + variable = merchants_tally + limit = { + holder ?= { + gdp_merchant_8020_visitor_trigger = yes + gdp_merchant_diplo_range_trigger = { TARGET = this MERCHANT = root } + } + } + holder = { save_scope_as = visitor } + } + } + 10 = { + trigger = { + any_in_global_list = { + variable = laamps_tally + holder ?= { + gdp_merchant_8020_visitor_trigger = yes + ep3_laamp_diplo_range_trigger = { TARGET = root LAAMP = this } + } + } + } + random_in_global_list = { + variable = laamps_tally + limit = { + holder ?= { + gdp_merchant_8020_visitor_trigger = yes + ep3_laamp_diplo_range_trigger = { TARGET = root LAAMP = this } + } + } + holder = { save_scope_as = visitor } + } + } + 25 = { + trigger = { + domicile.domicile_location.empire = { + any_in_de_jure_hierarchy = { + holder ?= { + gdp_merchant_8020_visitor_trigger = yes + gdp_merchant_diplo_range_trigger = { TARGET = this MERCHANT = root } + } + } + } + } + domicile.domicile_location.empire = { + random_in_de_jure_hierarchy = { + limit = { + holder ?= { + gdp_merchant_8020_visitor_trigger = yes + gdp_merchant_diplo_range_trigger = { TARGET = this MERCHANT = root } + } + } + weight = { + base = 5 + modifier = { + add = { + value = holder.highest_held_title_tier + multiply = -1 + } + } + } + holder = { save_scope_as = visitor } + } + } + } + 50 = {} + } + trigger_event = gdp_merchant.8021 + } +} + +# Caravaneer: Merchant recieves Visitor +gdp_merchant.8021 = { + type = character_event + title = gdp_merchant.8021.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:visitor = suzerain } + desc = gdp_merchant.8021.suzerain + } + triggered_desc = { + trigger = { + scope:visitor = { is_landless_merchant = yes } + } + desc = gdp_merchant.8021.merchant + } + triggered_desc = { + trigger = { + scope:visitor = { is_landless_adventurer = yes } + } + desc = gdp_merchant.8021.laamp + } + triggered_desc = { + trigger = { is_ruler = yes } + desc = gdp_merchant.8021.ruler + } + desc = gdp_merchant.8021.fallback + } + desc = gdp_merchant.8021.desc + first_valid = { + triggered_desc = { + trigger = { + scope:artifact = { artifact_slot_type = curio } + } + desc = gdp_merchant.8021.curio + } + triggered_desc = { + trigger = { + scope:artifact = { artifact_slot_type = library } + } + desc = gdp_merchant.8021.library + } + desc = gdp_merchant.8021.creature + } + } + theme = merchant + left_portrait = { + animation = admiration + character = root + } + right_portrait = { + character = scope:visitor + animation = deliberation + } + artifact = { + target = scope:artifact + position = lower_center_portrait + } + + trigger = { + exists = scope:visitor + gdp_merchant_8020_merchant_trigger = yes + } + + immediate = { + add_character_flag = { + flag = gdp_merchant_8021_cooldown + years = 3 + } + add_to_variable_list = { + name = gdp_merchant_8020_cooldown + target = scope:visitor + years = 15 + } + random_equipped_character_artifact = { + limit = { + OR = { + artifact_slot_type = library + artifact_slot_type = creature + artifact_slot_type = curio + } + } + save_scope_as = artifact + } + add_prestige = { + value = { + value = minor_prestige_value + # Artifact + if = { + limit = { scope:artifact = { rarity = masterwork } } + multiply = 1.5 + } + if = { + limit = { scope:artifact = { rarity = famed } } + multiply = 2 + } + if = { + limit = { scope:artifact = { rarity = illustrious } } + multiply = 2.5 + } + # Tier + if = { + limit = { + scope:visitor = { is_landed = yes } + scope:visitor.highest_held_title_tier = tier_county + } + multiply = 1.5 + } + if = { + limit = { + scope:visitor = { is_landed = yes } + scope:visitor.highest_held_title_tier = tier_duchy + } + multiply = 2 + } + if = { + limit = { + scope:visitor = { is_landed = yes } + scope:visitor.highest_held_title_tier = tier_kingdom + } + multiply = 2.5 + } + if = { + limit = { + scope:visitor = { is_landed = yes } + scope:visitor.highest_held_title_tier >= tier_empire + } + multiply = 3 + } + } + } + } + + option = { + name = gdp_merchant.8021.a + } + + option = { + name = gdp_merchant.8021.b + trigger = { + scope:visitor = { + is_ruler = yes + short_term_gold >= major_gold_value + trigger_if = { + limit = { + scope:artifact = { artifact_slot_type = creature } + } + is_landless_merchant = yes + } + } + } + show_as_unavailable = { + scope:visitor = { is_ruler = yes } + } + scope:visitor = { + pay_short_term_gold = { + gold = { + value = root.minor_gold_value + if = { + limit = { scope:artifact = { rarity = masterwork } } + multiply = 2 + } + if = { + limit = { scope:artifact = { rarity = famed } } + multiply = 3 + } + if = { + limit = { scope:artifact = { rarity = illustrious } } + multiply = 4 + } + } + target = root + } + } + scope:artifact = { + set_owner = { + target = scope:visitor + history = { + type = purchased + actor = root + recipient = scope:visitor + } + } + hidden_effect = { + if = { + limit = { + scope:visitor = { is_landless_merchant = no } + } + if = { + limit = { artifact_slot_type = library } + if = { + limit = { + scope:visitor = { has_royal_court = yes } + } + reforge_artifact = { type = book } + } + else = { + reforge_artifact = { type = journal } + } + } + else_if = { + limit = { artifact_slot_type = curio } + if = { + limit = { + scope:visitor = { has_royal_court = yes } + } + reforge_artifact = { + type = pedestal + visuals = small_box + } + } + else = { + reforge_artifact = { type = miscellaneous } + } + } + } + } + } + } +} + +# Move Company +gdp_merchant.9000 = { + type = character_event + hidden = yes + + immediate = { + location = { save_scope_as = origin } + var:new_capital = { save_scope_as = relocation_destination } + gdp_move_company_departure_effect = { + MERCHANT = this + OLD_MARKET = this.domicile.domicile_location.barony.trade_market + NEW_MARKET = scope:relocation_destination.barony.trade_market + OLD_PATRON = suzerain + NEW_PATRON = var:new_patron + } + hidden_effect = { + domicile = { move_domicile = scope:relocation_destination } + } + set_location = scope:origin + remove_variable = new_patron + remove_variable = new_capital + if = { + limit = { has_character_flag = being_evicted } + remove_character_flag = being_evicted + remove_variable = evicting_ruler + } + } +} + +# Forced Eviction Notice +gdp_merchant.9005 = { + type = character_event + title = gdp_merchant.9005.t + desc = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:courtier } + desc = gdp_merchant.9005.desc_intro + } + desc = gdp_merchant.9005.desc_intro.fallback + } + first_valid = { + triggered_desc = { + trigger = { + is_known_dealbreaker_trigger = { KNOWER = scope:expeller } + } + desc = gdp_merchant.9005.desc_body.dealbreaker + } + triggered_desc = { + trigger = { + OR = { + has_relation_rival = scope:expeller + has_relation_nemesis = scope:expeller + } + } + desc = gdp_merchant.9005.desc_body.enemies + } + desc = gdp_merchant.9005.desc_body.fallback + } + } + theme = merchant + override_background = study + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + has_trait = arrogant + has_trait = stubborn + } + } + animation = dismissal + } + animation = worry + } + right_portrait = { + trigger = { exists = scope:courtier } + character = scope:courtier + animation = anger + } + lower_right_portrait = { + character = scope:expeller + } + + trigger = { + is_ai = no + exists = scope:expeller + } + + immediate = { + play_music_cue = "mx_cue_negative" + if = { + limit = { + any_courtier = { + has_court_position = partner_court_position + is_available_ai_adult = yes + } + } + random_courtier = { + limit = { + has_court_position = partner_court_position + is_available_ai_adult = yes + } + save_scope_as = courtier + } + } + else_if = { + limit = { + any_courtier = { is_available_ai_adult = yes } + } + ordered_courtier = { + limit = { is_available_ai_adult = yes } + order_by = "opinion(root)" + save_scope_as = courtier + } + } + } + + option = { + name = gdp_merchant.9005.a + custom_tooltip = gdp_merchant.9005.a.tt + show_as_tooltip = { + add_opinion = { + target = scope:expeller + modifier = demanded_eviction_opinion + } + } + } +} + +# Client change messages +gdp_merchant.9011 = { + type = character_event + hidden = yes + cooldown = { days = 1 } + + trigger = { + domicile ?= { is_domicile_type = merchant_company } + government_has_flag = government_is_merchant # Republics share the domicile type + } + + immediate = { + # scope:merchant, scope:old_suzerain and scope:new_suzerain are saved in gdp_merchant_patron_change_on_title_transfer_effect + if = { + limit = { + exists = scope:old_suzerain + exists = scope:new_suzerain + scope:new_suzerain = { is_alive = yes } + NOT = { scope:old_suzerain = scope:new_suzerain } + } + if = { + limit = { + exists = scope:old_suzerain + scope:old_suzerain = { is_alive = yes } + } + scope:old_suzerain = { + send_interface_toast = { + type = event_toast_text_neutral + title = msg_client_lost_title + desc = msg_client_lost_desc + left_icon = scope:merchant + right_icon = scope:new_suzerain + show_as_tooltip = { + start_tributary_interaction_effect = { + TRIBUTARY = scope:merchant + SUZERAIN = scope:new_suzerain + } + } + } + } + } + gdp_notify_subject_overlord_changed_effect = yes + if = { + limit = { + scope:merchant != scope:old_suzerain + scope:old_suzerain = { is_alive = yes } + } + scope:new_suzerain = { + send_interface_toast = { + type = event_toast_text_neutral + title = msg_client_gained_title + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:merchant = { government_has_flag = government_is_merchant } + } + desc = msg_patron_changed_desc + } + desc = msg_suzerain_changed_desc + } + } + left_icon = scope:merchant + right_icon = scope:old_suzerain + } + } + } + } + else_if = { + limit = { + exists = scope:new_suzerain + scope:new_suzerain = { is_alive = yes } + NOT = { scope:merchant ?= scope:new_suzerain } + } + gdp_notify_subject_overlord_gained_effect = yes + } + else_if = { + limit = { + exists = scope:old_suzerain + NOT = { scope:merchant ?= scope:old_suzerain } + } + gdp_notify_subject_overlord_lost_effect = yes + } + } +} + +# AI commissions a merchant +gdp_merchant.9020 = { + type = character_event + hidden = yes + + trigger = { + # Allow trade to stabilize somewhat before commissions + years_from_game_start >= 2 + # ...AI only... + is_ai = yes + # ...landed, duke, market owner... + commission_trade_route_commissioner_trigger = yes + # ...needs something... + any_held_trade_market = { + OR = { + any_trade_good_with_unfulfilled_need = { save_temporary_scope_as = target_temp } + any_trade_category_with_unfulfilled_need = { + any_trade_good_in_category = { save_temporary_scope_as = target_temp } + } + } + save_temporary_scope_as = trade_market_temp + } + # ...consider creating a distribution route first if possible + should_create_distribution_route = no + save_temporary_scope_as = commissioner_temp + # We look up scopes after the chance roll so we do not search twice + # If they cannot be found, we skip quietly + } + + immediate = { + save_scope_value_as = { # for debugging + name = commission_chance + value = commission_trade_route_yearly_chance + } + random = { + chance = scope:commission_chance + save_scope_as = commissioner + random_held_trade_market = { + limit = { market_has_any_need_trigger = yes } + weight = { + base = 1 + # Prioritize higher overall needs + diversify_commission_route_market_need_modifier = yes + modifier = { + add = 1 + # Prioritize food + market_has_food_need_trigger = yes + } + modifier = { + factor = 2 + scope:commissioner.capital_province.barony.trade_market ?= this + } + } + save_scope_as = trade_market + # 1. Establish all categories with need or good need + every_trade_category_with_unfulfilled_need = { add_to_list = needed_categories } + every_trade_good_with_unfulfilled_need = { + trade_good_need_category = { add_to_list = needed_categories } + } + # 2. Find a suitable good need from one of those categories + random_in_list = { + list = needed_categories + weight = { + base = 2 + # Weight by need + diversify_commission_route_category_need_modifier = yes + # Prefer to diversify if possible + diversify_commission_route_category_routes_modifier = yes + # Prioritize food + modifier = { + OR = { + this = trade_good_category:trade_category_cereals + this = trade_good_category:trade_category_meat + } + factor = 2 + } + } + save_scope_as = category + scope:category ?= { + random_trade_good_in_category = { + weight = { + base = 2 + # Weight by need + diversify_commission_route_good_need_modifier = yes + # Prefer to diversify if possible + diversify_commission_route_good_routes_modifier = yes + } + save_scope_as = target + } + } + } + } + } + if = { + limit = { exists = scope:target } + random_tributary = { + limit = { + government_has_flag = government_is_merchant + commission_trade_route_merchant_trigger = { + COMMISSIONER = scope:commissioner + MERCHANT = this + } + commission_trade_route_good_trigger = { + COMMISSIONER = scope:commissioner + MARKET = scope:trade_market + GOOD = scope:target + MERCHANT = this + } + } + weight = { + base = 1 + # REALM + modifier = { + capital_province.county.holder.top_liege = scope:commissioner.top_liege + add = 1 + } + # COMPANY SIZE + modifier = { # Prefer cool companies + add = company_size_value + } + # CULTURE + modifier = { + culture = scope:commissioner.culture + add = 1 + } + modifier = { + culture = { has_same_culture_heritage = scope:commissioner.culture } + add = 1 + } + modifier = { + culture = { has_same_culture_language = scope:commissioner.culture } + add = 1 + } + # FAITH + modifier = { + rite = scope:commissioner.rite + add = 1 + } + modifier = { + faith = scope:commissioner.faith + add = 1 + } + modifier = { + religion = scope:commissioner.religion + add = 1 + } + modifier = { + faith = { + faith_hostility_level = { + target = scope:commissioner.faith + value >= faith_astray_level + } + } + add = -1 + } + modifier = { + faith = { + faith_hostility_level = { + target = scope:commissioner.faith + value >= faith_hostile_level + } + } + add = -1 + } + modifier = { + faith = { + faith_hostility_level = { + target = scope:commissioner.faith + value >= faith_evil_level + } + } + add = -1 + } + # EXPERTISE + first_valid = { + modifier = { + factor = 4 + exists = scope:target + primary_title = { save_temporary_scope_as = company_title_temp } + scope:target = { + any_trade_category = { + save_temporary_scope_as = category_expertise_temp + scope:company_title_temp = { + trade_good_category_level = { + target = scope:category_expertise_temp + value >= merchant_monopoly_trade_expertise_level_high_value + } + } + } + } + } + modifier = { + factor = 3 + exists = scope:target + primary_title = { save_temporary_scope_as = company_title_temp } + scope:target = { + any_trade_category = { + save_temporary_scope_as = category_expertise_temp + scope:company_title_temp = { + trade_good_category_level = { + target = scope:category_expertise_temp + value >= merchant_monopoly_trade_expertise_level_medium_value + } + } + } + } + } + modifier = { + factor = 2 + exists = scope:target + primary_title = { save_temporary_scope_as = company_title_temp } + scope:target = { + any_trade_category = { + save_temporary_scope_as = category_expertise_temp + scope:company_title_temp = { + trade_good_category_level = { + target = scope:category_expertise_temp + value >= merchant_monopoly_trade_expertise_level_low_value + } + } + } + } + } + } + # Favor players for visibility + modifier = { + is_ai = no + factor = 3 + } + } + save_scope_as = merchant + } + } + if = { + limit = { exists = scope:merchant } + scope:merchant = { + trigger_event = gdp_merchant.9021 + } + } + # ERROR SUPPRESSION + if = { + limit = { + always = no + any_in_list = { variable = commission_routes } + } + add_to_variable_list = { + name = commission_routes + target = scope:commissioner + } + } + } +} + +# Merchant accepts commission +gdp_merchant.9021 = { + type = letter_event + opening = gdp_merchant.9021.opening + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:commissioner = { + OR = { + has_diarchy_type = regency + has_diarchy_type = temporary_regency + } + } + } + desc = gdp_merchant.9021.diarch.desc + } + desc = gdp_merchant.9021.no_diarch.desc + } + desc = gdp_merchant.9021.desc + } + sender = scope:letter_sender + + immediate = { + ## Making sure that child rulers are represented by their diarch + if = { + limit = { + scope:commissioner = { + OR = { + has_diarchy_type = regency + has_diarchy_type = temporary_regency + } + } + } + scope:commissioner.diarch ?= { + save_scope_as = letter_sender + } + } + else = { + scope:commissioner = { + save_scope_as = letter_sender + } + } + } + + option = { + name = gdp_merchant.9021.a + # The market can change while the letter waits for an answer + trigger = { + commission_trade_route_good_trigger = { + COMMISSIONER = scope:commissioner + MARKET = scope:trade_market + GOOD = scope:target + MERCHANT = scope:merchant + } + } + show_as_unavailable = { always = yes } + scope:commissioner = { + # ...and again between choosing this option and it taking effect + if = { + limit = { + commission_trade_route_good_trigger = { + COMMISSIONER = scope:commissioner + MARKET = scope:trade_market + GOOD = scope:target + MERCHANT = scope:merchant + } + } + add_prestige = { + subtract = gdp_commission_route_cost_value + } + scope:merchant = { + add_prestige = { + value = gdp_commission_route_cost_value + divide = 2 + } + } + commission_merchant_effect = { + MERCHANT = scope:merchant + GOOD = scope:target + DEST = scope:trade_market + YEARS = 10 + } + } + } + custom_tooltip = commission_merchant_cancel_warning_tt + ai_chance = { + base = 25 + opinion_modifier = { + opinion_target = scope:commissioner + multiplier = 0.25 + } + ai_value_modifier = { + ai_greed = 0.5 + } + } + } + + option = { + name = gdp_merchant.9021.b + # Turning down a commission that could not go ahead anyway is not held against the merchant + if = { + limit = { + commission_trade_route_good_trigger = { + COMMISSIONER = scope:commissioner + MARKET = scope:trade_market + GOOD = scope:target + MERCHANT = scope:merchant + } + } + custom_tooltip = { + text = gdp_merchant.9021.b.cooldown_tt + set_variable = { + name = commission_trade_route_cooldown + years = commission_trade_route_merchant_cooldown_years_value + } + } + reverse_add_opinion = { + modifier = disappointed_opinion + target = scope:commissioner + opinion = -15 + } + } + ai_chance = { + base = 10 + opinion_modifier = { + opinion_target = scope:commissioner + multiplier = -0.25 + } + ai_value_modifier = { + ai_greed = -0.5 + } + } + } + # Let's debug + after = { + if = { + limit = { + this = character:bookmark_wuhsha_al_dallala + } + if = { + limit = { + NOT = { exists = global_var:commissions_tally } + } + set_global_variable = { + name = commissions_tally + value = 1 + } + } + change_global_variable = { + name = commissions_tally + add = 1 + } + } + } +} + +# You are a merchant who just became a patrician +gdp_merchant.9100 = { + type = character_event + title = gdp_merchant.9100.t + desc = gdp_merchant.9100.desc + theme = republic + left_portrait = { + character = root + animation = admiration + } + lower_right_portrait = scope:new_patrician_liege + + immediate = { + show_as_tooltip = { + get_title = primary_title + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + change_liege = { + liege = scope:new_patrician_liege + change = scope:change + } + resolve_title_and_vassal_change = scope:change + change_government = republic_government + } + } + + option = { + name = gdp_merchant.9100.a + } +} + +gdp_merchant.9110 = { + type = character_event + title = gdp_merchant.9110.t + desc = gdp_merchant.9110.desc + theme = republic + left_portrait = { + character = root + animation = stress + } + lower_right_portrait = scope:destroyer + + trigger = { + NOT = { has_character_flag = deposed_despot } + } + + immediate = { + show_as_tooltip = { + get_title = primary_title + create_title_and_vassal_change = { + type = conquest + save_scope_as = change + } + becomes_independent = { change = scope:change } + resolve_title_and_vassal_change = scope:change + start_tributary = { + contract_group = tributary_merchant + suzerain = suzerain + } + change_government = merchant_government + } + custom_tooltip = merchant_patrician_transition_domicile_tt + } + + option = { + name = gdp_merchant.9110.a + } +} diff --git a/events/dlc/gdp/gdp_merchant_family_events.txt b/events/dlc/gdp/gdp_merchant_family_events.txt new file mode 100644 index 000000000..a82cf232b --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_family_events.txt @@ -0,0 +1,4023 @@ +namespace = gdp_merchant_family + +### +# gdp_merchant_family.0001 - Runaway Bride/Groom +# gdp_merchant_family.0002 - Thicker Than Water +# gdp_merchant_family.0003 - Suffer No Dishonor +# gdp_merchant_family.0004 - An Auspicious Offer +# gdp_merchant_family.0005 - A Shame Upon the House +# gdp_merchant_family.0010 - Low House Unity causes fighting +# gdp_merchant_family.0015 - A Business Confidant +# gdp_merchant_family.0020 - Talent Exchange +# gdp_merchant_family.0025 - Nothing Personal +# gdp_merchant_family.0030 - House Member(s) loiter instead of working + +scripted_effect gdp_merchant_family_0001_marry_and_start_camp_effect = { + scope:house_member = { + if = { + limit = { + is_female = yes + is_lowborn = no + scope:wedding_interest = { + is_lowborn = yes + } + } + marry_matrilineal = scope:wedding_interest + } + else_if = { + limit = { + is_male = yes + is_lowborn = yes + scope:wedding_interest = { + is_lowborn = no + } + } + marry_matrilineal = scope:wedding_interest + } + else = { + marry = scope:wedding_interest + } + if = { + limit = { has_playable_adventurer_dlc_trigger = yes } + create_landless_adventurer_title_effect = { + REASON = flag:runaway_allowed + FLAVOR_CHAR = root + } + add_courtier = scope:wedding_interest + } + else = { + select_and_move_to_pool_effect = yes + scope:wedding_interest = { select_and_move_to_pool_effect = yes } + } + } +} + +# House member of root who is available to run away +scripted_trigger gdp_merchant_family_0001_valid_house_member_trigger = { + is_available_ai_adult = yes + NOR = { + is_married = yes + has_trait = chaste + has_trait = celibate + has_sexuality = asexual + } + is_attracted_to_gender_of = $WEDDING_INTEREST$ + is_courtier_of = root +} + +# Available to run away +scripted_trigger gdp_merchant_family_0001_valid_wedding_interest_trigger = { + is_available_ai_adult = yes + is_house_head = no + liege ?= { + is_ai = yes + } + NOR = { + is_married = yes + has_trait = chaste + has_trait = celibate + has_sexuality = asexual + } + save_temporary_scope_as = gdp_merchant_family_0001_wedding_interest_check + root = { + any_close_family_member = { + gdp_merchant_family_0001_valid_house_member_trigger = { WEDDING_INTEREST = scope:gdp_merchant_family_0001_wedding_interest_check } + } + } +} + +# Star-Crossed Lovers +gdp_merchant_family.0001 = { + type = character_event + title = gdp_merchant_family.0001.t + desc = { + desc = gdp_merchant_family.0001.desc + first_valid = { + triggered_desc = { + trigger = { + scope:house_member = { + OR = { + has_trait = callous + has_trait = stubborn + has_trait = arrogant + } + } + } + desc = gdp_merchant_family.0001.desc.stubborn_outro + } + desc = gdp_merchant_family.0001.desc.fallback_outro + } + } + theme = marriage + override_background = corridor_night + left_portrait = { + character = scope:house_member + triggered_animation = { + trigger = { + scope:house_member = { + OR = { + has_trait = callous + has_trait = stubborn + has_trait = arrogant + } + } + } + animation = war_over_win + } + animation = beg + camera = camera_event_right + } + right_portrait = { + character = scope:wedding_interest + animation = worry + } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + is_available_adult = yes + # We only want this to happen once in a campaign + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_family_0001 } + } + house ?= { + OR = { + has_house_unity_stage = rapacious_cs + has_house_unity_stage = opportunistic_cs + } + any_house_relation = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + any_house_member = { + gdp_merchant_family_0001_valid_wedding_interest_trigger = yes + } + } + } + } + } + + weight_multiplier = { + modifier = { + factor = 2 + house ?= { + any_house_relation = { + count >= 2 + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + } + } + + immediate = { + primary_title ?= { + set_variable = had_event_gdp_merchant_family_0001 + } + house ?= { + random_house_relation = { + limit = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + any_house_member = { + gdp_merchant_family_0001_valid_wedding_interest_trigger = yes + } + } + } + random_relation_house = { + limit = { + this != root.house + any_house_member = { + gdp_merchant_family_0001_valid_wedding_interest_trigger = yes + } + } + save_scope_as = wedding_interest_house + house_head = { save_scope_as = wedding_interest_house_head } + random_house_member = { + limit = { + gdp_merchant_family_0001_valid_wedding_interest_trigger = yes + } + save_scope_as = wedding_interest + } + } + } + } + random_close_family_member = { + limit = { + gdp_merchant_family_0001_valid_house_member_trigger = { WEDDING_INTEREST = scope:wedding_interest } + } + save_scope_as = house_member + } + } + + option = { # Take the gold, and go with my blessing. + name = gdp_merchant_family.0001.a + pay_short_term_gold = { + target = scope:house_member + gold = { + add = scope:wedding_interest.sum_of_all_skills_value + add = scope:wedding_interest.prowess + } + } + gdp_merchant_family_0001_marry_and_start_camp_effect = yes + ai_chance = { + base = 10 + + modifier = { + factor = 0 + OR = { + has_trait = greedy + gold <= { + add = scope:wedding_interest.sum_of_all_skills_and_prowess_value + multiply = 2 + } + } + } + } + } + + option = { # Convince both to stay. + name = gdp_merchant_family.0001.b + skill = intrigue + + duel = { + skill = intrigue + value = high_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_merchant_family.0001.b.success + send_interface_toast = { + title = gdp_merchant_family.0001.b.success + left_icon = scope:house_member + right_icon = scope:wedding_interest + gdp_merchant_family_0001_marry_and_start_camp_effect = yes + scope:house_member = { + progress_towards_friend_effect = { + CHARACTER = root + OPINION = 0 + REASON = friend_helped_me_marry + } + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 50 + } + } + scope:wedding_interest = { save_scope_as = relationship_reason_involved_character } + clear_saved_scope = relationship_reason_involved_character + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + desc = gdp_merchant_family.0001.b.failure + send_interface_toast = { + title = gdp_merchant_family.0001.b.failure + left_icon = scope:house_member + right_icon = scope:wedding_interest + scope:house_member = { + add_stress = medium_stress_gain + add_opinion = { + target = root + modifier = disappointed_opinion + opinion = -30 + } + } + } + } + } + + stress_and_fulfillment_impact = { + generous = medium_stress_impact_gain + } + + ai_chance = { + base = 10 + + modifier = { + factor = 0 + has_trait = generous + } + } + } + + option = { # Refuse them + name = gdp_merchant_family.0001.c + + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + generous = medium_stress_impact_gain + callous = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + chaste = minor_stress_impact_loss + } + scope:house_member = { + add_opinion = { + target = root + modifier = heartbroken_opinion + opinion = -30 + } + } + ai_chance = { + base = 10 + + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = generous + } + } + } + } +} + +scripted_trigger gdp_merchant_family_0002_adopted_trigger = { + OR = { + has_character_flag = merchant_adopted + has_trait = adopted_no_inheritance + } +} + +# Thicker than Water +# water is an adopted house member or associate who outdoes a blood relative +# We weigh this up when they are adopted, since the stakes are clearer +gdp_merchant_family.0002 = { + type = character_event + title = gdp_merchant_family.0002.t + desc = { + desc = gdp_merchant_family.0002.desc_intro + first_valid = { + triggered_desc = { + trigger = { + scope:water = { gdp_merchant_family_0002_adopted_trigger = yes } + } + desc = gdp_merchant_family.0002.desc_adopted + } + desc = gdp_merchant_family.0002.desc_associate + } + desc = gdp_merchant_family.0002.desc_outro + } + theme = family + left_portrait = { + character = root + animation = stressed_teacher + } + right_portrait = { + character = scope:blood + animation = debating + } + lower_right_portrait = { + character = scope:water + } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + # We only want this to happen once in a campaign + primary_title ?= { + NOT = { has_variable = had_event_gdp_merchant_family_0002 } + } + OR = { + AND = { + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + gdp_merchant_family_0002_adopted_trigger = yes + save_temporary_scope_as = temp_water_adopted + } + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + NOT = { gdp_merchant_family_0002_adopted_trigger = yes } + sum_of_all_skills_value < scope:temp_water_adopted.sum_of_all_skills_value + } + } + AND = { + any_courtier = { + is_available_ai_adult = yes + NOR = { + is_spouse_of = root + is_close_family_of = root + gdp_merchant_family_0002_adopted_trigger = yes + } + save_temporary_scope_as = temp_water_associate + } + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + NOT = { gdp_merchant_family_0002_adopted_trigger = yes } + sum_of_all_skills_value < scope:temp_water_associate.sum_of_all_skills_value + } + } + } + } + + weight_multiplier = { + modifier = { + add = 2 + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + gdp_merchant_family_0002_adopted_trigger = yes + sum_of_all_skills_value >= sum_of_all_skills_threshold_good + } + } + } + + immediate = { + primary_title ?= { + set_variable = had_event_gdp_merchant_family_0002 + } + # Prefer an adopted house member + if = { + limit = { + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + gdp_merchant_family_0002_adopted_trigger = yes + save_temporary_scope_as = temp_water_adopted + } + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + NOT = { gdp_merchant_family_0002_adopted_trigger = yes } + sum_of_all_skills_value < scope:temp_water_adopted.sum_of_all_skills_value + } + } + random_close_family_member = { + limit = { + is_available_ai_adult = yes + is_courtier_of = root + gdp_merchant_family_0002_adopted_trigger = yes + # Only an adopted member who actually outdoes a blood relative, so scope:blood can always be saved + save_temporary_scope_as = temp_water + root = { + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + NOT = { gdp_merchant_family_0002_adopted_trigger = yes } + sum_of_all_skills_value < scope:temp_water.sum_of_all_skills_value + } + } + } + # They better be good + weight = { + base = 1 + modifier = { + add = sum_of_all_skills_value + } + } + save_scope_as = water + } + } + # Fallback to any skilled associate who isn't a house member + else = { + random_courtier = { + limit = { + is_available_ai_adult = yes + NOR = { + is_spouse_of = root + is_close_family_of = root + gdp_merchant_family_0002_adopted_trigger = yes + } + save_temporary_scope_as = temp_water + root = { + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + NOT = { gdp_merchant_family_0002_adopted_trigger = yes } + sum_of_all_skills_value < scope:temp_water.sum_of_all_skills_value + } + } + } + weight = { + base = 1 + modifier = { + add = sum_of_all_skills_value + } + } + save_scope_as = water + } + } + random_close_family_member = { + limit = { + is_available_ai_adult = yes + is_courtier_of = root + NOT = { gdp_merchant_family_0002_adopted_trigger = yes } + sum_of_all_skills_value < scope:water.sum_of_all_skills_value + } + save_scope_as = blood + } + } + + # Side with blood relative / family loyalty + option = { + name = gdp_merchant_family.0002.a + house = { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_merchant_family.0002.a.unity_gain.desc + } + } + add_character_modifier = { + modifier = gdp_nepotism_modifier + years = 10 + } + scope:blood = { + add_stewardship_skill = 1 + } + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + callous = minor_stress_impact_loss + greedy = minor_stress_impact_gain + } + + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = medium_chance_impact_negative_ai_value + } + modifier = { + add = 20 + has_trait = arbitrary + } + modifier = { + add = 20 + has_trait = callous + } + modifier = { + add = -15 + has_trait = greedy + } + } + } + + # Side with the higher-performing water candidate + option = { + name = gdp_merchant_family.0002.b + house = { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant_family.0002.b.unity_loss.desc + } + } + add_character_modifier = { + modifier = gdp_merit_modifier + years = 10 + } + stress_and_fulfillment_impact = { + cynical = minor_stress_impact_loss + greedy = minor_stress_impact_loss + } + + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = medium_chance_impact_positive_ai_value + } + modifier = { + add = 10 + has_trait = cynical + } + modifier = { + add = 10 + has_trait = greedy + } + } + } + + # Figure it out + option = { + name = gdp_merchant_family.0002.c + + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + + lazy = minor_stress_impact_loss + cynical = minor_stress_impact_loss + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + add = 25 + has_trait = lazy + } + modifier = { + add = 20 + has_trait = cynical + } + modifier = { + add = -20 + has_trait = compassionate + } + } + } +} + +# Suffer no Dishonor +gdp_merchant_family.0003 = { + type = character_event + title = gdp_merchant_family.0003.t + desc = gdp_merchant_family.0003.desc + theme = family + left_portrait = { + character = root + animation = shock + } + right_portrait = { + character = scope:offended + animation = anger + } + lower_right_portrait = { + character = scope:offender + } + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + house ?= { + OR = { + has_house_unity_stage = ennobled_cs + has_house_unity_stage = grasping_cs + } + any_house_relation = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + any_house_member = { + is_available_ai_adult = yes + NOR = { + has_trait = compassionate + has_trait = calm + } + } + } + } + } + any_close_family_member = { + is_available_ai_adult = yes + is_courtier_of = root + NOR = { + has_trait = content + has_trait = calm + } + } + } + + weight_multiplier = { + modifier = { + factor = 2 + house ?= { + any_house_relation = { + count >= 2 + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + } + } + + immediate = { + house ?= { + random_house_relation = { + limit = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + any_house_member = { + is_available_ai_adult = yes + NOR = { + has_trait = compassionate + has_trait = calm + } + save_temporary_scope_as = temp_offender + } + } + } + } + scope:temp_offender = { save_scope_as = offender } + } + random_close_family_member = { + limit = { + is_available_ai_adult = yes + is_courtier_of = root + NOR = { + has_trait = content + has_trait = calm + } + } + save_scope_as = offended + } + } + + # I demand an apology! + option = { + name = gdp_merchant_family.0003.a + house = { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_merchant_family.0003.a.unity_gain.desc + } + change_house_relation_effect = { + HOUSE = scope:offender.house + VALUE = house_relation_damage_minor_value + REASON = gdp_merchant_family.0003.a.relation_damage.desc + CHAR = root + TARGET_CHAR = scope:offender.house.house_head + TITLE = scope:dummy_gender + } + } + add_prestige = minor_prestige_gain + + stress_and_fulfillment_impact = { + brave = minor_stress_impact_loss + callous = minor_stress_impact_loss + humble = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = medium_chance_impact_negative_ai_value + } + modifier = { + add = 20 + has_trait = brave + } + modifier = { + add = 20 + has_trait = callous + } + modifier = { + add = -20 + has_trait = humble + } + modifier = { + add = -20 + has_trait = shy + } + } + } + + # that's bait + option = { + name = gdp_merchant_family.0003.b + add_prestige = minor_prestige_loss + add_character_modifier = { + modifier = gdp_full_attention_modifier + years = 10 + } + house = { + add_unity_value = { + value = medium_unity_loss + character = root + desc = gdp_merchant_family.0003.b.unity_loss.desc + } + } + + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_gain + deceitful = minor_stress_impact_loss + cynical = minor_stress_impact_loss + } + + ai_chance = { + base = 10 + + ai_value_modifier = { + ai_greed = medium_chance_impact_positive_ai_value + ai_sociability = medium_chance_impact_negative_ai_value + } + modifier = { + add = -15 + has_trait = compassionate + } + modifier = { + add = 15 + has_trait = cynical + } + modifier = { + add = 15 + has_trait = deceitful + } + } + } + + # I don't want anything to do with that. + option = { + name = gdp_merchant_family.0003.c + house = { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant_family.0003.c.unity_loss.desc + } + } + scope:offended = { + add_stewardship_skill = 1 + add_character_modifier = { + modifier = gdp_responsible_modifier + years = 10 + } + } + + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + + lazy = minor_stress_impact_loss + cynical = minor_stress_impact_loss + compassionate = minor_stress_impact_gain + } + + ai_chance = { + base = 10 + modifier = { + add = 20 + has_trait = lazy + } + modifier = { + add = 15 + has_trait = cynical + } + modifier = { + add = -10 + has_trait = compassionate + } + } + } +} + +# Close family member of root who can marry the suitor +scripted_trigger gdp_merchant_family_0004_valid_family_member_trigger = { + is_available_ai_adult = yes + is_courtier_of = root + can_marry_character_trigger = { + CHARACTER = $OFFER$ + } +} + +# Suitor from a friendly house +scripted_trigger gdp_merchant_family_0004_valid_offer_trigger = { + is_available_ai_adult = yes + is_ruler = no + liege ?= { + is_ai = yes + } + can_marry_trigger = yes + save_temporary_scope_as = gdp_merchant_family_0004_offer_check + root = { + any_close_family_member = { + gdp_merchant_family_0004_valid_family_member_trigger = { OFFER = scope:gdp_merchant_family_0004_offer_check } + } + } +} + +# An Auspicious Offer +gdp_merchant_family.0004 = { + type = character_event + title = gdp_merchant_family.0004.t + desc = gdp_merchant_family.0004.desc + theme = family + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:offer_2 + animation = throne_room_conversation_4 + } + lower_left_portrait = { + character = scope:offer + } + override_background = { + reference = alley_day + } + + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + house ?= { + OR = { + has_house_unity_stage = ennobled_cs + has_house_unity_stage = grasping_cs + } + any_house_relation = { + NOR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + any_house_member = { + gdp_merchant_family_0004_valid_offer_trigger = yes + } + } + } + } + } + + immediate = { + random_dummy_gender_effect = yes + house ?= { + random_house_relation = { + limit = { + NOR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + any_house_member = { + gdp_merchant_family_0004_valid_offer_trigger = yes + } + } + } + random_relation_house = { + limit = { + this != root.house + any_house_member = { + gdp_merchant_family_0004_valid_offer_trigger = yes + } + } + random_house_member = { + limit = { + gdp_merchant_family_0004_valid_offer_trigger = yes + } + save_scope_as = offer_2 + liege = { + save_scope_as = foreign_liege + } + } + } + } + } + random_close_family_member = { + limit = { + gdp_merchant_family_0004_valid_family_member_trigger = { OFFER = scope:offer_2 } + } + save_scope_as = offer + } + scope:offer_2 = { + visit_court_of = root + } + } + + # I accept! + option = { + name = gdp_merchant_family.0004.a + if = { + limit = { + OR = { + scope:offer = { + is_adult = no + } + scope:offer_2 = { + is_adult = no + } + } + } + betroth_on_realm_law = { + SPOUSE_1 = scope:offer + SPOUSE_2 = scope:offer_2 + } + } + else = { + marry_on_realm_law = { + SPOUSE_1 = scope:offer + SPOUSE_2 = scope:offer_2 + } + } + add_prestige = minor_prestige_gain + + stress_and_fulfillment_impact = { + brave = minor_stress_impact_loss + humble = minor_stress_impact_loss + shy = minor_stress_impact_gain + } + + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = medium_chance_impact_positive_ai_value + } + modifier = { + add = 25 + has_trait = brave + } + modifier = { + add = -20 + has_trait = humble + } + modifier = { + add = -20 + has_trait = shy + } + } + } + + # TRADE OFFER + option = { + name = gdp_merchant_family.0004.b + scope:offer_2.house.house_head = { + add_character_modifier = { + modifier = gdp_cooperation_modifier + years = 10 + } + } + add_character_modifier = { + modifier = gdp_cooperation_modifier + years = 10 + } + house ?= { + change_house_relation_effect = { + HOUSE = scope:offer_2.house + VALUE = house_relation_improve_minor_value + REASON = gdp_merchant_family.0004.b.relation_improve.desc + CHAR = root + TARGET_CHAR = scope:offer_2.house.house_head + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + } + + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = medium_chance_impact_positive_ai_value + } + modifier = { + add = 20 + has_trait = greedy + } + } + } + + # No, thanks. + option = { + name = gdp_merchant_family.0004.c + + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + lazy = minor_stress_impact_loss + paranoid = minor_stress_impact_loss + ambitious = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + add = -20 + has_trait = ambitious + } + modifier = { + add = 20 + has_trait = lazy + } + modifier = { + add = 20 + has_trait = paranoid + } + } + } +} + +# A Shame Upon the House +gdp_merchant_family.0005 = { + type = character_event + title = gdp_merchant_family.0005.t + desc = gdp_merchant_family.0005.desc + theme = family + left_portrait = { + character = root + animation = anger + } + right_portrait = { + character = scope:wayward + animation = stress + } + + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + house ?= { + has_house_unity_stage = rapacious_cs + } + any_close_family_member = { + is_courtier_of = root + is_available_ai_adult = yes + } + } + + immediate = { + random_close_family_member = { + limit = { + is_courtier_of = root + is_available_ai_adult = yes + } + weight = { + base = 1 + modifier = { + factor = 0.5 + OR = { + has_trait = just + has_trait = honest + has_trait = compassionate + has_trait = ambitious + } + } + modifier = { + factor = 2 + OR = { + has_trait = lazy + has_trait = content + has_trait = profligate + } + } + } + save_scope_as = wayward + } + } + + # SHAME ON YOU! + option = { + name = gdp_merchant_family.0005.a + add_prestige = minor_prestige_gain + + house = { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant_family.0005.a.unity_loss.desc + } + } + + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + humble = minor_stress_impact_gain + shy = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + + ai_chance = { + base = 10 + + ai_value_modifier = { + ai_sociability = low_chance_impact_negative_ai_value + } + + modifier = { + add = 20 + has_trait = arbitrary + } + modifier = { + add = 20 + has_trait = sadistic + } + modifier = { + add = -25 + has_trait = humble + } + modifier = { + add = -25 + has_trait = shy + } + modifier = { + add = -20 + has_trait = compassionate + } + } + } + + # Family First + option = { + name = gdp_merchant_family.0005.b + add_prestige = minor_prestige_loss + house = { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_merchant_family.0005.b.unity_gain.desc + } + } + + stress_and_fulfillment_impact = { + content = minor_stress_impact_loss + generous = minor_stress_impact_loss + ambitious = minor_stress_impact_gain + } + + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = medium_chance_impact_negative_ai_value + } + modifier = { + add = 30 + has_trait = content + } + modifier = { + add = 20 + has_trait = generous + } + modifier = { + add = -15 + has_trait = ambitious + } + } + } + + # No, thanks. + option = { + name = gdp_merchant_family.0005.c + + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + lazy = minor_stress_impact_loss + ambitious = minor_stress_impact_gain + } + + + ai_chance = { + base = 10 + + modifier = { + add = -20 + has_trait = ambitious + } + + modifier = { + add = 20 + has_trait = lazy + } + } + } +} + +# The Tipping of the Scales +gdp_merchant_family.0010 = { + type = character_event + title = gdp_merchant_family.0010.t + desc = gdp_merchant_family.0010.desc + theme = merchant + override_background = { reference = market } + left_portrait = { + character = scope:attacker + animation = aggressive_unarmed + } + right_portrait = { + character = scope:defender + animation = wrestling_yield_start + } + + cooldown = { years = 20 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + house ?= { + OR = { + has_house_unity_stage = rapacious_cs + has_house_unity_stage = opportunistic_cs + } + } + any_courtier = { + is_available_ai_adult = yes + save_temporary_scope_as = temp_char + } + any_courtier = { + this != scope:temp_char + is_available_ai_adult = yes + can_set_relation_rival_trigger = { CHARACTER = scope:temp_char } + } + } + + immediate = { + ordered_courtier = { + order_by = prowess + limit = { is_available_ai_adult = yes } + save_scope_as = attacker + } + scope:attacker = { assign_quirk_effect = yes } + random_courtier = { + limit = { + this != scope:attacker + is_available_ai_adult = yes + can_set_relation_rival_trigger = { CHARACTER = scope:attacker } + } + save_scope_as = defender + } + scope:defender = { assign_quirk_effect = yes } + # Plus make sure we _definitely_ know who root is, for the after-toasts. + save_scope_as = og_root + } + + option = { # Intervene + name = gdp_merchant_family.0010.a + duel = { + skill = diplomacy + target = scope:attacker + # Victory! + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_family.0010.a.tt.success + send_interface_toast = { + title = gdp_merchant_family.0010.a.tt.success + left_icon = scope:attacker + right_icon = scope:defender + add_prestige = minor_prestige_gain + house ?= { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_unity_fight_stopped + } + } + reverse_add_opinion = { + target = scope:attacker + modifier = respect_opinion + opinion = 40 + } + reverse_add_opinion = { + target = scope:defender + modifier = respect_opinion + opinion = 40 + } + } + } + # Defeat. + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_family.0010.a.tt.failure + send_interface_toast = { + title = gdp_merchant_family.0010.a.tt.failure + left_icon = scope:attacker + right_icon = scope:defender + reverse_add_opinion = { + target = scope:attacker + modifier = respect_opinion + opinion = -20 + } + reverse_add_opinion = { + target = scope:defender + modifier = respect_opinion + opinion = -20 + } + } + scope:attacker = { + increase_wounds_no_death_effect = { REASON = fight } + } + scope:defender = { + increase_wounds_no_death_effect = { REASON = fight } + } + } + } + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_gain + patient = minor_stress_impact_gain + } + ai_chance = { + base = 1 + ai_value_modifier = { ai_compassion = 1 } + modifier = { + OR = { + has_trait = arbitrary + has_trait = patient + } + factor = 0 + } + } + } + + # Arrest the attacker + option = { + name = gdp_merchant_family.0010.c + rightfully_imprison_character_effect = { + TARGET = scope:attacker + IMPRISONER = root + } + reverse_add_opinion = { + target = scope:defender + modifier = grateful_opinion + opinion = 50 + } + stress_and_fulfillment_impact = { + just = miniscule_stress_impact_loss + arbitrary = minor_stress_impact_gain + } + ai_chance = { + base = 1 + ai_value_modifier = { ai_honor = 1 } + } + } + + option = { # If you must fight, put on a show! + name = gdp_merchant_family.0010.b + trigger = { + has_realm_law = company_purpose_creditor + } + reason = purpose_creditor + custom_tooltip = gdp_merchant_family.0010.tt.duel + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_medium_value + } + house ?= { + add_unity_value = { + value = medium_unity_loss + character = root + desc = merchant_unity_fight_promoted + } + } + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + just = minor_stress_impact_gain + wrathful = minor_stress_impact_loss + } + trigger_event = gdp_merchant_family.0011 + ai_chance = { + base = 1 + ai_value_modifier = { ai_honor = -2 } + modifier = { + has_trait = just + factor = 0 + } + } + } + + option = { # Let it play out + name = gdp_merchant_family.0010.d + trigger = { + NOT = { has_realm_law = company_purpose_creditor } + } + custom_tooltip = gdp_merchant_family.0010.tt.duel + stress_and_fulfillment_impact = { + wrathful = miniscule_stress_impact_loss + arbitrary = miniscule_stress_impact_loss + just = minor_stress_impact_gain + calm = minor_stress_impact_gain + } + trigger_event = gdp_merchant_family.0011 + ai_chance = { + base = 1 + ai_value_modifier = { ai_energy = 1 } + } + } +} + +# Fight outcome & player notice +gdp_merchant_family.0011 = { + hidden = yes + immediate = { + # Let's decide this thing + scope:attacker = { + duel = { + skills = { martial prowess } + target = scope:defender + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + increase_wounds_no_death_effect = { REASON = fight } + save_scope_as = winner + scope:defender = { save_scope_as = loser } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + scope:defender = { + increase_wounds_no_death_effect = { REASON = fight } + save_scope_as = loser + } + scope:attacker = { save_scope_as = winner } + } + } + } + if = { + limit = { scope:winner = scope:attacker } + scope:og_root = { + send_interface_toast = { + title = gdp_merchant_family.0010.tt.attacker_won + left_icon = scope:attacker + right_icon = scope:defender + custom_tooltip = gdp_merchant_family.0010.tt.attacker_won.tt + scope:defender = { + progress_towards_rival_effect = { + REASON = rival_low_house_unity_fight + CHARACTER = scope:attacker + OPINION = -50 + } + } + } + } + } + else = { + scope:og_root = { + send_interface_toast = { + title = gdp_merchant_family.0010.tt.defender_won + left_icon = scope:defender + right_icon = scope:attacker + custom_tooltip = gdp_merchant_family.0010.tt.defender_won.tt + scope:defender = { + progress_towards_rival_effect = { + REASON = rival_low_house_unity_fight + CHARACTER = scope:attacker + OPINION = -50 + } + } + } + } + } + } +} + +# A Business Confidant +gdp_merchant_family.0015 = { + type = character_event + title = gdp_merchant_family.0015.t + desc = gdp_merchant_family.0015.desc + theme = merchant + override_background = market_crowd + left_portrait = { + character = root + animation = page_flipping + } + right_portrait = { + character = scope:tip_giver + animation = admiration + } + artifact = { + trigger = { exists = scope:newly_created_artifact } + target = scope:newly_created_artifact + position = lower_center_portrait + } + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + is_available_adult = yes + domicile.domicile_location.barony.trade_market ?= { + save_temporary_scope_as = temp_local_market + OR = { + any_character_in_market = { this = root } + root = { + any_trade_route = { + any_trade_market_on_route = { this = scope:temp_local_market } + } + } + } + any_character_in_market = { + is_ai = yes + is_adult = yes + government_has_flag = government_is_merchant + this != root + house != root.house + house ?= { + any_house_relation = { + OR = { + has_house_relation_level = cordial + has_house_relation_level = friendly + has_house_relation_level = amity + } + any_relation_house = { this = root.house } + } + } + any_trade_route = { + any_trade_market_on_route = { this = scope:temp_local_market } + } + } + } + } + + immediate = { + domicile.domicile_location.barony.trade_market ?= { + save_scope_as = local_market + } + scope:local_market ?= { + random_character_in_market = { + limit = { + is_ai = yes + is_adult = yes + government_has_flag = government_is_merchant + NOT = { this = root } + NOT = { house = root.house } + house ?= { + any_house_relation = { + OR = { + has_house_relation_level = cordial + has_house_relation_level = friendly + has_house_relation_level = amity + } + any_relation_house = { this = root.house } + } + } + any_trade_route = { + any_trade_market_on_route = { this = scope:local_market } + } + } + save_scope_as = tip_giver + } + } + scope:tip_giver = { + hidden_effect_new_object = { + create_artifact = { + name = gdp_merchant_family.0015.b.artifact + description = gdp_merchant_family.0015.b.artifact.desc + type = journal + visuals = book + modifier = artifact_placeholder_modifier + wealth = 50 + quality = 50 + save_scope_as = newly_created_artifact + } + scope:newly_created_artifact = { + remove_artifact_modifier = artifact_placeholder_modifier + add_artifact_modifier = artifact_trade_category_all_xp_gain_mult_1_modifier + } + } + } + } + # Thankful for the tip and future collaboration + option = { + name = gdp_merchant_family.0015.a + hidden_effect = { + if = { + limit = { exists = scope:newly_created_artifact } + destroy_artifact = scope:newly_created_artifact + } + } + scope:local_market = { + add_competitiveness_modifier_for_character = { + modifier = trade_cooperation_modifier + character = root + years = 10 + } + add_competitiveness_modifier_for_character = { + modifier = trade_cooperation_modifier + character = scope:tip_giver + years = 10 + } + } + + house ?= { + change_house_relation_effect = { + HOUSE = scope:tip_giver.house + VALUE = house_relation_improve_minor_value + REASON = gdp_merchant_family.0015.a.relation_improve.desc + CHAR = root + TARGET_CHAR = scope:tip_giver + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + deceitful = minor_stress_impact_gain + } + + ai_chance = { + base = 25 + ai_value_modifier = { + ai_sociability = medium_chance_impact_positive_ai_value + } + modifier = { + add = 20 + OR = { + has_trait = just + has_trait = trusting + has_trait = compassionate + } + } + modifier = { + factor = 0 + OR = { + has_trait = deceitful + has_trait = callous + has_trait = arbitrary + } + } + } + } + # Purchase the ledger + option = { + name = gdp_merchant_family.0015.b + trigger = { + short_term_gold >= major_gold_value + exists = scope:newly_created_artifact + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:tip_giver + gold = major_gold_value + } + scope:newly_created_artifact = { set_owner = root } + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + greedy = minor_stress_impact_loss + diligent = minor_stress_impact_loss + } + + ai_chance = { + base = 30 + ai_value_modifier = { + ai_greed = medium_chance_impact_negative_ai_value + ai_energy = medium_chance_impact_positive_ai_value + } + modifier = { + add = 25 + OR = { + has_trait = ambitious + has_trait = greedy + has_trait = diligent + } + } + modifier = { + factor = 0 + short_term_gold < major_gold_value + } + } + } + # Screw them over + option = { + name = gdp_merchant_family.0015.c + hidden_effect = { + if = { + limit = { exists = scope:newly_created_artifact } + destroy_artifact = scope:newly_created_artifact + } + } + + scope:local_market = { + add_competitiveness_modifier_for_character = { + modifier = friendly_tip_exploit_modifier + character = root + years = 10 + } + add_competitiveness_modifier_for_character = { + modifier = friendly_tip_betrayed_modifier + character = scope:tip_giver + years = 10 + } + } + house ?= { + change_house_relation_effect = { + HOUSE = scope:tip_giver.house + VALUE = house_relation_damage_medium_value + REASON = gdp_merchant_family.0015.c.relation_damage.desc + CHAR = root + TARGET_CHAR = scope:tip_giver + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + greedy = minor_stress_impact_loss + diligent = minor_stress_impact_loss + arbitrary = minor_stress_impact_gain + } + + ai_chance = { + base = 5 + ai_value_modifier = { + ai_greed = medium_chance_impact_positive_ai_value + ai_honor = medium_chance_impact_negative_ai_value + } + modifier = { + add = 30 + OR = { + has_trait = deceitful + has_trait = callous + has_trait = arbitrary + } + } + modifier = { + factor = 0 + OR = { + has_trait = just + has_trait = compassionate + has_trait = honest + } + } + } + } +} + +# Talent Exchange +gdp_merchant_family.0020 = { + type = character_event + title = gdp_merchant_family.0020.t + desc = { + desc = gdp_merchant_family.0020.desc + first_valid = { + triggered_desc = { + trigger = { + scope:nepo_hire = { highest_skill = diplomacy } + } + desc = gdp_merchant_family.0020.desc.diplomacy + } + triggered_desc = { + trigger = { + scope:nepo_hire = { + OR = { + highest_skill = martial + highest_skill_including_prowess = prowess + } + } + } + desc = gdp_merchant_family.0020.desc.martial + } + triggered_desc = { + trigger = { + scope:nepo_hire = { highest_skill = stewardship } + } + desc = gdp_merchant_family.0020.desc.stewardship + } + triggered_desc = { + trigger = { + scope:nepo_hire = { highest_skill = intrigue } + } + desc = gdp_merchant_family.0020.desc.intrigue + } + triggered_desc = { + trigger = { + scope:nepo_hire = { highest_skill = learning } + } + desc = gdp_merchant_family.0020.desc.learning + } + } + desc = gdp_merchant_family.0020.desc.outro + } + theme = merchant + left_portrait = { + character = scope:nepo_hire + triggered_animation = { + trigger = { highest_skill = diplomacy } + animation = debating + } + triggered_animation = { + trigger = { + OR = { + highest_skill = martial + highest_skill_including_prowess = prowess + } + } + animation = war_over_win + } + triggered_animation = { + trigger = { highest_skill = stewardship } + animation = holding_scrolls + } + triggered_animation = { + trigger = { highest_skill = intrigue } + animation = scheme + } + triggered_animation = { + trigger = { highest_skill = learning } + animation = happy_teacher + } + camera = camera_event_left_forward + } + right_portrait = { + character = scope:house_friend + animation = flirtation_left + } + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + is_available_adult = yes + house ?= { + any_house_relation = { + OR = { + has_house_relation_level = friendly + has_house_relation_level = amity + } + any_relation_house = { + this != root.house + house_head ?= { + is_ai = yes + government_has_flag = government_is_merchant + save_temporary_scope_as = temp_house_friend + } + } + } + } + scope:temp_house_friend.house ?= { + any_house_member = { + is_courtier_of = house.house_head + is_adult = yes + is_available_quick = { adult = yes imprisoned = no incapable = no } + NOT = { is_player_heir_of = house.house_head } + OR = { + is_close_family_of = house.house_head + is_child_of = house.house_head + } + NOT = { this = house.house_head } + } + } + } + immediate = { + house ?= { + random_house_relation = { + limit = { + OR = { + has_house_relation_level = friendly + has_house_relation_level = amity + } + any_relation_house = { + this != root.house + house_head ?= { + is_ai = yes + government_has_flag = government_is_merchant + save_temporary_scope_as = temp_house_friend + } + any_house_member = { + is_courtier_of = scope:temp_house_friend + is_adult = yes + is_available_quick = { adult = yes imprisoned = no incapable = no } + NOT = { is_player_heir_of = scope:temp_house_friend } + OR = { + is_child_of = scope:temp_house_friend + is_close_family_of = scope:temp_house_friend + } + NOT = { this = scope:temp_house_friend } + } + } + } + } + scope:temp_house_friend = { save_scope_as = house_friend } + } + scope:house_friend.house = { + random_house_member = { + limit = { + is_courtier_of = scope:house_friend + is_adult = yes + is_available_quick = { adult = yes imprisoned = no incapable = no } + NOT = { is_player_heir_of = scope:house_friend } + OR = { + is_child_of = scope:house_friend + is_close_family_of = scope:house_friend + } + NOT = { this = scope:house_friend } + } + save_scope_as = nepo_hire + } + } + } + # Accept the new associate + option = { + name = gdp_merchant_family.0020.a + scope:nepo_hire = { + add_to_court_and_entourage_effect = yes + } + house ?= { + if = { + limit = { + scope:nepo_hire = { + sum_of_all_skills_value < sum_of_all_skills_threshold_terrible + } + } + add_unity_value = { + value = medium_unity_loss + character = root + desc = gdp_merchant_family.0020.a.unity_loss.desc + } + } + else = { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant_family.0020.a.unity_loss.desc + } + } + change_house_relation_effect = { + HOUSE = scope:house_friend.house + VALUE = house_relation_improve_minor_value + REASON = gdp_merchant_family.0020.a.relation_improve.desc + CHAR = root + TARGET_CHAR = scope:house_friend + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + diligent = minor_stress_impact_gain + just = minor_stress_impact_gain + paranoid = major_stress_impact_gain + } + + ai_chance = { + base = 25 + ai_value_modifier = { + ai_sociability = medium_chance_impact_positive_ai_value + } + modifier = { + add = 20 + scope:nepo_hire = { + sum_of_all_skills_value >= sum_of_all_skills_threshold_average + } + } + modifier = { + add = -30 + scope:nepo_hire = { + sum_of_all_skills_value < sum_of_all_skills_threshold_terrible + } + } + modifier = { + add = -20 + has_trait = just + } + modifier = { + add = -15 + has_trait = diligent + } + } + } + # Humbly decline the offer + option = { + name = gdp_merchant_family.0020.b + scope:house_friend = { + add_opinion = { + modifier = respect_opinion + target = root + opinion = 5 + } + } + house = { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_merchant_family.0020.b.unity_gain.desc + } + } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_loss + compassionate = minor_stress_impact_loss + ambitious = minor_stress_impact_gain + } + ai_chance = { + base = 15 + ai_value_modifier = { + ai_compassion = medium_chance_impact_positive_ai_value + } + modifier = { + add = 20 + has_trait = humble + } + modifier = { + add = 15 + has_trait = compassionate + } + modifier = { + add = 15 + scope:nepo_hire = { + sum_of_all_skills_value < sum_of_all_skills_threshold_terrible + } + } + modifier = { + add = -25 + has_trait = arbitrary + } + } + } + # You are insulted by their incompetence + option = { + name = gdp_merchant_family.0020.c + trigger = { + scope:nepo_hire = { + sum_of_all_skills_value < sum_of_all_skills_threshold_terrible + } + } + house ?= { + change_house_relation_effect = { + HOUSE = scope:house_friend.house + VALUE = house_relation_damage_minor_value + REASON = gdp_merchant_family.0020.c.relation_damage.desc + CHAR = root + TARGET_CHAR = scope:house_friend + TITLE = scope:dummy_gender + } + } + scope:house_friend = { + add_opinion = { + modifier = insulted_opinion + target = root + opinion = -20 + } + } + add_prestige = minor_prestige_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + callous = minor_stress_impact_loss + compassionate = minor_stress_impact_gain + just = minor_stress_impact_gain + humble = minor_stress_impact_gain + } + ai_chance = { + base = 5 + modifier = { + add = 25 + has_trait = arrogant + } + modifier = { + add = 15 + has_trait = diligent + } + modifier = { + add = 15 + has_trait = callous + } + modifier = { + factor = 0 + OR = { + has_trait = humble + has_trait = compassionate + } + } + } + } +} + +# Nothing Personal +gdp_merchant_family.0025 = { + type = character_event + title = gdp_merchant_family.0025.t + desc = gdp_merchant_family.0025.desc + theme = merchant + override_background = study + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_right_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + } + left_portrait = { + character = root + animation = anger + } + right_portrait = { + character = scope:leaving_associate + triggered_animation = { + trigger = { + has_any_good_relationship_with_character_trigger = { CHARACTER = root } + } + animation = sadness + } + triggered_animation = { + trigger = { + OR = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + has_trait = callous + has_trait = sadistic + } + } + animation = personality_callous + } + animation = nervous + } + lower_left_portrait = { + character = scope:rival_poacher + } + + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + is_available_adult = yes + house ?= { + OR = { + has_house_unity_stage = rapacious_cs + has_house_unity_stage = opportunistic_cs + } + any_house_relation = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + house_head ?= { + is_ai = yes + government_has_flag = government_is_merchant + NOT = { this = root } + save_temporary_scope_as = temp_poacher + } + } + } + } + any_courtier = { + is_courtier_of = root + is_ai = yes + NOT = { this = root } + is_available_quick = { adult = yes imprisoned = no incapable = no } + NOT = { is_player_heir_of = root } + } + } + + weight_multiplier = { + modifier = { + factor = 2 + house ?= { + any_house_relation = { + count >= 2 + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + } + } + + immediate = { + house ?= { + random_house_relation = { + limit = { + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + any_relation_house = { + this != root.house + house_head ?= { + is_ai = yes + government_has_flag = government_is_merchant + NOT = { this = root } + save_temporary_scope_as = temp_poacher + } + } + } + } + scope:temp_poacher = { save_scope_as = rival_poacher } + } + random_courtier = { + limit = { + is_courtier_of = root + is_ai = yes + NOR = { + this = root + this = scope:rival_poacher + } + is_available_quick = { adult = yes imprisoned = no incapable = no } + NOT = { is_player_heir_of = root } + } + save_scope_as = leaving_associate + } + } + #Let them go with your blessing + option = { + name = gdp_merchant_family.0025.a + trigger = { + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:leaving_associate } + } + scope:rival_poacher = { + add_courtier = scope:leaving_associate + } + reverse_add_opinion = { + target = scope:leaving_associate + modifier = grateful_opinion + opinion = 40 + } + house ?= { + change_house_relation_effect = { + HOUSE = scope:rival_poacher.house + VALUE = house_relation_improve_minor_value + REASON = gdp_merchant_family.0025.a.relation_improve.desc + CHAR = root + TARGET_CHAR = scope:rival_poacher + TITLE = scope:dummy_gender + } + } + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + compassionate = minor_stress_impact_loss + forgiving = minor_stress_impact_loss + greedy = minor_stress_impact_gain + vengeful = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_honor = medium_chance_impact_positive_ai_value + } + modifier = { + add = 20 + OR = { + has_trait = generous + has_trait = just + has_trait = compassionate + has_trait = forgiving + } + } + modifier = { + factor = 0 + OR = { + has_trait = wrathful + has_trait = vengeful + } + } + } + } + #You try to convince your associate to stay + option = { + name = gdp_merchant_family.0025.b + duel = { + skill = diplomacy + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + add = 15 + scope:leaving_associate = { + opinion = { target = root value >= low_positive_opinion } + } + } + modifier = { + add = 10 + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:leaving_associate } + } + desc = gdp_merchant_family.0025.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_family.0025.b.success + left_icon = root + right_icon = scope:leaving_associate + custom_tooltip = gdp_merchant_family.0025.b.tt + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + desc = gdp_merchant_family.0025.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_family.0025.b.fail + left_icon = root + right_icon = scope:leaving_associate + scope:rival_poacher = { + add_courtier = scope:leaving_associate + } + } + } + } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_loss + arrogant = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + ai_chance = { + base = 15 + ai_value_modifier = { + ai_sociability = medium_chance_impact_positive_ai_value + } + modifier = { + add = 25 + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:leaving_associate } + } + modifier = { + add = 15 + diplomacy >= decent_skill_rating + } + modifier = { + factor = 0 + has_usable_hook = scope:leaving_associate + } + } + } + #Use a hook to make the associate stay + option = { + name = gdp_merchant_family.0025.c + trigger = { + has_usable_hook = scope:leaving_associate + } + use_hook = scope:leaving_associate + scope:leaving_associate = { + add_opinion = { + modifier = angry_opinion + target = root + opinion = -15 + } + } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_gain + just = minor_stress_impact_gain + deceitful = minor_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { + add = 15 + has_trait = deceitful + } + } + } + #Allow them to leave, with spite + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + OR = { + has_relation_rival = scope:rival_poacher + has_relation_nemesis = scope:rival_poacher + } + } + desc = gdp_merchant_family.0025.d.rival + } + desc = gdp_merchant_family.0025.d + } + } + } + scope:rival_poacher = { + add_courtier = scope:leaving_associate + } + house ?= { + change_house_relation_effect = { + HOUSE = scope:rival_poacher.house + VALUE = house_relation_damage_medium_value + REASON = gdp_merchant_family.0025.d.relation_damage.desc + CHAR = root + TARGET_CHAR = scope:rival_poacher + TITLE = scope:dummy_gender + } + } + progress_towards_rival_effect = { + REASON = rival_poached_associate + CHARACTER = scope:rival_poacher + OPINION = 0 + } + stress_and_fulfillment_impact = { + wrathful = minor_stress_impact_loss + vengeful = minor_stress_impact_loss + callous = minor_stress_impact_loss + calm = minor_stress_impact_gain + humble = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + add = 25 + OR = { + has_trait = wrathful + has_trait = vengeful + has_trait = arbitrary + has_trait = callous + } + } + modifier = { + factor = 0 + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:leaving_associate } + } + modifier = { + factor = 0 + has_usable_hook = scope:leaving_associate + } + } + } +} + +# House Member(s) loiter instead of working +gdp_merchant_family.0030 = { + type = character_event + title = gdp_merchant_family.0030.t + desc = gdp_merchant_family.0030.desc + + theme = merchant + override_background = study + + left_portrait = { + character = scope:house_member + animation = toast + } + + right_portrait = { + character = scope:associate + animation = drink + } + + cooldown = { years = 10 } + + trigger = { + is_house_head = yes + government_has_flag = government_is_merchant + house ?= { + any_house_member = { + this != root + is_courtier_of = root + is_available_ai_adult = yes + drinks_alcohol_trigger = yes + save_temporary_scope_as = temp_char + } + } + any_courtier = { + is_available_ai_adult = yes + drinks_alcohol_trigger = yes + NOT = { this = scope:temp_char } + can_set_relation_friend_trigger = { CHARACTER = scope:temp_char } + } + } + + weight_multiplier = { + modifier = { + factor = 2 + house ?= { + OR = { + has_house_unity_stage = ennobled_cs + has_house_unity_stage = grasping_cs + } + } + } + } + + immediate = { + house ?= { + random_house_member = { + limit = { + this != root + is_courtier_of = root + is_available_ai_adult = yes + drinks_alcohol_trigger = yes + } + weight = { + base = 1 + modifier = { + add = ai_sociability + } + modifier = { + factor = 2 + has_trait = gregarious + } + } + save_scope_as = house_member + } + } + random_courtier = { + limit = { + is_available_ai_adult = yes + drinks_alcohol_trigger = yes + NOT = { this = scope:house_member } + can_set_relation_friend_trigger = { CHARACTER = scope:house_member } + } + save_scope_as = associate + } + } + + option = { # Join them + name = gdp_merchant_family.0030.a + flavor = gdp_merchant_family.0030.a.flavor + trigger = { drinks_alcohol_trigger = yes } + house ?= { + add_unity_value = { + value = medium_unity_gain + character = root + desc = merchant_unity_breaks_encouraged + } + } + reverse_add_opinion = { + target = scope:house_member + modifier = pleased_opinion + opinion = 15 + } + reverse_add_opinion = { + target = scope:associate + modifier = pleased_opinion + opinion = 15 + } + scope:house_member = { + if = { + limit = { + NOT = { has_trait = lifestyle_reveler } + } + random = { + chance = 5 + add_trait = lifestyle_reveler + } + } + } + stress_impact = { + ambitious = medium_stress_impact_gain + lazy = medium_stress_impact_loss + gregarious = medium_stress_impact_loss + lifestyle_reveler = medium_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = 1 + } + modifier = { + factor = 0 + has_trait = ambitious + } + } + } + + option = { # Scold them :whip: + name = gdp_merchant_family.0030.b + flavor = gdp_merchant_family.0030.b.flavor + house ?= { + add_unity_value = { + value = medium_unity_loss + character = root + desc = merchant_unity_breaks_discouraged + } + } + reverse_add_opinion = { + target = scope:house_member + modifier = annoyed_opinion + opinion = -15 + } + reverse_add_opinion = { + target = scope:associate + modifier = annoyed_opinion + opinion = -15 + } + stress_impact = { + arrogant = medium_stress_impact_loss + callous = medium_stress_impact_loss + compassionate = medium_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_sociability = -1 + ai_compassion = -1 + } + modifier = { + factor = 0 + has_trait = compassionate + } + } + } + option = { # encourage the friendship + name = gdp_merchant_family.0030.c + scope:house_member = { + progress_towards_friend_effect = { + REASON = friend_bonded_over_work_break + CHARACTER = scope:associate + OPINION = default_friend_opinion + } + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_compassion = 1 + } + } + } +} + +# Coming of age +gdp_merchant_family.9000 = { + type = character_event + title = gdp_merchant_family.9000.t + desc = { + desc = gdp_merchant_family.9000.desc + } + theme = merchant + left_portrait = { + character = root + animation = holding_scales + } + right_portrait = { + character = scope:portrait + animation = admiration + } + lower_center_portrait = scope:predecessor + + trigger = { + is_landless_merchant = yes + } + + immediate = { + # Scopes + save_scope_as = merchant + var:educator ?= { + if = { + limit = { court_owner = root } + save_scope_as = educator + save_scope_as = portrait + } + } + court_position:partner_court_position ?= { + save_scope_as = partner + if = { + limit = { + NOT = { exists = scope:portrait } + } + save_scope_as = portrait + } + } + primary_title.previous_holder ?= { save_scope_as = predecessor } + # Trait + if = { + limit = { + NOT = { has_trait = lifestyle_merchant } + } + add_trait = lifestyle_merchant + } + # Good + ordered_trade_good_category = { + limit = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "scope:merchant.primary_title.trade_good_category_level(scope:category_temp)" > 4 + } + order_by = "root.primary_title.trade_good_category_level(scope:category_temp)" + save_scope_as = best_category + } + custom_tooltip = gdp_merchant_family.9000.route_hint_tt + ### Childhood boons + # Trait bonus + if = { + limit = { + NOT = { var:merchant_childhood_purpose ?= flag:caravaneer } + has_character_flag = merchant_childhood_caravaneer_bonus + } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = 10 + } + } + # Purpose + if = { + limit = { exists = var:merchant_childhood_purpose } + switch = { + trigger = var:merchant_childhood_purpose + flag:caravaneer = { + if = { + limit = { NOT = { has_realm_law = company_purpose_caravaneer } } + add_realm_law_skip_effects = company_purpose_caravaneer + } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = { + value = 20 + if = { + limit = { + root = { has_character_flag = merchant_childhood_caravaneer_bonus } + } + add = 10 + } + } + } + } + flag:artisan = { + if = { + limit = { NOT = { has_realm_law = company_purpose_artisan } } + add_realm_law_skip_effects = company_purpose_artisan + } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = 20 + } + } + flag:creditor = { + if = { + limit = { NOT = { has_realm_law = company_purpose_creditor } } + add_realm_law_skip_effects = company_purpose_creditor + } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = 20 + } + } + flag:family = { + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = 5 + } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = 5 + } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = 5 + } + } + } + } + # Expertise + if = { + limit = { + exists = var:merchant_childhood_bonus_category + NOT = { exists = var:merchant_childhood_category } + } + var:merchant_childhood_bonus_category ?= { save_scope_as = category } + primary_title = { + add_trade_good_category_xp = { + target = scope:category + value = 450 + } + } + } + else_if = { + limit = { + NOT = { exists = var:merchant_childhood_bonus_category } + exists = var:merchant_childhood_category + } + var:merchant_childhood_category ?= { save_scope_as = category } + primary_title = { + add_trade_good_category_xp = { + target = scope:category + value = 450 + } + } + } + else_if = { + limit = { + exists = var:merchant_childhood_bonus_category + exists = var:merchant_childhood_category + } + if = { + limit = { var:merchant_childhood_bonus_category ?= var:merchant_childhood_category } + var:merchant_childhood_bonus_category ?= { save_scope_as = category } + primary_title = { + add_trade_good_category_xp = { + target = scope:category + value = trade_expertise_xp_monumental_value + } + } + } + else = { + primary_title = { + add_trade_good_category_xp = { + target = root.var:merchant_childhood_category + value = 450 + } + } + primary_title = { + add_trade_good_category_xp = { + target = root.var:merchant_childhood_bonus_category + value = 450 + } + } + } + } + # Modifiers + if = { + limit = { has_character_flag = merchant_childhood_suzerain_opinion } + add_character_modifier = { + modifier = merchant_childhood_suzerain_modifier + years = 10 + } + } + } + + option = { # Appoint educator as partner option + name = gdp_merchant_family.9000.a + trigger = { + exists = scope:educator + NOT = { employs_court_position = partner_court_position } + can_employ_court_position_type = partner_court_position + } + appoint_court_position = { + recipient = scope:educator + court_position = partner_court_position + } + scope:educator = { save_temporary_scope_as = candidate } + custom_tooltip = partner_aptitude_tooltip + reverse_add_opinion = { + modifier = respect_opinion + target = scope:educator + opinion = 15 + } + ai_chance = { + base = 10 + } + } + + option = { + name = gdp_merchant_family.9000.b + ai_chance = { + base = 10 + } + } + + after = { + remove_variable = merchant_childhood_purpose + remove_variable = merchant_childhood_category + remove_variable = merchant_childhood_bonus_category + remove_character_flag = merchant_childhood_caravaneer_bonus + remove_character_flag = merchant_childhood_suzerain_opinion + } +} + +# Child inheritance +gdp_merchant_family.9010 = { + type = character_event + title = gdp_merchant_family.9010.t + desc = { + desc = gdp_merchant_family.9010.desc + first_valid = { + triggered_desc = { + trigger = { + scope:interim ?= { has_character_flag = generated_interim } + } + desc = gdp_merchant_family.9010.interim_generated + } + triggered_desc = { + trigger = { + OR = { + any_relation = { this = scope:interim } + is_close_or_extended_family_of = scope:interim + } + } + desc = gdp_merchant_family.9010.interim_relation + } + desc = gdp_merchant_family.9010.interim + } + desc = gdp_merchant_family.9010.close + } + theme = merchant + left_portrait = { + character = root + animation = idle + } + right_portrait = { + character = scope:interim + animation = worry + } + lower_right_portrait = scope:previous_holder + + trigger = { + is_landless_merchant = yes + is_adult = no + OR = { + employs_court_position = partner_court_position + can_employ_court_position_type = partner_court_position + } + } + + immediate = { + if = { + limit = { + NOT = { employs_court_position = partner_court_position } + } + random_courtier = { + limit = { + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + has_relation_guardian = root + } + alternative_limit = { + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + health >= fine_health + } + alternative_limit = { + is_available_quick = { + adult = yes + incapable = no + imprisoned = no + } + } + weight = { + base = 1 + modifier = { add = stewardship } + modifier = { + has_trait = education_stewardship_3 + add = 5 + } + modifier = { + has_trait = education_stewardship_4 + add = 10 + } + modifier = { + has_trait = education_stewardship_5 + add = 20 + } + modifier = { + has_any_good_relationship_with_character_trigger = { CHARACTER = root } + add = 25 + } + modifier = { + is_close_family_of = root + add = 10 + } + modifier = { + is_extended_family_of = root + add = 5 + } + modifier = { + house ?= root.house + add = 5 + } + } + save_scope_as = interim + } + if = { + limit = { + NOT = { exists = scope:interim } + } + create_character = { + template = good_merchant_template + dynasty = none + employer = root + save_scope_as = interim + } + scope:interim = { + add_character_flag = { + flag = generated_interim + weeks = 1 + } + } + } + if = { + limit = { can_employ_court_position_type = partner_court_position } + appoint_court_position = { + recipient = scope:interim + court_position = partner_court_position + } + } + } + else = { + court_position:partner_court_position = { save_scope_as = interim} + } + } + + option = { + name = gdp_merchant_family.9010.a + ai_chance = { + base = 10 + } + } +} + +scripted_trigger shared_merchant_childhood_helper_trigger = { + is_available_quick = { + incapable = no + imprisoned = no + } + NOR = { + has_relation_rival = root + has_relation_bully = root + } +} + +# Trader help +gdp_merchant_family.9110 = { + type = character_event + title = gdp_merchant_family.9110.t + desc = gdp_merchant_family.9110.desc + theme = merchant + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:trader + animation = holding_tally_stick + } + cooldown = { years = 10 } + + trigger = { + is_landless_merchant = yes + is_adult = no + age > 7 + any_courtier = { + is_adult = yes + is_trader = yes + shared_merchant_childhood_helper_trigger = yes + assigned_trade_route ?= { + any_trade_market_on_route = { + NOT = { this = root.domicile.domicile_location.barony.trade_market } + save_temporary_scope_as = market_temp + } + any_traded_good = { + save_temporary_scope_as = good_temp + scope:market_temp = { + OR = { + any_trade_good_with_need = { this = scope:good_temp } + any_trade_good_with_surplus = { this = scope:good_temp } + } + } + } + } + } + } + + immediate = { + save_scope_as = merchant + random_courtier = { + limit = { + is_adult = yes + is_trader = yes + shared_merchant_childhood_helper_trigger = yes + location = root.location + NOT = { has_character_flag = merchant_childhood_associate_cooldown } + } + alternative_limit = { + is_adult = yes + is_trader = yes + location = root.location + shared_merchant_childhood_helper_trigger = yes + } + alternative_limit = { + is_adult = yes + is_trader = yes + shared_merchant_childhood_helper_trigger = yes + } + weight = { + base = 1 + modifier = { add = stewardship } + opinion_modifier = { + opinion_target = root + multiplier = 0.2 + } + } + save_scope_as = trader + } + scope:trader ?= { + add_character_flag = { + flag = merchant_childhood_associate_cooldown + years = 3 + } + assigned_trade_route ?= { + save_scope_as = route + random_trade_market_on_route = { + limit = { + NOT = { this = scope:merchant.domicile.domicile_location.barony.trade_market } + } + weight = { + base = 1 + modifier = { + add = "trade_market_owner.title_province.squared_distance(scope:merchant.domicile.domicile_location)" + } + } + save_scope_as = market + } + random_traded_good = { + limit = { + save_temporary_scope_as = good_temp + scope:market = { + OR = { + any_trade_good_with_need = { this = scope:good_temp } + any_trade_good_with_surplus = { this = scope:good_temp } + } + } + } + save_scope_as = good + } + } + } + scope:good ?= { + random_trade_category = { + limit = { has_trade_good_category_xp_track = yes } + save_scope_as = category + } + } + } + + option = { + name = gdp_merchant_family.9110.a + add_stewardship_skill = 1 + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + has_trait = lazy + add = -5 + } + modifier = { + has_trait = arrogant + add = -5 + } + } + } + + option = { + name = gdp_merchant_family.9110.b + progress_towards_friend_effect = { + REASON = friend_merchant_childhood_bonding + CHARACTER = scope:trader + OPINION = default_friend_opinion + } + custom_tooltip = gdp_merchant_family.9110.b.tt + add_character_flag = { + flag = merchant_childhood_caravaneer_bonus + years = 10 + } + stress_and_fulfillment_impact = { + shy = minor_stress_impact_gain + craven = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + has_trait = shy + add = -5 + } + modifier = { + has_trait = craven + add = -5 + } + } + } + + option = { + name = gdp_merchant_family.9110.c + trigger = { exists = scope:category } + custom_tooltip = { + text = gdp_merchant_family.9110.c.tt + set_variable = { + name = merchant_childhood_bonus_category + value = scope:category + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_gain + brave = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + has_trait = gregarious + add = -5 + } + modifier = { + has_trait = brave + add = -5 + } + } + } +} + +# Purpose help +gdp_merchant_family.9130 = { + type = character_event + title = gdp_merchant_family.9130.t + desc = { + desc = gdp_merchant_family.9130.desc + first_valid = { + triggered_desc = { + trigger = { has_realm_law = company_purpose_caravaneer } + desc = gdp_merchant_family.9130.caravaneer + } + triggered_desc = { + trigger = { has_realm_law = company_purpose_artisan } + desc = gdp_merchant_family.9130.artisan + } + triggered_desc = { + trigger = { has_realm_law = company_purpose_creditor } + desc = gdp_merchant_family.9130.creditor + } + desc = gdp_merchant_family.9130.fallback + } + } + theme = merchant + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:associate + animation = writing + } + cooldown = { years = 10 } + + trigger = { + is_landless_merchant = yes + is_adult = no + age > 7 + } + + immediate = { + random_courtier = { + limit = { + is_adult = yes + root.court_position:partner_court_position ?= this + shared_merchant_childhood_helper_trigger = yes + NOT = { has_character_flag = merchant_childhood_associate_cooldown } + } + alternative_limit = { + is_adult = yes + root.court_position:partner_court_position ?= this + shared_merchant_childhood_helper_trigger = yes + } + alternative_limit = { + is_adult = yes + shared_merchant_childhood_helper_trigger = yes + } + weight = { + base = 1 + modifier = { add = stewardship } + modifier = { + is_close_or_extended_family_of = root + add = 10 + } + opinion_modifier = { + opinion_target = root + multiplier = 0.2 + } + } + save_scope_as = associate + } + scope:associate ?= { + add_character_flag = { + flag = merchant_childhood_associate_cooldown + years = 3 + } + } + } + + option = { + name = { + trigger = { has_realm_law = company_purpose_caravaneer } + text = gdp_merchant_family.9130.a.caravaneer + } + name = { + trigger = { has_realm_law = company_purpose_artisan } + text = gdp_merchant_family.9130.a.artisan + } + name = { + trigger = { has_realm_law = company_purpose_creditor } + text = gdp_merchant_family.9130.a.creditor + } + name = { + trigger = { has_realm_law = company_purpose_family } + text = gdp_merchant_family.9130.a + } + add_stewardship_skill = 1 + switch = { + trigger = has_realm_law + company_purpose_caravaneer = { + custom_tooltip = { + text = gdp_merchant_family.9130.b.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:caravaneer + years = 10 + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + craven = minor_stress_impact_gain + content = minor_stress_impact_gain + curious = miniscule_stress_impact_loss + } + } + company_purpose_artisan = { + custom_tooltip = { + text = gdp_merchant_family.9130.c.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:artisan + years = 10 + } + } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_loss + lazy = minor_stress_impact_gain + humble = minor_stress_impact_gain + pensive = miniscule_stress_impact_loss + } + } + company_purpose_creditor = { + custom_tooltip = { + text = gdp_merchant_family.9130.d.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:creditor + years = 10 + } + } + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + shy = minor_stress_impact_gain + impatient = minor_stress_impact_gain + charming = minor_stress_impact_loss + } + } + company_purpose_family = { + custom_tooltip = { + text = gdp_merchant_family.9130.a.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:family + years = 10 + } + } + stress_and_fulfillment_impact = { + content = minor_stress_impact_loss + fickle = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + bossy = miniscule_stress_impact_gain + } + } + } + ai_chance = { + base = 50 + modifier = { + has_trait = content + add = 10 + } + modifier = { + has_realm_law = company_purpose_family + add = -50 + } + } + } + + option = { + name = gdp_merchant_family.9130.b + trigger = { + NOT = { has_realm_law = company_purpose_caravaneer } + } + add_diplomacy_skill = 1 + custom_tooltip = { + text = gdp_merchant_family.9130.b.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:caravaneer + years = 10 + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + craven = minor_stress_impact_gain + content = minor_stress_impact_gain + curious = miniscule_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { add = diplomacy } + modifier = { + has_trait = ambitious + add = 10 + } + modifier = { + has_trait = craven + add = -15 + } + modifier = { + has_trait = content + add = -15 + } + modifier = { + has_trait = curious + add = 10 + } + } + } + + option = { + name = gdp_merchant_family.9130.c + trigger = { + NOT = { has_realm_law = company_purpose_artisan } + } + add_learning_skill = 1 + custom_tooltip = { + text = gdp_merchant_family.9130.c.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:artisan + years = 10 + } + } + stress_and_fulfillment_impact = { + patient = minor_stress_impact_loss + lazy = minor_stress_impact_gain + humble = minor_stress_impact_gain + pensive = miniscule_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { add = learning } + modifier = { + has_trait = diligent + add = 10 + } + modifier = { + has_trait = lazy + add = -15 + } + modifier = { + has_trait = impatient + add = -15 + } + modifier = { + has_trait = pensive + add = 10 + } + } + } + + option = { + name = gdp_merchant_family.9130.d + trigger = { + NOT = { has_realm_law = company_purpose_creditor } + } + add_intrigue_skill = 1 + custom_tooltip = { + text = gdp_merchant_family.9130.d.tt + set_variable = { + name = merchant_childhood_purpose + value = flag:creditor + years = 10 + } + } + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + shy = minor_stress_impact_gain + impatient = minor_stress_impact_gain + charming = minor_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { add = intrigue } + modifier = { + has_trait = greedy + add = 10 + } + modifier = { + has_trait = shy + add = -15 + } + modifier = { + has_trait = trusting + add = -15 + } + modifier = { + has_trait = charming + add = 10 + } + } + } +} + +# Expertise help +gdp_merchant_family.9140 = { + type = character_event + title = gdp_merchant_family.9140.t + desc = gdp_merchant_family.9140.desc + theme = merchant + left_portrait = { + character = root + animation = boredom + camera = camera_event_left_wedding + } + right_portrait = { + character = scope:associate + animation = stressed_teacher + } + cooldown = { years = 10 } + override_background = study + + trigger = { + is_landless_merchant = yes + is_adult = no + age > 7 + save_temporary_scope_as = merchant_temp + any_trade_good_category = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "scope:merchant_temp.primary_title.trade_good_category_level(scope:category_temp)" < 100 + } + } + + immediate = { + # Scopes + save_scope_as = merchant + random_courtier = { + limit = { + is_adult = yes + root.court_position:partner_court_position ?= this + shared_merchant_childhood_helper_trigger = yes + NOT = { has_character_flag = merchant_childhood_associate_cooldown } + } + alternative_limit = { + is_adult = yes + root.court_position:partner_court_position ?= this + shared_merchant_childhood_helper_trigger = yes + } + alternative_limit = { + is_adult = yes + shared_merchant_childhood_helper_trigger = yes + } + weight = { + base = 1 + modifier = { add = stewardship } + modifier = { + is_close_or_extended_family_of = root + add = 10 + } + opinion_modifier = { + opinion_target = root + multiplier = 0.2 + } + } + save_scope_as = associate + } + scope:associate ?= { + add_character_flag = { + flag = merchant_childhood_associate_cooldown + years = 3 + } + } + ordered_trade_good_category = { + limit = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "scope:merchant.primary_title.trade_good_category_level(scope:category_temp)" > 4 + "scope:merchant.primary_title.trade_good_category_level(scope:category_temp)" < 100 + } + order_by = "scope:merchant.primary_title.trade_good_category_level(scope:category_temp)" + max = 3 + check_range_bounds = no + if = { + limit = { exists = scope:category_2 } + save_scope_as = category_3 + } + else_if = { + limit = { exists = scope:category_1 } + save_scope_as = category_2 + } + else = { save_scope_as = category_1 } + } + # Fallback, can be 0 but not max + hidden_effect = { + while = { + count = 3 + if = { + limit = { + NOT = { exists = scope:category_3 } + } + random_trade_good_category = { + limit = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = category_temp + "scope:merchant.primary_title.trade_good_category_level(scope:category_temp)" < 100 + NOR = { + scope:category_1 ?= this + scope:category_2 ?= this + scope:category_3 ?= this + } + } + if = { + limit = { exists = scope:category_2 } + save_scope_as = category_3 + } + else_if = { + limit = { exists = scope:category_1 } + save_scope_as = category_2 + } + else = { save_scope_as = category_1 } + } + } + } + } + } + + option = { + name = gdp_merchant_family.9140.a + custom_tooltip = gdp_merchant_family.9140.a.tt + set_variable = { + name = merchant_childhood_category + value = scope:category_1 + years = 10 + } + ai_chance = { + base = 1 + modifier = { + exists = scope:category_1 + add = { + value = "scope:merchant.primary_title.trade_good_category_level(scope:category_1)" + divide = 5 + floor = yes + } + } + modifier = { + exists = scope:category_1 + add = { + value = 0 + every_trade_route = { + limit = { + any_traded_good = { + any_trade_category = { this = scope:category_1 } + } + } + add = 5 + } + } + } + } + } + + option = { + name = gdp_merchant_family.9140.b + trigger = { exists = scope:category_2 } + custom_tooltip = gdp_merchant_family.9140.b.tt + set_variable = { + name = merchant_childhood_category + value = scope:category_2 + years = 10 + } + ai_chance = { + base = 1 + modifier = { + exists = scope:category_2 + add = { + value = "scope:merchant.primary_title.trade_good_category_level(scope:category_2)" + divide = 5 + floor = yes + } + } + modifier = { + exists = scope:category_2 + add = { + value = 0 + every_trade_route = { + limit = { + any_traded_good = { + any_trade_category = { this = scope:category_2 } + } + } + add = 5 + } + } + } + } + } + + option = { + name = gdp_merchant_family.9140.c + trigger = { exists = scope:category_3 } + custom_tooltip = gdp_merchant_family.9140.c.tt + set_variable = { + name = merchant_childhood_category + value = scope:category_3 + years = 10 + } + ai_chance = { + base = 1 + modifier = { + exists = scope:category_3 + add = { + value = "scope:merchant.primary_title.trade_good_category_level(scope:category_3)" + divide = 5 + floor = yes + } + } + modifier = { + exists = scope:category_3 + add = { + value = 0 + every_trade_route = { + limit = { + any_traded_good = { + any_trade_category = { this = scope:category_3 } + } + } + add = 5 + } + } + } + } + } +} + +# Partner help +gdp_merchant_family.9150 = { + type = character_event + title = gdp_merchant_family.9150.t + desc = { + desc = gdp_merchant_family.9150.desc + } + theme = merchant + left_portrait = { + character = root + animation = biting_coin + } + right_portrait = { + character = scope:partner + animation = steward + } + lower_center_portrait = suzerain + override_background = { reference = study } + cooldown = { years = 10 } + + trigger = { + is_landless_merchant = yes + is_adult = no + age > 7 + court_position:partner_court_position ?= { shared_merchant_childhood_helper_trigger = yes } + } + + immediate = { + save_scope_as = merchant + court_position:partner_court_position ?= { save_scope_as = partner } + scope:partner ?= { + add_character_flag = { + flag = merchant_childhood_associate_cooldown + years = 3 + } + } + } + + option = { + name = gdp_merchant_family.9150.a + switch = { + trigger = has_focus + education_diplomacy = { + add_diplomacy_skill = 1 + add_diplomacy_lifestyle_xp = massive_lifestyle_xp + } + education_martial = { + add_martial_skill = 1 + add_martial_lifestyle_xp = massive_lifestyle_xp + } + education_stewardship = { + add_stewardship_skill = 1 + add_stewardship_lifestyle_xp = massive_lifestyle_xp + } + education_intrigue = { + add_intrigue_skill = 1 + add_intrigue_lifestyle_xp = massive_lifestyle_xp + } + education_learning = { + add_learning_skill = 1 + add_learning_lifestyle_xp = massive_lifestyle_xp + } + fallback = { + add_stewardship_skill = 1 + add_diplomacy_lifestyle_xp = medium_lifestyle_xp + add_martial_lifestyle_xp = medium_lifestyle_xp + add_stewardship_lifestyle_xp = medium_lifestyle_xp + add_intrigue_lifestyle_xp = medium_lifestyle_xp + add_learning_lifestyle_xp = medium_lifestyle_xp + } + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + diligent = minor_stress_impact_loss + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + has_trait = diligent + add = 5 + } + modifier = { + has_trait = lazy + add = -5 + } + } + } + + option = { + name = gdp_merchant_family.9150.b + pay_short_term_gold = { + gold = minor_gold_value + target = scope:partner + } + progress_towards_friend_effect = { + REASON = friend_merchant_childhood_bonding + CHARACTER = scope:partner + OPINION = default_friend_opinion + } + custom_tooltip = gdp_merchant_family.9150.b.tt + scope:partner = { + set_variable = { + name = merchant_childhood_partner_aptitude + value = root + years = 10 + } + } + stress_and_fulfillment_impact = { + generous = minor_stress_impact_loss + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + has_trait = generous + add = 5 + } + modifier = { + has_trait = greedy + add = -5 + } + } + } + + option = { + name = gdp_merchant_family.9150.c + custom_tooltip = { + text = gdp_merchant_family.9150.c.tt + add_character_flag = merchant_childhood_suzerain_opinion + } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_loss + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + has_trait = humble + add = 5 + } + modifier = { + has_trait = arrogant + add = -5 + } + } + } +} diff --git a/events/dlc/gdp/gdp_merchant_luxury_contract_events.txt b/events/dlc/gdp/gdp_merchant_luxury_contract_events.txt new file mode 100644 index 000000000..d08e11ce7 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_luxury_contract_events.txt @@ -0,0 +1,8478 @@ +namespace = gdp_merchant_luxury_contract + +scripted_effect luxury_contract_save_spawn_culture_and_faith_effect = { + if = { + limit = { + exists = location.culture + exists = location.faith + } + location.culture = { save_temporary_scope_as = lc_spawn_culture } + location.faith = { save_temporary_scope_as = lc_spawn_faith } + } + else = { + culture = { save_temporary_scope_as = lc_spawn_culture } + faith = { save_temporary_scope_as = lc_spawn_faith } + } +} + +scripted_effect luxury_contract_cleanup_unused_character_effect = { + #if = { + # limit = { scope:artifact.artifact_owner ?= this } + # hidden_effect = { destroy_artifact = scope:artifact } + #} + if = { + limit = { scope:urchin ?= this } + remove_character_flag = peasant_outfit + } + if = { + limit = { has_character_flag = destroy_me } + silent_disappearance_effect = yes + } +} + +scripted_effect luxury_contract_reward_quality_effect = { + switch = { + trigger = scope:task_contract.task_contract_tier + tier_county = { + save_scope_value_as = { + name = quality + value = { 45 70 } + } + save_scope_value_as = { + name = wealth + value = { 20 30 } + } + } + tier_duchy = { + save_scope_value_as = { + name = quality + value = { 55 80 } + } + save_scope_value_as = { + name = wealth + value = { 35 45 } + } + } + tier_kingdom = { + save_scope_value_as = { + name = quality + value = { 65 90 } + } + save_scope_value_as = { + name = wealth + value = { 45 60 } + } + } + } +} + +scripted_effect luxury_contract_fallback_reward_quality_effect = { + switch = { + trigger = scope:task_contract.task_contract_tier + tier_county = { + save_scope_value_as = { + name = quality + value = { 10 25 } + } + save_scope_value_as = { + name = wealth + value = { 5 10 } + } + } + tier_duchy = { + save_scope_value_as = { + name = quality + value = { 20 35 } + } + save_scope_value_as = { + name = wealth + value = { 15 20 } + } + } + tier_kingdom = { + save_scope_value_as = { + name = quality + value = { 30 45 } + } + save_scope_value_as = { + name = wealth + value = { 25 30 } + } + } + } +} + +#### +# gdp_merchant_luxury_contract.0001-1000 - Menagerie Acquisition +### + +gdp_merchant_luxury_contract.0001 = { # Intro + type = character_event + title = gdp_merchant_luxury_contract.0001.t + desc = { + desc = gdp_merchant_luxury_contract.0001.desc + first_valid = { + triggered_desc = { + trigger = { + location = { + OR = { + terrain = desert + terrain = desert_mountains + } + } + } + desc = gdp_merchant_luxury_contract.0001.desc.desert + } + triggered_desc = { + trigger = { + location = { + terrain = mountains + } + } + desc = gdp_merchant_luxury_contract.0001.desc.mountain + } + triggered_desc = { + trigger = { + location = { + terrain = jungle + } + } + desc = gdp_merchant_luxury_contract.0001.desc.jungle + } + desc = gdp_merchant_luxury_contract.0001.desc.plains + } + desc = double_line_break + first_valid = { + triggered_desc = { + trigger = { knows_language_of_culture = location.county.culture } + desc = gdp_merchant_luxury_contract.0001.desc.locals_language + } + desc = gdp_merchant_luxury_contract.0001.desc.locals + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:big_cat_flag + calc_true_if = { + amount = 0 + exists = scope:small_cat_flag + exists = scope:elephant_flag + exists = scope:bear_flag + exists = scope:monkey_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.big_cat + } + triggered_desc = { + trigger = { + exists = scope:small_cat_flag + calc_true_if = { + amount = 0 + exists = scope:big_cat_flag + exists = scope:elephant_flag + exists = scope:bear_flag + exists = scope:monkey_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.small_cat + } + triggered_desc = { + trigger = { + exists = scope:bear_flag + calc_true_if = { + amount = 0 + exists = scope:big_cat_flag + exists = scope:small_cat_flag + exists = scope:monkey_flag + exists = scope:elephant_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.bear + } + triggered_desc = { + trigger = { + exists = scope:monkey_flag + calc_true_if = { + amount = 0 + exists = scope:big_cat_flag + exists = scope:small_cat_flag + exists = scope:bear_flag + exists = scope:elephant_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.monkey + } + triggered_desc = { + trigger = { + exists = scope:elephant_flag + calc_true_if = { + amount = 0 + exists = scope:big_cat_flag + exists = scope:small_cat_flag + exists = scope:bear_flag + exists = scope:monkey_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.elephant + } + triggered_desc = { + trigger = { + exists = scope:elephant_flag + calc_true_if = { + amount >= 1 + exists = scope:big_cat_flag + exists = scope:small_cat_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.elephant_cat + } + triggered_desc = { + trigger = { + exists = scope:monkey_flag + calc_true_if = { + amount >= 1 + exists = scope:big_cat_flag + exists = scope:small_cat_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.monkey_cat + } + triggered_desc = { + trigger = { + exists = scope:bear_flag + calc_true_if = { + amount >= 1 + exists = scope:big_cat_flag + exists = scope:small_cat_flag + } + } + desc = gdp_merchant_luxury_contract.0001.desc.bear_cat + } + triggered_desc = { + trigger = { + exists = scope:bear_flag + exists = scope:elephant_flag + } + desc = gdp_merchant_luxury_contract.0001.desc.monkey_elephant + } + desc = gdp_merchant_luxury_contract.0001.desc.bird + } + desc = double_line_break + desc = gdp_merchant_luxury_contract.0001.desc.close + } + theme = trade + left_portrait = { + character = root + animation = survey + } + override_background = { reference = terrain } + + immediate = { + remove_variable = target_animal_type + save_scope_as = merchant + hidden_effect = { + location = { + save_scope_as = local_province + barony = { save_scope_as = local_barony } + county = { save_scope_as = local_county } + duchy = { + while = { + count = 3 + random_list = { + 10 = { + trigger = { + NOT = { exists = scope:big_cat_flag } + any_de_jure_county = { + any_county_province = { + OR = { + hunt_animal_lion_trigger = yes + hunt_animal_tiger_trigger = yes + hunt_animal_leopard_trigger = yes + } + } + } + } + save_scope_as = big_cat_flag + } + 10 = { + trigger = { + NOT = { exists = scope:small_cat_flag } + any_de_jure_county = { + any_county_province = { + OR = { + hunt_animal_caracal_trigger = yes + hunt_animal_lynx_trigger = yes + } + } + } + } + save_scope_as = small_cat_flag + } + 10 = { + trigger = { + NOT = { exists = scope:bear_flag } + any_de_jure_county = { + any_county_province = { hunt_animal_bear_trigger = yes } + } + } + save_scope_as = bear_flag + } + 10 = { + trigger = { + NOT = { exists = scope:elephant_flag } + any_de_jure_county = { + any_county_province = { luxury_contract_creature_elephant_trigger = yes } + } + } + save_scope_as = elephant_flag + } + 10 = { + trigger = { + NOT = { exists = scope:monkey_flag } + any_de_jure_county = { + any_county_province = { luxury_contract_creature_monkey_trigger = yes } + } + } + save_scope_as = monkey_flag + } + } + } + } + } + } + } + + option = { # Wilds + name = gdp_merchant_luxury_contract.0001.a + flavor = gdp_merchant_luxury_contract.0001.a.flavor + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_wilds_flag + } + add_internal_flag = dangerous + custom_tooltip = gdp_merchant_luxury_contract.0001.a.tt + stress_and_fulfillment_impact = { + craven = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } + + option = { # City + name = gdp_merchant_luxury_contract.0001.b + flavor = gdp_merchant_luxury_contract.0001.b.flavor + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_urban_flag + } + custom_tooltip = gdp_merchant_luxury_contract.0001.b.tt + stress_and_fulfillment_impact = { + brave = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.25 + ai_boldness = -0.25 + } + } + } + + after = { + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + } +} + +scripted_trigger luxury_contract_potential_rich_trigger = { + exists = house + is_available_quick = { + ai = yes + adult = yes + imprisoned = no + incapable = no + in_army = no + } +} + +scripted_trigger luxury_contract_any_rich_local_trigger = { + location.county ?= { + OR = { + holder = { + OR = { + luxury_contract_potential_rich_trigger = yes + any_courtier = { luxury_contract_potential_rich_trigger = yes } + any_vassal = { + capital_province.duchy = root.location.duchy + OR = { + luxury_contract_potential_rich_trigger = yes + any_courtier = { luxury_contract_potential_rich_trigger = yes } + } + } + } + } + title_province = { + any_province_domicile = { + OR = { + is_domicile_type = merchant_company + is_domicile_type = east_asian_estate + is_domicile_type = japanese_manor + } + owner = { + OR = { + luxury_contract_potential_rich_trigger = yes + any_courtier = { luxury_contract_potential_rich_trigger = yes } + } + } + } + } + } + } +} + +scripted_effect luxury_contract_find_rich_local_effect = { + if = { + limit = { luxury_contract_potential_rich_trigger = yes } + add_to_list = potential_rich_local + } + every_courtier = { + limit = { luxury_contract_potential_rich_trigger = yes } + add_to_list = potential_rich_local + } +} + +scripted_effect luxury_contract_select_rich_local_effect = { + location = { + county.holder = { + luxury_contract_find_rich_local_effect = yes + every_vassal = { + limit = { capital_province.duchy = root.location.duchy } + luxury_contract_find_rich_local_effect = yes + } + } + duchy = { + every_de_jure_county = { + title_province = { + every_province_domicile = { + limit = { + OR = { + is_domicile_type = merchant_company + is_domicile_type = east_asian_estate + is_domicile_type = japanese_manor + } + } + owner = { luxury_contract_find_rich_local_effect = yes } + } + } + every_pool_character = { + province = title_province + limit = { luxury_contract_potential_rich_trigger = yes } + add_to_list = potential_rich_local + } + } + } + } + # SELECT + random_in_list = { + list = potential_rich_local + weight = { + base = 1 + modifier = { add = gold } + modifier = { + government_has_flag = government_has_influence + add = influence + } + modifier = { + add = { + value = prestige_level + multiply = 10 + } + } + modifier = { + add = { + value = dynasty.dynasty_prestige_level + multiply = 10 + } + } + modifier = { + is_ruler = yes + factor = 10 + } + modifier = { + primary_spouse ?= { is_ruler = yes } + factor = 5 + } + modifier = { + any_parent = { is_ruler = yes } + factor = 5 + } + modifier = { + is_landed = yes + factor = 10 + } + modifier = { + primary_spouse ?= { is_landed = yes } + factor = 5 + } + modifier = { + any_parent = { is_landed = yes } + factor = 5 + } + modifier = { + is_ai = no + factor = 0.01 + } + } + save_scope_as = rich_local + } +} + +### Rich Local sub-chain +gdp_merchant_luxury_contract.0011 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.0011.t + desc = { + desc = gdp_merchant_luxury_contract.0011.desc + first_valid = { + triggered_desc = { + trigger = { + scope:rich_local = { + OR = { + var:animal_type ?= flag:peacock + var:animal_type ?= flag:caracal + } + } + } + desc = gdp_merchant_luxury_contract.0011.leashed + } + triggered_desc = { + trigger = { + scope:rich_local = { + OR = { + var:animal_type ?= flag:cockatoo + var:animal_type ?= flag:parrot + } + } + } + desc = gdp_merchant_luxury_contract.0011.shoulder + } + desc = gdp_merchant_luxury_contract.0011.cage + } + desc = gdp_merchant_luxury_contract.0011.close + } + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:rich_local + animation = dismissal + camera = camera_event_right_pointing_left + } + artifact = { + target = scope:rich_local_creature + position = lower_center_portrait + } + override_background = { reference = market } + + trigger = { + scope:lc_active_path_flag ?= flag:lc_0001_urban_flag + luxury_contract_any_rich_local_trigger = yes + } + + immediate = { + save_scope_as = lc_0001_rich_local_flag + luxury_contract_select_rich_local_effect = yes + scope:rich_local = { + select_dealer_creature_effect = { TYPE = rich_local } + assign_quirk_effect = yes + } + luxury_contract_reward_quality_effect = yes + hidden_effect_new_object = { + create_creature_artifact_effect = { + OWNER = scope:rich_local + CREATOR = scope:rich_local + } + } + scope:newly_created_artifact ?= { save_scope_as = rich_local_creature } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:rich_local_creature + } + } + } + + option = { # Offer to buy it + name = gdp_merchant_luxury_contract.0011.a + duel = { + skills = { diplomacy stewardship } + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 2.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0011.a.success + save_scope_as = lc_0001_success + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:rich_local.medium_gold_value + target = scope:rich_local + } + scope:task_contract = { complete_task_contract = success_standard } + } + } + 25 = { + compare_modifier = { + value = scope:duel_value + multiplier = -2.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0011.a.failure + custom_tooltip = gdp_merchant_luxury_contract.some_other_way + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + trigger_event = { + id = gdp_merchant_luxury_contract.0012 + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.25 + ai_greed = -0.25 + } + modifier = { + short_term_gold < scope:rich_local.major_gold_value + factor = 0 + } + modifier = { + diplomacy < scope:rich_local.diplomacy_double_value + factor = 0.5 + } + modifier = { + stewardship < scope:rich_local.stewardship_double_value + factor = 0.5 + } + } + } + + option = { # Go to wilds + name = gdp_merchant_luxury_contract.0011.b + flavor = gdp_merchant_luxury_contract.0001.a.flavor + trigger = { + NOT = { has_character_flag = menagerie_acquisition_rejected_other_path } + } + add_character_flag = { flag = menagerie_acquisition_rejected_other_path months = 6 } + scope:task_contract = { remove_variable = artifact } + custom_tooltip = gdp_merchant_luxury_contract_back_to_wilderness_tt + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_wilds_flag + } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } +} + +gdp_merchant_luxury_contract.0012 = { # Offer outcome + type = character_event + title = gdp_merchant_luxury_contract.0012.t + desc = { + desc = gdp_merchant_luxury_contract.0012.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_0001_success } + desc = gdp_merchant_luxury_contract.0012.success + } + desc = gdp_merchant_luxury_contract.0012.failure + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:lc_0001_success } + animation = happiness + } + triggered_animation = { + trigger = { NOT = { exists = scope:lc_0001_success } } + animation = stress + } + } + right_portrait = { + character = scope:rich_local + triggered_animation = { + trigger = { exists = scope:lc_0001_success } + animation = steward + } + triggered_animation = { + trigger = { NOT = { exists = scope:lc_0001_success } } + animation = dismissal + } + } + artifact = { + target = scope:rich_local_creature + position = lower_center_portrait + } + override_background = { reference = market } + + immediate = { + if = { + limit = { exists = scope:lc_0001_success } + pay_short_term_gold = { + gold = scope:rich_local.medium_gold_value + target = scope:rich_local + } + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:rich_local_creature + } + } + } + + option = { # Yay! + name = gdp_merchant_luxury_contract.0012.a + trigger = { exists = scope:lc_0001_success } + scope:task_contract = { complete_task_contract = success_standard } + scope:rich_local = { remove_variable = animal_type } + } + + option = { # Make ridiculous offer + name = gdp_merchant_luxury_contract.0012.b + trigger = { + NOT = { exists = scope:lc_0001_success } + gold >= scope:rich_local.major_gold_value + } + show_as_unavailable = { + NOT = { exists = scope:lc_0001_success } + } + pay_short_term_gold = { + gold = scope:rich_local.major_gold_value + target = scope:rich_local + } + scope:task_contract = { complete_task_contract = success_standard } + scope:rich_local = { remove_variable = animal_type } + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + impatient = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = -0.5 + } + modifier = { + short_term_gold < scope:rich_local.massive_gold_value + factor = 0 + } + } + } + + option = { # Plan theft + name = gdp_merchant_luxury_contract.0012.c + trigger = { + NOT = { exists = scope:lc_0001_success } + } + duel = { + skill = intrigue + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0012.c.success + show_as_tooltip = { + scope:task_contract = { complete_task_contract = success_standard } + reverse_add_opinion = { + modifier = stole_artifact_from_me + target = scope:rich_local + } + } + save_scope_as = lc_0001_success + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0012.c.failure + show_as_tooltip = { + scope:task_contract = { complete_task_contract = failure_standard } + reverse_add_opinion = { + modifier = attempted_to_steal_artifact_from_me + target = scope:rich_local + } + random = { + chance = 25 + increase_wounds_no_death_effect = { REASON = fight } + } + } + } + } + show_as_tooltip = { + scope:rich_local = { + progress_towards_rival_effect = { + REASON = rival_stole_creature + CHARACTER = root + OPINION = 0 + } + } + } + stress_and_fulfillment_impact = { + craven = minor_stress_impact_gain + just = minor_stress_impact_gain + } + trigger_event = gdp_merchant_luxury_contract.0013 + ai_chance = { + base = 10 + ai_value_modifier = { + ai_honor = -0.25 + ai_boldness = 0.25 + } + modifier = { + intrigue < scope:rich_local.intrigue_double_value + factor = 0 + } + } + } + + option = { # Give up + name = gdp_merchant_luxury_contract.0012.d + trigger = { + NOR = { + exists = scope:lc_0001_success + has_character_flag = menagerie_acquisition_failed_other_path + has_character_flag = menagerie_acquisition_rejected_other_path + } + } + add_character_flag = { flag = menagerie_acquisition_failed_other_path months = 6 } + scope:task_contract = { remove_variable = artifact } + scope:rich_local = { remove_variable = animal_type } + custom_tooltip = gdp_merchant_luxury_contract_back_to_wilderness_tt + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_wilds_flag + } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } + + option = { # Really give up + name = gdp_merchant_luxury_contract.0012.e + trigger = { + NOT = { exists = scope:lc_0001_success } + } + scope:task_contract = { remove_variable = artifact } + scope:rich_local = { remove_variable = animal_type } + scope:task_contract = { complete_task_contract = failure_standard } + ai_chance = { + base = -100 + } + } +} + +gdp_merchant_luxury_contract.0013 = { # Theft outcome + type = character_event + title = gdp_merchant_luxury_contract.0013.t + desc = { + desc = gdp_merchant_luxury_contract.0013.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_0001_success } + desc = gdp_merchant_luxury_contract.0013.success + } + desc = gdp_merchant_luxury_contract.0013.failure + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:lc_0001_success } + animation = scheme + } + triggered_animation = { + trigger = { NOT = { exists = scope:lc_0001_success } } + animation = sadness + } + camera = camera_event_very_right + } + lower_right_portrait = scope:rich_local + artifact = { + target = scope:rich_local_creature + position = lower_center_portrait + } + override_background = { reference = alley_night } + + immediate = { + add_character_flag = use_stealth_clothes + if = { + limit = { exists = scope:lc_0001_success } + reverse_add_opinion = { + modifier = stole_artifact_from_me + target = scope:rich_local + } + } + else = { + random = { + chance = 25 + increase_wounds_no_death_effect = { REASON = fight } + } + reverse_add_opinion = { + modifier = attempted_to_steal_artifact_from_me + target = scope:rich_local + } + } + progress_towards_rival_effect = { + REASON = rival_stole_creature + CHARACTER = scope:rich_local + OPINION = 0 + } + } + + option = { # Success + name = gdp_merchant_luxury_contract.0013.a + trigger = { exists = scope:lc_0001_success } + scope:task_contract = { complete_task_contract = success_standard } + scope:rich_local = { add_personal_artifact_claim = scope:rich_local_creature } + } + + option = { # Failure + name = gdp_merchant_luxury_contract.0013.b + trigger = { + NOT = { exists = scope:lc_0001_success } + } + scope:task_contract = { complete_task_contract = failure_standard } + } + + after = { + remove_character_flag = use_stealth_clothes + scope:rich_local = { remove_variable = animal_type } + } +} + +scripted_effect luxury_contract_find_or_create_dealer_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + } + weight = { + base = 1 + modifier = { add = stewardship } + } + save_scope_as = dealer + } + if = { + limit = { NOT = { exists = scope:dealer } } + if = { + limit = { + exists = location.culture + exists = location.faith + } + create_character = { + template = merchant_template + dynasty = none + location = location + culture = location.culture + faith = location.faith + save_scope_as = dealer + } + } + else = { + create_character = { + template = merchant_template + dynasty = none + location = location + save_scope_as = dealer + } + } + scope:dealer = { add_character_flag = destroy_me } + } + scope:dealer ?= { assign_quirk_effect = yes } +} + +### Dealer sub-chain +gdp_merchant_luxury_contract.0021 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.0021.t + desc = gdp_merchant_luxury_contract.0021.desc + theme = trade + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:dealer + animation = flirtation_left + } + artifact = { + target = scope:dealer_creature_1 + position = lower_center_portrait + } + artifact = { + target = scope:dealer_creature_2 + position = lower_right_portrait + } + override_background = { reference = market } + + trigger = { + scope:lc_active_path_flag ?= flag:lc_0001_urban_flag + } + + immediate = { + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_dealer_flag + } + luxury_contract_find_or_create_dealer_effect = yes + scope:dealer = { + select_dealer_creature_effect = { TYPE = dealer } + } + luxury_contract_reward_quality_effect = yes + hidden_effect_new_object = { + create_creature_artifact_effect = { + OWNER = scope:dealer + CREATOR = scope:dealer + } + scope:newly_created_artifact = { save_scope_as = dealer_creature_1 } + set_variable = { + name = animal_type + value = scope:dealer.var:animal_type + } + switch = { + trigger = scope:dealer.var:animal_type + flag:peacock = { save_scope_value_as = { name = reserved_type value = flag:peacock } } + flag:parrot = { save_scope_value_as = { name = reserved_type value = flag:parrot } } + flag:cockatoo = { save_scope_value_as = { name = reserved_type value = flag:cockatoo } } + flag:crane = { save_scope_value_as = { name = reserved_type value = flag:crane } } + flag:monkey = { save_scope_value_as = { name = reserved_type value = flag:monkey } } + } + scope:dealer = { + remove_variable = animal_type + save_scope_as = small_local_creature + select_local_creature_effect = { TYPE = dealer } + clear_saved_scope = small_local_creature + } + luxury_contract_fallback_reward_quality_effect = yes + create_creature_artifact_effect = { + OWNER = scope:dealer + CREATOR = scope:dealer + } + scope:newly_created_artifact = { save_scope_as = dealer_creature_2 } + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:dealer_creature_1 + } + } + } + + option = { # Asking price + name = gdp_merchant_luxury_contract.0021.a + save_scope_as = lc_0001_success + save_scope_value_as = { + name = price + value = { + value = medium_gold_value + multiply = 1.25 + } + } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + scope:task_contract = { complete_task_contract = success_standard } + } + scope:dealer = { + set_variable = { + name = animal_type + value = scope:merchant.var:animal_type + } + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:dealer_creature_1 + } + } + remove_variable = animal_type + hidden_effect = { destroy_artifact = scope:dealer_creature_2 } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + patient = minor_stress_impact_gain + improvident = medium_stress_impact_loss + } + trigger_event = gdp_merchant_luxury_contract.0023 + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = -0.25 + ai_energy = 0.25 + } + modifier = { + short_term_gold < major_gold_value + factor = 0 + } + } + } + + option = { # Haggle + name = gdp_merchant_luxury_contract.0021.b + flavor = gdp_merchant_luxury_contract.0021.b.tt + save_scope_as = lc_0001_haggle_flag + duel = { + skills = { diplomacy stewardship } + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 2.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0021.b.success_critical + save_scope_as = lc_0001_success + save_scope_value_as = { + name = price + value = { + value = medium_gold_value + multiply = 0.75 + } + } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 1 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0021.b.success + save_scope_value_as = { + name = price + value = medium_gold_value + } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -2.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0021.b.failure + save_scope_as = lc_0001_failure + save_scope_value_as = { + name = price + value = { + value = medium_gold_value + multiply = 1.5 + } + } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + } + } + } + show_as_tooltip = { + scope:task_contract = { complete_task_contract = success_standard } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + impatient = minor_stress_impact_gain + } + trigger_event = gdp_merchant_luxury_contract.0022 + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = 0.25 + ai_sociability = 0.25 + } + modifier = { + short_term_gold < major_gold_value + factor = 0 + } + modifier = { + diplomacy < very_high_skill_rating + factor = 0.5 + } + modifier = { + stewardship < very_high_skill_rating + factor = 0.5 + } + } + } + + option = { # Take cheap animal + name = gdp_merchant_luxury_contract.0021.c + save_scope_as = lc_0001_success + save_scope_as = lc_0001_cheap_flag + scope:task_contract = { + set_variable = { + name = artifact + value = scope:dealer_creature_2 + } + } + save_scope_value_as = { + name = price + value = { + value = medium_gold_value + multiply = 0.5 + } + } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + # Pseudo effect due to variable change + custom_description_no_bullet = { text = task_contract_success_pseudo } + add_prestige = menagerie_acquisition_prestige_reward_value + scope:dealer_creature_2 = { set_owner = root } + } + scope:dealer = { remove_variable = animal_type } + hidden_effect = { destroy_artifact = scope:dealer_creature_1 } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + trigger_event = gdp_merchant_luxury_contract.0023 + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = -0.25 + ai_boldness = -0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Wilds + name = gdp_merchant_luxury_contract.0021.d + flavor = gdp_merchant_luxury_contract.0001.a.flavor + trigger = { + NOT = { has_character_flag = menagerie_acquisition_rejected_other_path } + } + add_character_flag = { flag = menagerie_acquisition_rejected_other_path months = 6 } + custom_tooltip = gdp_merchant_luxury_contract_back_to_wilderness_tt + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_wilds_flag + } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } +} + +gdp_merchant_luxury_contract.0022 = { # Haggle outcome + type = character_event + title = gdp_merchant_luxury_contract.0022.t + desc = { + desc = gdp_merchant_luxury_contract.0022.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_0001_success } + desc = gdp_merchant_luxury_contract.0022.success + } + triggered_desc = { + trigger = { exists = scope:lc_0001_failure } + desc = gdp_merchant_luxury_contract.0022.failure + } + desc = gdp_merchant_luxury_contract.0022.neutral + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:lc_0001_success } + animation = war_over_tie + } + triggered_animation = { + trigger = { exists = scope:lc_0001_failure } + animation = disgust + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_0001_success + exists = scope:lc_0001_failure + } + } + animation = thinking + } + } + right_portrait = { + character = scope:dealer + triggered_animation = { + trigger = { exists = scope:lc_0001_success } + animation = war_over_win + } + triggered_animation = { + trigger = { exists = scope:lc_0001_failure } + animation = anger + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_0001_success + exists = scope:lc_0001_failure + } + } + animation = debating + } + } + artifact = { + target = scope:dealer_creature_1 + position = lower_center_portrait + } + artifact = { + target = scope:dealer_creature_2 + position = lower_right_portrait + } + + option = { # Give cash + name = gdp_merchant_luxury_contract.0022.a + scope:dealer = { remove_variable = animal_type } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + scope:task_contract = { complete_task_contract = success_standard } + } + stress_and_fulfillment_impact = { + stubborn = minor_stress_impact_loss + } + trigger_event = gdp_merchant_luxury_contract.0023 + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = 0.25 + ai_boldness = 0.25 + } + modifier = { + short_term_gold < major_gold_value + factor = 0 + } + } + } + + option = { # Cheaper animal + name = gdp_merchant_luxury_contract.0022.b + save_scope_value_as = { + name = price + value = { + value = medium_gold_value + multiply = 0.5 + } + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:dealer_creature_2 + } + } + set_variable = { + name = animal_type + value = scope:dealer.var:animal_type + } + scope:dealer = { remove_variable = animal_type } + show_as_tooltip = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + # Pseudo effect due to variable change + custom_description_no_bullet = { text = task_contract_success_pseudo } + add_prestige = menagerie_acquisition_prestige_reward_value + scope:dealer_creature_2 = { set_owner = root } + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + fickle = minor_stress_impact_loss + } + trigger_event = gdp_merchant_luxury_contract.0023 + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = 0 + ai_boldness = -0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Give up + name = gdp_merchant_luxury_contract.0022.c + trigger = { + NOR = { + has_character_flag = menagerie_acquisition_failed_other_path + has_character_flag = menagerie_acquisition_rejected_other_path + } + } + add_character_flag = { flag = menagerie_acquisition_failed_other_path months = 6 } + scope:task_contract = { remove_variable = artifact } + scope:dealer = { remove_variable = animal_type } + custom_tooltip = gdp_merchant_luxury_contract_back_to_wilderness_tt + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_wilds_flag + } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } + + option = { # Really give up + name = gdp_merchant_luxury_contract.0012.e + trigger = { + NOT = { exists = scope:lc_0001_success } + } + scope:task_contract = { remove_variable = artifact } + scope:dealer = { remove_variable = animal_type } + scope:task_contract = { complete_task_contract = failure_standard } + ai_chance = { + base = -100 + } + } +} + +gdp_merchant_luxury_contract.0023 = { # Dealer outcome + type = character_event + title = gdp_merchant_luxury_contract.0023.t + desc = { + desc = gdp_merchant_luxury_contract.0023.desc + } + theme = trade + left_portrait = { + character = root + animation = happiness + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = terrain } + + immediate = { + pay_short_term_gold = { + gold = scope:price + target = scope:dealer + } + scope:task_contract.var:artifact = { save_scope_as = artifact } + set_variable = { name = animal_type value = scope:artifact.var:animal_type years = 3 } + scope:task_contract = { complete_task_contract = success_standard } + } + + option = { # Asking price + name = gdp_merchant_luxury_contract.0023.a + } +} + +scripted_effect luxury_contract_find_or_create_hunter_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = this } + } + weight = { + base = 1 + modifier = { add = prowess } + modifier = { + has_trait = lifestyle_hunter + factor = 10 + } + } + save_scope_as = hunter + } + if = { + limit = { NOT = { exists = scope:hunter } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = hunter_template + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = hunter + } + scope:hunter = { add_character_flag = destroy_me } + } + scope:hunter = { assign_quirk_effect = yes } +} + +### Hunt sub-chain +gdp_merchant_luxury_contract.0041 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.0041.t + desc = gdp_merchant_luxury_contract.0041.desc + theme = trade + left_portrait = { + character = root + animation = throne_room_two_handed_passive_1 + } + override_background = { reference = terrain } + + trigger = { + scope:lc_active_path_flag ?= flag:lc_0001_wilds_flag + } + + immediate = { + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_hunt_flag + } + if = { + limit = { exists = scope:task_contract.var:target_animal_type } + if = { + limit = { + NOT = { exists = scope:creature_location } + } + location = { save_scope_as = creature_location } + } + set_variable = { name = animal_type value = scope:task_contract.var:target_animal_type years = 3 } + } + else = { + save_scope_as = big_local_creature + select_local_creature_effect = { TYPE = hunt } + clear_saved_scope = big_local_creature + } + } + + option = { # Into the wilds + name = gdp_merchant_luxury_contract.0041.a + add_internal_flag = dangerous + custom_tooltip = gdp_merchant_luxury_contract.0041.a.tt + trigger_event = { + on_action = gdp_menagerie_acquisition_wilds_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 0.25 + ai_energy = 0.25 + } + } + } + + option = { # Go to the market + name = gdp_merchant_luxury_contract.0041.b + trigger = { + NOT = { has_character_flag = menagerie_acquisition_rejected_other_path } + } + add_character_flag = { flag = menagerie_acquisition_rejected_other_path months = 6 } + custom_tooltip = gdp_merchant_luxury_contract_back_to_town_tt + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_urban_flag + } + stress_and_fulfillment_impact = { + brave = minor_stress_impact_gain + impatient = minor_stress_impact_gain + } + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.25 + ai_boldness = -0.25 + } + } + } +} + +gdp_merchant_luxury_contract.0042 = { # Baby + type = character_event + title = gdp_merchant_luxury_contract.0042.t + desc = gdp_merchant_luxury_contract.0042.desc + theme = trade + left_portrait = { + character = root + animation = shock + camera = camera_event_very_left + } + artifact = { + target = scope:baby_creature + position = lower_center_portrait + } + override_background = { reference = terrain } + + immediate = { + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_baby_flag + } + luxury_contract_fallback_reward_quality_effect = yes + hidden_effect_new_object = { + create_creature_artifact_effect = { + OWNER = root + CREATOR = root + } + } + scope:newly_created_artifact = { + save_scope_as = baby_creature + set_artifact_name = baby_creature_artifact_name + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:baby_creature + } + } + } + + option = { # Press on + name = gdp_merchant_luxury_contract.0042.a + custom_tooltip = gdp_merchant_luxury_contract.0042.a.tt + hidden_effect = { + destroy_artifact = scope:baby_creature + clear_saved_scope = baby_creature + clear_saved_scope = newly_created_artifact + clear_saved_scope = quality + clear_saved_scope = wealth + } + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + trigger_event = { + id = gdp_merchant_luxury_contract.0044 + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 0.25 + ai_energy = 0.25 + } + } + } + + option = { # Use it as bait + name = gdp_merchant_luxury_contract.0042.b + duel = { + skills = { intrigue prowess } + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0042.b.success + save_scope_as = lc_0001_success + show_as_tooltip = { + custom_description_no_bullet = { text = task_contract_success_pseudo } + add_prestige = { + value = medium_prestige_gain + add = menagerie_acquisition_prestige_reward_value + } + scope:baby_creature = { set_owner = root } + } + custom_tooltip = gdp_merchant_luxury_contract.0042.b.success.tt + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0042.b.failure + save_scope_as = lc_0001_failure + show_as_tooltip = { + scope:task_contract = { complete_task_contract = failure_standard } + } + } + } + stress_and_fulfillment_impact = { + content = minor_stress_impact_gain + impatient = minor_stress_impact_gain + } + trigger_event = { + id = gdp_merchant_luxury_contract.0044 + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_honor = -0.25 + ai_rationality = 0.25 + } + modifier = { + intrigue < very_high_skill_rating + factor = 0.5 + } + modifier = { + prowess < very_high_skill_rating + factor = 0.5 + } + } + } + + option = { # Take it + name = gdp_merchant_luxury_contract.0042.c + scope:task_contract = { complete_task_contract = success_standard } + hidden_effect = { + send_interface_toast = { + type = msg_artifact_gained + right_icon = scope:baby_creature + show_as_tooltip = { + scope:baby_creature = { set_owner = root } + } + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + callous = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_boldness = -0.25 + } + } + } +} + +gdp_merchant_luxury_contract.0043 = { # Trapper + type = character_event + title = gdp_merchant_luxury_contract.0043.t + desc = gdp_merchant_luxury_contract.0043.desc + theme = trade + left_portrait = { + character = root + animation = shock + camera = camera_event_very_left + } + right_portrait = { + character = scope:hunter + animation = hunting_shortbow_rest_arrow_default + } + override_background = { reference = terrain } + + immediate = { + luxury_contract_find_or_create_hunter_effect = yes + } + + option = { # Accept + name = gdp_merchant_luxury_contract.0043.a + pay_short_term_gold = { + gold = minor_gold_value + target = scope:hunter + } + custom_tooltip = gdp_merchant_luxury_contract.0043.b.success_tt + save_scope_as = lc_0001_trapper_flag + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = -0.25 + ai_boldness = 0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Persuade + name = gdp_merchant_luxury_contract.0043.b + duel = { + skill = diplomacy + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0043.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_luxury_contract.0043.b.success + right_icon = scope:hunter + custom_tooltip = gdp_merchant_luxury_contract.0043.b.success_tt + } + save_scope_as = lc_0001_trapper_flag + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0043.b.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_luxury_contract.0043.b.failure + right_icon = scope:hunter + # Destroy unused characters + scope:hunter ?= { luxury_contract_cleanup_unused_character_effect = yes } + } + } + } + stress_and_fulfillment_impact = { + shy = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 0.25 + ai_sociability = 0.25 + } + modifier = { + diplomacy < very_high_skill_rating + factor = 0 + } + } + } + + option = { # Dismiss + name = gdp_merchant_luxury_contract.0043.c + add_prestige = miniscule_prestige_gain + # Destroy unused characters + scope:hunter ?= { luxury_contract_cleanup_unused_character_effect = yes } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_sociability = -0.25 + } + } + } + + after = { + trigger_event = { + id = gdp_merchant_luxury_contract.0044 + days = 3 + } + } +} + +gdp_merchant_luxury_contract.0044 = { # Hunt outcome + type = character_event + title = gdp_merchant_luxury_contract.0044.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:lc_active_path_flag = flag:lc_0001_baby_flag } + desc = gdp_merchant_luxury_contract.0044.bait + } + triggered_desc = { + trigger = { exists = scope:lc_0001_trapper_flag } + desc = gdp_merchant_luxury_contract.0044.trapper + } + desc = gdp_merchant_luxury_contract.0044.desc + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:lc_0001_success + scope:lc_active_path_flag = flag:lc_0001_baby_flag + } + desc = gdp_merchant_luxury_contract.0044.bait_success + } + triggered_desc = { + trigger = { + exists = scope:lc_0001_failure + scope:lc_active_path_flag = flag:lc_0001_baby_flag + } + desc = gdp_merchant_luxury_contract.0044.bait_failure + } + triggered_desc = { + trigger = { exists = scope:lc_0001_success } + desc = gdp_merchant_luxury_contract.0044.success + } + desc = gdp_merchant_luxury_contract.0044.failure + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_0001_success + exists = scope:lc_0001_hunt_success_flag + } + } + animation = happiness + } + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_0001_failure + exists = scope:lc_0001_hunt_failure_flag + } + } + animation = stress + } + } + right_portrait = { + character = scope:hunter + trigger = { exists = scope:lc_0001_trapper_flag } + triggered_animation = { + trigger = { + NOT = { + exists = scope:lc_0001_failure + } + } + animation = war_over_tie + } + triggered_animation = { + trigger = { + exists = scope:lc_0001_failure + } + animation = eyeroll + } + } + artifact = { + target = scope:hunt_creature + position = lower_center_portrait + } + artifact = { + target = scope:baby_creature + position = lower_right_portrait + } + override_background = { reference = terrain } + + immediate = { + if = { + limit = { exists = scope:baby_creature } + if = { + limit = { exists = scope:lc_0001_success } + add_prestige = medium_prestige_gain + hidden_effect = { + send_interface_toast = { + type = msg_artifact_gained + right_icon = scope:baby_creature + show_as_tooltip = { + scope:baby_creature = { set_owner = root } + } + } + } + } + else = { + hidden_effect = { destroy_artifact = scope:baby_creature } + } + } + if = { + limit = { + NOR = { + exists = scope:lc_0001_success + exists = scope:lc_0001_failure + } + } + hidden_effect = { + duel = { + skills = { martial prowess } + value = decent_skill_rating + 50 = { + modifier = { + exists = scope:lc_0001_trapper_flag + add = 10 + } + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + save_scope_as = lc_0001_hunt_success_flag + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + save_scope_as = lc_0001_hunt_failure_flag + } + } + } + } + else_if = { # Outcome already decided by an earlier sub-chain, carry it over + limit = { exists = scope:lc_0001_success } + save_scope_as = lc_0001_hunt_success_flag + } + else = { + save_scope_as = lc_0001_hunt_failure_flag + } + # CREATE MAIN REWARD CREATURE + if = { + limit = { exists = scope:lc_0001_hunt_success_flag } + luxury_contract_reward_quality_effect = yes + hidden_effect_new_object = { + create_creature_artifact_effect = { + OWNER = root + CREATOR = root + } + } + scope:newly_created_artifact ?= { save_scope_as = hunt_creature } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:hunt_creature + } + } + } + } + + option = { # Wahoo + name = { + trigger = { exists = scope:baby_creature } + text = gdp_merchant_luxury_contract.0044.a + } + name = { + trigger = { + NOT = { exists = scope:baby_creature } + } + text = gdp_merchant_luxury_contract.0044.c + } + trigger = { exists = scope:lc_0001_hunt_success_flag } + scope:task_contract = { complete_task_contract = success_standard } + hidden_effect = { + send_interface_toast = { + type = msg_artifact_gained + right_icon = scope:hunt_creature + show_as_tooltip = { + scope:hunt_creature = { set_owner = root } + } + } + } + scope:hunter ?= { + if = { + limit = { has_character_flag = destroy_me } + silent_disappearance_effect = yes + } + } + ai_chance = { + base = 10 + } + } + + option = { # Fail + name = { + trigger = { exists = scope:baby_creature } + text = gdp_merchant_luxury_contract.0044.b + } + name = { + trigger = { + NOT = { exists = scope:baby_creature } + } + text = gdp_merchant_luxury_contract.0044.d + } + trigger = { exists = scope:lc_0001_hunt_failure_flag } + scope:task_contract = { complete_task_contract = failure_standard } + scope:hunter ?= { + if = { + limit = { exists = scope:fallback_creature } + hidden_effect = { destroy_artifact = scope:fallback_creature } + } + } + # Destroy unused characters + scope:hunter ?= { luxury_contract_cleanup_unused_character_effect = yes } + ai_chance = { + base = 10 + } + } + + option = { # Hire Trapper + name = gdp_merchant_luxury_contract.0044.e + trigger = { + scope:hunter ?= { is_alive = yes } + exists = scope:lc_0001_trapper_flag + NOT = { + scope:hunter = { is_courtier_of = root } + } + } + if = { + limit = { exists = scope:lc_0001_hunt_success_flag } + scope:task_contract = { complete_task_contract = success_standard } + hidden_effect = { + send_interface_toast = { + type = msg_artifact_gained + right_icon = scope:hunt_creature + show_as_tooltip = { + scope:hunt_creature = { set_owner = root } + } + } + } + } + else = { + scope:task_contract = { complete_task_contract = failure_standard } + } + pay_short_term_gold = { + target = scope:hunter + gold = minor_gold_value + } + add_courtier = scope:hunter + hidden_effect = { + reverse_add_opinion = { + target = scope:hunter + modifier = recruited_me_opinion + opinion = 50 + } + } + if = { + limit = { is_travelling = yes } + current_travel_plan = { add_companion = scope:hunter } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = -0.25 + ai_sociability = 0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } +} + +### Poach sub-chain +gdp_merchant_luxury_contract.0051 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.0051.t + desc = gdp_merchant_luxury_contract.0051.desc + theme = trade + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:hunter + animation = hunting_knife_start + } + lower_center_portrait = scope:rich_local + override_background = { reference = terrain } + + trigger = { + scope:lc_active_path_flag ?= flag:lc_0001_wilds_flag + luxury_contract_any_rich_local_trigger = yes + } + + immediate = { + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_poach_flag + } + luxury_contract_select_rich_local_effect = yes + scope:rich_local = { + save_scope_as = big_local_creature + select_local_creature_effect = { TYPE = rich_local } + assign_quirk_effect = yes + } + luxury_contract_find_or_create_hunter_effect = yes + } + + option = { # Go for it + name = gdp_merchant_luxury_contract.0051.a + flavor = gdp_merchant_luxury_contract.0051.a.flavor + add_internal_flag = dangerous + custom_tooltip = gdp_merchant_luxury_contract.0051.a.tt + stress_and_fulfillment_impact = { + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + } + trigger_event = { + id = gdp_merchant_luxury_contract.0052 + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_honor = -0.25 + ai_greed = 0.25 + } + } + } + + option = { # No way Jose + name = gdp_merchant_luxury_contract.0051.b + flavor = gdp_merchant_luxury_contract.0001.b.flavor + trigger = { + NOT = { has_character_flag = menagerie_acquisition_rejected_other_path } + } + add_character_flag = { flag = menagerie_acquisition_rejected_other_path months = 6 } + custom_tooltip = gdp_merchant_luxury_contract_back_to_town_tt + save_scope_value_as = { + name = lc_active_path_flag + value = flag:lc_0001_urban_flag + } + scope:hunter ?= { + if = { + limit = { has_character_flag = destroy_me } + silent_disappearance_effect = yes + } + } + stress_and_fulfillment_impact = { + brave = minor_stress_impact_gain + impatient = minor_stress_impact_gain + } + trigger_event = { + on_action = gdp_menagerie_acquisition_random_pool_start + days = 3 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.25 + ai_boldness = -0.25 + } + } + } +} + +gdp_merchant_luxury_contract.0052 = { # Poaching time + type = character_event + title = gdp_merchant_luxury_contract.0052.t + desc = gdp_merchant_luxury_contract.0052.desc + theme = trade + left_portrait = { + character = root + animation = paranoia + } + right_portrait = { + character = scope:hunter + animation = eavesdrop + } + lower_right_portrait = scope:rich_local + artifact = { + target = scope:rich_local_creature + position = lower_center_portrait + } + override_background = { reference = terrain } + + immediate = { + luxury_contract_reward_quality_effect = yes + hidden_effect_new_object = { + create_creature_artifact_effect = { + OWNER = scope:rich_local + CREATOR = scope:rich_local + } + } + scope:newly_created_artifact ?= { save_scope_as = rich_local_creature } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:rich_local_creature + } + } + } + + option = { # Go for it + name = gdp_merchant_luxury_contract.0052.a + add_internal_flag = dangerous + duel = { + skills = { martial prowess } + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0052.a.success + save_scope_as = lc_0001_success + show_as_tooltip = { + scope:task_contract = { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 1 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.0052.a.neutral + custom_tooltip = gdp_merchant_luxury_contract.0052.b.tt + hidden_effect = { destroy_artifact = scope:rich_local_creature } + random = { + chance = 25 + save_scope_as = lc_0001_poach_wound_flag + show_as_tooltip = { + increase_wounds_no_death_effect = { REASON = fight } + } + } + } + } + stress_and_fulfillment_impact = { + craven = major_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + modifier = { + prowess < very_high_skill_rating + factor = 0 + } + } + } + + option = { # Hide + name = gdp_merchant_luxury_contract.0052.b + custom_tooltip = gdp_merchant_luxury_contract.0052.b.tt + hidden_effect = { destroy_artifact = scope:rich_local_creature } + stress_and_fulfillment_impact = { + brave = major_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.25 + ai_boldness = -0.25 + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.0053 + } +} + +gdp_merchant_luxury_contract.0053 = { # Poaching outcome + type = character_event + title = gdp_merchant_luxury_contract.0053.t + desc = { + desc = gdp_merchant_luxury_contract.0053.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_0001_success } + desc = gdp_merchant_luxury_contract.0053.success + } + desc = gdp_merchant_luxury_contract.0053.failure + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:lc_0001_success } + animation = war_over_tie + } + triggered_animation = { + trigger = { + NOT = { exists = scope:lc_0001_success } + NOT = { exists = scope:lc_0001_poach_wound_flag } + } + animation = anger + } + triggered_animation = { + trigger = { exists = scope:lc_0001_poach_wound_flag } + animation = loss_1 + } + } + right_portrait = { + character = scope:hunter + animation = shame + } + lower_right_portrait = scope:rich_local + artifact = { + target = scope:rich_local_creature + position = lower_center_portrait + trigger = { + NOT = { exists = scope:lc_0001_failure } + } + } + artifact = { + target = scope:fallback_creature + position = lower_left_portrait + } + override_background = { reference = terrain } + + immediate = { + if = { + limit = { + NOT = { exists = scope:lc_0001_success } + } + save_scope_as = harmless_local_creature + scope:hunter = { + select_local_creature_effect = { TYPE = fallback } + } + luxury_contract_fallback_reward_quality_effect = yes + hidden_effect_new_object = { + create_creature_artifact_effect = { + OWNER = scope:hunter + CREATOR = scope:hunter + } + } + scope:newly_created_artifact = { save_scope_as = fallback_creature } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:fallback_creature + } + } + } + else = { + scope:task_contract = { complete_task_contract = success_standard } + } + if = { + limit = { exists = scope:lc_0001_poach_wound_flag } + increase_wounds_no_death_effect = { REASON = hunting_accident } + } + } + + option = { # Wahoo + name = gdp_merchant_luxury_contract.0053.a + trigger = { exists = scope:lc_0001_success } + # Destroy unused characters + scope:hunter ?= { luxury_contract_cleanup_unused_character_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + brave = major_stress_impact_gain + } + ai_chance = { + base = 10 + } + } + + option = { # Take responsibility + name = gdp_merchant_luxury_contract.0053.b + flavor = gdp_merchant_luxury_contract.0053.b.flavor + trigger = { exists = scope:lc_0001_success } + add_prestige = minor_prestige_gain + reverse_add_opinion = { + modifier = stole_artifact_from_me + target = scope:rich_local + opinion = -50 + } + scope:rich_local = { add_personal_artifact_claim = scope:rich_local_creature } + add_courtier = scope:hunter + hidden_effect = { + reverse_add_opinion = { + target = scope:hunter + modifier = recruited_me_opinion + opinion = 50 + } + } + if = { + limit = { is_travelling = yes } + current_travel_plan = { add_companion = scope:hunter } + } + stress_and_fulfillment_impact = { + callous = medium_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_honor = 0.25 + ai_compassion = 0.25 + } + } + } + + option = { # Gosh darned it + name = gdp_merchant_luxury_contract.0053.c + trigger = { + NOT = { exists = scope:lc_0001_success } + } + scope:task_contract = { complete_task_contract = failure_standard } + hidden_effect = { + scope:hunter = { destroy_artifact = scope:fallback_creature } + } + # Destroy unused characters + scope:hunter ?= { luxury_contract_cleanup_unused_character_effect = yes } + ai_chance = { + base = 10 + } + } + + option = { # Recruit + name = gdp_merchant_luxury_contract.0053.d + trigger = { + NOT = { exists = scope:lc_0001_success } + } + hidden_effect = { + scope:hunter = { destroy_artifact = scope:fallback_creature } + } + scope:task_contract = { complete_task_contract = failure_standard } + pay_short_term_gold = { + gold = minor_gold_value + target = scope:hunter + } + add_courtier = scope:hunter + hidden_effect = { + reverse_add_opinion = { + target = scope:hunter + modifier = recruited_me_opinion + opinion = 50 + } + } + if = { + limit = { is_travelling = yes } + current_travel_plan = { add_companion = scope:hunter } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.25 + ai_greed = -0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Fallback + name = gdp_merchant_luxury_contract.0053.e + trigger = { + NOT = { exists = scope:lc_0001_success } + } + scope:task_contract = { complete_task_contract = success_standard } + pay_short_term_gold = { + target = scope:hunter + gold = medium_gold_value + } + # Destroy unused characters + scope:hunter ?= { luxury_contract_cleanup_unused_character_effect = yes } + stress_and_fulfillment_impact = { + stubborn = minor_stress_impact_loss + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + after = { + remove_variable = animal_type + } +} + +scripted_effect lc_curio_next_building_option_effect = { + custom_tooltip = gdp_merchant_luxury_contract.$TOOLTIP$.tt + # Save flag + save_scope_value_as = { + name = lc_active_building_flag + value = flag:$FLAG$ + } + # Destroy unused artifact + if = { + limit = { exists = scope:task_contract.var:artifact } + destroy_artifact = scope:task_contract.var:artifact + } + # Trigger event + trigger_event = { + id = gdp_merchant_luxury_contract.$EVENT_ID$ + days = 3 + } +} + +scripted_effect lc_curio_next_path_option_effect = { + custom_tooltip = gdp_merchant_luxury_contract.$TOOLTIP$.tt + # Setup path scope + save_scope_value_as = { + name = lc_active_path_flag + value = flag:$FLAG$ + } + # Trigger event + trigger_event = { + id = gdp_merchant_luxury_contract.$EVENT_ID$ + days = 3 + } +} + +scripted_trigger lc_curio_next_building_option_trigger = { + trigger_if = { + limit = { + OR = { # Barter options allow changing your mind + scope:lc_active_path_flag = flag:lc_1101_urchin_flag + scope:lc_active_path_flag = flag:lc_1101_antiques_flag + scope:lc_active_path_flag = flag:lc_1101_bookseller_flag + } + } + } + trigger_else = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + scope:merchant = { + NOR = { + any_in_list = { + variable = lc_building_completed_list + this = flag:$FLAG$ + } + any_in_list = { + variable = lc_building_completed_list + count >= 2 + } + } + any_in_list = { + variable = lc_building_potential_list + this = flag:$FLAG$ + } + } +} + +scripted_trigger lc_curio_bad_success_option_trigger = { + exists = scope:task_contract.var:artifact + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } +} + +scripted_trigger lc_curio_give_up_option_trigger = { + trigger_if = { + limit = { + OR = { # Barter options allow changing your mind + scope:lc_active_path_flag = flag:lc_1101_urchin_flag + scope:lc_active_path_flag = flag:lc_1101_antiques_flag + scope:lc_active_path_flag = flag:lc_1101_bookseller_flag + } + } + } + trigger_else = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + exists = scope:task_contract.var:artifact # why fail when you can take it + } + } +} + +scripted_effect lc_curio_give_up_option_effect = { + scope:task_contract = { complete_task_contract = failure_standard } + lc_curio_clean_up_variables_effect = yes +} + +scripted_effect lc_curio_success_option_effect = { + scope:task_contract = { complete_task_contract = success_standard } + lc_curio_clean_up_variables_effect = yes +} + +scripted_effect lc_curio_failure_option_effect = { + hidden_effect = { + if = { + limit = { exists = scope:artifact } + destroy_artifact = scope:artifact + } + } + scope:task_contract = { remove_variable = artifact } + clear_saved_scope = artifact +} + +scripted_effect lc_curio_clean_up_variables_effect = { + scope:merchant = { + clear_variable_list = lc_path_options_list + clear_variable_list = lc_building_fallback_list + clear_variable_list = lc_building_potential_list + clear_variable_list = lc_building_completed_list + } +} + +#### +# gdp_merchant_luxury_contract.1001-2000 - Find Curio +### + +gdp_merchant_luxury_contract.1001 = { # Intro + type = character_event + title = gdp_merchant_luxury_contract.1001.t + desc = { + desc = gdp_merchant_luxury_contract.1001.desc + first_valid = { + triggered_desc = { + trigger = { + location = { + OR = { + terrain = desert + terrain = desert_mountains + } + } + } + desc = gdp_merchant_luxury_contract.0001.desc.desert + } + triggered_desc = { + trigger = { + location = { + terrain = mountains + } + } + desc = gdp_merchant_luxury_contract.0001.desc.mountain + } + triggered_desc = { + trigger = { + location = { + terrain = jungle + } + } + desc = gdp_merchant_luxury_contract.0001.desc.jungle + } + desc = gdp_merchant_luxury_contract.0001.desc.plains + } + desc = double_line_break + first_valid = { + triggered_desc = { + trigger = { knows_language_of_culture = location.county.culture } + desc = gdp_merchant_luxury_contract.1001.desc.locals_language + } + desc = gdp_merchant_luxury_contract.1001.desc.locals + } + random_valid = { + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_building_potential_list + this = flag:religious_building + } + } + desc = gdp_merchant_luxury_contract.1001.desc.religious + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_building_potential_list + this = flag:scholarly_building + } + } + desc = gdp_merchant_luxury_contract.1001.desc.scholarly + } + desc = gdp_merchant_luxury_contract.1001.desc.fallback + } + desc = double_line_break + desc = gdp_merchant_luxury_contract.0001.desc.close + } + theme = trade + left_portrait = { + character = root + animation = survey + } + override_background = { reference = market } + + immediate = { + save_scope_as = merchant + hidden_effect = { + location = { + save_scope_as = local_province + barony = { save_scope_as = local_barony } + county = { save_scope_as = local_county } + duchy = { + # Pick a building path via flags and interests + while = { + count = 2 + random_list = { + # Religious + 10 = { + trigger = { + any_de_jure_county = { + any_county_province = { gdp_find_curio_poi_religious_province_trigger = yes } + } + NOT = { + scope:merchant = { + any_in_list = { + variable = lc_building_potential_list + this = flag:religious_building + } + } + } + } + modifier = { add = scope:merchant.learning } + modifier = { + scope:merchant = { has_trait = theologian } + add = 20 + } + modifier = { + scope:merchant = { has_trait = cynical } + add = -20 + } + random_de_jure_county = { + limit = { + any_county_province = { gdp_find_curio_poi_religious_province_trigger = yes } + } + random_county_province = { + limit = { gdp_find_curio_poi_religious_province_trigger = yes } + save_scope_as = religious_building_province + random_built_buildings = { + limit = { + building_district = { gdp_find_curio_poi_religious_province_trigger = yes } + } + building_district = { save_scope_as = religious_building_district } + } + scope:merchant = { + add_to_variable_list = { + name = lc_building_potential_list + target = flag:religious_building + } + } + barony = { + save_temporary_scope_as = holy_site_temp + # Save main faith for loc purposes + if = { + limit = { + is_holy_site_of = scope:religious_building_province.faith + OR = { + AND = { + scope:religious_building_province.religion = religion:hinduism_religion + title_province = { has_building_with_flag = holy_building_hinduism } + } + AND = { + scope:religious_building_province.religion = religion:buddhism_religion + title_province = { has_building_with_flag = holy_building_buddhism } + } + AND = { + OR = { scope:religious_building_province.religion = religion:catholic_religion scope:religious_building_province.religion = religion:protestant_religion scope:religious_building_province.religion = religion:eastern_orthodox_religion scope:religious_building_province.religion = religion:oriental_orthodox_religion } + title_province = { has_building_with_flag = holy_building_christianity } + } + AND = { + scope:religious_building_province.religion = religion:islam_religion + title_province = { has_building_with_flag = holy_building_islam } + } + AND = { + scope:religious_building_province.religion = religion:judaism_religion + title_province = { has_building_with_flag = holy_building_judaism } + } + AND = { + scope:religious_building_province.religion = religion:shintoism_religion + title_province = { has_building_with_flag = holy_building_shintoism } + } + } + } + scope:religious_building_province.faith = { save_scope_as = religious_building_faith } + } + else_if = { + limit = { + title_province = { has_building_with_flag = holy_building_hinduism } + } + religion:hinduism_religion = { + ordered_faith = { + order_by = num_county_followers + save_scope_as = religious_building_faith + } + } + } + else_if = { + limit = { + title_province = { has_building_with_flag = holy_building_buddhism } + } + religion:buddhism_religion = { + ordered_faith = { + order_by = num_county_followers + save_scope_as = religious_building_faith + } + } + } + else_if = { + limit = { + title_province = { has_building_with_flag = holy_building_christianity } + } + scope:religious_building_province.religion = { + ordered_faith = { + order_by = num_county_followers + save_scope_as = religious_building_faith + } + } + } + else_if = { + limit = { + title_province = { has_building_with_flag = holy_building_islam } + } + religion:islam_religion = { + ordered_faith = { + order_by = num_county_followers + save_scope_as = religious_building_faith + } + } + } + else_if = { + limit = { + title_province = { has_building_with_flag = holy_building_judaism } + } + religion:judaism_religion = { + ordered_faith = { + order_by = num_county_followers + save_scope_as = religious_building_faith + } + } + } + else_if = { + limit = { + title_province = { has_building_with_flag = holy_building_shintoism } + } + religion:shintoism_religion = { + ordered_faith = { + order_by = num_county_followers + save_scope_as = religious_building_faith + } + } + } + else = { + scope:religious_building_province.faith = { save_scope_as = religious_building_faith } + } + } + } + } + } + # Scholarly + 10 = { + trigger = { + any_de_jure_county = { + any_county_province = { gdp_find_curio_poi_scholarly_province_trigger = yes } + } + NOT = { + scope:merchant = { + any_in_list = { + variable = lc_building_potential_list + this = flag:scholarly_building + } + } + } + } + modifier = { add = scope:merchant.learning } + modifier = { + scope:merchant = { has_trait = lifestyle_scholar } + add = 20 + } + modifier = { + scope:merchant = { has_trait = erudite } + add = 20 + } + random_de_jure_county = { + limit = { + any_county_province = { gdp_find_curio_poi_scholarly_province_trigger = yes } + } + random_county_province = { + limit = { gdp_find_curio_poi_scholarly_province_trigger = yes } + save_scope_as = scholarly_building_province + random_built_buildings = { + limit = { + building_district = { gdp_find_curio_poi_scholarly_province_trigger = yes } + } + building_district = { save_scope_as = scholarly_building_district } + } + scope:merchant = { + add_to_variable_list = { + name = lc_building_potential_list + target = flag:scholarly_building + } + } + } + } + } + } + } + } + } + } + } + + option = { # Urban + name = gdp_merchant_luxury_contract.1001.a + flavor = gdp_merchant_luxury_contract.1001.a.flavor + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.a + FLAG = urban_building + EVENT_ID = 1101 + } + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } + + option = { # Religious + name = gdp_merchant_luxury_contract.1001.e + flavor = gdp_merchant_luxury_contract.1001.e.flavor + trigger = { + scope:merchant = { + any_in_list = { + variable = lc_building_potential_list + this = flag:religious_building + } + } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.e + FLAG = religious_building + EVENT_ID = 1501 + } + stress_and_fulfillment_impact = { + zealous = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } + + option = { # Scholarly + name = gdp_merchant_luxury_contract.1001.f + flavor = gdp_merchant_luxury_contract.1001.f.flavor + trigger = { + scope:merchant = { + any_in_list = { + variable = lc_building_potential_list + this = flag:scholarly_building + } + } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.f + FLAG = scholarly_building + EVENT_ID = 1601 + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } +} + +scripted_trigger lc_curio_select_fallback_location_trigger = { + scope:merchant = { + any_in_list = { + variable = lc_building_potential_list + this = flag:$FLAG$ + } + NOT = { + any_in_list = { + variable = lc_building_completed_list + this = flag:$FLAG$ + } + } + } +} + +scripted_effect lc_curio_select_fallback_location_effect = { + hidden_effect = { + while = { + count = 1 + scope:merchant = { + random_list = { + 1 = { + trigger = { + lc_curio_select_fallback_location_trigger = { FLAG = religious_building } + } + add_to_variable_list = { + name = lc_building_fallback_list + target = flag:religious_building + } + } + 1 = { + trigger = { + lc_curio_select_fallback_location_trigger = { FLAG = scholarly_building } + } + add_to_variable_list = { + name = lc_building_fallback_list + target = flag:scholarly_building + } + } + } + } + } + } +} + +scripted_effect lc_curio_reforge_effect = { + hidden_effect_new_object = { + scope:artifact ?= { + if = { + limit = { + NOT = { artifact_type = $TYPE$ } + } + reforge_artifact = { type = $TYPE$ } + } + if = { + limit = { artifact_type = library_item } + domicile_library_artifact_modifiers_effect = yes + } + else = { + domicile_curio_artifact_modifiers_effect = yes + } + } + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:artifact + } + } + clear_saved_scope = newly_created_artifact +} + +scripted_effect lc_curio_portrait_scope_effect = { + save_scope_as = portrait + save_scope_as = bg_override_char +} + +scripted_effect lc_curio_fallback_artifact_effect = { + if = { + limit = { + NOT = { exists = scope:lc_1001_success_critical } + trigger_if = { + limit = { exists = scope:lc_1001_success } + OR = { + scope:lc_active_path_flag = flag:lc_1101_antiques_flag + scope:lc_active_path_flag = flag:lc_1101_bookseller_flag + } + } + NOT = { scope:lc_active_path_flag = flag:lc_1501_tomb_flag } + $OWNER$ = { is_alive = yes } + scope:merchant = { + OR = { + any_in_list = { + variable = lc_building_completed_list + count >= 2 + } + NOT = { + any_in_list = { variable = lc_building_fallback_list } + } + } + } + } + hidden_effect = { + luxury_contract_fallback_reward_quality_effect = yes + $OWNER$ = { + create_curio_artifact_effect = { + OWNER = $OWNER$ + CREATOR = dummy_female + } + } + if = { + limit = { exists = scope:new_trinket } + scope:new_trinket = { save_scope_as = fallback_artifact } + clear_saved_scope = new_trinket + } + else_if = { + limit = { exists = scope:newly_created_artifact } + scope:newly_created_artifact = { save_scope_as = fallback_artifact } + clear_saved_scope = newly_created_artifact + } + clear_saved_scope = quality + clear_saved_scope = wealth + } + } +} + +scripted_trigger lc_curio_fallback_option_trigger = { + exists = scope:fallback_artifact + scope:merchant = { + OR = { + any_in_list = { + variable = lc_building_completed_list + count >= 2 + } + NOT = { + any_in_list = { variable = lc_building_fallback_list } + } + } + } +} + +scripted_effect lc_curio_fallback_option_effect = { + custom_description_no_bullet = { text = task_contract_success_pseudo } + remove_short_term_gold = minor_gold_value + show_as_tooltip = { + add_prestige = find_curio_prestige_reward_value + scope:fallback_artifact ?= { set_owner = scope:merchant } + } + scope:task_contract = { + set_variable = { + name = artifact + value = scope:fallback_artifact + } + } + hidden_effect = { + scope:task_contract = { complete_task_contract = success_standard } + } +} + +scripted_effect lc_curio_cleanup_path_scopes_effect = { + clear_saved_scope = portrait + clear_saved_scope = lc_1001_success + clear_saved_scope = lc_1001_success_critical + clear_saved_scope = lc_1001_failure_critical +} + +scripted_effect luxury_contract_wound_effect = { + if = { + limit = { exists = var:lc_wound_flag } + increase_wounds_no_death_effect = { REASON = fight } + remove_variable = lc_wound_flag + } +} + +### Market sub-chain + +scripted_effect luxury_contract_find_or_create_urchin_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + age <= 18 + NOR = { + scope:dealer ?= this + scope:traveler ?= this + scope:gambler ?= this + } + } + weight = { + base = 1 + modifier = { add = intrigue } + } + save_scope_as = urchin + } + if = { + limit = { NOT = { exists = scope:urchin } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = criminal_fingers_character + age = { 8 16 } + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = urchin + } + scope:urchin = { add_character_flag = destroy_me } + } + scope:urchin ?= { + assign_quirk_effect = yes + add_character_flag = peasant_outfit + } +} + +scripted_effect luxury_contract_find_or_create_traveler_effect = { + scope:local_county.duchy = { + every_de_jure_county = { + every_county_province = { + every_province_domicile = { + limit = { + is_domicile_type = camp + owner = { + is_available_quick = { + ai = yes + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + owner = { add_to_list = potential_travelers } + } + } + } + } + random_in_list = { + list = potential_travelers + limit = { + NOR = { + culture = scope:merchant.culture + culture = scope:local_county.culture + } + } + alternative_limit = { always = yes } + save_scope_as = traveler + } + if = { + limit = { + NOT = { exists = scope:traveler } + } + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + NOR = { + scope:dealer ?= this + scope:urchin ?= this + scope:gambler ?= this + culture = scope:merchant.culture + culture = scope:local_county.culture + + } + is_lowborn = yes + } + weight = { + base = 1 + modifier = { add = sum_of_all_skills_and_prowess_value } + } + save_scope_as = traveler + } + } + if = { + limit = { NOT = { exists = scope:traveler } } + scope:dealer = { save_traveler_culture_effect = yes } + scope:traveler_culture_2 = { + random_culture_county = { + limit = { + NOR = { + culture = scope:dealer.culture + culture = scope:merchant.culture + } + } + faith = { save_scope_as = traveler_faith } + } + } + if = { + limit = { + NOT = { exists = scope:traveler_faith } + } + location.faith = { save_scope_as = traveler_faith } + } + create_character = { + template = foreign_mercenary_template + dynasty = none + location = location + culture = scope:traveler_culture_2 + faith = scope:traveler_faith + save_scope_as = traveler + } + scope:traveler = { add_character_flag = destroy_me } + } + scope:traveler ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_or_create_gambler_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + NOR = { + scope:dealer ?= this + scope:urchin ?= this + scope:traveler ?= this + } + } + weight = { + base = 1 + modifier = { + add = { + value = 0 + subtract = ai_honor + } + } + } + save_scope_as = gambler + } + if = { + limit = { NOT = { exists = scope:gambler } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = criminal_brains_character + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = gambler + } + random = { + chance = 33 + random_list = { + 10 = { add_trait = one_legged } + 10 = { add_trait = one_eyed } + 10 = { add_trait = scarred } + } + } + scope:gambler = { add_character_flag = destroy_me } + } + scope:gambler ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_other_merchant_effect = { + # Find merchants + scope:local_barony.trade_market ?= { + every_character_in_market = { + limit = { + government_has_flag = government_is_merchant + is_ai = yes + NOT = { this = scope:merchant } + capital_province.kingdom = { + OR = { + this = scope:local_county.kingdom + any_title_to_title_neighboring_and_across_water_kingdom = { this = scope:local_county.kingdom } + } + } + } + add_to_list = potential_merchants + } + } +} + +# Intro +gdp_merchant_luxury_contract.1101 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = { + desc = gdp_merchant_luxury_contract.1101.desc + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_urchin_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1101.urchin + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_antiques_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1101.antiques + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_bookseller_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1101.bookseller + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_travelers_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1101.travelers + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_gambler_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1101.tavern + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_merchant_flag + } + } + desc = gdp_merchant_luxury_contract.1101.merchant + } + } + theme = trade + left_portrait = { + character = root + animation = interested + } + override_background = { reference = market } + + trigger = { + scope:lc_active_building_flag ?= flag:urban_building + } + + immediate = { + # Prevent repeats + add_to_variable_list = { + name = lc_building_completed_list + target = flag:urban_building + } + # Save paths + luxury_contract_find_other_merchant_effect = yes + hidden_effect = { + while = { + count = 2 + random_list = { + 10 = { # Urchin + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1101_urchin_flag + # Intrigue group + this = flag:lc_1101_gambler_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1101_urchin_flag + } + } + 10 = { # Antiques + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1101_antiques_flag + # Barter group + this = flag:lc_1101_bookseller_flag + } + } + NOT = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_antiques_flag + # Barter group + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1101_antiques_flag + } + } + 10 = { # Bookseller + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1101_bookseller_flag + # Barter group + this = flag:lc_1101_antiques_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1101_bookseller_flag + } + } + 10 = { # Travelers + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1101_travelers_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1101_travelers_flag + } + } + 10 = { # Gambler + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1101_gambler_flag + # Intrigue group + this = flag:lc_1101_urchin_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1101_gambler_flag + } + } + 30 = { # Merchant + trigger = { + any_in_list = { list = potential_merchants } + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1101_merchant_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1101_merchant_flag + } + } + } + } + } + # Save scopes + luxury_contract_find_or_create_dealer_effect = yes + scope:dealer = { save_scope_as = bg_override_char } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_urchin_flag + } + } + luxury_contract_find_or_create_urchin_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_travelers_flag + } + } + luxury_contract_find_or_create_traveler_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_gambler_flag + } + } + luxury_contract_find_or_create_gambler_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_merchant_flag + } + } + random_in_list = { + list = potential_merchants + save_scope_as = other_merchant + assign_quirk_effect = yes + random_trade_route = { + limit = { + any_trade_market_on_route = { this = scope:local_barony.trade_market } + } + random_traded_good = { save_scope_as = merchant_good } + } + } + } + } + + option = { # Urchin + name = gdp_merchant_luxury_contract.1101.a + flavor = gdp_merchant_luxury_contract.1101.a.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_urchin_flag + } + } + # Destroy unused characters + scope:gambler ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1101.a + FLAG = lc_1101_urchin_flag + EVENT_ID = 1111 + } + } + + option = { # Antiques + name = gdp_merchant_luxury_contract.1101.b + flavor = gdp_merchant_luxury_contract.1101.b.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_antiques_flag + } + } + # Destroy unused characters + scope:urchin ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:gambler ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1101.b + FLAG = lc_1101_antiques_flag + EVENT_ID = 1121 + } + } + + option = { # Bookseller + name = gdp_merchant_luxury_contract.1101.c + flavor = gdp_merchant_luxury_contract.1101.c.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_bookseller_flag + } + } + # Destroy unused characters + scope:urchin ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:gambler ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1101.c + FLAG = lc_1101_bookseller_flag + EVENT_ID = 1131 + } + } + + option = { # Travelers + name = { + trigger = { + NOT = { knows_language_of_culture = scope:traveler.culture } + } + text = gdp_merchant_luxury_contract.1101.d + } + name = { + trigger = { knows_language_of_culture = scope:traveler.culture } + text = gdp_merchant_luxury_contract.1101.d.lingua + } + flavor = gdp_merchant_luxury_contract.1101.d.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_travelers_flag + } + } + # Destroy unused characters + scope:urchin ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:gambler ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1101.d + FLAG = lc_1101_travelers_flag + EVENT_ID = 1141 + } + } + + option = { # Gambler + name = gdp_merchant_luxury_contract.1101.e + flavor = gdp_merchant_luxury_contract.1101.e.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_gambler_flag + } + } + # Destroy unused characters + scope:urchin ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1101.e + FLAG = lc_1101_gambler_flag + EVENT_ID = 1151 + } + } + + option = { # Merchant + name = gdp_merchant_luxury_contract.1101.f + flavor = gdp_merchant_luxury_contract.1101.f.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1101_merchant_flag + } + } + # Destroy unused characters + scope:urchin ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:gambler ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1101.f + FLAG = lc_1101_merchant_flag + EVENT_ID = 1161 + } + } + + after = { + clear_variable_list = lc_path_options_list + clear_variable_list = lc_building_fallback_list + clear_variable_list = lc_building_potential_list + clear_variable_list = lc_building_completed_list + } +} + +# Duel Outcome +gdp_merchant_luxury_contract.1102 = { # End + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = { + first_valid = { + triggered_desc = { # Urchin + trigger = { scope:lc_active_path_flag = flag:lc_1101_urchin_flag } + desc = { + desc = gdp_merchant_luxury_contract.1102.urchin + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success_critical } + desc = gdp_merchant_luxury_contract.1102.urchin.success_critical + } + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1102.urchin.success + } + desc = gdp_merchant_luxury_contract.1102.urchin.failure + } + } + } + triggered_desc = { # Antiques + trigger = { scope:lc_active_path_flag = flag:lc_1101_antiques_flag } + desc = { + desc = gdp_merchant_luxury_contract.1102.antiques + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success_critical } + desc = gdp_merchant_luxury_contract.1102.antiques.success + } + desc = gdp_merchant_luxury_contract.1102.antiques.failure + } + } + } + triggered_desc = { # Bookseller + trigger = { scope:lc_active_path_flag = flag:lc_1101_bookseller_flag } + desc = { + desc = gdp_merchant_luxury_contract.1102.bookseller + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success_critical } + desc = gdp_merchant_luxury_contract.1102.bookseller.success + } + desc = gdp_merchant_luxury_contract.1102.bookseller.failure + } + } + } + triggered_desc = { # Travelers + trigger = { scope:lc_active_path_flag = flag:lc_1101_travelers_flag } + desc = { + desc = gdp_merchant_luxury_contract.1102.travelers + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1102.travelers.success + } + desc = gdp_merchant_luxury_contract.1102.travelers.failure + } + } + } + triggered_desc = { # Gambler + trigger = { scope:lc_active_path_flag = flag:lc_1101_gambler_flag } + desc = { + desc = gdp_merchant_luxury_contract.1102.tavern + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1102.tavern.success + } + triggered_desc = { + trigger = { exists = scope:lc_1001_failure_critical } + desc = gdp_merchant_luxury_contract.1102.tavern.failure_critical + } + desc = gdp_merchant_luxury_contract.1102.tavern.failure + } + } + } + triggered_desc = { # Merchant + trigger = { scope:lc_active_path_flag = flag:lc_1101_merchant_flag } + desc = { + desc = gdp_merchant_luxury_contract.1102.merchant + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1102.merchant.success + } + desc = gdp_merchant_luxury_contract.1102.merchant.failure + } + } + } + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + animation = happiness + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + animation = stress + } + camera = camera_event_very_left + } + right_portrait = { + character = scope:portrait + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + NOT = { + scope:lc_active_path_flag = flag:lc_1101_gambler_flag + } + } + animation = dismissal + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + scope:lc_active_path_flag = flag:lc_1101_gambler_flag + } + animation = steward + } + triggered_animation = { + trigger = { + OR = { + AND = { + exists = scope:lc_1001_success_critical + scope:lc_active_path_flag = flag:lc_1101_urchin_flag + } + AND = { + exists = scope:lc_1001_success + NOT = { scope:lc_active_path_flag = flag:lc_1101_gambler_flag } + } + } + } + animation = admiration + } + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success + exists = scope:lc_1001_success_critical + } + scope:lc_active_path_flag = flag:lc_1101_gambler_flag + } + animation = rage + } + triggered_animation = { + trigger = { + exists = scope:lc_1001_success + scope:lc_active_path_flag = flag:lc_1101_urchin_flag + } + animation = beg + } + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + artifact = { + target = scope:fallback_artifact + position = lower_center_portrait + } + override_background = { + trigger = { + OR = { + scope:lc_active_path_flag = flag:lc_1101_bookseller_flag + scope:lc_active_path_flag = flag:lc_1101_merchant_flag + } + } + reference = study + } + override_background = { + trigger = { + scope:lc_active_path_flag = flag:lc_1101_gambler_flag + } + reference = tavern + } + override_background = { + trigger = { + NOR = { + scope:lc_active_path_flag = flag:lc_1101_bookseller_flag + scope:lc_active_path_flag = flag:lc_1101_gambler_flag + scope:lc_active_path_flag = flag:lc_1101_merchant_flag + } + } + reference = market + } + + immediate = { + lc_curio_fallback_artifact_effect = { OWNER = scope:dealer } + luxury_contract_wound_effect = yes + lc_curio_select_fallback_location_effect = yes + switch = { + trigger = scope:lc_active_path_flag + flag:lc_1101_gambler_flag = { + if = { + limit = { exists = scope:lc_1001_failure_critical } + pay_short_term_gold = { + gold = minor_gold_value + target = scope:gambler + } + } + else_if = { + limit = { exists = scope:lc_1001_success } + add_short_term_gold = medium_gold_value + } + else = { add_short_term_gold = minor_gold_value } + } + flag:lc_1101_merchant_flag = { + if = { + limit = { exists = scope:lc_1001_success } + scope:merchant.house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_improve_medium_value + REASON = trade_opportunity_cooperation + CHAR = scope:merchant + TARGET_CHAR = scope:other_merchant + TITLE = dummy_female + } + } + } + else = { + scope:merchant.house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_damage_medium_value + REASON = trade_opportunity_friction + CHAR = scope:merchant + TARGET_CHAR = scope:other_merchant + TITLE = dummy_female + } + } + } + } + } + } + + option = { # Success! + name = gdp_merchant_luxury_contract.1102.a + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + # SALE OUTCOMES + if = { + limit = { + OR = { + scope:lc_active_path_flag = flag:lc_1101_antiques_flag + scope:lc_active_path_flag = flag:lc_1101_bookseller_flag + } + scope:dealer ?= { is_alive = yes } + } + if = { + limit = { exists = scope:lc_1001_success_critical } + pay_short_term_gold = { + gold = minor_gold_value + target = scope:dealer + } + } + else = { + pay_short_term_gold = { + gold = medium_gold_value + target = scope:dealer + } + } + } + # HIRE OUTCOMES + else_if = { + limit = { + scope:lc_active_path_flag = flag:lc_1101_urchin_flag + exists = scope:lc_1001_success + } + pay_short_term_gold = { + gold = medium_gold_value + target = scope:urchin + } + } + lc_curio_success_option_effect = yes + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_greed = 0.25 + } + } + } + + option = { # Bad success! + name = gdp_merchant_luxury_contract.1102.b + trigger = { lc_curio_bad_success_option_trigger = yes } + lc_curio_success_option_effect = yes + stress_impact = { + compassionate = minor_stress_impact_gain + just = minor_stress_impact_gain + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_greed = 0.25 + } + } + } + + option = { # Religious + name = gdp_merchant_luxury_contract.1001.return.religious + flavor = gdp_merchant_luxury_contract.1001.e.flavor + trigger = { + lc_curio_next_building_option_trigger = { FLAG = religious_building } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.e + FLAG = religious_building + EVENT_ID = 1501 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_rationality = 0.25 + } + } + } + + option = { # Scholarly + name = gdp_merchant_luxury_contract.1001.return.scholarly + flavor = gdp_merchant_luxury_contract.1001.f.flavor + trigger = { + lc_curio_next_building_option_trigger = { FLAG = scholarly_building } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.f + FLAG = scholarly_building + EVENT_ID = 1601 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_rationality = 0.25 + } + } + } + + option = { # Fallback! + name = gdp_merchant_luxury_contract.1001.fallback + flavor = gdp_merchant_luxury_contract.1001.fallback.flavor + trigger = { lc_curio_fallback_option_trigger = yes } + lc_curio_fallback_option_effect = yes + ai_chance = { + base = 0 + } + } + + option = { # Give up! + name = gdp_merchant_luxury_contract.1001.give_up + trigger = { lc_curio_give_up_option_trigger = yes } + lc_curio_give_up_option_effect = yes + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_greed = -0.25 + } + } + } + + after = { + lc_curio_cleanup_path_scopes_effect = yes + scope:dealer ?= { luxury_contract_cleanup_unused_character_effect = yes } + } +} + +# Duel Events +gdp_merchant_luxury_contract.1111 = { # Urchin + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = gdp_merchant_luxury_contract.1111.desc + theme = trade + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:urchin + animation = nervous + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = alley_day } + + immediate = { + # Save portrait scope for ending event + scope:urchin = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:urchin = { + random_list = { + 10 = { + create_artifact_ring_effect = { + OWNER = scope:urchin + SMITH = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1111.artifact.ring + set_artifact_description = gdp_merchant_luxury_contract.1111.artifact.ring.desc + } + } + 10 = { + create_artifact_brooch_effect = { + OWNER = scope:urchin + SMITH = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1111.artifact.brooch + set_artifact_description = gdp_merchant_luxury_contract.1111.artifact.brooch.desc + } + } + 10 = { + create_artifact_necklace_effect = { + OWNER = scope:urchin + SMITH = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1111.artifact.necklace + set_artifact_description = gdp_merchant_luxury_contract.1111.artifact.necklace.desc + } + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # Duel + name = gdp_merchant_luxury_contract.1111.a + duel = { + skills = { intrigue diplomacy } + value = decent_skill_rating + 25 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = gallowsbait + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1111.a.success_critical + save_scope_as = lc_1001_success_critical + add_courtier = scope:urchin + reverse_add_opinion = { + target = scope:urchin + modifier = trust_opinion + opinion = 25 + } + hidden_effect = { + reverse_add_opinion = { + target = scope:urchin + modifier = recruited_me_opinion + opinion = 50 + } + if = { + limit = { is_travelling = yes } + current_travel_plan = { add_companion = scope:urchin } + } + } + show_as_tooltip = { + scope:task_contract = { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 1 + min = -49 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1111.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + pay_short_term_gold = { + gold = medium_gold_value + target = scope:urchin + } + scope:task_contract = { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:urchin } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1111.a.failure + lc_curio_failure_option_effect = yes + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1102 + } +} + +gdp_merchant_luxury_contract.1121 = { # Antiques + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = gdp_merchant_luxury_contract.1121.desc + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:dealer + animation = debating + } + artifact = { + target = scope:artifact + position = lower_center_portrait + } + override_background = { reference = alley_day } + + immediate = { + # Save portrait scope for ending event + scope:dealer = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:dealer = { + random_list = { + 10 = { + random_dummy_gender_effect = yes + create_artifact_weapon_effect = { + OWNER = scope:dealer + CREATOR = scope:dummy_gender + SET_WEAPON_TYPE = flag:no + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1121.artifact.weapon + set_artifact_description = gdp_merchant_luxury_contract.1121.artifact.weapon.desc + } + } + 10 = { + create_artifact_bowl_effect = { + OWNER = scope:dealer + SMITH = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1121.artifact.bowl + } + } + 10 = { + create_artifact_plate_effect = { + OWNER = scope:dealer + SMITH = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1121.artifact.plate + } + } + 10 = { + random_dummy_gender_effect = yes + create_artifact_urn_effect = { + OWNER = scope:dealer + POTTER = scope:dummy_gender + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1121.artifact.urn + } + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1121.a + duel = { + skills = { diplomacy stewardship } + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = lifestyle_scholar + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1121.a.success_critical + save_scope_as = lc_1001_success_critical + show_as_tooltip = { + pay_short_term_gold = { + gold = minor_gold_value + target = scope:dealer + } + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.1121.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + pay_short_term_gold = { + gold = medium_gold_value + target = scope:dealer + } + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1102 + } +} + +gdp_merchant_luxury_contract.1131 = { # Bookseller + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = gdp_merchant_luxury_contract.1131.desc + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:dealer + animation = debating + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = study } + + immediate = { + # Save portrait scope for ending event + scope:dealer = { lc_curio_portrait_scope_effect = yes } + # Create potential reward artifact + scope:dealer = { + luxury_contract_reward_quality_effect = yes + random_dummy_gender_effect = yes + create_library_artifact_effect = { + OWNER = scope:dealer + CREATOR = scope:dummy_gender + SUBJECT = flag:no + TOPIC = flag:no + } + } + # Save artifact scope for ending event + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1131.desc + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = library_item } + } + + option = { # Duel + name = gdp_merchant_luxury_contract.1131.a + duel = { + skills = { diplomacy stewardship } + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = erudite + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1131.a.success_critical + save_scope_as = lc_1001_success_critical + show_as_tooltip = { + pay_short_term_gold = { + gold = minor_gold_value + target = scope:dealer + } + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1131.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + pay_short_term_gold = { + gold = medium_gold_value + target = scope:dealer + } + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1102 + } +} + +gdp_merchant_luxury_contract.1141 = { # Travelers + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = gdp_merchant_luxury_contract.1141.desc + theme = trade + left_portrait = { + character = root + animation = admiration + camera = camera_event_very_left + } + right_portrait = { + character = scope:traveler + animation = war_over_win + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = alley_day } + + immediate = { + # Save portrait scope for ending event + scope:traveler = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:traveler = { + random_list = { + 10 = { + random_dummy_gender_effect = yes + create_artifact_weapon_effect = { + OWNER = scope:traveler + CREATOR = scope:dummy_gender + SET_WEAPON_TYPE = flag:no + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1141.artifact.weapon.desc + } + } + 10 = { + create_artifact_brooch_effect = { + OWNER = scope:traveler + SMITH = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1141.artifact.brooch + set_artifact_description = gdp_merchant_luxury_contract.1141.artifact.brooch.desc + } + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1141.a + flavor = gdp_merchant_luxury_contract.1141.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.diplomacy + add = { + value = scope:merchant.prestige_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = adventurer + add = 10 + } + modifier = { + has_trait = lifestyle_traveler + add = 10 + } + modifier = { + has_trait = lifestyle_surveyor + add = 10 + } + modifier = { + has_trait = lifestyle_wayfarer + add = 10 + } + modifier = { + has_trait = lifestyle_voyager + add = 10 + } + modifier = { + has_trait = gallivanter + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1141.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract = { + complete_task_contract = success_standard + } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:traveler } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1141.a.failure + lc_curio_failure_option_effect = yes + } + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.25 + ai_greed = -0.25 + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1102 + } +} + +gdp_merchant_luxury_contract.1151 = { # Gambler + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = gdp_merchant_luxury_contract.1151.desc + theme = trade + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:gambler + animation = steward + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = tavern } + + immediate = { + # Save portrait scope for ending event + scope:gambler = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:gambler = { + create_artifact = { + name = gdp_merchant_luxury_contract.1151.artifact.dice + description = gdp_merchant_luxury_contract.1151.artifact.dice.desc + type = curio + visuals = pouch + modifier = artifact_monthly_prestige_2_modifier + modifier = artifact_intrigue_1_modifier + quality = scope:quality + wealth = scope:wealth + max_durability = 30 + generate_history = no + save_scope_as = artifact + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1151.a + flavor = gdp_merchant_luxury_contract.1151.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.intrigue + add = { + value = { + integer_range = { + min = 5 + max = 15 + } + } + } + subtract = decent_skill_rating + subtract = { + value = { + integer_range = { + min = 5 + max = 15 + } + } + } + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = lifestyle_reveler + add = 10 + } + modifier = { + has_trait = drunkard + add = 10 + } + modifier = { + has_trait = gallowsbait + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1151.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + add_short_term_gold = medium_gold_value + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 1 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.1151.a.failure + lc_curio_failure_option_effect = yes + show_as_tooltip = { + add_short_term_gold = minor_gold_value + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.1151.a.failure_critical + lc_curio_failure_option_effect = yes + save_scope_as = lc_1001_failure_critical + show_as_tooltip = { + remove_short_term_gold = minor_gold_value + } + } + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.25 + ai_greed = -0.25 + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1102 + } +} + +gdp_merchant_luxury_contract.1161 = { # Merchant + type = character_event + title = gdp_merchant_luxury_contract.1101.t + desc = gdp_merchant_luxury_contract.1161.desc + theme = trade + left_portrait = { + character = root + animation = war_over_win + camera = camera_event_very_left + } + right_portrait = { + character = scope:other_merchant + animation = interested + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = market } + + immediate = { + # Save portrait scope for ending event + scope:other_merchant = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:other_merchant = { + random_list = { + 10 = { + create_artifact = { + name = gdp_merchant_luxury_contract.1161.artifact.fabric + description = gdp_merchant_luxury_contract.1161.artifact.fabric.desc + type = miscellaneous + visuals = fabric_roll + quality = scope:quality + wealth = scope:wealth + modifier = artifact_monthly_prestige_3_modifier + modifier = artifact_trade_competitiveness_add_1_modifier + save_scope_as = artifact + } + } + 10 = { + create_artifact_pedestal_gold_effect = { OWNER = scope:other_merchant } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1161.artifact.gold + set_artifact_description = gdp_merchant_luxury_contract.1161.artifact.gold.desc + } + } + 10 = { + create_artifact_pedestal_diamond_effect = { OWNER = scope:other_merchant } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1161.artifact.gem + set_artifact_description = gdp_merchant_luxury_contract.1161.artifact.gem.desc + } + } + } + } + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # + name = gdp_merchant_luxury_contract.1161.a + flavor = gdp_merchant_luxury_contract.1161.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.stewardship + add = { + value = scope:merchant.prestige_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 10 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = administrator + add = 10 + } + modifier = { + has_trait = diplomat + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1161.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + scope:merchant.house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_improve_medium_value + REASON = trade_opportunity_cooperation + CHAR = scope:merchant + TARGET_CHAR = scope:other_merchant + TITLE = dummy_female + } + } + } + 10 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:other_merchant } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1161.a.failure + lc_curio_failure_option_effect = yes + scope:merchant.house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_damage_medium_value + REASON = trade_opportunity_friction + CHAR = scope:merchant + TARGET_CHAR = scope:other_merchant + TITLE = dummy_female + } + } + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.25 + ai_greed = -0.25 + } + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1102 + } +} + +### Religious sub-chain + +scripted_effect luxury_contract_find_or_create_priest_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_clergy = yes + is_lowborn = yes + faith = scope:religious_building_faith + NOT = { faith.religious_head ?= this } + } + weight = { + base = 1 + modifier = { add = learning } + modifier = { + has_trait = devoted + factor = 10 + } + } + save_scope_as = priest + } + scope:local_county.holder = { + if = { + limit = { faith = scope:religious_building_faith } + if = { + limit = { + cp:councillor_court_chaplain ?= { + NOT = { faith.religious_head ?= this } + } + } + cp:councillor_court_chaplain = { save_scope_as = priest } + } + else_if = { + limit = { + is_clergy = yes + NOT = { faith.religious_head ?= this } + } + save_scope_as = priest + } + } + } + if = { + limit = { NOT = { exists = scope:priest } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = priest_character_template + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:religious_building_faith + save_scope_as = priest + } + scope:priest = { add_character_flag = destroy_me } + } + scope:priest ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_or_create_pilgrim_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_clergy = no + is_lowborn = yes + NOT = { has_trait = devoted } + faith = scope:religious_building_faith + NOR = { + scope:priest ?= this + scope:monk ?= this + } + } + weight = { + base = 1 + } + save_scope_as = pilgrim + } + if = { + limit = { NOT = { exists = scope:pilgrim } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = location_pilgrim_template + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:religious_building_faith + save_scope_as = pilgrim + } + scope:pilgrim = { add_character_flag = destroy_me } + } + scope:pilgrim ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_or_create_monk_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + faith = scope:religious_building_faith + has_trait = devoted + NOR = { + scope:priest ?= this + scope:pilgrim ?= this + } + } + weight = { + base = 1 + } + save_scope_as = monk + } + if = { + limit = { NOT = { exists = scope:monk } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = monk_character_template + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:religious_building_faith + save_scope_as = monk + } + scope:monk = { add_character_flag = destroy_me } + } + scope:monk ?= { assign_quirk_effect = yes } +} + +# Intro +gdp_merchant_luxury_contract.1501 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = { + desc = gdp_merchant_luxury_contract.1501.desc + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_site_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1501.site + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_tomb_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1501.tombs + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_pilgrim_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1501.pilgrim + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_monks_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1501.monks + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_keepsake_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1501.keepsake + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_apostate_flag + } + } + desc = gdp_merchant_luxury_contract.1501.apostate + } + } + theme = trade + left_portrait = { + character = root + animation = thinking + } + override_background = { reference = holy_site_generic_scope } + + trigger = { + scope:lc_active_building_flag ?= flag:religious_building + } + + immediate = { + # Prevent repeats + add_to_variable_list = { + name = lc_building_completed_list + target = flag:religious_building + } + # Save paths + hidden_effect = { + while = { + count = 2 + random_list = { + 10 = { # Site + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1501_site_flag + # Learning group + this = flag:lc_1501_monks_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1501_site_flag + } + } + 10 = { # Tomb + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1501_tomb_flag + # Intrigue group + this = flag:lc_1501_pilgrim_flag + this = flag:lc_1501_keepsake_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1501_tomb_flag + } + } + 10 = { # Pilgrim + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1501_pilgrim_flag + # Intrigue group + this = flag:lc_1501_tomb_flag + this = flag:lc_1501_keepsake_flag + # Pilgrim group + this = flag:lc_1501_apostate_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1501_pilgrim_flag + } + } + 10 = { # Monks + trigger = { + scope:religious_building_faith = { faith_has_monasticism_trigger = yes } + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1501_monks_flag + # Learning group + this = flag:lc_1501_site_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1501_monks_flag + } + } + 10 = { # Keepsake + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1501_keepsake_flag + # Intrigue group + this = flag:lc_1501_tomb_flag + this = flag:lc_1501_pilgrim_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1501_keepsake_flag + } + } + 10 = { # Apostate + trigger = { + religion != scope:religious_building_faith.religion + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1501_apostate_flag + # Pilgrim group + this = flag:lc_1501_pilgrim_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1501_apostate_flag + } + } + } + } + } + # Source priest character + luxury_contract_find_or_create_priest_effect = yes + scope:priest = { save_scope_as = bg_override_char } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + OR = { + this = flag:lc_1501_pilgrim_flag + this = flag:lc_1501_apostate_flag + } + } + } + luxury_contract_find_or_create_pilgrim_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_monks_flag + } + } + luxury_contract_find_or_create_monk_effect = yes + } + # Save background scope + scope:religious_building_province = { save_scope_as = holy_site_scope } + } + + option = { # Site + name = gdp_merchant_luxury_contract.1501.a + flavor = gdp_merchant_luxury_contract.1501.a.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_site_flag + } + } + # Destroy unneeded characters + scope:pilgrim ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:monk ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1501.a + FLAG = lc_1501_site_flag + EVENT_ID = 1521 + } + } + + option = { # Tombs + name = gdp_merchant_luxury_contract.1501.b + flavor = gdp_merchant_luxury_contract.1501.b.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_tomb_flag + } + } + # Destroy unneeded characters + scope:pilgrim ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:monk ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1501.b + FLAG = lc_1501_tomb_flag + EVENT_ID = 1511 + } + } + + option = { # Pilgrim + name = gdp_merchant_luxury_contract.1501.c + flavor = gdp_merchant_luxury_contract.1501.c.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_pilgrim_flag + } + } + # Destroy unneeded characters + scope:monk ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1501.c + FLAG = lc_1501_pilgrim_flag + EVENT_ID = 1531 + } + } + + option = { # Monks + name = gdp_merchant_luxury_contract.1501.d + flavor = gdp_merchant_luxury_contract.1501.d.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_monks_flag + } + } + # Destroy unneeded characters + scope:pilgrim ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1501.d + FLAG = lc_1501_monks_flag + EVENT_ID = 1541 + } + } + + option = { # Keepsake + name = gdp_merchant_luxury_contract.1501.e + flavor = gdp_merchant_luxury_contract.1501.e.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_keepsake_flag + } + } + # Destroy unneeded characters + scope:pilgrim ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:monk ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1501.e + FLAG = lc_1501_keepsake_flag + EVENT_ID = 1551 + } + } + + option = { # Apostate + name = gdp_merchant_luxury_contract.1501.f + flavor = gdp_merchant_luxury_contract.1501.f.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1501_apostate_flag + } + } + # Destroy unneeded characters + scope:monk ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1501.f + FLAG = lc_1501_apostate_flag + EVENT_ID = 1561 + } + } +} + +# Duel Outcomes +gdp_merchant_luxury_contract.1502 = { # End + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = { + first_valid = { + triggered_desc = { # Site + trigger = { scope:lc_active_path_flag = flag:lc_1501_site_flag } + desc = { + desc = gdp_merchant_luxury_contract.1502.site + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1502.site.success + } + desc = gdp_merchant_luxury_contract.1502.site.failure + } + } + } + triggered_desc = { # Tomb + trigger = { scope:lc_active_path_flag = flag:lc_1501_tomb_flag } + desc = { + desc = gdp_merchant_luxury_contract.1502.tomb + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success_critical } + desc = gdp_merchant_luxury_contract.1502.tomb.success_critical + } + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1502.tomb.success + } + desc = gdp_merchant_luxury_contract.1502.tomb.failure + } + } + } + triggered_desc = { # Pilgrim + trigger = { scope:lc_active_path_flag = flag:lc_1501_pilgrim_flag } + desc = { + desc = gdp_merchant_luxury_contract.1502.pilgrim + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1502.pilgrim.success + } + desc = gdp_merchant_luxury_contract.1502.pilgrim.failure + } + } + } + triggered_desc = { # Monks + trigger = { scope:lc_active_path_flag = flag:lc_1501_monks_flag } + desc = { + desc = gdp_merchant_luxury_contract.1502.monks + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1502.monks.success + } + desc = gdp_merchant_luxury_contract.1502.monks.failure + } + } + } + triggered_desc = { # Keepsake + trigger = { scope:lc_active_path_flag = flag:lc_1501_keepsake_flag } + desc = { + desc = gdp_merchant_luxury_contract.1502.keepsake + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1502.keepsake.success + } + desc = gdp_merchant_luxury_contract.1502.keepsake.failure + } + } + } + triggered_desc = { # Apostate + trigger = { scope:lc_active_path_flag = flag:lc_1501_apostate_flag } + desc = { + desc = gdp_merchant_luxury_contract.1502.apostate + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success_critical } + desc = gdp_merchant_luxury_contract.1502.apostate.success_critical + } + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1502.apostate.success + } + desc = gdp_merchant_luxury_contract.1502.apostate.failure + } + } + } + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + animation = happiness + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + scope:lc_active_path_flag != flag:lc_1501_apostate_flag + } + animation = nervous + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + scope:lc_active_path_flag = flag:lc_1501_apostate_flag + } + animation = fear + } + camera = camera_event_very_left + } + right_portrait = { + character = scope:portrait + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + OR = { + scope:lc_active_path_flag = flag:lc_1501_pilgrim_flag + } + } + animation = sadness + } + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + NOR = { + scope:lc_active_path_flag = flag:lc_1501_pilgrim_flag + } + } + animation = interested + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + OR = { + scope:lc_active_path_flag = flag:lc_1501_pilgrim_flag + scope:lc_active_path_flag = flag:lc_1501_apostate_flag + } + } + animation = anger + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + OR = { + scope:lc_active_path_flag = flag:lc_1501_site_flag + } + } + animation = dismissal + } + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + artifact = { + target = scope:fallback_artifact + position = lower_center_portrait + } + override_background = { + trigger = { + scope:lc_active_path_flag = flag:lc_1501_site_flag + } + reference = temple + } + override_background = { + trigger = { + scope:lc_active_path_flag = flag:lc_1501_tomb_flag + } + reference = bp1_bonfire + } + override_background = { + trigger = { + NOR = { + scope:lc_active_path_flag = flag:lc_1501_site_flag + scope:lc_active_path_flag = flag:lc_1501_tomb_flag + } + } + reference = holy_site_generic_scope + } + + immediate = { + lc_curio_fallback_artifact_effect = { OWNER = scope:priest } + hidden_effect = { + switch = { + trigger = scope:lc_active_path_flag + flag:lc_1501_tomb_flag = { + if = { + limit = { exists = scope:lc_1001_success_critical } + save_temporary_scope_value_as = { + name = quality + value = { 65 90 } + } + # Create artifact + scope:priest = { + random_dummy_gender_effect = yes + create_artifact_urn_effect = { + OWNER = scope:priest + POTTER = scope:dummy_gender + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1511.artifact.urn + set_artifact_description = gdp_merchant_luxury_contract.1511.artifact.urn.desc + } + } + } + else_if = { + limit = { exists = scope:lc_1001_success } + save_temporary_scope_value_as = { + name = quality + value = { 45 70 } + } + # Create artifact + scope:priest = { + random_dummy_gender_effect = yes + create_artifact_urn_effect = { + OWNER = scope:priest + POTTER = scope:dummy_gender + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1511.artifact.urn + set_artifact_description = gdp_merchant_luxury_contract.1511.artifact.urn.desc + } + } + } + else = { + scope:priest = { + luxury_contract_fallback_reward_quality_effect = yes + create_artifact_pedestal_human_skull_effect = { + OWNER = scope:priest + CREATOR = dummy_female + DESKULLED = dummy_female + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + hidden_effect = { + random_list = { + 10 = { + set_artifact_name = gdp_merchant_luxury_contract.1511.artifact.skull + set_artifact_description = gdp_merchant_luxury_contract.1511.artifact.skull.desc + } + 10 = { + set_artifact_name = gdp_merchant_luxury_contract.1511.artifact.bone + set_artifact_description = gdp_merchant_luxury_contract.1511.artifact.bone.desc + } + } + } + } + } + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + luxury_contract_wound_effect = yes + lc_curio_select_fallback_location_effect = yes + } + + option = { # Success! + name = { + trigger = { exists = scope:lc_1001_success_critical } + text = gdp_merchant_luxury_contract.1502.a.critical + } + name = { + trigger = { + NOT = { exists = scope:lc_1001_success_critical } + } + text = gdp_merchant_luxury_contract.1502.a + } + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + lc_curio_success_option_effect = yes + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_greed = 0.25 + } + } + } + + option = { # Bad success! + name = gdp_merchant_luxury_contract.1502.b + trigger = { lc_curio_bad_success_option_trigger = yes } + lc_curio_success_option_effect = yes + stress_impact = { + compassionate = minor_stress_impact_gain + just = minor_stress_impact_gain + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_greed = 0.25 + } + } + } + + option = { # Scholarly + name = gdp_merchant_luxury_contract.1001.return.scholarly + flavor = gdp_merchant_luxury_contract.1001.f.flavor + trigger = { + lc_curio_next_building_option_trigger = { FLAG = scholarly_building } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.f + FLAG = scholarly_building + EVENT_ID = 1601 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_rationality = 0.25 + } + } + } + + option = { # Urban + name = gdp_merchant_luxury_contract.1001.return.urban + flavor = gdp_merchant_luxury_contract.1001.a.flavor + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + scope:merchant = { + any_in_list = { + variable = lc_building_completed_list + count >= 2 + } + any_in_list = { + variable = lc_building_completed_list + this = flag:urban_building + } + } + } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.a + FLAG = urban_building + EVENT_ID = 1101 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_greed = 0.25 + } + } + } + + option = { # Fallback! + name = gdp_merchant_luxury_contract.1001.fallback + flavor = gdp_merchant_luxury_contract.1001.fallback.flavor + trigger = { lc_curio_fallback_option_trigger = yes } + lc_curio_fallback_option_effect = yes + ai_chance = { + base = 0 + } + } + + option = { # Give up! + name = gdp_merchant_luxury_contract.1001.give_up + trigger = { lc_curio_give_up_option_trigger = yes } + lc_curio_give_up_option_effect = yes + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_greed = -0.25 + } + } + } + + after = { + lc_curio_cleanup_path_scopes_effect = yes + scope:priest ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:pilgrim ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:monk ?= { luxury_contract_cleanup_unused_character_effect = yes } + } +} + +# Duel Events +gdp_merchant_luxury_contract.1511 = { # Tomb + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = gdp_merchant_luxury_contract.1511.desc + theme = trade + left_portrait = { + character = root + animation = paranoia + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = bp1_bonfire } + + option = { # Duel + name = gdp_merchant_luxury_contract.1511.a + duel = { + skills = { intrigue prowess } + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = gallowsbait + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1511.a.success_critical + custom_tooltip = gdp_merchant_luxury_contract.1511.a.success_critical.tt + save_scope_as = lc_1001_success_critical + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 1 + min = -49 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1511.a.success + custom_tooltip = gdp_merchant_luxury_contract.1511.a.success.tt + save_scope_as = lc_1001_success + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.1511.a.failure + custom_tooltip = gdp_merchant_luxury_contract.1511.a.failure.tt + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + cynical = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1502 + } +} + +gdp_merchant_luxury_contract.1521 = { # Site + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = gdp_merchant_luxury_contract.1521.desc + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:priest + animation = war_over_tie + } + artifact = { + target = scope:newly_created_artifact + position = lower_right_portrait + } + override_background = { reference = temple } + + immediate = { + # Save portrait scope for ending event + scope:priest = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:priest = { + set_variable = { + name = religious_text + value = faith + } + random_dummy_gender_effect = yes + create_library_artifact_effect = { + OWNER = scope:priest + CREATOR = scope:dummy_gender + SUBJECT = flag:religious_text + TOPIC = flag:religious_text + } + remove_variable = religious_text + } + } + scope:newly_created_artifact ?= { save_scope_as = artifact } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1521.a + flavor = gdp_merchant_luxury_contract.1521.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.learning + add = { + value = scope:merchant.piety_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = theologian + add = 10 + } + modifier = { + has_trait = heresiarch + add = 10 + } + modifier = { + has_perk = apostate_perk + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1521.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:artifact = { set_owner = root } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:priest } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1521.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + fickle = minor_stress_impact_loss + cynical = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1502 + } +} + +gdp_merchant_luxury_contract.1531 = { # Pilgrim + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = gdp_merchant_luxury_contract.1531.desc + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:pilgrim + animation = worry + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = holy_site_generic_scope } + + immediate = { + # Save portrait scope for ending event + scope:pilgrim = { lc_curio_portrait_scope_effect = yes } + # Create potential reward artifact + scope:pilgrim = { + luxury_contract_reward_quality_effect = yes + create_appropriate_relic_artifact_effect = { + OWNER = scope:pilgrim + CREATOR = dummy_female + } + } + # Save artifact scope for ending event + hidden_effect = { + scope:newly_created_artifact ?= { + save_scope_as = artifact + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + + option = { # Duel + name = gdp_merchant_luxury_contract.1531.a + duel = { + skills = { diplomacy intrigue } + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = pilgrim + add = 10 + } + modifier = { + has_trait = pilgrim + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1531.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:pilgrim } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1531.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + arbitrary = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1502 + } +} + +gdp_merchant_luxury_contract.1541 = { # Monks + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = gdp_merchant_luxury_contract.1541.desc + theme = trade + left_portrait = { + character = root + animation = happiness + camera = camera_event_very_left + } + right_portrait = { + character = scope:monk + animation = thinking + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = holy_site_generic_scope } + + immediate = { + # Save portrait scope for ending event + scope:monk = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:monk = { + random_list = { + 10 = { + trigger = { + scope:religious_building_faith = { + NOR = { + religion = religion:islam_religion + main_rite = { rite_has_tenet = tenet_aniconism } + } + } + } + create_artifact_icon_effect = { + OWNER = scope:monk + CREATOR = scope:monk + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_name = gdp_merchant_luxury_contract.1541.artifact.icon + set_artifact_description = gdp_merchant_luxury_contract.1541.artifact.icon.desc + } + } + 10 = { + create_artifact = { + name = gdp_merchant_luxury_contract.1541.artifact.prayer_beads + description = gdp_merchant_luxury_contract.1541.artifact.prayer_beads.desc + type = miscellaneous + visuals = small_box + modifier = artifact_monthly_prestige_2_modifier + modifier = artifact_monthly_piety_1_modifier + max_durability = 30 + generate_history = no + save_scope_as = artifact + } + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1541.a + flavor = gdp_merchant_luxury_contract.1541.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.diplomacy + add = { + value = scope:merchant.piety_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = devoted + add = 10 + } + modifier = { + has_trait = theologian + add = 10 + } + modifier = { + has_trait = lifestyle_mystic + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1541.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract = { + complete_task_contract = success_standard + } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:monk } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1541.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1502 + } +} + +gdp_merchant_luxury_contract.1551 = { # Keepsake + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = gdp_merchant_luxury_contract.1551.desc + theme = trade + left_portrait = { + character = root + animation = paranoia + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = holy_site_generic_scope } + + immediate = { + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:priest = { + create_artifact = { + name = gdp_merchant_luxury_contract.1551.artifact.edifice + description = gdp_merchant_luxury_contract.1551.artifact.edifice.desc + type = miscellaneous + visuals = rock + modifier = artifact_monthly_prestige_2_modifier + modifier = artifact_zealot_vassal_opinion_2_modifier + max_durability = 30 + quality = scope:quality + wealth = scope:wealth + generate_history = no + save_scope_as = artifact + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1551.a + duel = { + skills = { intrigue prowess } + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = athletic + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1551.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.1551.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + arbitrary = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1502 + } +} + +gdp_merchant_luxury_contract.1561 = { # Apostate + type = character_event + title = gdp_merchant_luxury_contract.1501.t + desc = gdp_merchant_luxury_contract.1561.desc + theme = trade + left_portrait = { + character = root + animation = worry + camera = camera_event_very_left + } + right_portrait = { + character = scope:pilgrim + animation = grief + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = holy_site_generic_scope } + + immediate = { + # Save portrait scope for ending event + scope:pilgrim = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:pilgrim = { + set_variable = { + name = religious_text + value = faith + } + random_dummy_gender_effect = yes + create_library_artifact_effect = { + OWNER = scope:pilgrim + CREATOR = scope:dummy_gender + SUBJECT = flag:religious_text + TOPIC = flag:religious_text + } + remove_variable = religious_text + } + scope:newly_created_artifact ?= { + set_artifact_name = gdp_merchant_luxury_contract.1561.artifact.holy_book + set_artifact_description = gdp_merchant_luxury_contract.1561.artifact.holy_book.desc + save_scope_as = artifact + } + lc_curio_reforge_effect = { TYPE = library_item } + } + } + + option = { # Convert + name = gdp_merchant_luxury_contract.1561.a + flavor = gdp_merchant_luxury_contract.1561.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.diplomacy + add = { + value = scope:merchant.piety_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 10 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_perk = apostate_perk + add = 10 + } + modifier = { + has_trait = heresiarch + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1561.a.success_critical + save_scope_as = lc_1001_success_critial + scope:pilgrim = { set_character_faith = root.faith } + add_courtier = scope:pilgrim + reverse_add_opinion = { + target = scope:pilgrim + modifier = inspired_opinion + opinion = 25 + } + hidden_effect = { + reverse_add_opinion = { + target = scope:pilgrim + modifier = recruited_me_opinion + opinion = 50 + } + if = { + limit = { is_travelling = yes } + current_travel_plan = { add_companion = scope:pilgrim } + } + } + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 1 + min = -49 + } + min = 10 + desc = gdp_merchant_luxury_contract.1561.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:pilgrim } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1561.a.failure + random = { + chance = 25 + show_as_tooltip = { + increase_wounds_no_death_effect = { REASON = fight } + } + set_variable = { + name = lc_wound_flag + weeks = 1 + } + } + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + zealous = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1502 + } +} + +### Scholarly sub-chain + +scripted_effect luxury_contract_find_or_create_scholar_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + age >= 35 + NOR = { + scope:sage ?= this + scope:physician ?= this + scope:student ?= this + scope:botanist ?= this + } + } + weight = { + base = 1 + modifier = { add = learning } + modifier = { + has_trait = erudite + factor = 10 + } + modifier = { + has_trait = lifestyle_scholar + factor = 10 + } + } + save_scope_as = scholar + } + if = { + limit = { NOT = { exists = scope:scholar } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = scholar_character + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = scholar + } + scope:scholar = { add_character_flag = destroy_me } + } + scope:scholar ?= { + assign_quirk_effect = yes + add_character_flag = has_reading_glasses + } +} + +scripted_effect luxury_contract_find_or_create_physician_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + has_trait = lifestyle_physician + NOR = { + scope:scholar ?= this + scope:sage ?= this + scope:student ?= this + scope:botanist ?= this + } + } + weight = { + base = 1 + modifier = { add = learning } + modifier = { + has_trait = lifestyle_herbalist + factor = 10 + } + modifier = { + has_trait = lifestyle_gardener + factor = 10 + } + } + save_scope_as = physician + } + if = { + limit = { NOT = { exists = scope:physician } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = physician_high_character_template + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = physician + } + scope:physician = { add_character_flag = destroy_me } + } + scope:physician ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_or_create_student_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + has_trait = lifestyle_physician + age < 25 + NOR = { + scope:scholar ?= this + scope:sage ?= this + scope:physician ?= this + scope:botanist ?= this + } + } + weight = { + base = 1 + modifier = { add = learning } + modifier = { + has_trait = erudite + factor = 10 + } + modifier = { + has_trait = lifestyle_scholar + factor = 10 + } + } + save_scope_as = student + } + if = { + limit = { NOT = { exists = scope:student } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = physician_low_character_template + age = { 18 24 } + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = student + } + scope:student = { add_character_flag = destroy_me } + } + scope:student ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_or_create_sage_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + has_trait = lifestyle_mystic + NOR = { + scope:scholar ?= this + scope:physician ?= this + scope:student ?= this + scope:botanist ?= this + } + } + weight = { + base = 1 + modifier = { add = learning } + modifier = { + has_trait = lifestyle_scholar + factor = 10 + } + modifier = { + has_trait = erudite + factor = 10 + } + modifier = { + has_trait = theologian + factor = 10 + } + } + save_scope_as = sage + } + if = { + limit = { NOT = { exists = scope:sage } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = garden_hermit_character + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = sage + } + scope:sage = { add_character_flag = destroy_me } + } + scope:sage ?= { assign_quirk_effect = yes } +} + +scripted_effect luxury_contract_find_or_create_botanist_effect = { + random_pool_character = { + province = scope:merchant.location + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_lowborn = yes + OR = { + has_trait = lifestyle_gardener + has_trait = lifestyle_herbalist + } + NOR = { + scope:scholar ?= this + scope:sage ?= this + scope:physician ?= this + scope:student ?= this + } + } + weight = { + base = 1 + modifier = { add = learning } + modifier = { + has_trait = lifestyle_gardener + factor = 10 + } + modifier = { + has_trait = lifestyle_herbalist + factor = 10 + } + } + save_scope_as = botanist + } + if = { + limit = { NOT = { exists = scope:botanist } } + luxury_contract_save_spawn_culture_and_faith_effect = yes + create_character = { + template = gardener_template + dynasty = none + location = location + culture = scope:lc_spawn_culture + faith = scope:lc_spawn_faith + save_scope_as = botanist + } + scope:botanist = { add_character_flag = destroy_me } + } + scope:botanist ?= { assign_quirk_effect = yes } +} + +# Intro +gdp_merchant_luxury_contract.1601 = { # Start + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = { + desc = gdp_merchant_luxury_contract.1601.desc + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_dean_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1601.dean + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_sages_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1601.sages + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_library_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1601.library + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_physician_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1601.physician + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_student_flag + } + } + desc = { + desc = gdp_merchant_luxury_contract.1601.student + desc = double_line_break + } + } + triggered_desc = { + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_botanist_flag + } + } + desc = gdp_merchant_luxury_contract.1601.botanist + } + } + theme = trade + left_portrait = { + character = root + animation = thinking + } + override_background = { reference = bp2_university } + + trigger = { + scope:lc_active_building_flag ?= flag:scholarly_building + } + + immediate = { + # Prevent repeats + add_to_variable_list = { + name = lc_building_completed_list + target = flag:scholarly_building + } + # Save paths + hidden_effect = { + while = { + count = 2 + random_list = { + 10 = { # Dean + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1601_dean_flag + this = flag:lc_1601_library_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1601_dean_flag + } + } + 10 = { # Sages + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1601_sages_flag + } + } + } + modifier = { + scope:local_county = { + any_county_province = { gdp_find_curio_poi_religious_province_trigger = yes } + } + factor = 2 + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1601_sages_flag + } + } + 10 = { # Library + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1601_library_flag + this = flag:lc_1601_dean_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1601_library_flag + } + } + 10 = { # Physician + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1601_physician_flag + this = flag:lc_1601_botanist_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1601_physician_flag + } + } + 10 = { # Student + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1601_student_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1601_student_flag + } + } + 10 = { # Botanist + trigger = { + any_in_list = { + variable = lc_path_options_list + count = 0 + OR = { + this = flag:lc_1601_botanist_flag + this = flag:lc_1601_physician_flag + } + } + } + add_to_variable_list = { + name = lc_path_options_list + target = flag:lc_1601_botanist_flag + } + } + } + } + } + # Source characters + luxury_contract_find_or_create_scholar_effect = yes + scope:scholar = { save_scope_as = bg_override_char } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_physician_flag + } + } + luxury_contract_find_or_create_physician_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_student_flag + } + } + luxury_contract_find_or_create_student_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_sages_flag + } + } + luxury_contract_find_or_create_sage_effect = yes + } + if = { + limit = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_botanist_flag + } + } + luxury_contract_find_or_create_botanist_effect = yes + } + } + + option = { # Dean + name = gdp_merchant_luxury_contract.1601.a + flavor = gdp_merchant_luxury_contract.1601.a.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_dean_flag + } + } + # Destroy unused characters + scope:physician ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:student ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:sage ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:botanist ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1601.a + FLAG = lc_1601_dean_flag + EVENT_ID = 1611 + } + } + + option = { # Sages + name = gdp_merchant_luxury_contract.1601.b + flavor = gdp_merchant_luxury_contract.1601.b.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_sages_flag + } + } + # Destroy unused characters + scope:physician ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:student ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:botanist ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1601.b + FLAG = lc_1601_sages_flag + EVENT_ID = 1621 + } + } + + option = { # Library + name = gdp_merchant_luxury_contract.1601.c + flavor = gdp_merchant_luxury_contract.1601.c.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_library_flag + } + } + # Destroy unused characters + scope:physician ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:student ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:sage ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:botanist ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1601.c + FLAG = lc_1601_library_flag + EVENT_ID = 1631 + } + } + + option = { # Physician + name = gdp_merchant_luxury_contract.1601.d + flavor = gdp_merchant_luxury_contract.1601.d.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_physician_flag + } + } + # Destroy unused characters + scope:student ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:sage ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:botanist ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1601.d + FLAG = lc_1601_physician_flag + EVENT_ID = 1641 + } + } + + option = { # Students + name = gdp_merchant_luxury_contract.1601.e + flavor = gdp_merchant_luxury_contract.1601.e.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_student_flag + } + } + # Destroy unused characters + scope:physician ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:sage ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:botanist ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1601.e + FLAG = lc_1601_student_flag + EVENT_ID = 1651 + } + } + + option = { # Botanist + name = gdp_merchant_luxury_contract.1601.f + flavor = gdp_merchant_luxury_contract.1601.f.flavor + trigger = { + any_in_list = { + variable = lc_path_options_list + this = flag:lc_1601_botanist_flag + } + } + # Destroy unused characters + scope:physician ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:sage ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:student ?= { luxury_contract_cleanup_unused_character_effect = yes } + # Trigger event + lc_curio_next_path_option_effect = { + TOOLTIP = 1601.f + FLAG = lc_1601_botanist_flag + EVENT_ID = 1661 + } + } +} + +# Duel Outcome +gdp_merchant_luxury_contract.1602 = { # End + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = { + first_valid = { + triggered_desc = { # Dean + trigger = { scope:lc_active_path_flag = flag:lc_1601_dean_flag } + desc = { + desc = gdp_merchant_luxury_contract.1602.dean + first_valid = { + triggered_desc = { + trigger = { + OR = { + exists = scope:lc_1001_success + exists = scope:lc_1001_success_critical + } + } + desc = gdp_merchant_luxury_contract.1602.dean.success + } + desc = gdp_merchant_luxury_contract.1602.dean.failure + } + } + } + triggered_desc = { # Sages + trigger = { scope:lc_active_path_flag = flag:lc_1601_sages_flag } + desc = { + desc = gdp_merchant_luxury_contract.1602.sages + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1602.sages.success + } + desc = gdp_merchant_luxury_contract.1602.sages.failure + } + } + } + triggered_desc = { # Library + trigger = { scope:lc_active_path_flag = flag:lc_1601_library_flag } + desc = { + desc = gdp_merchant_luxury_contract.1602.library + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1602.library.success + } + desc = gdp_merchant_luxury_contract.1602.library.failure + } + } + } + triggered_desc = { # Physician + trigger = { scope:lc_active_path_flag = flag:lc_1601_physician_flag } + desc = { + desc = gdp_merchant_luxury_contract.1602.physician + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1602.physician.success + } + desc = gdp_merchant_luxury_contract.1602.physician.failure + } + } + } + triggered_desc = { # + trigger = { scope:lc_active_path_flag = flag:lc_1601_student_flag } + desc = { + desc = gdp_merchant_luxury_contract.1602.student + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1602.student.success + } + desc = gdp_merchant_luxury_contract.1602.student.failure + } + } + } + triggered_desc = { # Botanist + trigger = { scope:lc_active_path_flag = flag:lc_1601_botanist_flag } + desc = { + desc = gdp_merchant_luxury_contract.1602.botanist + first_valid = { + triggered_desc = { + trigger = { exists = scope:lc_1001_success } + desc = gdp_merchant_luxury_contract.1602.botanist.success + } + desc = gdp_merchant_luxury_contract.1602.botanist.failure + } + } + } + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + animation = admiration + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + animation = disappointed + } + camera = camera_event_very_left + } + right_portrait = { + character = scope:portrait + trigger = { + trigger_if = { + limit = { scope:lc_active_path_flag = flag:lc_1601_student_flag } + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + } + triggered_animation = { + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + animation = happiness + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + scope:lc_active_path_flag = flag:lc_1601_sages_flag + } + animation = war_over_tie + } + triggered_animation = { + trigger = { + NOR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + NOR = { + scope:lc_active_path_flag = flag:lc_1601_sages_flag + } + } + animation = dismissal + } + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + artifact = { + target = scope:fallback_artifact + position = lower_center_portrait + } + override_background = { + trigger = { + scope:lc_active_path_flag = flag:lc_1601_physician_flag + } + reference = physicians_study + } + override_background = { + trigger = { + OR = { + scope:lc_active_path_flag = flag:lc_1601_sages_flag + scope:lc_active_path_flag = flag:lc_1601_botanist_flag + } + } + reference = garden + } + override_background = { + trigger = { + scope:lc_active_path_flag = flag:lc_1601_student_flag + } + reference = alley_night + } + override_background = { + trigger = { + NOR = { + scope:lc_active_path_flag = flag:lc_1601_sages_flag + scope:lc_active_path_flag = flag:lc_1601_botanist_flag + scope:lc_active_path_flag = flag:lc_1601_physician_flag + scope:lc_active_path_flag = flag:lc_1601_student_flag + } + } + reference = study + } + + immediate = { + lc_curio_fallback_artifact_effect = { OWNER = scope:scholar } + if = { + limit = { + exists = scope:lc_1001_success + scope:lc_active_path_flag = flag:lc_1601_student_flag + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + luxury_contract_wound_effect = yes + lc_curio_select_fallback_location_effect = yes + } + + option = { # Success! + name = gdp_merchant_luxury_contract.1602.a + trigger = { + OR = { + exists = scope:lc_1001_success_critical + exists = scope:lc_1001_success + } + } + if = { + limit = { + scope:lc_active_path_flag = flag:lc_1601_dean_flag + NOT = { exists = scope:lc_1001_success_critical } + } + pay_short_term_gold = { + gold = medium_gold_value + target = scope:scholar + } + } + lc_curio_success_option_effect = yes + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_greed = 0.25 + } + } + } + + option = { # Bad success! + name = gdp_merchant_luxury_contract.1602.b + trigger = { lc_curio_bad_success_option_trigger = yes } + lc_curio_success_option_effect = yes + stress_impact = { + compassionate = minor_stress_impact_gain + just = minor_stress_impact_gain + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_greed = 0.25 + } + } + } + + option = { # Religious + name = gdp_merchant_luxury_contract.1001.e + flavor = gdp_merchant_luxury_contract.1001.e.flavor + trigger = { + lc_curio_next_building_option_trigger = { FLAG = religious_building } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.e + FLAG = religious_building + EVENT_ID = 1501 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_boldness = 0.25 + } + } + } + + option = { # Urban + name = gdp_merchant_luxury_contract.1001.return.urban + flavor = gdp_merchant_luxury_contract.1001.a.flavor + trigger = { + lc_curio_next_building_option_trigger = { FLAG = urban_building } + } + lc_curio_next_building_option_effect = { + TOOLTIP = 1001.a + FLAG = urban_building + EVENT_ID = 1101 + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_greed = 0.25 + } + } + } + + option = { # Fallback! + name = gdp_merchant_luxury_contract.1001.fallback + flavor = gdp_merchant_luxury_contract.1001.fallback.flavor + trigger = { lc_curio_fallback_option_trigger = yes } + lc_curio_fallback_option_effect = yes + ai_chance = { + base = 0 + } + } + + option = { # Give up! + name = gdp_merchant_luxury_contract.1001.give_up + trigger = { lc_curio_give_up_option_trigger = yes } + lc_curio_give_up_option_effect = yes + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = -0.25 + ai_greed = -0.25 + } + } + } + + after = { + lc_curio_cleanup_path_scopes_effect = yes + scope:scholar ?= { + remove_character_flag = has_reading_glasses + luxury_contract_cleanup_unused_character_effect = yes + } + scope:sage ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:physician ?= { luxury_contract_cleanup_unused_character_effect = yes } + scope:botanist ?= { luxury_contract_cleanup_unused_character_effect = yes } + } +} + +# Duel Events +gdp_merchant_luxury_contract.1611 = { # Dean + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = gdp_merchant_luxury_contract.1611.desc + theme = trade + left_portrait = { + character = root + animation = war_over_tie + } + right_portrait = { + character = scope:scholar + animation = flirtation + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = study } + + immediate = { + # Save portrait scope for ending event + scope:scholar = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:scholar = { + create_artifact = { + name = gdp_merchant_luxury_contract.1611.artifact.certificate + description = gdp_merchant_luxury_contract.1611.artifact.certificate.desc + type = curio + visuals = scroll_bundle_artifact + modifier = artifact_monthly_prestige_3_modifier + max_durability = 30 + quality = scope:quality + wealth = scope:wealth + generate_history = no + save_scope_as = artifact + } + lc_curio_reforge_effect = { TYPE = curio } + } + } + } + + option = { # Duel + name = gdp_merchant_luxury_contract.1611.a + flavor = gdp_merchant_luxury_contract.1611.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.diplomacy + add = { + value = scope:merchant.prestige_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1611.a.success_critical + save_scope_as = lc_1001_success_critical + show_as_tooltip = { + scope:artifact = { set_owner = scope:merchant } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 1 + min = -49 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1611.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:artifact = { set_owner = scope:merchant } + pay_short_term_gold = { + gold = medium_gold_value + target = scope:scholar + } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:scholar } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1611.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1602 + } +} + +gdp_merchant_luxury_contract.1621 = { # Sage + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = gdp_merchant_luxury_contract.1621.desc + theme = trade + left_portrait = { + character = root + animation = nervous + camera = camera_event_very_left + } + right_portrait = { + character = scope:sage + animation = holding_staff + camera = camera_event_very_right + } + artifact = { + target = scope:newly_created_artifact + position = lower_center_portrait + } + override_background = { reference = garden } + + immediate = { + # Save portrait scope for ending event + scope:sage = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:sage = { + create_curio_artifact_effect = { + OWNER = scope:sage + CREATOR = dummy_female + } + } + } + if = { + limit = { exists = scope:new_trinket } + scope:new_trinket = { save_scope_as = artifact } + clear_saved_scope = new_trinket + } + else_if = { + limit = { exists = scope:newly_created_artifact } + scope:newly_created_artifact = { save_scope_as = artifact } + clear_saved_scope = newly_created_artifact + } + lc_curio_reforge_effect = { TYPE = curio } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1621.a + flavor = gdp_merchant_luxury_contract.1621.a.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.learning + add = { + value = scope:merchant.piety_level + multiply = 3 + } + subtract = decent_skill_rating + subtract = 6 + } + } + random_list = { + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = theologian + add = 10 + } + modifier = { + has_trait = lifestyle_mystic + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1621.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract = { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:pseudo_duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:sage } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1621.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + zealous = minor_stress_impact_loss + diligent = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1602 + } +} + +gdp_merchant_luxury_contract.1631 = { # Library + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = gdp_merchant_luxury_contract.1631.desc + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:scholar + animation = reading + } + artifact = { + target = scope:artifact + position = lower_center_portrait + } + override_background = { reference = study } + + immediate = { + # Save portrait scope for ending event + scope:scholar = { lc_curio_portrait_scope_effect = yes } + # Create potential reward artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:scholar = { + random_dummy_gender_effect = yes + random_list = { + 10 = { + create_library_artifact_effect = { + OWNER = scope:scholar + CREATOR = scope:dummy_gender + SUBJECT = flag:medicine + TOPIC = flag:artifact_book_topic_medicine + } + } + 10 = { + create_library_artifact_effect = { + OWNER = scope:scholar + CREATOR = scope:dummy_gender + SUBJECT = flag:medicine + TOPIC = flag:artifact_book_topic_science + } + } + 20 = { + create_library_artifact_effect = { + OWNER = scope:scholar + CREATOR = scope:dummy_gender + SUBJECT = flag:learning + TOPIC = flag:no + } + } + 10 = { + create_library_artifact_effect = { + OWNER = scope:scholar + CREATOR = scope:dummy_gender + SUBJECT = flag:alchemy + TOPIC = flag:artifact_book_topic_alchemy + } + } + 5 = { + trigger = { + scope:scholar.culture = { has_cultural_pillar = heritage_latin } + } + create_library_artifact_effect = { + OWNER = scope:scholar + CREATOR = scope:dummy_gender + SUBJECT = flag:diplomacy + TOPIC = flag:cicero + } + } + 5 = { + create_library_artifact_effect = { + OWNER = scope:scholar + CREATOR = scope:dummy_gender + SUBJECT = flag:martial + TOPIC = flag:martial_ancient_military_campaigns + } + } + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1631.artifact.book.desc + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = library_item } + } + + option = { # Duel + name = gdp_merchant_luxury_contract.1631.a + duel = { + skills = { diplomacy learning } + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = lifestyle_scholar + add = 10 + } + modifier = { + has_trait = erudite + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1631.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:scholar } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1631.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + shy = minor_stress_impact_loss + diligent = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1602 + } +} + +gdp_merchant_luxury_contract.1641 = { # Physician + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = gdp_merchant_luxury_contract.1641.desc + theme = trade + left_portrait = { + character = root + animation = thinking + camera = camera_event_very_left + } + right_portrait = { + character = scope:physician + animation = debating + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = physicians_study } + + immediate = { + # Save portrait scope for ending event + scope:physician = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:physician = { + random_list = { + 10 = { + create_artifact_elixir_effect = { + OWNER = scope:physician + ALCHEMIST = scope:physician + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1641.artifact.elixir.desc + } + } + 10 = { + create_artifact_pedestal_human_skull_effect = { + OWNER = scope:physician + CREATOR = dummy_female + DESKULLED = scope:physician + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + random_list = { + 10 = { + set_artifact_name = gdp_merchant_luxury_contract.1641.artifact.skull + set_artifact_description = gdp_merchant_luxury_contract.1641.artifact.skull.desc + } + 10 = { + set_artifact_name = gdp_merchant_luxury_contract.1641.artifact.bone + set_artifact_description = gdp_merchant_luxury_contract.1641.artifact.bone.desc + } + } + } + } + } + } + # Save artifact to contract for tooltips + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1641.a + duel = { + skill = learning + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = torturer + add = 10 + } + modifier = { + has_trait = lifestyle_physician + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1641.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract = { + complete_task_contract = success_standard + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:physician } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1641.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + vengeful = minor_stress_impact_loss + diligent = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1602 + } +} + +gdp_merchant_luxury_contract.1651 = { # Student + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = gdp_merchant_luxury_contract.1651.desc + theme = trade + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:student + triggered_animation = { + trigger = { use_goblet_in_tavern_trigger = yes } + animation = drink_goblet + } + triggered_animation = { + trigger = { use_goblet_in_tavern_trigger = no } + animation = drink + } + } + override_background = { reference = relaxing_room } + + immediate = { + # Save portrait scope for ending event + scope:student = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:student = { + create_curio_artifact_effect = { + OWNER = scope:student + CREATOR = dummy_female + } + if = { + limit = { exists = scope:new_trinket } + scope:new_trinket = { save_scope_as = artifact } + clear_saved_scope = new_trinket + } + else_if = { + limit = { exists = scope:newly_created_artifact } + scope:newly_created_artifact = { save_scope_as = artifact } + clear_saved_scope = newly_created_artifact + } + } + } + } + + option = { # Continue + name = gdp_merchant_luxury_contract.1651.a + duel = { + skills = { diplomacy prowess } + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = lifestyle_reveler + add = 10 + } + modifier = { + has_trait = drunkard + add = 10 + } + modifier = { + has_trait = hashishiyah + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1651.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:student } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1651.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + lazy = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1602 + } +} + +gdp_merchant_luxury_contract.1661 = { # Botanist + type = character_event + title = gdp_merchant_luxury_contract.1601.t + desc = gdp_merchant_luxury_contract.1661.desc + theme = trade + left_portrait = { + character = root + animation = admiration + camera = camera_event_very_left + } + right_portrait = { + character = scope:botanist + animation = war_over_tie + } + artifact = { + target = scope:artifact + position = lower_right_portrait + } + override_background = { reference = study } + + immediate = { + # Save portrait scope for ending event + scope:botanist = { lc_curio_portrait_scope_effect = yes } + # Create artifact + hidden_effect = { + luxury_contract_reward_quality_effect = yes + scope:botanist = { + random_list = { + 10 = { + create_artifact_pressed_flower_effect = { OWNER = scope:botanist } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1661.artifact.flower.desc + } + clear_saved_scope = flower_species + } + 10 = { + create_artifact_animal_trinket_effect = { + OWNER = scope:botanist + HUNTER = scope:botanist + LEGENDARY = no + ANIMAL = flag:none + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1661.artifact.animal.desc + } + } + 10 = { + create_artifact_bird_feather_effect = { + OWNER = scope:botanist + HUNTER = scope:botanist + ANIMAL = flag:none + } + scope:newly_created_artifact ?= { + save_scope_as = artifact + set_artifact_description = gdp_merchant_luxury_contract.1661.artifact.feather.desc + } + } + } + } + lc_curio_reforge_effect = { TYPE = curio } + } + } + + option = { # + name = gdp_merchant_luxury_contract.1661.a + duel = { + skills = { diplomacy learning } + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + has_trait = lifestyle_herbalist + add = 10 + } + modifier = { + has_trait = lifestyle_hunter + add = 10 + } + modifier = { + has_trait = lifestyle_gardener + add = 10 + } + merchant_find_shared_duel_success_modifier = yes # boost success on 2nd pass + min = 10 + desc = gdp_merchant_luxury_contract.1661.a.success + save_scope_as = lc_1001_success + show_as_tooltip = { + scope:task_contract ?= { complete_task_contract = success_standard } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + NOT = { knows_language_of_character = scope:botanist } + add = 10 + } + min = 10 + desc = gdp_merchant_luxury_contract.1661.a.failure + lc_curio_failure_option_effect = yes + } + } + stress_and_fulfillment_impact = { + calm = minor_stress_impact_loss + patient = minor_stress_impact_loss + } + } + + after = { + trigger_event = gdp_merchant_luxury_contract.1602 + } +} + +### MAINTENANCE +gdp_merchant_luxury_contract.9999 = { # Suppressor + type = character_event + hidden = yes + orphan = yes + trigger = { + scope:lc_active_path_flag = flag:lc_0001_urban_flag + scope:lc_active_path_flag = flag:lc_0001_dealer_flag + scope:lc_active_path_flag = flag:lc_0001_poach_flag + scope:lc_active_path_flag = flag:lc_0001_hunt_flag + scope:lc_active_path_flag = flag:lc_0001_baby_flag + exists = scope:harmless_local_creature + exists = scope:dangerous_local_creature + exists = scope:prowling_local_creature + exists = scope:creature_type + any_in_list = { variable = lc_path_options_list } + any_in_list = { variable = lc_building_fallback_list } + any_in_list = { variable = lc_building_potential_list } + any_in_list = { variable = lc_building_completed_list } + } + immediate = { + save_scope_as = harmless_local_creature + save_scope_as = dangerous_local_creature + save_scope_as = prowling_local_creature + save_scope_as = creature_type + add_to_variable_list = { + name = lc_path_options_list + target = flag:none + } + add_to_variable_list = { + name = lc_building_fallback_list + target = flag:none + } + add_to_variable_list = { + name = lc_building_potential_list + target = flag:none + } + add_to_variable_list = { + name = lc_building_completed_list + target = flag:none + } + } +} diff --git a/events/dlc/gdp/gdp_merchant_patron_contract_events.txt b/events/dlc/gdp/gdp_merchant_patron_contract_events.txt new file mode 100644 index 000000000..b0ab7faf1 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_patron_contract_events.txt @@ -0,0 +1,196 @@ +namespace = gdp_merchant_patron_contract + +################################################## +# GENERAL SCRIPTED TRIGGERS & EFFECTS + +# Syncs stress lost from successfully completing a trade deal scheme. +scripted_effect merchant_base_patron_schemes_acknowledge_success_stress_effect = { + stress_and_fulfillment_impact = { arrogant = minor_stress_impact_loss } +} + +# Syncs stress gained from failing a trade deal scheme. +scripted_effect merchant_base_patron_schemes_acknowledge_failure_stress_effect = { + if = { + limit = { scope:task_contract_tier >= 2 } + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_gain + humble = minor_stress_impact_loss + arrogant = minor_stress_impact_gain + } + } +} + +#### +# gdp_merchant_patron_contract.0001-0010 - Hobnob +### + +gdp_merchant_patron_contract.0001 = { # intro + type = character_event + title = gdp_merchant_patron_contract.0001.t + desc = gdp_merchant_patron_contract.0001.desc + theme = diplomacy + left_portrait = { + character = root + animation = throne_room_conversation_1 + } + right_portrait = { + character = scope:patron + animation = flirtation_left + } + override_background = { reference = sitting_room } + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + immediate = { + scope:patron = { save_scope_as = bg_override_char } + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_patron_contract.0001.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme = { + # Success. + add_agent_slot = agent_diplomat + add_agent_slot = agent_diplomat + add_agent_slot = agent_shill + # Speed. + add_agent_slot = agent_herald + add_agent_slot = agent_socialite + } + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_patron_contract.0001.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme = { + # Success. + add_agent_slot = agent_diplomat + add_agent_slot = agent_diplomat + add_agent_slot = agent_shill + add_agent_slot = agent_bodyguard + # Speed. + add_agent_slot = agent_herald + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_patron_contract.0001.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme = { + # Success. + add_agent_slot = agent_diplomat + # Speed. + add_agent_slot = agent_herald + add_agent_slot = agent_herald + add_agent_slot = agent_socialite + add_agent_slot = agent_socialite + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +# Success event. +gdp_merchant_patron_contract.0002 = { + type = character_event + window = scheme_successful_event + title = gdp_merchant_patron_contract.0002.t + desc = gdp_merchant_patron_contract.0002.desc + theme = diplomacy + center_portrait = { + character = root + animation = hero_flex + } + right_portrait = { + character = scope:patron + animation = admiration + } + override_background = { reference = sitting_room } + + immediate = { + merchant_base_patron_contract_schemes_set_up_outcome_immediate_effect = yes + random_list = { + 67 = { + scope:scheme.task_contract = { complete_task_contract = success_standard } + } + 33 = { + scope:scheme.task_contract = { complete_task_contract = success_critical } + } + } + scope:patron = { add_stress = major_stress_loss } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_patron_contract.0002.a + flavor = merchant_base_patron_contract_schemes.0000.f.contract_concluded + merchant_base_patron_schemes_acknowledge_success_stress_effect = yes + } +} + +# Failure event. +gdp_merchant_patron_contract.0003 = { + type = character_event + window = scheme_failed_event + title = gdp_merchant_patron_contract.0003.t + desc = gdp_merchant_patron_contract.0003.desc + theme = diplomacy + center_portrait = { + character = root + animation = disappointed + } + right_portrait = { + character = scope:patron + animation = dismissal + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_patron_contract_schemes_set_up_outcome_immediate_effect = yes + scope:scheme.task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_patron_contract.0003.a + flavor = merchant_base_patron_contract_schemes.0000.f.contract_concluded + + merchant_base_patron_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_patron_contract.0004 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_patron_contract.0002 + FAILURE_EVENT = gdp_merchant_patron_contract.0003 + } + } +} diff --git a/events/dlc/gdp/gdp_merchant_scheme_advantage_events.txt b/events/dlc/gdp/gdp_merchant_scheme_advantage_events.txt new file mode 100644 index 000000000..8008774a5 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_scheme_advantage_events.txt @@ -0,0 +1,817 @@ +namespace = gdp_merchant_scheme_advantage + +scripted_effect merchant_scheme_advantage_save_scopes_effect = { + scope:scheme = { + task_contract = { + save_scope_as = task_contract + task_contract_taker = { save_scope_as = merchant } + task_contract_employer = { + save_scope_as = trader + assigned_trade_route ?= { save_scope_as = route } + } + task_contract_location = { + save_scope_as = task_contract_location + barony.trade_market = { + save_scope_as = market + every_character_in_market = { + limit = { + government_has_flag = government_is_merchant + NOT = { this = scope:merchant } + } + add_to_list = potential_rivals + } + } + } + task_contract_target ?= { save_scope_as = task_contract_target } + } + every_scheme_agent_character = { + limit = { + NOT = { this = scope:trader } + } + add_to_list = potential_agents + } + } + hidden_effect = { + # Save portrait scope + random_list = { + 10 = { + trigger = { + any_in_list = { list = potential_agents } + } + random_in_list = { + list = potential_agents + limit = { + is_available_quick = { + imprisoned = no + incapable = no + } + NOT = { this = scope:trader } + } + save_scope_as = agent + save_scope_as = portrait + } + } + 10 = { + trigger = { + court_position:partner_court_position ?= { + is_available_quick = { + imprisoned = no + incapable = no + } + NOT = { this = scope:trader } + } + } + court_position:partner_court_position = { + save_scope_as = partner + save_scope_as = portrait + } + } + 30 = { + scope:trader = { save_scope_as = portrait } + } + } + # Save rival scope + random_in_list = { + list = potential_rivals + save_scope_as = rival + } + # Save malus + random_list = { + 10 = { + modifier = { + add = -10 + scope:scheme = { has_scheme_modifier = gdp_merchant_scheme_advantage_success_chance_potential_modifier } + } + save_scope_value_as = { name = malus value = flag:potential } + } + 10 = { + modifier = { + add = -10 + scope:scheme = { has_scheme_modifier = gdp_merchant_scheme_advantage_success_chance_growth_modifier } + } + save_scope_value_as = { name = malus value = flag:growth } + } + 10 = { + modifier = { + add = -10 + scope:scheme = { has_scheme_modifier = gdp_merchant_scheme_advantage_success_chance_length_modifier } + } + save_scope_value_as = { name = malus value = flag:length } + } + 10 = { + save_scope_value_as = { name = malus value = flag:opportunity } + } + 10 = { + trigger = { NOT = { scope:portrait = scope:trader } } + save_scope_value_as = { name = malus value = flag:quit } + } + 10 = { + trigger = { NOT = { scope:task_contract = { has_task_contract_type = promote_goods } } } + save_scope_value_as = { name = malus value = flag:competitiveness } + } + 10 = { + trigger = { + exists = scope:rival.house + NOT = { scope:merchant.house ?= scope:rival.house } + } + save_scope_value_as = { name = malus value = flag:relation } + } + } + # Save duel type + random_list = { + 10 = { + trigger = { house.house_unity_value >= 33 } + save_scope_value_as = { name = duel_type value = flag:unity } + } + 10 = { + save_scope_value_as = { name = duel_type value = flag:stress } + } + 10 = { + save_scope_value_as = { name = duel_type value = flag:associate } + } + } + # Save spend type + random_list = { + 10 = { + trigger = { + house.house_unity_value >= 5 + NOT = { scope:duel_type = flag:unity } + } + save_scope_value_as = { name = spend_type value = flag:unity } + } + 10 = { + trigger = { NOT = { scope:duel_type = flag:stress } } + save_scope_value_as = { name = spend_type value = flag:stress } + } + 10 = { + trigger = { NOT = { scope:duel_type = flag:associate } } + save_scope_value_as = { name = spend_type value = flag:associate } + } + } + } +} + +scripted_effect merchant_scheme_advantage_upset_outcome_effect = { + save_scope_value_as = { name = opinion value = $OPINION_LOSS$ } + save_scope_value_as = { name = stress value = $STRESS_GAIN$ } + save_scope_value_as = { name = unity value = $UNITY_LOSS$ } + if = { + limit = { scope:opinion != 0 } + scope:portrait = { + add_opinion = { + target = root + modifier = upset_opinion + opinion = scope:opinion + } + } + } + scope:portrait = { + if = { + limit = { scope:stress != 0 } + stress_and_fulfillment_impact = { base = scope:stress } + } + } + scope:merchant.house = { + if = { + limit = { scope:unity != 0 } + add_unity_value = { + value = scope:unity + character = root + desc = gdp_merchant_scheme_advantage.desc + } + } + } +} + +scripted_effect gdp_merchant_scheme_advantage_add_opportunity_effect = { + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_scheme_advantage_outcome + right_icon = scope:trader + custom_tooltip = { + text = gdp_merchant_scheme_advantage_add_2_opportunities_tt + scope:scheme = { change_opportunities = 2 } + } + } + } +} + +scripted_effect gdp_merchant_scheme_advantage_malus_outcome_effect = { + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_scheme_advantage_outcome + switch = { + trigger = scope:malus + flag:potential = { + scope:scheme = { + add_scheme_modifier = { type = gdp_merchant_scheme_advantage_success_chance_potential_modifier } + } + } + flag:growth = { + scope:scheme = { + add_scheme_modifier = { type = gdp_merchant_scheme_advantage_success_chance_growth_modifier } + } + } + flag:length = { + scope:scheme = { + add_scheme_modifier = { type = gdp_merchant_scheme_advantage_success_chance_length_modifier } + } + } + flag:opportunity = { + custom_tooltip = { + text = gdp_merchant_scheme_advantage_subtract_opportunity_tt + scope:scheme = { change_opportunities = -1 } + } + } + flag:quit = { + scope:portrait = { move_to_pool = yes } + } + flag:competitiveness = { + scope:market = { + add_competitiveness_modifier_for_character = { + character = scope:merchant + modifier = gdp_merchant_scheme_advantage_market_competitiveness_modifier + } + } + } + flag:relation = { + scope:merchant.house = { + change_house_relation_effect = { + HOUSE = scope:rival.house + VALUE = house_relation_damage_minor_value + REASON = scheme_push_for_advantage + CHAR = scope:merchant + TARGET_CHAR = scope:rival + TITLE = dummy_female + } + } + } + } + } + } +} + +scripted_effect gdp_merchant_scheme_advantage_contract_failure_effect = { + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_scheme_advantage_outcome + right_icon = scope:trader + scope:task_contract = { complete_task_contract = failure_standard } + } + } +} + +gdp_merchant_scheme_advantage.1000 = { + type = character_event + title = gdp_merchant_scheme_advantage.1000.t + desc = { + desc = gdp_merchant_scheme_advantage.1000.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:rival } + desc = gdp_merchant_scheme_advantage.1000.intro.rival + } + triggered_desc = { + trigger = { exists = scope:partner } + desc = gdp_merchant_scheme_advantage.1000.intro.partner + } + triggered_desc = { + trigger = { exists = scope:agent } + desc = gdp_merchant_scheme_advantage.1000.intro.agent + } + desc = gdp_merchant_scheme_advantage.1000.intro.trader + } + first_valid = { + triggered_desc = { + trigger = { scope:duel_type = flag:unity } + desc = gdp_merchant_scheme_advantage.1000.desc.unity + } + triggered_desc = { + trigger = { scope:duel_type = flag:stress } + desc = gdp_merchant_scheme_advantage.1000.desc.stress + } + desc = gdp_merchant_scheme_advantage.1000.desc.associate + } + } + theme = trade + left_portrait = { + character = root + animation = arguing + camera = camera_event_very_left + } + right_portrait = { + character = scope:portrait + animation = disbelief + camera = camera_event_very_right + } + lower_right_portrait = scope:rival + override_background = { reference = study } + + immediate = { + merchant_scheme_advantage_save_scopes_effect = yes + } + + option = { # Crack whip + name = gdp_merchant_scheme_advantage.1000.a + trigger = { scope:duel_type = flag:associate } + flavor = gdp_merchant_scheme_advantage.1000.a.flavor + scope:portrait = { + duel = { + skill = stewardship + value = decent_skill_rating + 10 = { + base_duel_compare_modifier = { MULTIPLIER = 3.5 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_add_opportunity_effect = yes + } + 10 = { + base_duel_compare_modifier = { MULTIPLIER = -1 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_malus_outcome_effect = yes + } + 5 = { + base_duel_compare_modifier = { MULTIPLIER = -3.5 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_contract_failure_effect = yes + } + } + } + merchant_scheme_advantage_upset_outcome_effect = { + OPINION_LOSS = -25 + STRESS_GAIN = medium_stress_gain + UNITY_LOSS = major_unity_loss + } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_gain + patient = minor_stress_impact_gain + } + # No ai_chance + } + + option = { # Leverage House Unity + name = gdp_merchant_scheme_advantage.1000.b + trigger = { scope:duel_type = flag:unity } + flavor = gdp_merchant_scheme_advantage.1000.b.flavor + save_scope_value_as = { + name = pseudo_duel_value + value = { + value = scope:merchant.house.house_unity_value + subtract = 100 + } + } + random_list = { + 5 = { + base_duel_compare_modifier = { MULTIPLIER = 3.5 VALUE = scope:pseudo_duel_value } + min = 5 + gdp_merchant_scheme_advantage_add_opportunity_effect = yes + } + 10 = { + base_duel_compare_modifier = { MULTIPLIER = -1 VALUE = scope:pseudo_duel_value } + min = 5 + gdp_merchant_scheme_advantage_malus_outcome_effect = yes + } + 5 = { + base_duel_compare_modifier = { MULTIPLIER = -3.5 VALUE = scope:pseudo_duel_value } + min = 5 + gdp_merchant_scheme_advantage_contract_failure_effect = yes + } + } + merchant_scheme_advantage_upset_outcome_effect = { + OPINION_LOSS = 0 + STRESS_GAIN = 0 + UNITY_LOSS = massive_unity_loss + } + every_courtier = { + custom = custom.every_associate + add_opinion = { + target = root + modifier = upset_opinion + opinion = -15 + } + } + # No ai_chance + } + + option = { # Do *something* yourself + name = gdp_merchant_scheme_advantage.1000.c + trigger = { scope:duel_type = flag:stress } + flavor = gdp_merchant_scheme_advantage.1000.c.flavor + duel = { + skill = stewardship + value = decent_skill_rating + 10 = { + base_duel_compare_modifier = { MULTIPLIER = 3.5 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_add_opportunity_effect = yes + } + 10 = { + base_duel_compare_modifier = { MULTIPLIER = -1 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_malus_outcome_effect = yes + } + 5 = { + base_duel_compare_modifier = { MULTIPLIER = -3.5 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_contract_failure_effect = yes + } + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + # No ai_chance + } + + option = { # Spend + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { scope:spend_type = flag:associate } + desc = gdp_merchant_scheme_advantage.1000.d.associate + } + triggered_desc = { + trigger = { scope:spend_type = flag:unity } + desc = gdp_merchant_scheme_advantage.1000.d.unity + } + desc = gdp_merchant_scheme_advantage.1000.d.stress + } + } + } + custom_tooltip = { + text = gdp_merchant_scheme_advantage_add_1_opportunity_tt + scope:scheme = { change_opportunities = 1 } + } + switch = { + trigger = scope:spend_type + flag:associate = { + merchant_scheme_advantage_upset_outcome_effect = { + OPINION_LOSS = -10 + STRESS_GAIN = minor_stress_impact_gain + UNITY_LOSS = minor_unity_loss + } + } + flag:unity = { + stress_and_fulfillment_impact = { base = medium_stress_impact_gain } + scope:merchant.house = { + add_unity_value = { + value = medium_unity_loss + character = root + desc = gdp_merchant_scheme_advantage.desc + } + } + } + flag:stress = { + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_gain + lazy = miniscule_stress_impact_gain + } + } + } + # No ai_chance + } + + option = { # Ah forget it + name = gdp_merchant_scheme_advantage.1000.e + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + } + # No ai_chance + } +} + +scripted_effect gdp_merchant_scheme_advantage_recruit_outcome_effect = { + custom_tooltip = { + text = gdp_merchant_scheme_advantage_add_1_opportunity_tt + scope:scheme = { change_opportunities = 1 } + } + scope:merchant = { + add_courtier = scope:recruit + hidden_effect = { + reverse_add_opinion = { + target = scope:recruit + modifier = recruited_me_opinion + opinion = 50 + } + } + house = { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant_scheme_advantage.desc + } + } + if = { + limit = { exists = scope:recruit_liege.house } + reverse_add_opinion = { + target = scope:recruit_liege + modifier = upset_opinion + opinion = -15 + } + house = { + change_house_relation_effect = { + HOUSE = scope:recruit_liege.house + VALUE = house_relation_damage_minor_value + REASON = scheme_push_for_advantage + CHAR = scope:merchant + TARGET_CHAR = scope:recruit_liege + TITLE = dummy_female + } + } + scope:recruit_liege.house = { + add_unity_value = { + value = minor_unity_loss + character = root + desc = gdp_merchant_scheme_advantage.desc + } + } + } + } +} + +gdp_merchant_scheme_advantage.1010 = { + type = character_event + title = gdp_merchant_scheme_advantage.1010.t + desc = { + desc = gdp_merchant_scheme_advantage.1010.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:recruit_liege } + desc = gdp_merchant_scheme_advantage.1010.desc.liege + } + desc = gdp_merchant_scheme_advantage.1010.desc.recruit + } + } + theme = trade + left_portrait = { + character = root + animation = worry + camera = camera_event_very_left + } + right_portrait = { + character = scope:trader + animation = debating + camera = camera_event_very_right + } + lower_center_portrait = scope:recruit + lower_right_portrait = scope:recruit_liege + override_background = { reference = study } + cooldown = { years = 5 } + + immediate = { + merchant_scheme_advantage_save_scopes_effect = yes + domicile.domicile_location.barony.trade_market = { + every_character_in_market = { + limit = { + government_has_flag = government_is_merchant + NOT = { this = root } + } + add_to_list = potential_rivals + } + } + every_in_list = { + list = potential_rivals + every_courtier = { add_to_list = potential_rival_recruits } + } + hidden_effect = { + random = { + chance = 50 + random_in_list = { + list = potential_rival_recruits + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + NOR = { + house = liege.house + is_married = yes + opinion = { + target = liege + value >= 50 + } + has_any_good_relationship_with_character_trigger = { CHARACTER = liege } + } + } + save_scope_as = recruit + } + } + } + if = { + limit = { + NOT = { exists = scope:recruit } + } + hidden_effect = { + random_list = { + 10 = { + create_character = { + template = bad_merchant_template + dynasty = none + faith = location.faith + culture = location.culture + location = root.location + gender_female_chance = root_faith_dominant_gender_adjusted_female_chance + save_scope_as = recruit + } + } + 10 = { + create_character = { + template = pool_repopulate_local_flavor + dynasty = none + location = root.location + gender_female_chance = root_faith_dominant_gender_adjusted_female_chance + save_scope_as = recruit + } + } + } + } + } + scope:recruit.liege = { save_scope_as = recruit_liege } + } + + option = { # Duel + name = gdp_merchant_scheme_advantage.1010.a + flavor = gdp_merchant_scheme_advantage.1010.a.flavor + duel = { + skill = diplomacy + value = decent_skill_rating + 10 = { + base_duel_compare_modifier = { MULTIPLIER = 3.5 VALUE = scope:duel_value } + min = 10 + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_scheme_advantage_outcome + right_icon = scope:trader + pay_short_term_gold = { + gold = minor_gold_value + target = scope:recruit + } + gdp_merchant_scheme_advantage_recruit_outcome_effect = yes + } + } + } + 10 = { + base_duel_compare_modifier = { MULTIPLIER = -3.5 VALUE = scope:duel_value } + min = 10 + scope:merchant = { + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_scheme_advantage_outcome + right_icon = scope:trader + add_prestige = miniscule_prestige_loss + } + } + } + } + # No ai_chance + } + + option = { # Spend + name = gdp_merchant_scheme_advantage.1010.b + flavor = gdp_merchant_scheme_advantage.1010.b.flavor + scope:merchant = { + pay_short_term_gold = { + gold = medium_gold_value + target = scope:recruit + } + } + gdp_merchant_scheme_advantage_recruit_outcome_effect = yes + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + # No ai_chance + } + + option = { # Ah forget it + name = gdp_merchant_scheme_advantage.1010.e + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + } + # No ai_chance + } +} + +gdp_merchant_scheme_advantage.1020 = { + type = character_event + title = gdp_merchant_scheme_advantage.1020.t + desc = gdp_merchant_scheme_advantage.1020.desc + theme = trade + left_portrait = { + character = root + animation = war_over_win + camera = camera_event_very_left + } + right_portrait = { + character = scope:trader + animation = thinking + camera = camera_event_very_right + } + lower_center_portrait = scope:patron + override_background = { reference = study } + cooldown = { years = 5 } + + trigger = { + merchant_has_usable_charter_trigger = { + ONLY_EQUIPPED = no + INCLUDE_FORGERIES = no + } + } + + immediate = { + merchant_scheme_advantage_save_scopes_effect = yes + random_character_artifact = { + limit = { + save_temporary_scope_as = charter_temp + var:charter_patron ?= { save_temporary_scope_as = patron_temp } # is charter + root = { can_benefit_from_artifact = scope:charter_temp } + } + var:charter_patron = { save_scope_as = patron } + save_scope_as = charter + } + } + + option = { # Duel + name = gdp_merchant_scheme_advantage.1020.a + duel = { + skill = diplomacy + target = scope:patron + 10 = { + base_duel_compare_modifier = { MULTIPLIER = 3.5 VALUE = scope:duel_value } + min = 5 + gdp_merchant_scheme_advantage_add_opportunity_effect = yes + } + 10 = { + base_duel_compare_modifier = { MULTIPLIER = -1 VALUE = scope:duel_value } + min = 5 + add_prestige = miniscule_prestige_loss + reverse_add_opinion = { + target = scope:patron + modifier = angry_opinion + opinion = -15 + } + merchant_charter_abuse_counter_effect = { + PATRON = scope:patron + MERCHANT = scope:merchant + } + } + 5 = { + base_duel_compare_modifier = { MULTIPLIER = -3.5 VALUE = scope:duel_value } + min = 5 + reverse_add_opinion = { + target = scope:patron + modifier = angry_opinion + opinion = -25 + } + merchant_charter_destroy_held_charters_effect = { + MERCHANT = scope:merchant + PATRON = scope:patron + } + } + } + # No ai_chance + } + + option = { # Spend + name = gdp_merchant_scheme_advantage.1020.b + custom_tooltip = { + text = gdp_merchant_scheme_advantage_add_1_opportunity_tt + scope:scheme = { change_opportunities = 1 } + } + reverse_add_opinion = { + target = scope:patron + modifier = angry_opinion + opinion = -10 + } + merchant_charter_abuse_counter_effect = { + PATRON = scope:patron + MERCHANT = scope:merchant + } + stress_and_fulfillment_impact = { + craven = minor_stress_impact_gain + } + # No ai_chance + } + + option = { # Ah forget it + name = gdp_merchant_scheme_advantage.1020.e + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + } + # No ai_chance + } +} + +gdp_merchant_scheme_advantage.9999 = { # suppressor + type = character_event + hidden = yes + orphan = yes + + trigger = { + exists = var:push_for_advantage_cooldown + } +} diff --git a/events/dlc/gdp/gdp_merchant_schmooze_events.txt b/events/dlc/gdp/gdp_merchant_schmooze_events.txt new file mode 100644 index 000000000..67a593308 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_schmooze_events.txt @@ -0,0 +1,1357 @@ +namespace = gdp_schmooze_events + +# Butter up a noble +gdp_schmooze_events.1000 = { + type = activity_event + title = gdp_schmooze_events.1000.t + desc = gdp_schmooze_events.1000.desc + theme = trade + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:schmoozee + animation = war_over_tie + } + cooldown = { months = 1 } + override_background = { reference = ep2_involved_activity } + + trigger = { + has_activity_intent = schmooze_intent + scope:activity = { + any_attending_character = { + is_landed = yes + NOT = { government_has_flag = government_is_merchant } + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + } + } + + immediate = { + save_scope_as = schmoozer + scope:activity = { + random_attending_character = { + limit = { + is_landed = yes + NOT = { government_has_flag = government_is_merchant } + save_temporary_scope_as = schmoozee_temp + NOT = { + scope:schmoozer = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + save_scope_as = schmoozee + } + } + if = { + limit = { + government_has_flag = government_is_merchant + any_trade_route_with_goods_category_trigger = { CATEGORY = luxury_items } + } + save_random_trade_route_with_goods_category_effect = { CATEGORY = luxury_items } + scope:goods_route ?= { + random_trade_market_on_route = { + limit = { + NOT = { has_trade_market_modifier = activity_used_trade_market_luxury_items_modifier } + trade_market_production_of_trade_good_need_category = { + target = trade_good_category:trade_category_luxury_items + value > 0 + } + } + alternative_limit = { + trade_market_production_of_trade_good_need_category = { + target = trade_good_category:trade_category_luxury_items + value > 0 + } + } + alternative_limit = { always = yes } + save_scope_as = goods_market + } + } + } + } + + option = { #I am an luxury merchant! + name = gdp_schmooze_events.1000.d + trigger = { + custom_tooltip = { + text = trade_category_luxury_items_trade_route_trigger + exists = scope:goods_market + } + } + reason = have_luxury_items_route + show_as_unavailable = { government_has_flag = government_is_merchant } + reverse_add_opinion = { + target = scope:schmoozee + modifier = impressed_opinion + opinion = 20 + } + scope:goods_market ?= { + add_trade_market_modifier = { + modifier = activity_used_trade_market_luxury_items_modifier + years = 10 + } + } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 50 + modifier = { + add = 50 + has_trait = ambitious + } + ai_value_modifier = { + ai_boldness = 0.5 + } + } + } + + option = { + name = gdp_schmooze_events.1000.a + trigger = { gold >= scope:schmoozee.minor_gold_value } + show_as_unavailable = { gold < scope:schmoozee.minor_gold_value } + pay_short_term_gold = { + gold = scope:schmoozee.minor_gold_value + target = scope:schmoozee + } + reverse_add_opinion = { + target = scope:schmoozee + modifier = impressed_opinion + opinion = 20 + } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 25 + modifier = { + gold < scope:schmoozee.medium_gold_value + factor = 0 + } + ai_value_modifier = { + ai_greed = -0.5 + } + } + } + + option = { + name = gdp_schmooze_events.1000.b + duel = { + skill = diplomacy + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1000.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_schmooze_events.1000.b.success + right_icon = scope:schmoozee + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + reverse_add_opinion = { + target = scope:schmoozee + modifier = impressed_opinion + opinion = 10 + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1000.b.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_schmooze_events.1000.b.failure + right_icon = scope:schmoozee + add_prestige = miniscule_prestige_loss + } + } + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 25 + modifier = { + add = 50 + diplomacy >= decent_skill_rating + } + ai_value_modifier = { + ai_sociability = 0.5 + } + } + } + + option = { + name = gdp_schmooze_events.1000.c + add_prestige = minor_prestige_value + ai_chance = { + base = 25 + ai_value_modifier = { + ai_energy = -0.5 + } + } + } +} + +# Butter up a merchant +gdp_schmooze_events.1010 = { + type = activity_event + title = gdp_schmooze_events.1010.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + involved_activity = { has_activity_type = activity_feast } + } + desc = gdp_schmooze_events.1010.feast + } + desc = gdp_schmooze_events.1010.hunt + } + desc = gdp_schmooze_events.1010.outro + } + theme = trade + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:schmoozee + animation = war_over_tie + } + cooldown = { months = 1 } + override_background = { reference = ep2_involved_activity } + + trigger = { + has_activity_intent = schmooze_intent + num_trade_routes > 0 + scope:activity = { + any_attending_character = { + NOT = { this = root } + exists = domicile + government_has_flag = government_is_merchant + any_trade_route = {} + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + } + } + + immediate = { + save_scope_as = schmoozer + scope:activity = { + random_attending_character = { + limit = { + NOT = { this = root } + exists = domicile + government_has_flag = government_is_merchant + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + weight = { + base = 100 + modifier = { + gold < medium_gold_value + add = -99 + } + } + save_scope_as = schmoozee + } + } + scope:schmoozee = { + random_trade_route = { + limit = { + any_trade_market_on_route = { save_temporary_scope_as = market_temp } + scope:schmoozer = { + any_trade_route = { + any_trade_market_on_route = { scope:market_temp ?= this } + } + } + } + save_scope_as = shared_route + scope:market_temp = { save_scope_as = shared_market } + } + } + if = { + limit = { + NOT = { exists = scope:shared_market } + } + random_trade_route = { + random_trade_market_on_route = { save_scope_as = schmoozer_market } + } + scope:schmoozee = { + random_trade_route = { + random_trade_market_on_route = { save_scope_as = schmoozee_market } + } + } + } + } + + option = { + name = gdp_schmooze_events.1010.a + trigger = { + scope:schmoozee = { gold >= medium_gold_value } + } + show_as_unavailable = { + scope:schmoozee = { gold < medium_gold_value } + } + scope:schmoozee = { + pay_short_term_gold = { + gold = medium_gold_value + target = scope:schmoozer + } + } + if = { + limit = { exists = scope:shared_market } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozee + TARGET = scope:schmoozer + MARKET = scope:shared_market + } + } + else = { + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozee + TARGET = scope:schmoozer + MARKET = scope:schmoozee_market + } + } + house = { + change_house_relation_effect = { + HOUSE = scope:schmoozee.house + VALUE = house_relation_improve_minor_value + REASON = trade_opportunity_cooperation + CHAR = scope:schmoozer + TARGET_CHAR = scope:schmoozee + TITLE = dummy_female + } + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 25 + modifier = { + short_term_gold < minor_gold_value + add = 50 + } + ai_value_modifier = { + ai_greed = 0.5 + } + } + } + + option = { + name = gdp_schmooze_events.1010.b + trigger = { gold >= medium_gold_value } + show_as_unavailable = { gold < medium_gold_value } + pay_short_term_gold = { + gold = medium_gold_value + target = scope:schmoozee + } + if = { + limit = { exists = scope:shared_market } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:shared_market + } + } + else = { + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:schmoozer_market + } + } + house = { + change_house_relation_effect = { + HOUSE = scope:schmoozee.house + VALUE = house_relation_improve_minor_value + REASON = trade_opportunity_cooperation + CHAR = scope:schmoozer + TARGET_CHAR = scope:schmoozee + TITLE = scope:dummy_gender + } + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 25 + modifier = { + short_term_gold < minor_gold_value + factor = 0 + } + ai_value_modifier = { + ai_boldness = 0.5 + } + } + } + + option = { + name = gdp_schmooze_events.1010.c + duel = { + skill = diplomacy + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1010.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_schmooze_events.1010.c.success + right_icon = scope:schmoozee + if = { + limit = { exists = scope:shared_market } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:shared_market + } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozee + TARGET = scope:schmoozer + MARKET = scope:shared_market + } + } + else = { + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:schmoozer_market + } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozee + TARGET = scope:schmoozer + MARKET = scope:schmoozee_market + } + } + house = { + change_house_relation_effect = { + HOUSE = scope:schmoozee.house + VALUE = house_relation_improve_minor_value + REASON = trade_opportunity_cooperation + CHAR = scope:schmoozer + TARGET_CHAR = scope:schmoozee + TITLE = scope:dummy_gender + } + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1010.c.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_schmooze_events.1010.c.failure + right_icon = scope:schmoozee + reverse_add_opinion = { + target = scope:schmoozee + modifier = insulted_opinion + } + house = { + change_house_relation_effect = { + HOUSE = scope:schmoozee.house + VALUE = house_relation_damage_minor_value + REASON = trade_opportunity_friction + CHAR = scope:schmoozer + TARGET_CHAR = scope:schmoozee + TITLE = scope:dummy_gender + } + } + } + } + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 25 + modifier = { + diplomacy >= decent_skill_rating + add = 50 + } + } + } + + option = { + name = gdp_schmooze_events.1010.d + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_energy = -0.5 + } + } + } +} + +# Pick a noble to side with +gdp_schmooze_events.1030 = { + type = activity_event + title = gdp_schmooze_events.1030.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + involved_activity = { has_activity_type = activity_feast } + } + desc = gdp_schmooze_events.1030.feast + } + desc = gdp_schmooze_events.1030.hunt + } + desc = gdp_schmooze_events.1030.outro + } + theme = trade + left_portrait = { + character = scope:schmoozee_1 + animation = dismissal + } + center_portrait = { + character = root + animation = war_over_tie + } + right_portrait = { + character = scope:schmoozee_2 + animation = disgust + } + cooldown = { months = 1 } + override_background = { reference = ep2_involved_activity } + + trigger = { + has_activity_intent = schmooze_intent + scope:activity = { + any_attending_character = { + count >= 2 + NOT = { government_has_flag = government_is_merchant } + is_ruler = yes + save_temporary_scope_as = schmoozee_temp + root = { + NOT = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + } + } + + immediate = { + save_scope_as = schmoozer + scope:activity = { + ordered_attending_character = { + limit = { + NOR = { + government_has_flag = government_is_merchant + scope:schmoozee_1 ?= this + } + is_ruler = yes + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + order_by = highest_held_title_tier + check_range_bounds = no + max = 2 + if = { + limit = { exists = scope:schmoozee_1 } + save_scope_as = schmoozee_2 + } + else = { save_scope_as = schmoozee_1 } + } + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee_1 + months = 6 + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee_2 + months = 6 + } + } + + option = { + name = gdp_schmooze_events.1030.c + duel = { + value = decent_skill_rating + skill = diplomacy + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1030.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_schmooze_events.1030.c.success + left_icon = scope:schmoozee_1 + right_icon = scope:schmoozee_2 + gdp_log_schmooze_successful_empty_effect = { + CHAR = scope:schmoozer + MARKET = scope:province.barony.trade_market + } + reverse_add_opinion = { + target = scope:schmoozee_1 + modifier = impressed_opinion + opinion = 10 + } + reverse_add_opinion = { + target = scope:schmoozee_2 + modifier = impressed_opinion + opinion = 10 + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1030.c.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_schmooze_events.1030.c.failure + left_icon = scope:schmoozee_1 + right_icon = scope:schmoozee_2 + add_prestige = miniscule_prestige_loss + reverse_add_opinion = { + target = scope:schmoozee_1 + modifier = insulted_opinion + opinion = -20 + } + reverse_add_opinion = { + target = scope:schmoozee_2 + modifier = insulted_opinion + opinion = -20 + } + } + } + + } + ai_chance = { + base = 5 + modifier = { + diplomacy >= high_skill_rating + add = 45 + } + } + } + + option = { # Favor 1 + name = gdp_schmooze_events.1030.a + add_prestige = minor_prestige_gain + reverse_add_opinion = { + target = scope:schmoozee_1 + modifier = pleased_opinion + opinion = 15 + } + reverse_add_opinion = { + target = scope:schmoozee_2 + modifier = insulted_opinion + opinion = -15 + } + ai_chance = { + base = 10 + modifier = { + suzerain ?= scope:schmoozee_1 + add = 20 + } + } + } + + option = { # Favor 2 + name = gdp_schmooze_events.1030.b + add_prestige = minor_prestige_gain + reverse_add_opinion = { + target = scope:schmoozee_2 + modifier = pleased_opinion + opinion = 15 + } + reverse_add_opinion = { + target = scope:schmoozee_1 + modifier = insulted_opinion + opinion = -15 + } + ai_chance = { + base = 10 + modifier = { + suzerain ?= scope:schmoozee_2 + add = 20 + } + } + } + + option = { + name = gdp_schmooze_events.1030.d + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + } + ai_chance = { + base = 0 + } + } +} + +scripted_trigger gdp_schmooze_events_1050_schmoozee_trigger = { + is_landed = yes + NOR = { + this = root + scope:schmoozee_1 ?= this + scope:schmoozee_2 ?= this + } + any_held_trade_market = { + any_character_in_market = { this = root } + } + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } +} + +scripted_effect gdp_schmooze_events_1050_scope_effect = { + save_scope_as = schmoozee_$NUM$ + random_held_trade_market = { + limit = { + NOR = { + scope:market_1 ?= this + scope:market_2 ?= this + } + any_character_in_market = { this = root } + } + alternative_limit = { + any_character_in_market = { this = root } + } + add_to_list = markets_list + save_scope_as = market_$NUM$ + root = { + random_trade_route = { + limit = { + NOR = { + scope:route_1 ?= this + scope:route_2 ?= this + } + any_trade_market_on_route = { this = scope:market_$NUM$ } + } + alternative_limit = { + any_trade_market_on_route = { this = scope:market_$NUM$ } + } + save_scope_as = route_$NUM$ + } + } + } +} + +scripted_effect gdp_schmooze_events_1050_schmooze_effect = { + reverse_add_opinion = { + target = scope:schmoozee_$NUM$ + modifier = impressed_opinion + opinion = 15 + } + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee_$NUM$ + MARKET = scope:market_$NUM$ + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee_$NUM$ + months = 6 + } +} + +# Butter up market (dude) +gdp_schmooze_events.1050 = { + type = activity_event + title = gdp_schmooze_events.1050.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + involved_activity = { has_activity_type = activity_feast } + } + desc = gdp_schmooze_events.1050.feast + } + desc = gdp_schmooze_events.1050.hunt + } + desc = gdp_schmooze_events.1050.outro + triggered_desc = { + trigger = { exists = scope:schmoozee_3 } + desc = gdp_schmooze_events.1050.three + } + } + theme = trade + left_portrait = { + character = scope:schmoozee_1 + animation = happiness + } + center_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:schmoozee_2 + animation = admiration + } + lower_right_portrait = scope:schmoozee_3 + cooldown = { months = 1 } + override_background = { reference = ep2_involved_activity } + + trigger = { + has_activity_intent = schmooze_intent + scope:activity = { + any_attending_character = { + count >= 2 + gdp_schmooze_events_1050_schmoozee_trigger = yes + } + } + } + + immediate = { + save_scope_as = schmoozer + scope:activity = { + hidden_effect = { + while = { + count = 3 + random_attending_character = { + limit = { + gdp_schmooze_events_1050_schmoozee_trigger = yes + any_held_trade_market = { + any_character_in_market = { this = root } + NOR = { + scope:market_1 ?= this + scope:market_2 ?= this + } + } + } + alternative_limit = { gdp_schmooze_events_1050_schmoozee_trigger = yes } + weight = { + base = 1 + modifier = { add = highest_held_title_tier } + } + if = { + limit = { exists = scope:schmoozee_2 } + gdp_schmooze_events_1050_scope_effect = { NUM = 3 } + } + else_if = { + limit = { exists = scope:schmoozee_1 } + gdp_schmooze_events_1050_scope_effect = { NUM = 2 } + } + else = { + gdp_schmooze_events_1050_scope_effect = { NUM = 1 } + } + } + } + } + } + } + + option = { + name = gdp_schmooze_events.1050.a + add_prestige = minor_prestige_loss + gdp_schmooze_events_1050_schmooze_effect = { NUM = 1 } + ai_chance = { + base = 1 + modifier = { add = scope:route_1.age_in_months } + modifier = { add = scope:route_1.last_tick_profit } + ai_value_modifier = { + ai_energy = 0.25 + } + } + } + + option = { + name = gdp_schmooze_events.1050.b + add_prestige = minor_prestige_loss + gdp_schmooze_events_1050_schmooze_effect = { NUM = 2 } + ai_chance = { + base = 1 + modifier = { add = scope:route_2.age_in_months } + modifier = { add = scope:route_2.last_tick_profit } + ai_value_modifier = { + ai_energy = 0.25 + } + } + } + + option = { + name = gdp_schmooze_events.1050.c + trigger = { exists = scope:schmoozee_3 } + add_prestige = minor_prestige_loss + gdp_schmooze_events_1050_schmooze_effect = { NUM = 3 } + ai_chance = { + base = 1 + modifier = { add = scope:route_3.age_in_months } + modifier = { add = scope:route_3.last_tick_profit } + ai_value_modifier = { + ai_energy = 0.25 + } + } + } + + option = { + name = gdp_schmooze_events.1050.d + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_loss + content = minor_stress_impact_loss + diligent = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + ai_chance = { + base = 5 + ai_value_modifier = { + ai_energy = -0.5 + } + } + } +} + +# Clash with other schmoozer +gdp_schmooze_events.1060 = { + type = activity_event + title = gdp_schmooze_events.1060.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + involved_activity = { has_activity_type = activity_feast } + } + desc = gdp_schmooze_events.1060.feast + } + desc = gdp_schmooze_events.1060.hunt + } + desc = gdp_schmooze_events.1060.outro + } + theme = trade + left_portrait = { + character = root + animation = war_over_win + } + center_portrait = { + character = scope:schmoozee + animation = happiness + } + right_portrait = { + character = scope:rival + animation = admiration + } + cooldown = { months = 1 } + override_background = { reference = ep2_involved_activity } + + trigger = { + has_activity_intent = schmooze_intent + scope:activity = { + any_attending_character = { + NOT = { this = root } + has_activity_intent = schmooze_intent + exists = domicile + government_has_flag = government_is_merchant + save_temporary_scope_as = rival_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:rival_temp + } + } + } + } + any_attending_character = { + NOT = { this = root } + is_landed = yes + NOT = { government_has_flag = government_is_merchant } + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + } + } + + immediate = { + save_scope_as = schmoozer + scope:activity = { + random_attending_character = { + limit = { + NOT = { this = root } + has_activity_intent = schmooze_intent + exists = domicile + government_has_flag = government_is_merchant + save_temporary_scope_as = rival_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:rival_temp + } + } + } + } + save_scope_as = rival + } + random_attending_character = { + limit = { + NOR = { + this = root + scope:rival ?= this + } + is_landed = yes + NOT = { government_has_flag = government_is_merchant } + save_temporary_scope_as = schmoozee_temp + NOT = { + root = { + is_target_in_variable_list = { + name = schmoozed + target = scope:schmoozee_temp + } + } + } + } + save_scope_as = schmoozee + } + } + } + + option = { # Detract + name = gdp_schmooze_events.1060.a + trigger = { + has_bigger_company_than_trigger = { OTHER = scope:rival } + } + reason = have_bigger_company + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + scope:schmoozee = { + add_opinion = { + target = scope:rival + modifier = disrespect_opinion + opinion = -15 + } + } + reverse_add_opinion = { + target = scope:rival + modifier = disrespect_opinion + opinion = -15 + } + add_to_variable_list = { + name = schmoozed + target = scope:rival + months = 6 + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + ai_chance = { + base = 150 + } + } + + option = { # Detract duel + name = gdp_schmooze_events.1060.a + trigger = { + NOT = { + has_bigger_company_than_trigger = { OTHER = scope:rival } + } + } + duel = { + skill = diplomacy + target = scope:rival + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1060.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_schmooze_events.1060.a.success + left_icon = scope:schmoozee + right_icon = scope:rival + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + scope:schmoozee = { + add_opinion = { + target = scope:rival + modifier = disrespect_opinion + opinion = -15 + } + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + modifier = { + add = 10 + has_smaller_company_than_trigger = { OTHER = scope:rival } + } + min = 5 + desc = gdp_schmooze_events.1060.a.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_schmooze_events.1060.a.failure + left_icon = scope:schmoozee + right_icon = scope:rival + gdp_log_schmooze_successful_effect = { + CHAR = scope:rival + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + scope:schmoozee = { + add_opinion = { + target = root + modifier = disrespect_opinion + opinion = -15 + } + } + } + } + } + add_to_variable_list = { + name = schmoozed + target = scope:rival + months = 6 + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_gain + forgiving = minor_stress_impact_gain + vengeful = minor_stress_impact_loss + } + ai_chance = { + base = 25 + modifier = { + diplomacy >= decent_skill_rating + add = 25 + } + ai_value_modifier = { + ai_boldness = 0.5 + } + } + } + + option = { # Show acumen + name = gdp_schmooze_events.1060.b + duel = { + skill = stewardship + value = decent_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1060.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_schmooze_events.1060.b.success + left_icon = scope:schmoozee + right_icon = scope:rival + gdp_log_schmooze_successful_effect = { + CHAR = scope:schmoozer + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + reverse_add_opinion = { + target = scope:schmoozee + modifier = impressed_opinion + opinion = 15 + } + reverse_add_opinion = { + target = scope:rival + modifier = annoyed_opinion + opinion = -15 + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_schmooze_events.1060.b.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_schmooze_events.1060.b.failure + left_icon = scope:schmoozee + right_icon = scope:rival + add_prestige = minor_prestige_loss + gdp_log_schmooze_successful_effect = { + CHAR = scope:rival + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + reverse_add_opinion = { + target = scope:schmoozee + modifier = contempt_opinion + opinion = -15 + } + } + } + } + add_to_variable_list = { + name = schmoozed + target = scope:rival + months = 6 + } + add_to_variable_list = { + name = schmoozed + target = scope:schmoozee + months = 6 + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + humble = minor_stress_impact_gain + just = minor_stress_impact_loss + } + ai_chance = { + base = 25 + modifier = { + stewardship >= decent_skill_rating + add = 25 + } + ai_value_modifier = { + ai_energy = 0.5 + } + } + } + + option = { # Cut short (opt out) + name = gdp_schmooze_events.1060.c + add_prestige = minor_prestige_gain + gdp_log_schmooze_successful_effect = { + CHAR = scope:rival + TARGET = scope:schmoozee + MARKET = scope:province.barony.trade_market + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + deceitful = minor_stress_impact_loss + shy = minor_stress_impact_gain + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_boldness = -0.25 + ai_energy = -0.25 + } + } + } +} diff --git a/events/dlc/gdp/gdp_merchant_trade_opportunity_events.txt b/events/dlc/gdp/gdp_merchant_trade_opportunity_events.txt new file mode 100644 index 000000000..2c1634465 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_trade_opportunity_events.txt @@ -0,0 +1,6780 @@ +namespace = gdp_merchant_trade_opportunity + +################################################## +# GENERAL SCRIPTED TRIGGERS & EFFECTS + +# Syncs stress lost from successfully completing a trade deal scheme. +scripted_effect merchant_base_contract_schemes_acknowledge_success_stress_effect = { + stress_and_fulfillment_impact = { arrogant = minor_stress_impact_loss } +} + +# Syncs stress gained from failing a trade deal scheme. +scripted_effect merchant_base_contract_schemes_acknowledge_failure_stress_effect = { + if = { + limit = { scope:task_contract_tier >= 2 } + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_gain + humble = minor_stress_impact_loss + arrogant = minor_stress_impact_gain + } + } +} + +scripted_effect save_trade_opportunity_contract_scopes_effect = { + scope:task_contract = { + task_contract_target ?= { save_scope_as = task_contract_target } + task_contract_employer ?= { save_scope_as = associate } + var:task_contract_trade_good ?= { save_scope_as = trade_good_type } + var:task_contract_trade_category ?= { save_scope_as = trade_good_category } + task_contract_location = { + save_scope_as = task_contract_location + save_scope_as = destination + barony ?= { + save_scope_as = task_contract_title + trade_market = { save_scope_as = local_market } + } + } + } +} + +#### +# gdp_merchant_trade_opportunity.0001-0010 - Challenge Competitor +### + +gdp_merchant_trade_opportunity.0001 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0001.t + desc = gdp_merchant_trade_opportunity.0001.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + lower_right_portrait = scope:task_contract_target + + trigger = { + scope:task_contract = { + has_task_contract_type = challenge_competitor + exists = task_contract_target + } + scope:task_contract.task_contract_target = { is_alive = yes } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_challenge_competitor_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_target.primary_title + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0001.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0001.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_scribe + # Speed. + add_agent_slot = agent_overseer + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0001.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_gabbler + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0002 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0002.t + desc = gdp_merchant_trade_opportunity.0002.desc + theme = trade + center_portrait = { + character = root + animation = war_over_tie + } + right_portrait = { + character = scope:target_title.holder + animation = dismissal + } + override_background = { reference = sitting_room } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + } + + # Diplo + option = { + name = gdp_merchant_trade_opportunity.0002.b + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + trigger = { + custom_tooltip = { + text = gdp_merchant_trade_opportunity.0002.b.tt + OR = { + has_relation_friend = scope:target_title.holder + is_spouse_of = scope:target_title.holder + diplomacy >= high_skill_rating + } + NOR = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:target_title.holder } + house_has_feud_relation_with_trigger = { TARGET = scope:target_title.holder } + } + } + } + show_as_unavailable = { always = yes } + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Antag + option = { + name = gdp_merchant_trade_opportunity.0002.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0003 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0003.t + desc = gdp_merchant_trade_opportunity.0003.desc + theme = trade + center_portrait = { + character = root + animation = disgust + } + right_portrait = { + character = scope:target_title.holder + animation = dismissal + } + override_background = { reference = courtyard } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0003.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0004 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0002 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0003 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0011-0020 - Promote Goods +### + +gdp_merchant_trade_opportunity.0011 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0011.t + desc = gdp_merchant_trade_opportunity.0011.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + lower_right_portrait = scope:associate + + trigger = { + scope:task_contract = { has_task_contract_type = promote_goods } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_promote_goods_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0011.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0011.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_scribe + # Speed. + add_agent_slot = agent_overseer + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0011.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_socialite + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0012 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0012.t + desc = gdp_merchant_trade_opportunity.0012.desc + theme = trade + center_portrait = { + character = root + animation = steward + } + override_background = { reference = sitting_room } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0012.a + trigger = { scope:scheme_success_type ?= flag:success_critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0012.b + trigger = { + NOT = { scope:scheme_success_type ?= flag:success_critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0013 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0013.t + desc = gdp_merchant_trade_opportunity.0013.desc + theme = trade + center_portrait = { + character = root + animation = dismissal + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0013.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0014 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0012 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0013 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0021-0030 - Market Investment +### + +gdp_merchant_trade_opportunity.0021 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0021.t + desc = gdp_merchant_trade_opportunity.0021.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + right_portrait = { + character = scope:task_contract_title.county.holder + animation = idle + } + + trigger = { + scope:task_contract = { has_task_contract_type = market_investment } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_market_investment_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0021.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0021.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_scribe + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0021.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_socialite + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0022 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0022.t + desc = gdp_merchant_trade_opportunity.0022.desc + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + right_portrait = { + character = scope:local_ruler + animation = interested + } + override_background = { reference = sitting_room } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract.task_contract_location.county.holder ?= { save_scope_as = local_ruler } + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0022.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + } +} + +gdp_merchant_trade_opportunity.0023 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0023.t + desc = gdp_merchant_trade_opportunity.0023.desc + theme = trade + center_portrait = { + character = root + animation = war_over_loss + } + right_portrait = { + character = scope:target_title.holder + animation = dismissal + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + } + + # Pay. + option = { + name = gdp_merchant_trade_opportunity.0023.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0023.b + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = failure_standard } + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0024 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0022 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0023 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0031-0040 - Exploit Upheaval +### + +gdp_merchant_trade_opportunity.0031 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0031.t + desc = gdp_merchant_trade_opportunity.0031.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + + trigger = { + scope:task_contract = { has_task_contract_type = exploit_upheaval } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_exploit_upheaval_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0031.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_thug + add_agent_slot = agent_muscle + add_agent_slot = agent_bodyguard + # Speed. + add_agent_slot = agent_footpad + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0031.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_thug + add_agent_slot = agent_muscle + add_agent_slot = agent_bodyguard + add_agent_slot = agent_bailiff + # Speed. + add_agent_slot = agent_footpad + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0031.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_thug + add_agent_slot = agent_muscle + # Speed. + add_agent_slot = agent_footpad + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0032 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0032.t + desc = gdp_merchant_trade_opportunity.0032.desc + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + override_background = { reference = sitting_room } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0032.a + trigger = { scope:scheme_success_type ?= flag:success_critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0032.b + trigger = { + NOT = { scope:scheme_success_type ?= flag:success_critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0033 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0033.t + desc = gdp_merchant_trade_opportunity.0033.desc + theme = trade + center_portrait = { + character = root + animation = disappointed + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0033.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0034 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0032 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0033 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0041-0050 - Support Guilds +### + +gdp_merchant_trade_opportunity.0041 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0041.t + desc = gdp_merchant_trade_opportunity.0041.desc + theme = trade + left_portrait = { + character = root + animation = steward + } + + trigger = { + scope:task_contract = { has_task_contract_type = support_guilds } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_support_guilds_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0041.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_appraiser + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_gabbler + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0041.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_appraiser + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_broker + add_agent_slot = agent_scribe + # Speed. + add_agent_slot = agent_gabbler + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0041.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_appraiser + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_gabbler + add_agent_slot = agent_messenger + add_agent_slot = agent_socialite + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0042 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0042.t + desc = gdp_merchant_trade_opportunity.0042.desc + theme = trade + center_portrait = { + character = root + animation = pondering + } + right_portrait = { + character = scope:inspired_artisan + animation = thinking + } + override_background = { reference = sitting_room } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location.duchy = { save_scope_as = contract_duchy } + } + # Inspiration + scope:contract_duchy = { + every_de_jure_county = { + every_county_province = { + save_temporary_scope_as = province_temp + every_pool_character = { + province = scope:province_temp + limit = { + age >= 20 + is_lowborn = yes + is_clergy = no + health >= fine_health + sum_of_all_skills_value >= 15 + NOR = { + has_trait = peasant_leader + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + trigger_if = { # Existing relevant inspiration without sponsor + limit = { exists = inspiration } + inspiration = { + has_inspiration_type = artisan_inspiration + NOT = { exists = inspiration_sponsor } + } + } + } + add_to_list = pool_list + } + } + } + } + random_in_list = { + list = pool_list + limit = { exists = inspiration } + alternative_limit = { culture = { has_cultural_parameter = improved_artisan_inspiration } } + alternative_limit = { always = yes } + weight = { + base = 1 + modifier = { add = stewardship } + modifier = { + add = { + value = learning + divide = 2 + } + } + } + save_scope_as = inspired_artisan + inspiration ?= { save_scope_as = new_inspiration } + } + if = { + limit = { NOT = { exists = scope:inspired_artisan } } + create_character = { + template = local_artisan_template + location = scope:contract_duchy.title_capital_county.title_province + gender_female_chance = location_faith_dominant_gender_female_chance + save_scope_as = inspired_artisan + } + } + if = { + limit = { NOT = { exists = scope:new_inspiration } } + hidden_effect = { + scope:inspired_artisan = { + # needed for artisan_inspiration on_creation + add_character_flag = support_guilds_inspiration + create_inspiration = artisan_inspiration + remove_character_flag = support_guilds_inspiration + } + } + } + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Hire artisan. + option = { + name = gdp_merchant_trade_opportunity.0042.b + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + trigger = { + exists = scope:inspired_artisan + exists = scope:new_inspiration + } + add_prestige = { + value = minor_prestige_gain + multiply = trade_opportunity_contract_tier_value + } + add_courtier = scope:inspired_artisan + hidden_effect = { + reverse_add_opinion = { + target = scope:inspired_artisan + modifier = recruited_me_opinion + opinion = 50 + } + } + sponsor_inspiration = scope:new_inspiration + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0042.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + } +} + +gdp_merchant_trade_opportunity.0043 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0043.t + desc = gdp_merchant_trade_opportunity.0043.desc + theme = trade + center_portrait = { + character = root + animation = war_over_loss + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0043.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = failure_standard } + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0044 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0042 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0043 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0051-0060 - Seek Debtors +### + +gdp_merchant_trade_opportunity.0051 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0051.t + desc = gdp_merchant_trade_opportunity.0051.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + + trigger = { + scope:task_contract = { has_task_contract_type = seek_debtors } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_seek_debtors_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0051.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0051.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0051.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_gabbler + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +scripted_trigger gdp_seek_debtors_potential_debtor_trigger = { + save_temporary_scope_as = debtor_temp + is_ai = yes + is_adult = yes + scope:task_contract.task_contract_taker = { + OR = { + can_add_hook = { + target = scope:debtor_temp + type = indebted_hook + } + has_hook_of_type = { + target = scope:debtor_temp + type = indebted_hook + } + } + } +} + +scripted_effect gdp_seek_debtors_list_effect = { + if = { + limit = { gdp_seek_debtors_potential_debtor_trigger = yes } + add_to_list = potential_debtors + } +} + +scripted_effect gdp_seek_debtors_find_debtor_effect = { + scope:task_contract.task_contract_location.duchy ?= { + holder ?= { + gdp_seek_debtors_list_effect = yes + primary_heir ?= { gdp_seek_debtors_list_effect = yes } + } + every_in_de_jure_hierarchy = { + holder ?= { + gdp_seek_debtors_list_effect = yes + primary_heir ?= { gdp_seek_debtors_list_effect = yes } + } + } + } + random_in_list = { + list = potential_debtors + limit = { + OR = { + highest_held_title_tier >= tier_county + AND = { + is_ruler = no + primary_heir ?= { highest_held_title_tier >= tier_county } + } + } + } + alternative_limit = { always = yes } + weight = { + base = 1 + modifier = { + add = { + value = 1 + add = highest_held_title_tier + multiply = 100 + } + } + modifier = { + is_ruler = no + add = { + value = 1 + ordered_heir_title = { + order_by = tier + add = tier + } + multiply = 75 + } + } + modifier = { + exists = capital_county + add = capital_county.prosperity_level + } + modifier = { + gold < 0 + factor = 4 + } + modifier = { + has_trait = improvident + add = 50 + } + modifier = { + has_trait = profligate + add = 25 + } + modifier = { + is_at_war = yes + add = 50 + } + } + save_scope_as = debtor + save_scope_as = bg_override_char + } +} + +gdp_merchant_trade_opportunity.0052 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0052.t + desc = gdp_merchant_trade_opportunity.0052.desc + theme = trade + center_portrait = { + character = root + animation = steward + } + right_portrait = { + character = scope:debtor + animation = worry + } + override_background = { reference = sitting_room } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + # Find appropriate debtor + gdp_seek_debtors_find_debtor_effect = yes + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0052.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + trigger = { exists = scope:debtor } + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + pay_short_term_gold = { + target = scope:debtor + gold = scope:debtor.medium_gold_value + } + if = { + limit = { + can_add_hook = { + target = scope:debtor + type = indebted_hook + } + } + add_hook = { + target = scope:debtor + type = indebted_hook + } + } + else = { + hidden_effect = { + remove_hook = { + target = scope:debtor + type = indebted_hook + } + } + add_hook = { + target = scope:debtor + type = strong_indebted_hook + } + } + } + + # Renege. + option = { + name = gdp_merchant_trade_opportunity.0052.b + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + progress_towards_rival_effect = { + REASON = rival_refused_credit + CHARACTER = scope:debtor + OPINION = 0 + } + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0053 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0053.t + desc = gdp_merchant_trade_opportunity.0053.desc + theme = trade + center_portrait = { + character = root + animation = stunned + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0053.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0054 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0052 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0053 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0061-0070 - Sabotage Competition +### + +scripted_trigger trade_opportunity_trader_travelling_to_contract_trigger = { + current_travel_plan ?= { final_destination_province = scope:task_contract_location } + location != scope:task_contract_location +} + +gdp_merchant_trade_opportunity.0061 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0061.t + desc = gdp_merchant_trade_opportunity.0061.desc + theme = trade + left_portrait = { + character = root + animation = schadenfreude + } + right_portrait = { + trigger = { + scope:contract_employer ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:contract_employer + animation = flirtation + } + lower_left_portrait = { + trigger = { + scope:contract_employer ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:contract_employer + } + lower_right_portrait = scope:task_contract_target + + trigger = { + scope:task_contract = { + has_task_contract_type = sabotage_competition + task_contract_target = { is_alive = yes } + } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + scope:task_contract.task_contract_employer = { save_scope_as = contract_employer } # Save the employer + scope:task_contract.task_contract_location.county.holder = { save_scope_as = market_owner } + scope:task_contract_target = { + random_trade_route = { + limit = { + any_trade_market_on_route = { + trade_market_owner.title_province = scope:task_contract.task_contract_location + } + } + random_traded_good = { save_scope_as = trade_good_type } + } + } + start_scheme = { + type = merchant_sabotage_competition_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_target.primary_title + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0061.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0061.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0061.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_gabbler + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0062 = { # sucess + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0062.t + desc = gdp_merchant_trade_opportunity.0062.desc + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + right_portrait = { + character = scope:target_title.holder + animation = disbelief + } + override_background = { reference = sitting_room } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + if = { + limit = { scope:scheme_success_type ?= flag:success_critical } + scope:task_contract = { complete_task_contract = success_critical } + } + else = { + scope:task_contract = { complete_task_contract = success_standard } + } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0062.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + } +} + +gdp_merchant_trade_opportunity.0063 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0063.t + desc = gdp_merchant_trade_opportunity.0063.desc + theme = trade + center_portrait = { + character = root + animation = dismissal + } + right_portrait = { + character = scope:target_title.holder + animation = chancellor + } + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0063.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0064 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0062 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0063 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0071-0080 - Build Connections +### + +gdp_merchant_trade_opportunity.0071 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0071.t + desc = gdp_merchant_trade_opportunity.0071.desc + theme = trade + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + trigger = { + scope:contract_employer ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:contract_employer + animation = holding_tally_stick + } + lower_left_portrait = { + trigger = { + scope:contract_employer ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:contract_employer + } + + trigger = { + scope:task_contract = { has_task_contract_type = build_category_connections } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + scope:task_contract.task_contract_employer = { save_scope_as = contract_employer } # Save the employer + start_scheme = { + type = merchant_build_category_connections_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0071.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0071.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_scribe + # Speed. + add_agent_slot = agent_overseer + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0071.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_bailiff + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_socialite + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0072 = { # sucess + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0072.t + desc = gdp_merchant_trade_opportunity.0072.desc + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + right_portrait = { + character = scope:associate + animation = holding_tally_stick + } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + save_trade_opportunity_contract_scopes_effect = yes + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0072.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + } +} + +gdp_merchant_trade_opportunity.0073 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0073.t + desc = gdp_merchant_trade_opportunity.0073.desc + theme = trade + center_portrait = { + character = root + animation = dismissal + } + right_portrait = { + character = scope:associate + animation = shame + } + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + save_trade_opportunity_contract_scopes_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0073.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0074 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0072 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0073 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0081-0090 - Disrupt Charter +### + +gdp_merchant_trade_opportunity.0081 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0081.t + desc = gdp_merchant_trade_opportunity.0081.desc + theme = trade + left_portrait = { + character = root + animation = schadenfreude + } + right_portrait = { + trigger = { + scope:contract_employer ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:contract_employer + animation = flirtation + } + lower_left_portrait = { + trigger = { + scope:contract_employer ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:contract_employer + } + lower_center_portrait = scope:contract_target + lower_right_portrait = scope:contract_target.suzerain + override_background = { reference = study } + + trigger = { + scope:task_contract = { + has_task_contract_type = disrupt_charter + task_contract_target ?= { is_alive = yes } + } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + scope:task_contract = { + task_contract_employer = { save_scope_as = contract_employer } # Save the employer + task_contract_target = { save_scope_as = contract_target } # Save the target + } + start_scheme = { + type = merchant_disrupt_charter_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:contract_target.primary_title + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0081.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0081.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + add_agent_slot = agent_muscle + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0081.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_broker + add_agent_slot = agent_bailiff + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_gabbler + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0082 = { # sucess + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0082.t + desc = gdp_merchant_trade_opportunity.0082.desc + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + right_portrait = { + character = scope:associate + animation = schadenfreude + } + lower_center_portrait = scope:target_title.holder.suzerain + lower_right_portrait = scope:target_title.holder + override_background = { reference = sitting_room } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + if = { + limit = { scope:scheme_success_type ?= flag:success_critical } + scope:task_contract = { complete_task_contract = success_critical } + } + else = { + scope:task_contract = { complete_task_contract = success_standard } + } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0082.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + } +} + +gdp_merchant_trade_opportunity.0083 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0083.t + desc = gdp_merchant_trade_opportunity.0083.desc + theme = trade + center_portrait = { + character = root + animation = dismissal + } + right_portrait = { + character = scope:associate + animation = chancellor + } + lower_center_portrait = scope:target_title.holder.suzerain + lower_right_portrait = scope:target_title.holder + override_background = { reference = courtyard } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0083.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0084 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0082 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0083 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0091-0100 - Alleviate Upheaval +### + +gdp_merchant_trade_opportunity.0091 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0091.t + desc = gdp_merchant_trade_opportunity.0091.desc + theme = trade + left_portrait = { + character = root + animation = sadness + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = worry + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + + trigger = { + scope:task_contract = { has_task_contract_type = alleviate_upheaval } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_alleviate_upheaval_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0091.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0091.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0091.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_supplier + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0092 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0092.t + desc = { + desc = gdp_merchant_trade_opportunity.0092.desc + random_valid = { + triggered_desc = { + trigger = { + scope:destination.barony.trade_market = { + OR = { + has_trade_market_modifier = gdp_market_recently_sieged_capacity_modifier + has_trade_market_modifier = gdp_market_recently_raided_capacity_modifier + has_trade_market_modifier = gdp_market_army_movement_capacity_modifier + } + } + } + desc = gdp_merchant_trade_opportunity.0092.war + } + triggered_desc = { + trigger = { + scope:destination.barony.trade_market = { + OR = { + has_trade_market_modifier = gdp_natural_disaster_1_trade_modifier + has_trade_market_modifier = gdp_natural_disaster_2_trade_modifier + has_trade_market_modifier = gdp_natural_disaster_3_trade_modifier + } + } + } + desc = gdp_merchant_trade_opportunity.0092.disaster + } + triggered_desc = { + trigger = { + scope:destination.barony.trade_market = { + OR = { + has_trade_market_modifier = gdp_epidemic_1_trade_modifier + has_trade_market_modifier = gdp_epidemic_2_trade_modifier + has_trade_market_modifier = gdp_epidemic_3_trade_modifier + } + } + } + desc = gdp_merchant_trade_opportunity.0092.epidemic + } + } + desc = gdp_merchant_trade_opportunity.0092.closing + } + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + override_background = { reference = market } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + random = { + chance = { + value = 5 + add = { + value = scope:task_contract.scheme.scheme_success_chance + divide = 2 + } + add = { + value = root.stewardship + multiply = 5 + } + } + save_scope_as = critical + } + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0092.a + trigger = { exists = scope:critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0092.a + trigger = { + NOT = { exists = scope:critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0093 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0093.t + desc = gdp_merchant_trade_opportunity.0093.desc + theme = trade + center_portrait = { + character = root + animation = disappointed + } + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0093.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0094 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0092 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0093 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0101-0110 - Silk Road Network +### + +gdp_merchant_trade_opportunity.0101 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0101.t + desc = gdp_merchant_trade_opportunity.0101.desc + theme = trade + left_portrait = { + character = root + animation = trade_deal + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = thinking + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + + trigger = { + scope:task_contract = { has_task_contract_type = silk_road_network } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_silk_road_network_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0101.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0101.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0101.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_supplier + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0102 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0102.t + desc = gdp_merchant_trade_opportunity.0102.desc + theme = trade + center_portrait = { + character = root + animation = war_over_win + } + override_background = { reference = market } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + random = { + chance = { + value = 5 + add = { + value = scope:task_contract.scheme.scheme_success_chance + divide = 2 + } + add = { + value = root.stewardship + multiply = 5 + } + } + save_scope_as = critical + } + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0102.a + trigger = { exists = scope:critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0102.a + trigger = { + NOT = { exists = scope:critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0103 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0103.t + desc = gdp_merchant_trade_opportunity.0103.desc + theme = trade + center_portrait = { + character = root + animation = disappointed + } + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0103.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0104 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0102 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0103 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0111-0120 - Silk Road Caravan +### + +gdp_merchant_trade_opportunity.0111 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0111.t + desc = gdp_merchant_trade_opportunity.0111.desc + theme = trade + left_portrait = { + character = root + animation = trade_deal + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = thinking + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + + trigger = { + scope:task_contract = { has_task_contract_type = silk_road_caravan } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_silk_road_caravan_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0111.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0111.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0111.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_supplier + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0112 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0112.t + desc = gdp_merchant_trade_opportunity.0112.desc + theme = trade + center_portrait = { + character = root + animation = dromedary_petting + camera = camera_event_dromedary_leading_left_forward_centered + } + override_background = { reference = market } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + random = { + chance = { + value = 5 + add = { + value = scope:task_contract.scheme.scheme_success_chance + divide = 2 + } + add = { + value = root.stewardship + multiply = 5 + } + } + save_scope_as = critical + } + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0112.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + trigger = { exists = scope:critical } + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0112.a + trigger = { + NOT = { exists = scope:critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0113 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0113.t + desc = gdp_merchant_trade_opportunity.0113.desc + theme = trade + center_portrait = { + character = root + animation = disappointed + } + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0113.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0114 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0112 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0113 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0121-0130 - Entrepot Buy +### + +gdp_merchant_trade_opportunity.0121 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0121.t + desc = gdp_merchant_trade_opportunity.0121.desc + theme = trade + left_portrait = { + character = root + animation = trade_deal + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = thinking + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + + trigger = { + scope:task_contract = { has_task_contract_type = entrepot_buy } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_entrepot_buy_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0121.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0121.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0121.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_supplier + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0122 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0122.t + desc = gdp_merchant_trade_opportunity.0122.desc + theme = trade + center_portrait = { + character = root + animation = holding_tally_stick + } + override_background = { reference = market } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + random = { + chance = { + value = 5 + add = { + value = scope:task_contract.scheme.scheme_success_chance + divide = 2 + } + add = { + value = root.stewardship + multiply = 5 + } + } + save_scope_as = critical + } + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0122.a + trigger = { exists = scope:critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0122.a + trigger = { + NOT = { exists = scope:critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0123 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0123.t + desc = gdp_merchant_trade_opportunity.0123.desc + theme = trade + center_portrait = { + character = root + animation = stress + } + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0123.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0124 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0122 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0123 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0131-0140 - Entrepot Sell +### + +gdp_merchant_trade_opportunity.0131 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0131.t + desc = gdp_merchant_trade_opportunity.0131.desc + theme = trade + left_portrait = { + character = root + animation = trade_deal + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = thinking + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + + trigger = { + scope:task_contract = { has_task_contract_type = entrepot_sell } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_entrepot_sell_trade_opportunity_scheme + contract = scope:task_contract + target_title = scope:task_contract_title.duchy + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0131.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0131.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_wrangler + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_overseer + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0131.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_scribe + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_overseer + add_agent_slot = agent_messenger + add_agent_slot = agent_supplier + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0132 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0132.t + desc = gdp_merchant_trade_opportunity.0132.desc + theme = trade + center_portrait = { + character = root + animation = holding_tally_stick + } + override_background = { reference = market } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + random = { + chance = { + value = 5 + add = { + value = scope:task_contract.scheme.scheme_success_chance + divide = 2 + } + add = { + value = root.stewardship + multiply = 5 + } + } + save_scope_as = critical + } + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0132.a + trigger = { exists = scope:critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0132.a + trigger = { + NOT = { exists = scope:critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0133 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0133.t + desc = gdp_merchant_trade_opportunity.0133.desc + theme = trade + center_portrait = { + character = root + animation = stress + } + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0133.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0134 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0132 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0133 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0141-0150 - Negotiate Tolls +### + +gdp_merchant_trade_opportunity.0141 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0141.t + desc = gdp_merchant_trade_opportunity.0141.desc + theme = trade + left_portrait = { + character = root + animation = trade_deal + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = thinking + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + lower_center_portrait = scope:task_contract.task_contract_target + + trigger = { + scope:task_contract = { has_task_contract_type = negotiate_tolls } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_negotiate_tolls_trade_opportunity_scheme + contract = scope:task_contract + target_character = scope:task_contract_target + } + scope:task_contract.scheme = { save_scope_as = task_contract_scheme } # save scheme + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0141.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_diplomat + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_scribe + # Speed. + add_agent_slot = agent_socialite + add_agent_slot = agent_messenger + } + + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0141.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_diplomat + add_agent_slot = agent_bookkeeper + add_agent_slot = agent_scribe + add_agent_slot = agent_broker + # Speed. + add_agent_slot = agent_socialite + } + + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0141.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_diplomat + add_agent_slot = agent_bookkeeper + # Speed. + add_agent_slot = agent_socialite + add_agent_slot = agent_messenger + add_agent_slot = agent_supplier + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0142 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0142.t + desc = gdp_merchant_trade_opportunity.0142.desc + theme = trade + center_portrait = { + character = root + animation = holding_tally_stick + } + override_background = { reference = market } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + task_contract_target ?= { save_scope_as = task_contract_target } + } + if = { + limit = { scope:task_contract.var:task_contract_market.market_toll_level_minus_2_value != scope:task_contract.var:task_contract_market.market_toll_level_minus_1_value } + random = { + chance = { + value = 5 + add = { + value = scope:task_contract.scheme.scheme_success_chance + divide = 2 + } + add = { + value = root.diplomacy + multiply = 5 + } + } + save_scope_as = critical + } + } + } + + # Double down. + option = { + name = gdp_merchant_trade_opportunity.0142.a + trigger = { exists = scope:critical } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_critical } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0142.a + trigger = { + NOT = { exists = scope:critical } + } + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0143 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0143.t + desc = gdp_merchant_trade_opportunity.0143.desc + theme = trade + center_portrait = { + character = root + animation = stress + } + override_background = { reference = throne_room } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + task_contract_target = { save_scope_as = bg_override_char } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0143.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0144 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0142 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0143 + } + } +} + +#### +# gdp_merchant_trade_opportunity.0151-0160 - Smuggle Goods +### + +gdp_merchant_trade_opportunity.0151 = { # intro + type = character_event + title = gdp_merchant_trade_opportunity.0151.t + desc = gdp_merchant_trade_opportunity.0151.desc + theme = trade + left_portrait = { + character = root + animation = trade_deal + } + right_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = no } + } + character = scope:associate + animation = thinking + } + lower_left_portrait = { + trigger = { + scope:associate ?= { trade_opportunity_trader_travelling_to_contract_trigger = yes } + } + character = scope:associate + } + lower_center_portrait = scope:owner + + trigger = { + scope:task_contract = { has_task_contract_type = smuggle_goods } + } + + immediate = { + save_trade_opportunity_contract_scopes_effect = yes + start_scheme = { + type = merchant_smuggle_goods_trade_opportunity_scheme + contract = scope:task_contract + target_character = scope:task_contract_title.county.holder + } + scope:task_contract = { + scheme = { save_scope_as = task_contract_scheme } # save scheme + var:task_contract_market = { + trade_market_owner.county.holder = { save_scope_as = owner } + } + } + } + + # Go for a balanced agent mix. + option = { + name = gdp_merchant_trade_opportunity.0151.d + reason = give_me_balanced_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_BALANCED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_muscle + add_agent_slot = agent_scout + # Speed. + add_agent_slot = agent_planner + add_agent_slot = agent_supplier + # Secrecy. + add_agent_slot = agent_lookout + } + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Focus on success chance agents. + option = { + name = gdp_merchant_trade_opportunity.0151.a + reason = give_me_success_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SUCCESS + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_muscle + add_agent_slot = agent_scout + add_agent_slot = agent_thug + # Speed. + add_agent_slot = agent_planner + # Secrecy. + add_agent_slot = agent_lookout + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on speedy agents. + option = { + name = gdp_merchant_trade_opportunity.0151.b + reason = give_me_speed_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SPEED + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_muscle + # Speed. + add_agent_slot = agent_planner + add_agent_slot = agent_supplier + add_agent_slot = agent_messenger + # Secrecy. + add_agent_slot = agent_lookout + } + # No stress, we're just selecting our starter batch. + # AI always picks the balanced config. + } + + # Focus on secrecy agents. + option = { + name = gdp_merchant_trade_opportunity.0151.c + reason = give_me_secrecy_agents + flavor = EVENT_WINDOW_OPTION_AGENTS_SECRECY + scope:task_contract_scheme ?= { + # Success. + add_agent_slot = agent_muscle + # Speed. + add_agent_slot = agent_planner + # Secrecy. + add_agent_slot = agent_lookout + add_agent_slot = agent_alibi + add_agent_slot = agent_decoy + } + # No stress, we're just selecting our starter batch. + # AI always selects balanced agents. + ai_chance = { base = 1000 } + } + + # Now show us the panel. + after = { + open_view = { + view = intrigue_window + player = root + } + } +} + +gdp_merchant_trade_opportunity.0152 = { # success + type = character_event + window = scheme_successful_event + title = gdp_merchant_trade_opportunity.0152.t + desc = gdp_merchant_trade_opportunity.0152.desc + theme = trade + center_portrait = { + character = root + animation = lantern + } + lower_right_portrait = scope:target + override_background = { reference = alley_night } + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + task_contract_target = { save_scope_as = target } + } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0152.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + scope:task_contract = { complete_task_contract = success_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } +} + +gdp_merchant_trade_opportunity.0153 = { # failure + type = character_event + window = scheme_failed_event + title = gdp_merchant_trade_opportunity.0153.t + desc = gdp_merchant_trade_opportunity.0153.desc + theme = trade + center_portrait = { + character = root + animation = stress + } + lower_right_portrait = scope:target + override_background = { reference = market } + + immediate = { + merchant_base_trade_opportunity_schemes_set_up_outcome_immediate_effect = yes + scope:task_contract = { + task_contract_location = { save_scope_as = destination } + task_contract_target = { save_scope_as = target } + } + scope:task_contract = { complete_task_contract = failure_standard } + # And wrap things up. + scope:scheme ?= { end_scheme = yes } + } + + # Acknowledge. + option = { + name = gdp_merchant_trade_opportunity.0153.a + flavor = merchant_base_trade_opportunity_schemes.0000.f.contract_concluded + merchant_base_contract_schemes_acknowledge_failure_stress_effect = yes + } +} + +gdp_merchant_trade_opportunity.0154 = { # result roll + hidden = yes + + immediate = { + roll_scheme_success_or_failure_effect = { + SUCCESS_EVENT = gdp_merchant_trade_opportunity.0152 + FAILURE_EVENT = gdp_merchant_trade_opportunity.0153 + } + } +} + +################################################## +# Trade Opportunity Pool Events +# 1001 - 2000 +################################################## + +# Local ruler gets in the way +gdp_merchant_trade_opportunity.1001 = { + type = character_event + title = gdp_merchant_trade_opportunity.1001.t + desc = gdp_merchant_trade_opportunity.1001.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + lower_center_portrait = scope:local_ruler + lower_right_portrait = scope:other_merchant + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:local_ruler ?= { + is_available_quick = { + ai = yes + alive = yes + adult = yes + imprisoned = no + incapable = no + in_army = no + } + opinion = { + target = root + value < 50 + } + } + trigger_if = { + limit = { exists = suzerain } + suzerain != scope:local_ruler + } + NOT = { + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + scope:scheme = { + scheme_agent_charges > 1 + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1001 } + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1001 } + scope:local_market ?= { + # Search current market first + random_character_in_market = { + limit = { + is_ai = yes + government_has_flag = government_is_merchant + this != root + } + save_scope_as = other_merchant + } + # Then owners of routes touching market + if = { + limit = { NOT = { exists = scope:other_merchant } } + random_trade_route_in_market = { + limit = { + trade_route_owner = { + is_ai = yes + government_has_flag = government_is_merchant + this != root + } + } + trade_route_owner = { save_scope_as = other_merchant } + } + } + # Then nearby global merchants + if = { + limit = { NOT = { exists = scope:other_merchant } } + random_in_global_list = { + variable = merchants_tally + limit = { + holder = { + is_ai = yes + this != root + domicile.domicile_location ?= { + duchy ?= { + OR = { + this = scope:local_market.trade_market_owner.duchy + any_title_to_title_neighboring_and_across_water_duchy = { this = scope:local_market.trade_market_owner.duchy } + } + } + } + } + } + holder = { save_scope_as = other_merchant } + } + } + } + } + + option = { # Bribe + name = gdp_merchant_trade_opportunity.1001.a + pay_short_term_gold = { + gold = scope:local_ruler.minor_gold_value + target = scope:local_ruler + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.5 + } + modifier = { + short_term_gold < scope:local_ruler.medium_gold_value + factor = 0 + } + } + } + + option = { # Sweeten + name = gdp_merchant_trade_opportunity.1001.b + duel = { + target = scope:local_ruler + skill = diplomacy + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1001.b.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1001.b.good + right_icon = scope:local_ruler + add_prestige = minor_prestige_gain + reverse_add_opinion = { + target = scope:local_ruler + modifier = friendliness_opinion + opinion = 20 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1001.b.bad + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1001.b.bad + right_icon = scope:local_ruler + scope:scheme = { change_opportunities = -2 } + reverse_add_opinion = { + target = scope:local_ruler + modifier = angry_opinion + opinion = -20 + } + } + } + } + stress_and_fulfillment_impact = { + humble = minor_stress_impact_gain + craven = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.5 + } + modifier = { + diplomacy < scope:local_ruler.diplomacy_double_value + factor = 0 + } + } + } + + option = { # Distract + name = gdp_merchant_trade_opportunity.1001.c + trigger = { exists = scope:other_merchant } + duel = { + target = scope:local_ruler + skill = intrigue + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1001.c.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1001.c.good + right_icon = scope:local_ruler + add_intrigue_lifestyle_xp = medium_lifestyle_xp + scope:other_merchant = { + pay_short_term_gold = { + gold = minor_gold_value + target = scope:local_ruler + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1001.c.bad + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1001.c.bad + right_icon = scope:local_ruler + pay_short_term_gold = { + gold = medium_gold_value + target = scope:local_ruler + } + reverse_add_opinion = { + target = scope:local_ruler + modifier = angry_opinion + opinion = -20 + } + } + } + } + reverse_add_opinion = { + target = scope:other_merchant + modifier = angry_opinion + opinion = -20 + } + house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_damage_minor_value + REASON = trade_opportunity_friction + CHAR = root + TARGET_CHAR = scope:other_merchant + TITLE = scope:dummy_gender + } + } + stress_and_fulfillment_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_honor = -0.25 + } + modifier = { + intrigue < scope:local_ruler.intrigue_double_value + factor = 0 + } + } + } + + option = { # Dismiss + name = gdp_merchant_trade_opportunity.1001.d + scope:scheme = { change_opportunities = -1 } + reverse_add_opinion = { + target = scope:local_ruler + modifier = angry_opinion + opinion = -20 + } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 0.5 + } + } + } +} + +scripted_trigger gdp_merchant_trade_opportunity_1011_other_merchant_trigger = { + is_ai = yes + gdp_profit_potential_rival_trigger = { + ROUTE_OWNER = root + MARKET = scope:local_market + } + NOR = { + this = root + save_temporary_scope_as = other_merchant_temp + scope:local_market = { + has_competitiveness_modifier_for_character = { + modifier = ruler_stifles_company_modifier + character = scope:other_merchant_temp + } + } + } +} + +# Local ruler offers assistance +gdp_merchant_trade_opportunity.1011 = { + type = character_event + title = gdp_merchant_trade_opportunity.1011.t + desc = gdp_merchant_trade_opportunity.1011.desc + theme = trade + left_portrait = { + character = root + animation = nervous + } + right_portrait = { + character = scope:local_ruler + animation = war_over_tie + } + lower_center_portrait = scope:other_merchant + override_background = { reference = relaxing_room } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:local_ruler ?= { + is_available_quick = { + ai = yes + alive = yes + adult = yes + imprisoned = no + incapable = no + in_army = no + } + opinion = { + target = root + value > -25 + } + } + trigger_if = { + limit = { exists = suzerain } + suzerain != scope:local_ruler + } + NOR = { + scope:local_market = { + has_competitiveness_modifier_for_character = { + modifier = ruler_stifles_company_modifier + character = root + } + } + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1011 } + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1011 } + scope:local_market ?= { + random_character_in_market = { + limit = { gdp_merchant_trade_opportunity_1011_other_merchant_trigger = yes } + save_scope_as = other_merchant + } + } + scope:local_ruler = { save_scope_as = bg_override_char } + } + + option = { # Request kickbacks + name = gdp_merchant_trade_opportunity.1011.a + trigger = { scope:local_ruler.gold > medium_gold_value } + scope:local_ruler = { + pay_short_term_gold = { + gold = root.minor_gold_value + target = root + } + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_loss + honest = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = 0.5 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Attempt to advise + name = gdp_merchant_trade_opportunity.1011.b + duel = { + skill = stewardship + value = decent_skill_rating + 5 = { + compare_modifier = { + value = scope:duel_value + multiplier = 2 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1011.b.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1011.b.good + right_icon = scope:target + add_prestige = minor_prestige_gain + scope:task_contract_location.county = { + add_county_modifier = { + modifier = merchant_prosperity_advice_modifier + years = 10 + } + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -2 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1011.b.bad + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_trade_opportunity.1011.b.bad + right_icon = scope:target + reverse_add_opinion = { + target = scope:local_ruler + modifier = disappointed_opinion + opinion = -15 + } + scope:task_contract_location.county = { change_prosperity_progress = -15 } + } + } + } + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.5 + } + modifier = { + stewardship < extremely_high_skill_rating + factor = 0 + } + } + } + + option = { # Attack competitor + name = { + text = gdp_merchant_trade_opportunity.1011.c + trigger = { exists = scope:other_merchant } + } + name = { + text = gdp_merchant_trade_opportunity.1011.c.fallback + trigger = { + NOT = { exists = scope:other_merchant } + } + } + flavor = gdp_merchant_trade_opportunity.1011.c.flavor + trigger = { + custom_tooltip = { + text = gdp_merchant_trade_opportunity.other_merchant_tt + exists = scope:other_merchant + } + } + show_as_unavailable = { always = yes } + random_list = { + 100 = { + modifier = { add = "scope:local_ruler.opinion(root)" } + modifier = { + factor = { + value = diplomacy + divide = 10 + min = 1 + } + } + modifier = { + add = 25 + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + modifier = { + add = -25 + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + desc = gdp_merchant_trade_opportunity.1011.c.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1011.c.good + left_icon = scope:local_ruler + right_icon = scope:other_merchant + scope:local_market = { + add_competitiveness_modifier_for_character = { + modifier = ruler_stifles_company_modifier + character = scope:other_merchant + } + } + } + } + 100 = { + modifier = { add = "scope:local_ruler.opinion(scope:other_merchant)" } + modifier = { + factor = { + value = scope:other_merchant.diplomacy + divide = 10 + min = 1 + } + } + modifier = { + add = 25 + scope:other_merchant = { + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + } + modifier = { + add = -25 + scope:other_merchant = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:local_ruler } + } + } + desc = gdp_merchant_trade_opportunity.1011.c.bad + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_trade_opportunity.1011.c.bad + left_icon = scope:local_ruler + right_icon = scope:other_merchant + scope:local_market = { + add_competitiveness_modifier_for_character = { + modifier = ruler_stifles_company_modifier + character = root + } + } + } + } + } + reverse_add_opinion = { + target = scope:other_merchant + modifier = angry_opinion + opinion = -10 + } + house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_damage_minor_value + REASON = trade_opportunity_friction + CHAR = root + TARGET_CHAR = scope:other_merchant + TITLE = scope:dummy_gender + } + } + stress_and_fulfillment_impact = { + forgiving = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 0.5 + } + modifier = { + diplomacy < scope:other_merchant.diplomacy_double_value + factor = 0 + } + } + } + + option = { # Suck up + name = gdp_merchant_trade_opportunity.1011.d + add_prestige = miniscule_prestige_gain + reverse_add_opinion = { + target = scope:local_ruler + modifier = friendliness_opinion + opinion = 20 + } + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_sociability = 0.5 + } + } + } +} + +scripted_trigger gdp_merchant_trade_opportunity_1021_merchant_trigger = { + is_ai = yes + government_has_flag = government_is_merchant + NOR = { + this = scope:owner + trigger_if = { + limit = { + scope:scheme ?= { is_scheme_target_type = character } + } + scope:scheme.scheme_target_character ?= this + } + trigger_if = { + limit = { + scope:scheme ?= { is_scheme_target_type = title } + } + scope:scheme.scheme_target_title.holder ?= this + } + } +} + +# Third party family offers assistance +gdp_merchant_trade_opportunity.1021 = { + type = character_event + title = gdp_merchant_trade_opportunity.1021.t + desc = gdp_merchant_trade_opportunity.1021.desc + theme = trade + left_portrait = { + character = scope:owner + animation = pondering + camera = camera_event_very_left + } + right_portrait = { + character = scope:other_merchant + animation = schadenfreude + camera = camera_event_very_right + } + lower_center_portrait = scope:target + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1021 } + } + scope:local_market ?= { + OR = { + # Search current market first + any_character_in_market = { gdp_merchant_trade_opportunity_1021_merchant_trigger = yes } + # Then owners of routes touching market + any_trade_route_in_market = { + trade_route_owner = { gdp_merchant_trade_opportunity_1021_merchant_trigger = yes } + } + # Then nearby global merchants + any_in_global_list = { + variable = merchants_tally + holder = { + gdp_merchant_trade_opportunity_1021_merchant_trigger = yes + domicile.domicile_location ?= { + duchy ?= { + OR = { + this = scope:local_market.trade_market_owner.duchy + any_title_to_title_neighboring_and_across_water_duchy = { this = scope:local_market.trade_market_owner.duchy } + } + } + } + } + } + } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1021 } + scope:local_market ?= { + # Search current market first + random_character_in_market = { + limit = { gdp_merchant_trade_opportunity_1021_merchant_trigger = yes } + weight = { + base = 1 + modifier = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:owner } + add = -10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = character } + exists = scope:scheme.scheme_target_character + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:scheme.scheme_target_character } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = title } + exists = scope:scheme.scheme_target_title.holder + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:scheme.scheme_target_title.holder } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = character } + exists = scope:scheme.scheme_target_character + house = { + has_better_house_relation_with_target_house_than_other_trigger = { + TARGET = scope:owner.house + OTHER = scope:scheme.scheme_target_character.house + } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = title } + exists = scope:scheme.scheme_target_title.holder + house = { + has_better_house_relation_with_target_house_than_other_trigger = { + TARGET = scope:owner.house + OTHER = scope:scheme.scheme_target_title.holder.house + } + } + add = 10 + } + } + save_scope_as = other_merchant + } + # Then owners of routes touching market + if = { + limit = { NOT = { exists = scope:other_merchant } } + random_trade_route_in_market = { + limit = { + trade_route_owner = { gdp_merchant_trade_opportunity_1021_merchant_trigger = yes } + } + weight = { + base = 1 + modifier = { + trade_route_owner = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:owner } + } + add = -10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = character } + exists = scope:scheme.scheme_target_character + trade_route_owner = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:scheme.scheme_target_character } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = title } + exists = scope:scheme.scheme_target_title.holder + trade_route_owner = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:scheme.scheme_target_title.holder } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = character } + exists = scope:scheme.scheme_target_character + trade_route_owner.house = { + has_better_house_relation_with_target_house_than_other_trigger = { + TARGET = scope:owner.house + OTHER = scope:scheme.scheme_target_character.house + } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = title } + exists = scope:scheme.scheme_target_title.holder + trade_route_owner.house = { + has_better_house_relation_with_target_house_than_other_trigger = { + TARGET = scope:owner.house + OTHER = scope:scheme.scheme_target_title.holder.house + } + } + add = 10 + } + } + trade_route_owner = { save_scope_as = other_merchant } + } + } + # Then nearby global merchants + if = { + limit = { NOT = { exists = scope:other_merchant } } + random_in_global_list = { + variable = merchants_tally + limit = { + holder = { + gdp_merchant_trade_opportunity_1021_merchant_trigger = yes + domicile.domicile_location ?= { + duchy ?= { + OR = { + this = scope:local_market.trade_market_owner.duchy + any_title_to_title_neighboring_and_across_water_duchy = { this = scope:local_market.trade_market_owner.duchy } + } + } + } + } + } + weight = { + base = 1 + modifier = { + holder = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:owner } + } + add = -10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = character } + exists = scope:scheme.scheme_target_character + holder = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:scheme.scheme_target_character } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = title } + exists = scope:scheme.scheme_target_title.holder + holder = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:scheme.scheme_target_title.holder } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = character } + exists = scope:scheme.scheme_target_character + holder.house = { + has_better_house_relation_with_target_house_than_other_trigger = { + TARGET = scope:owner.house + OTHER = scope:scheme.scheme_target_character.house + } + } + add = 10 + } + modifier = { + scope:scheme ?= { is_scheme_target_type = title } + exists = scope:scheme.scheme_target_title.holder + holder.house = { + has_better_house_relation_with_target_house_than_other_trigger = { + TARGET = scope:owner.house + OTHER = scope:scheme.scheme_target_title.holder.house + } + } + add = 10 + } + } + holder = { save_scope_as = other_merchant } + } + } + } + } + + option = { # Accept + name = gdp_merchant_trade_opportunity.1021.a + pay_short_term_gold = { + gold = minor_gold_value + target = scope:other_merchant + } + scope:scheme = { change_opportunities = 1 } + reverse_add_opinion = { + target = scope:other_merchant + modifier = friendliness_opinion + opinion = 10 + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.25 + } + opinion_modifier = { + opinion_target = scope:other_merchant + multiplier = 0.25 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Deal + name = gdp_merchant_trade_opportunity.1021.b + duel = { + skill = intrigue + target = scope:other_merchant + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 2 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1021.b.good + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_merchant_trade_opportunity.1021.b.good + right_icon = scope:other_merchant + add_hook = { + target = scope:other_merchant + type = favor_hook + } + reverse_add_opinion = { + target = scope:other_merchant + modifier = respect_opinion + opinion = 10 + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -2 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1021.b.bad + send_interface_toast = { + type = event_toast_effect_neutral + title = gdp_merchant_trade_opportunity.1021.b.bad + right_icon = scope:other_merchant + scope:scheme = { change_opportunities = -1 } + reverse_add_opinion = { + target = scope:other_merchant + modifier = offended_opinion + opinion = -10 + } + } + } + } + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = -0.25 + } + opinion_modifier = { + opinion_target = scope:other_merchant + multiplier = -0.25 + } + modifier = { + intrigue < scope:other_merchant.intrigue_double_value + factor = 0 + } + } + } + + option = { # Alliance + name = gdp_merchant_trade_opportunity.1021.c + reverse_add_opinion = { + target = scope:other_merchant + modifier = friendliness_opinion + opinion = 20 + } + scope:local_market = { + add_competitiveness_modifier_for_character = { + modifier = trade_cooperation_modifier + character = root + } + add_competitiveness_modifier_for_character = { + modifier = trade_cooperation_modifier + character = scope:other_merchant + } + } + house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_improve_medium_value + REASON = trade_opportunity_cooperation + CHAR = root + TARGET_CHAR = scope:other_merchant + TITLE = scope:dummy_gender + } + } + stress_and_fulfillment_impact = { + trusting = minor_stress_impact_loss + paranoid = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = -0.25 + } + opinion_modifier = { + opinion_target = scope:other_merchant + multiplier = -0.25 + } + } + } + + option = { + name = gdp_merchant_trade_opportunity.1021.d + add_prestige = minor_prestige_gain + progress_towards_rival_effect = { + REASON = rival_trade_opportunity_friction + CHARACTER = scope:other_merchant + OPINION = 0 + } + reverse_add_opinion = { + target = scope:other_merchant + modifier = hate_opinion + opinion = -30 + } + house = { + change_house_relation_effect = { + HOUSE = scope:other_merchant.house + VALUE = house_relation_damage_minor_value + REASON = trade_opportunity_friction + CHAR = root + TARGET_CHAR = scope:other_merchant + TITLE = scope:dummy_gender + } + } + stress_and_fulfillment_impact = { + forgiving = minor_stress_impact_gain + ambitious = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = -0.25 + } + opinion_modifier = { + opinion_target = scope:other_merchant + multiplier = -0.25 + } + } + } +} + +# Low unity, leverage house member for opportunity +gdp_merchant_trade_opportunity.1031 = { + type = character_event + title = gdp_merchant_trade_opportunity.1031.t + desc = gdp_merchant_trade_opportunity.1031.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + right_portrait = { + character = scope:associate + animation = stress + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + override_background = { reference = study } + + trigger = { + house = { + OR = { + has_house_unity_stage = opportunistic_cs + has_house_unity_stage = rapacious_cs + } + } + any_courtier = { + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1031 } + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + house = { has_house_unity_stage = rapacious_cs } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1031 } + random_courtier = { + limit = { + house ?= root.house + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + num_offered_task_contracts = 0 + } + alternative_limit = { + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + num_offered_task_contracts = 0 + } + weight = { + base = 1 + modifier = { + add = { + value = "opinion(root)" + multiply = -1 + } + } + } + save_scope_as = associate + } + } + + option = { + name = gdp_merchant_trade_opportunity.1031.a + scope:scheme = { change_opportunities = 1 } + reverse_add_opinion = { + target = scope:associate + modifier = angry_opinion + opinion = -20 + } + apply_house_unity_interaction_effect = { + CHARACTER = root + TARGET = scope:associate + DESC = merchant_unity_associate_after_company_desc + VALUE = minor_unity_loss + VALUE_REVERSED = no + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.5 + } + } + } + + option = { + name = gdp_merchant_trade_opportunity.1031.b + pay_short_term_gold = { + target = scope:associate + gold = minor_gold_value + } + reverse_add_opinion = { + target = scope:associate + modifier = pleased_opinion + opinion = 10 + } + apply_house_unity_interaction_effect = { + CHARACTER = root + TARGET = scope:associate + DESC = merchant_unity_associate_after_company_desc + VALUE = minor_unity_gain + VALUE_REVERSED = no + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + callous = minor_stress_impact_gain + compassionate = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_compassion = 0.5 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { + name = gdp_merchant_trade_opportunity.1031.c + trigger = { + NOR = { + is_spouse_of = scope:associate + is_parent_of = scope:associate + } + } + add_prestige = minor_prestige_gain + scope:associate = { move_to_pool = yes } + reverse_add_opinion = { + target = scope:associate + modifier = fired_opinion + } + stress_and_fulfillment_impact = { + wrathful = minor_stress_impact_loss + forgiving = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_vengefulness = 0.5 + } + } + } +} + +# High unity, house member seizes opportunity +gdp_merchant_trade_opportunity.1041 = { + type = character_event + title = gdp_merchant_trade_opportunity.1041.t + desc = gdp_merchant_trade_opportunity.1041.desc + theme = trade + left_portrait = { + character = root + animation = admiration + camera = camera_event_very_left + } + right_portrait = { + character = scope:associate + animation = personality_honorable + camera = camera_event_very_right + } + override_background = { reference = study } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + house = { + OR = { + has_house_unity_stage = grasping_cs + has_house_unity_stage = ennobled_cs + } + } + any_courtier = { + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1041 } + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + house = { has_house_unity_stage = ennobled_cs } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1041 } + random_courtier = { + limit = { + house ?= root.house + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + NOT = { has_character_modifier = associate_setting_example_modifier } + } + alternative_limit = { + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + NOT = { has_character_modifier = associate_setting_example_modifier } + } + save_scope_as = associate + } + } + + option = { + name = gdp_merchant_trade_opportunity.1041.a + scope:scheme = { change_opportunities = 1 } + reverse_add_opinion = { + target = scope:associate + modifier = respect_opinion + opinion = 10 + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.5 + } + } + } + + option = { + name = gdp_merchant_trade_opportunity.1041.b + scope:scheme = { change_opportunities = 2 } + reverse_add_opinion = { + target = scope:associate + modifier = annoyed_opinion + opinion = -10 + } + apply_house_unity_interaction_effect = { + CHARACTER = root + TARGET = scope:associate + DESC = merchant_unity_associate_unappreciated_desc + VALUE = minor_unity_loss + VALUE_REVERSED = no + } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_compassion = -0.25 + ai_greed = 0.25 + } + } + } + + option = { + name = gdp_merchant_trade_opportunity.1041.c + scope:associate = { + hidden_effect = { + if = { + limit = { has_character_modifier = associate_following_example_modifier } + remove_character_modifier = associate_following_example_modifier + } + } + add_character_modifier = { + modifier = associate_setting_example_modifier + years = 10 + } + } + every_courtier = { + custom = custom.every_other_associate + limit = { + NOR = { + this = scope:associate + has_character_modifier = associate_following_example_modifier + } + } + hidden_effect = { + if = { + limit = { has_character_modifier = associate_setting_example_modifier } + remove_character_modifier = associate_setting_example_modifier + } + } + add_character_modifier = { + modifier = associate_following_example_modifier + years = 10 + } + } + apply_house_unity_interaction_effect = { + CHARACTER = root + TARGET = scope:associate + DESC = merchant_unity_associate_example_desc + VALUE = miniscule_unity_loss + VALUE_REVERSED = no + } + stress_and_fulfillment_impact = { + just = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.25 + ai_sociability = 0.25 + } + } + } +} + +# Competitor offers boon to shove off +gdp_merchant_trade_opportunity.1051 = { + type = character_event + title = gdp_merchant_trade_opportunity.1051.t + desc = { + desc = gdp_merchant_trade_opportunity.1051.desc + first_valid = { + triggered_desc = { + trigger = { scope:competitor_boon = flag:luxury } + desc = gdp_merchant_trade_opportunity.1051.desc.luxury + } + desc = gdp_merchant_trade_opportunity.1051.desc.gold + } + } + theme = trade + left_portrait = { + character = root + animation = war_over_win + camera = camera_event_very_left + } + right_portrait = { + character = scope:target + triggered_animation = { + trigger = { + NOT = { exists = scope:competitor_boon } + } + animation = steward + } + triggered_animation = { + trigger = { exists = scope:competitor_boon } + animation = debating + } + camera = camera_event_very_right + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:scheme.scheme_target_title.holder ?= { + is_ai = yes + government_has_flag = government_is_merchant + short_term_gold >= root.medium_gold_value + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1051 } + } + } + + immediate = { + scope:scheme ?= { trade_opportunity_scheme_scopes_effect = yes } + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1051 } + scope:target ?= { + random_list = { + # Luxury Contract + 5 = { + trigger = { + root = { + has_realm_law = company_purpose_caravaneer + NOT = { + any_character_task_contract = { has_task_contract_group = merchant_luxury_contract_group } + } + } + } + save_scope_value_as = { + name = competitor_boon + value = flag:luxury + } + } + # Gold + 10 = { + save_scope_value_as = { + name = competitor_boon + value = flag:gold + } + } + } + } + } + + option = { + name = gdp_merchant_trade_opportunity.1051.a + switch = { + trigger = scope:competitor_boon + flag:luxury = { + custom_tooltip = { + text = trade_opportunity_gain_luxury_contract_tt + trigger_event = { on_action = spawn_luxury_contract_on_action } + } + } + flag:gold = { + scope:target = { + pay_short_term_gold = { + gold = root.minor_gold_value + target = root + } + } + } + } + reverse_add_opinion = { + target = scope:target + modifier = pleased_opinion + opinion = 10 + } + house = { + change_house_relation_effect = { + HOUSE = scope:target.house + VALUE = house_relation_improve_minor_value + REASON = trade_opportunity_cooperation + CHAR = root + TARGET_CHAR = scope:target + TITLE = scope:dummy_gender + } + } + hidden_effect = { + scope:task_contract = { merchant_trade_opportunity_travel_complete_or_invalidated_effect = yes } + } + scope:scheme = { end_scheme = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + vengeful = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_greed = 0.25 + ai_vengefulness = -0.25 + } + } + } + + # Counter + option = { + name = gdp_merchant_trade_opportunity.1051.b + duel = { + skills = { diplomacy stewardship } + target = scope:target + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1051.b.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1051.b.good + right_icon = scope:target + scope:target = { + pay_short_term_gold = { + gold = root.medium_gold_value + target = root + } + } + hidden_effect = { + scope:task_contract = { merchant_trade_opportunity_travel_complete_or_invalidated_effect = yes } + } + scope:scheme = { end_scheme = yes } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1051.b.bad + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_trade_opportunity.1051.b.bad + right_icon = scope:target + reverse_add_opinion = { + target = scope:target + modifier = angry_opinion + opinion = -20 + } + house = { + change_house_relation_effect = { + HOUSE = scope:target.house + VALUE = house_relation_damage_medium_value + REASON = trade_opportunity_friction + CHAR = root + TARGET_CHAR = scope:target + TITLE = scope:dummy_gender + } + } + } + } + } + stress_and_fulfillment_impact = { + content = minor_stress_impact_gain + just = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 0.5 + ai_greed = 0.5 + } + modifier = { + diplomacy < scope:target.stewardship_double_value + factor = 0 + } + modifier = { + stewardship < scope:target.stewardship_double_value + factor = 0 + } + } + } + + # Refuse + option = { + name = gdp_merchant_trade_opportunity.1051.d + reverse_add_opinion = { + target = scope:target + modifier = angry_opinion + opinion = -10 + } + house = { + change_house_relation_effect = { + HOUSE = scope:target.house + VALUE = house_relation_damage_minor_value + REASON = trade_opportunity_friction + CHAR = root + TARGET_CHAR = scope:target + TITLE = scope:dummy_gender + } + } + stress_and_fulfillment_impact = { + craven = minor_stress_impact_gain + fickle = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = -0.5 + ai_energy = -0.5 + } + modifier = { + OR = { + has_trait = craven + has_trait = fickle + } + factor = 0 + } + } + } +} + +# Stretched Thin +gdp_merchant_trade_opportunity.1061 = { + type = character_event + title = gdp_merchant_trade_opportunity.1061.t + desc = gdp_merchant_trade_opportunity.1061.desc + theme = trade + left_portrait = { + character = root + animation = worry + camera = camera_event_left + } + right_portrait = { + character = scope:associate + animation = deliberation + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:scheme = { scheme_agent_charges > 1 } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1061 } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1061 } + scope:associate ?= { add_stress = minor_stress_gain } + scope:scheme ?= { change_opportunities = 1 } + } + + option = { # I'll risk it for another advantage + name = gdp_merchant_trade_opportunity.1061.a + custom_tooltip = gdp_merchant_trade_opportunity.1061.already_tt + duel = { + skill = stewardship + value = decent_skill_rating + 5 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1061.a.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1061.a.good + left_icon = root + right_icon = scope:associate + custom_tooltip = { + text = gdp_merchant_scheme_advantage_add_1_opportunity_tt + scope:scheme = { change_opportunities = 1 } + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1061.a.bad + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_trade_opportunity.1061.a.bad + left_icon = root + right_icon = scope:associate + stress_and_fulfillment_impact = { base = minor_stress_impact_gain } + } + } + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_boldness = 1 + } + modifier = { + stewardship < high_skill_rating + factor = 0 + } + } + } + + option = { # I'll take one advantage please + name = gdp_merchant_trade_opportunity.1061.b + custom_tooltip = gdp_merchant_trade_opportunity.1061.already_tt + ai_chance = { + base = 100 + ai_value_modifier = { + ai_energy = 1 + } + } + } +} + +# Routes over capacity +gdp_merchant_trade_opportunity.1071 = { + type = character_event + title = gdp_merchant_trade_opportunity.1071.t + desc = gdp_merchant_trade_opportunity.1071.desc + theme = trade + left_portrait = { + character = root + animation = reading + camera = camera_event_very_left + } + right_portrait = { + character = scope:associate + animation = worry + camera = camera_event_very_right + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + override_background = { reference = study } + + trigger = { + any_trade_route = { + any_trade_market_on_route = { this = scope:local_market } + } + NOT = { + any_trade_route = { + OR = { + has_trade_route_modifier = diverted_trade_modifier + has_trade_route_modifier = focused_trade_modifier + has_trade_route_modifier = sidelined_trade_modifier + } + } + } + scope:scheme = { scheme_agent_charges > 1 } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1071 } + } + any_trade_route = { trader ?= scope:associate } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1071 } + } + + option = { # Trader focus + name = gdp_merchant_trade_opportunity.1071.d + scope:associate = { + add_stress = minor_stress_loss + add_character_modifier = { + modifier = gdp_trader_undivided_focus_modifier + years = 10 + } + } + reverse_add_opinion = { + target = scope:associate + modifier = pleased_opinion + opinion = 15 + } + stress_impact = { + compassionate = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_compassion = 0.5 + } + } + } + + option = { # Scheme focus + name = gdp_merchant_trade_opportunity.1071.a + scope:scheme = { change_opportunities = 2 } + reverse_add_opinion = { + target = scope:associate + modifier = annoyed_opinion + opinion = -10 + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + impatient = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.5 + } + } + } +} + +# Competent associate +gdp_merchant_trade_opportunity.1081 = { + type = character_event + title = gdp_merchant_trade_opportunity.1081.t + desc = gdp_merchant_trade_opportunity.1081.desc + theme = trade + left_portrait = { + character = root + animation = admiration + } + right_portrait = { + character = scope:associate + animation = writing + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:associate ?= { + is_available_quick = { + alive = yes + adult = yes + imprisoned = no + incapable = no + } + stewardship > medium_skill_rating + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1081 } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = scope:associate.stewardship + subtract = 10 + divide = 10 + round = yes + max = 1 + } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1081 } + } + + option = { # Encourage + name = gdp_merchant_trade_opportunity.1081.a + scope:scheme = { change_opportunities = 1 } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_energy = 0.5 + } + } + } + + option = { # Reward + name = gdp_merchant_trade_opportunity.1081.b + pay_short_term_gold = { + gold = minor_gold_value + target = scope:associate + } + progress_towards_friend_effect = { + REASON = friend_rewarded_associate + CHARACTER = scope:associate + OPINION = default_friend_opinion + } + apply_house_unity_interaction_effect = { + CHARACTER = root + TARGET = scope:associate + DESC = merchant_unity_associate_rewarded_desc + VALUE = minor_unity_gain + VALUE_REVERSED = no + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + just = minor_stress_impact_loss + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_compassion = 0.5 + } + modifier = { + short_term_gold < medium_gold_value + factor = 0 + } + } + } + + option = { # Example + name = gdp_merchant_trade_opportunity.1081.c + trigger = { + custom_tooltip = { + text = gdp_merchant_trade_opportunity.1081.c.trigger + any_courtier = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + stewardship < medium_skill_rating + NOT = { this = scope:associate } + } + } + } + show_as_unavailable = { always = yes } + random_courtier = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + } + stewardship < medium_skill_rating + NOT = { this = scope:associate } + } + weight = { + base = 1 + modifier = { + add = { + value = 10 + subtract = stewardship + divide = 5 + } + } + } + save_scope_as = learner + } + random = { + chance = 25 + custom_tooltip = { + text = gdp_merchant_trade_opportunity.1081.c.tt + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1081.c.title + left_icon = scope:associate + right_icon = scope:learner + scope:learner = { add_stewardship_skill = 1 } + } + } + } + scope:associate = { + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + shy = minor_stress_impact_gain + } + } + stress_and_fulfillment_impact = { + content = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_rationality = 0.5 + } + } + } + + option = { # Brag + name = gdp_merchant_trade_opportunity.1081.d + add_prestige = minor_prestige_gain + stress_and_fulfillment_impact = { + humble = minor_stress_impact_gain + } + ai_chance = { + base = 10 + ai_value_modifier = { + ai_boldness = 0.5 + } + } + } +} + +# Incompetent associate +gdp_merchant_trade_opportunity.1091 = { + type = character_event + title = gdp_merchant_trade_opportunity.1091.t + desc = gdp_merchant_trade_opportunity.1091.desc + theme = trade + left_portrait = { + character = root + animation = eyeroll + } + right_portrait = { + character = scope:associate + animation = deliberation + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:associate ?= { stewardship <= medium_skill_rating } + scope:scheme = { + scheme_agent_charges > 0 + } + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1091 } + } + } + + weight_multiplier = { + base = 1 + modifier = { + add = { + value = 10 + subtract = scope:associate.stewardship + divide = 10 + round = yes + min = 0 + } + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1091 } + } + + option = { # Teach + name = gdp_merchant_trade_opportunity.1091.b + duel = { + target = scope:associate + skill = stewardship + 5 = { + compare_modifier = { + value = scope:duel_value + multiplier = 2.5 + min = -49 + } + min = 10 + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1091.b.good + right_icon = scope:associate + scope:associate = { add_stewardship_skill = 1 } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -2.5 + min = -49 + } + min = 10 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_trade_opportunity.1091.b.bad + right_icon = scope:associate + stress_and_fulfillment_impact = { base = minor_stress_impact_gain } + } + } + } + scope:associate = { + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + } + } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + ai_compassion = 0.5 + } + modifier = { + stewardship < scope:associate.stewardship_double_value + factor = 0 + } + } + } + + option = { # Blame others + name = gdp_merchant_trade_opportunity.1091.c + scope:associate = { + add_character_modifier = { + modifier = associate_taking_assistance_modifier + years = 10 + } + } + every_courtier = { + custom = custom.every_other_associate + limit = { + is_adult = yes + NOT = { this = scope:associate } + } + stress_and_fulfillment_impact = { base = minor_stress_impact_gain } + } + apply_house_unity_interaction_effect = { + CHARACTER = root + TARGET = scope:associate + DESC = merchant_unity_associate_busywork_desc + VALUE = minor_unity_loss + VALUE_REVERSED = no + } + stress_and_fulfillment_impact = { + just = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + ai_honor = -0.5 + } + } + } + + option = { # Accept + name = gdp_merchant_trade_opportunity.1091.d + scope:scheme = { change_opportunities = -1 } + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_gain + wrathful = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + ai_boldness = -0.5 + } + } + } +} + +scripted_trigger gdp_merchant_trade_opportunity_1101_trigger = { + is_available_quick = { + ai = yes + adult = yes + imprisoned = no + incapable = no + in_army = no + } + health >= fine_health + NOT = { this = root.suzerain } + highest_held_title_tier < tier_duchy + gold >= scope:investor_min_gold # root.gdp_seed_capital_investment_value, saved by the caller + trigger_if = { + limit = { + is_landed = no + is_theocratic_lessee = no + } + is_clergy = no + } + NOR = { + government_has_flag = government_is_tribal + # Knows better + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + any_close_family_member = { + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + } + any_courtier = { + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + } + any_relation = { + type = lover + type = friend + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + } + liege ?= { + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + } + employer ?= { + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + } + any_vassal = { + has_opinion_modifier = { + target = root + modifier = investor_scammer_opinion + } + } + } +} + +scripted_effect gdp_merchant_trade_opportunity_1101_investment_effect = { + scope:investor = { + pay_short_term_gold = { + gold = scope:investment + target = root + } + } + save_scope_value_as = { + name = interest + value = { + value = scope:investment + multiply = 1.2 + } + } + custom_tooltip = gdp_merchant_trade_opportunity_1101_calling_tt + trigger_event = { + id = gdp_merchant_trade_opportunity.1102 + years = 5 + } +} + +# A wild investor appears +gdp_merchant_trade_opportunity.1101 = { + type = character_event + title = gdp_merchant_trade_opportunity.1101.t + desc = { + desc = gdp_merchant_trade_opportunity.1101.desc + first_valid = { + triggered_desc = { + trigger = { + scope:investor = { government_has_flag = government_is_landless_adventurer } + } + desc = gdp_merchant_trade_opportunity.1101.adventurer + } + triggered_desc = { + trigger = { + scope:investor = { is_ruler = yes } + } + desc = gdp_merchant_trade_opportunity.1101.ruler + } + triggered_desc = { + trigger = { exists = scope:investor.liege } + desc = gdp_merchant_trade_opportunity.1101.courtier + } + desc = gdp_merchant_trade_opportunity.1101.fallback + } + desc = gdp_merchant_trade_opportunity.1101.end + } + theme = trade + left_portrait = { + character = root + animation = interested + } + right_portrait = { + character = scope:investor + animation = admiration + camera = camera_event_very_right + } + # Scheme Preparations status bar + widget = { + gui = "event_window_widget_scheme" + container = "custom_widgets_container" + } + + trigger = { + scope:task_contract ?= { + NOT = { has_variable = had_event_gdp_merchant_trade_opportunity_1101 } + } + NOR = { + has_character_flag = investor_scammer_cooldown + scope:task_contract = { has_task_contract_type = seek_debtors } + } + save_temporary_scope_value_as = { + name = investor_min_gold + value = gdp_seed_capital_investment_value + } + scope:task_contract_location.duchy = { + any_in_de_jure_hierarchy = { + OR = { + holder ?= { gdp_merchant_trade_opportunity_1101_trigger = yes } + lessee ?= { gdp_merchant_trade_opportunity_1101_trigger = yes } + title_province ?= { + any_province_domicile = { + is_domicile_type = camp + owner = { gdp_merchant_trade_opportunity_1101_trigger = yes } + } + any_pool_character = { + province = scope:task_contract_location + gdp_merchant_trade_opportunity_1101_trigger = yes + } + } + } + } + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 0.2 + has_character_modifier = investor_scammer_modifier + } + } + + immediate = { + scope:task_contract ?= { set_variable = had_event_gdp_merchant_trade_opportunity_1101 } + primary_title = { save_scope_as = company } + save_scope_as = trader + save_temporary_scope_value_as = { + name = investor_min_gold + value = gdp_seed_capital_investment_value + } + scope:task_contract_location.duchy = { + every_in_de_jure_hierarchy = { + holder ?= { + # A holder of several titles in the hierarchy only needs their court checked once + if = { + limit = { + NOT = { is_in_list = investor_courts_checked } + } + add_to_temporary_list = investor_courts_checked + if = { + limit = { gdp_merchant_trade_opportunity_1101_trigger = yes } + add_to_list = investors + } + every_courtier = { + limit = { gdp_merchant_trade_opportunity_1101_trigger = yes } + add_to_list = investors + } + } + } + lessee ?= { + if = { + limit = { gdp_merchant_trade_opportunity_1101_trigger = yes } + add_to_list = investors + } + } + title_province ?= { + every_province_domicile = { + limit = { + is_domicile_type = camp + owner = { gdp_merchant_trade_opportunity_1101_trigger = yes } + } + add_to_list = investors + } + every_pool_character = { + province = scope:task_contract_location + limit = { gdp_merchant_trade_opportunity_1101_trigger = yes } + add_to_list = investors + } + } + } + } + random_in_list = { + list = investors + weight = { + base = 1 + modifier = { + add = { + value = gold + divide = root.minor_gold_value + min = 0 + } + } + is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root } + is_of_major_interest_to_weight_up_modifier = { CHARACTER = root } + modifier = { + factor = 4 + highest_held_title_tier >= tier_county + } + modifier = { + factor = 2 + highest_held_title_tier >= tier_county + } + } + save_scope_as = investor + } + } + + option = { # Accept + name = gdp_merchant_trade_opportunity.1101.a + save_scope_value_as = { + name = investment + value = gdp_seed_capital_investment_value + } + gdp_merchant_trade_opportunity_1101_investment_effect = yes + ai_chance = { + base = 10 + modifier = { + ai_honor = 0.25 + ai_energy = 0.25 + } + modifier = { + short_term_gold < medium_gold_value + add = 10 + } + } + } + + option = { # Request more for hook + name = gdp_merchant_trade_opportunity.1101.c + trigger = { + scope:investor = { gold >= root.gdp_seed_capital_investment_hook_value } + } + save_scope_value_as = { + name = investment + value = gdp_seed_capital_investment_hook_value + } + scope:investor = { + add_hook = { + type = favor_hook + target = root + } + } + gdp_merchant_trade_opportunity_1101_investment_effect = yes + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { + ai_honor = 0.25 + ai_rationality = 0.25 + } + } + } + + option = { # Refuse + name = gdp_merchant_trade_opportunity.1101.d + reverse_add_opinion = { + target = scope:investor + modifier = offended_opinion + opinion = -10 + } + stress_and_fulfillment_impact = { + stubborn = minor_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { + short_term_gold < minor_gold_value + factor = 0.5 + } + } + } +} + +gdp_merchant_trade_opportunity.1102 = { + type = letter_event + opening = gdp_merchant_trade_opportunity.1102.opening + desc = gdp_merchant_trade_opportunity.1102.desc + sender = { + character = scope:investor + animation = interested + } + + trigger = { + scope:investor ?= { + is_available_quick = { + ai = yes + adult = yes + alive = yes + imprisoned = no + incapable = no + } + } + exists = scope:company.holder + scope:trader ?= scope:company.holder + } + + on_trigger_fail = { + scope:company.holder ?= { save_scope_as = trader } + if = { + limit = { exists = scope:trader } + scope:investor ?= { + if = { + limit = { + scope:investor = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + incapable = no + } + } + } + scope:trader = { + trigger_event = { + id = gdp_merchant_trade_opportunity.1102 + months = 1 + } + } + } + else_if = { + limit = { + any_child = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + incapable = no + } + } + } + random_child = { + limit = { + is_available_quick = { + ai = yes + adult = yes + alive = yes + incapable = no + } + } + save_scope_as = investor + } + scope:trader = { + trigger_event = { + id = gdp_merchant_trade_opportunity.1102 + days = 1 + } + } + } + } + } + } + + option = { # Pay up + name = gdp_merchant_trade_opportunity.1102.a + add_prestige = minor_prestige_gain + reverse_add_opinion = { + modifier = pleased_opinion + target = scope:investor + opinion = 15 + } + pay_short_term_gold = { + gold = { + value = scope:investment + multiply = 1.2 + } + target = scope:investor + } + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + greedy = minor_stress_impact_gain + honest = minor_stress_impact_loss + just = minor_stress_impact_loss + } + ai_chance = { + base = 10 + modifier = { + ai_honor = 0.25 + ai_greed = -0.25 + } + modifier = { + short_term_gold < scope:investment + factor = 0.5 + } + modifier = { + short_term_gold < major_gold_value + factor = 0.5 + } + } + } + + option = { # Lie + name = gdp_merchant_trade_opportunity.1102.b + trigger = { + NOT = { + scope:investor = { has_hook = root } + } + } + pay_short_term_gold = { + gold = { + value = scope:investment + multiply = 0.5 + } + target = scope:investor + } + duel = { + skill = intrigue + target = scope:investor + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1102.b.good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_merchant_trade_opportunity.1102.b.good + right_icon = scope:investor + reverse_add_opinion = { + target = scope:investor + modifier = disappointed_opinion + opinion = -10 + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_merchant_trade_opportunity.1102.b.bad + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_merchant_trade_opportunity.1102.b.bad + right_icon = scope:investor + add_prestige = minor_prestige_loss + reverse_add_opinion = { + modifier = angry_opinion + target = scope:investor + opinion = -25 + } + } + } + } + stress_and_fulfillment_impact = { + honest = medium_stress_impact_gain + generous = medium_stress_impact_gain + just = minor_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + ai_honor = -0.25 + ai_greed = 0.25 + } + modifier = { + short_term_gold < scope:investment + factor = 1.25 + } + modifier = { + short_term_gold < major_gold_value + factor = 1.25 + } + } + } + + option = { # Refuse + name = gdp_merchant_trade_opportunity.1102.d + trigger = { + NOT = { + scope:investor = { has_hook = root } + } + } + add_prestige = medium_prestige_loss + progress_towards_rival_effect = { + REASON = rival_investor_scammer + CHARACTER = scope:investor + OPINION = 0 + } + add_character_modifier = { + modifier = investor_scammer_modifier + years = 25 + } + reverse_add_opinion = { + modifier = investor_scammer_opinion + target = scope:investor + } + add_character_flag = { + flag = investor_scammer_cooldown + years = 5 + } + stress_and_fulfillment_impact = { + craven = minor_stress_impact_gain + just = medium_stress_impact_gain + } + ai_chance = { + base = 10 + modifier = { + ai_rationality = -0.25 + ai_honor = -0.25 + } + modifier = { + short_term_gold < scope:investment + factor = 1.25 + } + modifier = { + short_term_gold < major_gold_value + factor = 1.25 + } + } + } +} + +# Piggy back +gdp_merchant_trade_opportunity.9000 = { + type = character_event + title = gdp_merchant_trade_opportunity.9000.t + desc = gdp_merchant_trade_opportunity.9000.desc + theme = trade + left_portrait = { + character = root + animation = pondering + } + + trigger = { is_ai = no } + + on_trigger_fail = { + current_travel_plan ?= { + if = { + limit = { is_paused = yes } + resume_travel_plan = yes + } + } + } + + immediate = { + hidden_effect = { + current_travel_plan ?= { + if = { + limit = { is_paused = no } + pause_travel_plan = yes + } + } + } + every_available_task_contract = { + limit = { + has_task_contract_group = merchant_trade_opportunity_group + task_contract_location = root.location + NOT = { this = scope:task_contract } + root = { can_accept_task_contract = prev } + } + add_to_list = potential_contracts + } + ordered_in_list = { + list = potential_contracts + order_by = task_contract_tier + max = 3 + check_range_bounds = no + if = { + limit = { exists = scope:contract_2 } + save_scope_as = contract_3 + } + else_if = { + limit = { exists = scope:contract_1 } + save_scope_as = contract_2 + } + else = { save_scope_as = contract_1 } + } + } + + option = { + name = gdp_merchant_trade_opportunity.9000.a + trigger = { + exists = scope:contract_1 + can_accept_task_contract = scope:contract_1 + } + hidden_effect = { accept_task_contract = scope:contract_1 } + scope:contract_1 = { custom_tooltip = gdp_merchant_trade_opportunity.9000.accept_tt } + show_as_tooltip = { + current_travel_plan ?= { pause_travel_plan = yes } + } + } + + option = { + name = gdp_merchant_trade_opportunity.9000.b + trigger = { + exists = scope:contract_2 + can_accept_task_contract = scope:contract_2 + } + hidden_effect = { accept_task_contract = scope:contract_2 } + scope:contract_2 = { custom_tooltip = gdp_merchant_trade_opportunity.9000.accept_tt } + show_as_tooltip = { + current_travel_plan ?= { pause_travel_plan = yes } + } + } + + option = { + name = gdp_merchant_trade_opportunity.9000.c + trigger = { + exists = scope:contract_3 + can_accept_task_contract = scope:contract_3 + } + hidden_effect = { accept_task_contract = scope:contract_3 } + scope:contract_3 = { custom_tooltip = gdp_merchant_trade_opportunity.9000.accept_tt } + show_as_tooltip = { + current_travel_plan ?= { pause_travel_plan = yes } + } + } + + option = { + name = gdp_merchant_trade_opportunity.9000.d + current_travel_plan ?= { + if = { + limit = { is_paused = yes } + resume_travel_plan = yes + } + } + } +} + +scripted_effect trade_opportunity_assign_partner_effect = { + save_scope_as = partner + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.partner_assign + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.partner_away + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.partner_outcome + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.partner_valid + set_variable = { + name = partner_contract + value = scope:task_contract + months = 9 # max duration is 8 + } + scope:task_contract = { + task_contract_location = { save_scope_as = task_contract_location } + set_variable = { + name = contract_partner + value = scope:partner + } + task_contract_taker = { + house = { + add_unity_value = { + value = minor_unity_value + character = scope:task_contract.var:contract_partner + desc = unity_trade_opportunity_partner_assigned_desc + } + } + trigger_event = { + id = gdp_merchant_trade_opportunity.9022 + months = { 4 8 } + } + hidden_effect = { + send_interface_toast = { + type = event_trade_neutral + title = trade_opportunity_assign_partner_title + right_icon = scope:partner + scope:partner ?= { + set_location = scope:task_contract.task_contract_location + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.partner_assigned + } + } + } + } + } +} + +# Travel/partner opening. +gdp_merchant_trade_opportunity.9010 = { + type = character_event + title = gdp_merchant_trade_opportunity.9010.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:task_contract_location = location } + desc = gdp_merchant_trade_opportunity.9010.intro + } + desc = gdp_merchant_trade_opportunity.9010.intro_elsewhere + } + desc = gdp_merchant_trade_opportunity.9010.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:partner_busy } + desc = gdp_merchant_trade_opportunity.9010.partner_busy + } + triggered_desc = { + trigger = { exists = scope:partner } + desc = gdp_merchant_trade_opportunity.9010.partner + } + triggered_desc = { + trigger = { exists = scope:candidate } + desc = gdp_merchant_trade_opportunity.9010.candidate + } + desc = gdp_merchant_trade_opportunity.9010.no_partner + } + } + theme = trade + left_portrait = { + character = root + animation = war_over_tie + } + right_portrait = { + trigger = { + NOT = { exists = scope:partner_busy } + } + character = scope:partner + animation = writing + } + lower_left_portrait = scope:partner_busy + lower_right_portrait = scope:candidate + override_background = { reference = study } + + trigger = { + trigger_if = { + limit = { is_travelling = yes } + is_ai = no + scope:task_contract_location != location + } + } + + on_trigger_fail = { + trigger_event = { on_action = trade_opportunity_arrival_events } + } + + immediate = { + if = { + limit = { is_travelling = yes } + scope:task_contract = { set_variable = accepted_while_traveling_elsewhere } + } + court_position:partner_court_position ?= { + save_scope_as = partner + if = { + limit = { + OR = { + merchant_trade_opportunity_partner_available_trigger = no + root = { merchant_trade_opportunity_partner_send_blocked_trigger = yes } + } + } + save_scope_as = partner_busy + } + } + if = { + limit = { + NOT = { exists = scope:partner } + can_employ_court_position_type = partner_court_position + } + ordered_courtier = { + limit = { + would_be_valid_for_court_position = { + employer = root + court_position = partner_court_position + } + merchant_trade_opportunity_partner_available_trigger = yes + } + order_by = "aptitude(partner_court_position)" + save_scope_as = candidate + } + if = { + limit = { + NOT = { exists = scope:candidate } + } + ordered_courtier = { + limit = { + would_be_valid_for_court_position = { + employer = root + court_position = partner_court_position + } + merchant_trade_opportunity_partner_candidate_available_trigger = { TAKER = root } + } + order_by = "aptitude(partner_court_position)" + save_scope_as = candidate + } + } + } + } + + option = { # Travel to take + name = gdp_merchant_trade_opportunity.9010.a + trigger = { + scope:task_contract_location != location + is_travelling = no + custom_tooltip = { + text = has_active_merchant_contract + any_character_active_contract = { + count = 0 + NOR = { + this = scope:task_contract + exists = var:contract_partner + } + } + } + } + show_as_unavailable = { scope:task_contract_location != location } + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.destination_list + start_travel_plan = { + destination = scope:task_contract_location + on_arrival_event = gdp_merchant_trade_opportunity.9012 + travel_with_domicile = no + return_trip = yes + can_cancel_planning = no + on_travel_planner_cancel_event = gdp_merchant_trade_opportunity.9011 + players_use_planner = yes + on_arrival_destinations = all_but_last + } + stress_impact = { + lazy = miniscule_stress_impact_gain + } + ai_chance = { base = 100 } + } + + option = { # Take here + name = gdp_merchant_trade_opportunity.9010.a + trigger = { + scope:task_contract_location = location + custom_tooltip = { + text = has_active_merchant_contract + any_character_active_contract = { + count = 0 + NOR = { + this = scope:task_contract + exists = var:contract_partner + } + } + } + } + show_as_unavailable = { scope:task_contract_location = location } + custom_tooltip = gdp_merchant_trade_opportunity.9010.tt.start + trigger_event = { on_action = trade_opportunity_arrival_events } + stress_impact = { + lazy = miniscule_stress_impact_gain + } + ai_chance = { base = 100 } + } + + option = { # Partner + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + NOT = { exists = scope:partner } + } + desc = gdp_merchant_trade_opportunity.9010.c.no_partner + } + desc = gdp_merchant_trade_opportunity.9010.c + } + } + } + trigger = { + trigger_if = { + limit = { exists = scope:partner } + scope:partner = { merchant_trade_opportunity_partner_available_trigger = yes } + custom_tooltip = { + text = gdp_merchant_trade_opportunity.9010.c.involved_other.tt + NOT = { merchant_trade_opportunity_partner_send_blocked_trigger = yes } + } + } + trigger_else = { employs_court_position = partner_court_position } + } + reason = have_partner + scope:partner ?= { trade_opportunity_assign_partner_effect = yes } + stress_impact = { + diligent = miniscule_stress_impact_gain + } + ai_chance = { base = 0 } + } + + option = { # Candidate + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:candidate } + desc = gdp_merchant_trade_opportunity.9010.d + } + desc = gdp_merchant_trade_opportunity.9010.d.no_candidate + } + } + } + trigger = { + custom_tooltip = { + text = gdp_merchant_trade_opportunity.9010.d.tt + exists = scope:candidate + } + custom_tooltip = { + text = gdp_merchant_trade_opportunity.9010.c.involved_other.tt + NOT = { merchant_trade_opportunity_partner_send_blocked_trigger = yes } + } + } + show_as_unavailable = { + NOT = { exists = scope:partner } + } + if = { + limit = { + scope:candidate = { merchant_trade_opportunity_partner_in_entourage_trigger = { TAKER = root } } + } + current_travel_plan = { remove_character = scope:candidate } + } + appoint_court_position = { + recipient = scope:candidate + court_position = partner_court_position + } + scope:candidate = { + add_opinion = { + opinion = 15 + target = root + modifier = grateful_opinion + } + trade_opportunity_assign_partner_effect = yes + } + stress_impact = { + diligent = miniscule_stress_impact_gain + } + ai_chance = { base = 0 } + } + + option = { # Forget it + name = gdp_merchant_trade_opportunity.9010.e + custom_tooltip = gdp_merchant_trade_opportunity.9010.e.tt + scope:task_contract = { complete_task_contract = failure_standard } + stress_impact = { + diligent = miniscule_stress_impact_gain + } + ai_chance = { base = 0 } + } +} + +# Travel invalidation event. +gdp_merchant_trade_opportunity.9011 = { + hidden = yes + + trigger = { is_alive = yes } + + immediate = { + random_character_active_contract = { save_scope_as = task_contract } + send_interface_message = { + title = contract_invalidated_title + type = stewardship_contract_scheme_invalidated_message + desc = contract_invalidated_desc + right_icon = scope:task_contract.task_contract_employer + scope:task_contract = { complete_task_contract = failure_standard } + } + } +} + +# Travel setup event. +gdp_merchant_trade_opportunity.9012 = { + type = character_event + hidden = yes + + immediate = { + if = { + limit = { + has_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + } + remove_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + temporarily_lock_visit_holding_effect = yes + trigger_event = gdp_visit_holding_decision_event.1000 + } + else = { + trigger_event = { + on_action = trade_opportunity_arrival_events + } + } + } +} + +gdp_merchant_trade_opportunity.9050 = { + type = character_event + title = gdp_merchant_trade_opportunity.9050.t + desc = { + desc = gdp_merchant_trade_opportunity.9050.desc_opening + first_valid = { + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:route_destroyed } + desc = gdp_merchant_trade_opportunity.9050.reason_route_destroyed + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:market_left_route } + desc = gdp_merchant_trade_opportunity.9050.reason_market_left_route + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:trader_changed } + desc = gdp_merchant_trade_opportunity.9050.reason_trader_changed + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:upheaval_ended } + desc = gdp_merchant_trade_opportunity.9050.reason_upheaval_ended + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:purpose_artisan } + desc = gdp_merchant_trade_opportunity.9050.reason_purpose_artisan + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:purpose_creditor } + desc = gdp_merchant_trade_opportunity.9050.reason_purpose_creditor + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:competitor_gone } + desc = gdp_merchant_trade_opportunity.9050.reason_competitor_gone + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:entrepot_gone } + desc = gdp_merchant_trade_opportunity.9050.reason_entrepot_gone + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:tolls_ended } + desc = gdp_merchant_trade_opportunity.9050.reason_tolls_ended + } + triggered_desc = { + trigger = { scope:task_contract.var:trade_opportunity_lost_reason ?= flag:silk_road } + desc = gdp_merchant_trade_opportunity.9050.reason_silk_road + } + desc = gdp_merchant_trade_opportunity.9050.reason_unknown + } + desc = gdp_merchant_trade_opportunity.9050.desc_closing + } + theme = trade + left_portrait = { + character = root + animation = disappointed + } + override_background = { reference = terrain } + + # Give up on the venture and head home. + option = { + name = gdp_merchant_trade_opportunity.9050.a + + return_home = yes + + ai_chance = { + base = 100 + } + } + + # Carry on to the destination anyway and visit the local holding on arrival. + option = { + name = gdp_merchant_trade_opportunity.9050.b + + custom_tooltip = gdp_merchant_trade_opportunity.9050.b.tt + add_character_flag = gdp_trade_opportunity_visit_holding_on_arrival + + ai_chance = { + base = 0 + } + } +} + +# Partner outcome. +gdp_merchant_trade_opportunity.9020 = { + type = character_event + title = gdp_merchant_trade_opportunity.9020.t + desc = { + desc = gdp_merchant_trade_opportunity.9020.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:contract_success } + desc = gdp_merchant_trade_opportunity.9020.success + } + desc = gdp_merchant_trade_opportunity.9020.failure + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:contract_success } + animation = war_over_tie + } + animation = disappointed + } + right_portrait = { + character = scope:partner + triggered_animation = { + trigger = { exists = scope:contract_success } + animation = admiration + } + animation = stress + } + override_background = { reference = study } + + immediate = { + if = { + limit = { exists = scope:contract_success } + scope:task_contract = { complete_task_contract = success_standard } + # Add Trait XP to Partner + if = { + limit = { + NOT = { has_trait = lifestyle_merchant } + } + add_trait = lifestyle_merchant + } + else_if = { + limit = { + scope:task_contract = { has_task_contract_type = support_guilds } + } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_minor_value + } + } + else_if = { + limit = { + scope:task_contract = { has_task_contract_type = seek_debtors } + } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + merchant_creditor_capstone_prestige_effect = yes + } + } + else = { + scope:task_contract = { complete_task_contract = failure_standard } + } + } + + option = { # Ok + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:contract_success } + desc = gdp_merchant_trade_opportunity.9020.a.success + } + desc = gdp_merchant_trade_opportunity.9020.a.failure + } + } + } + } +} + +# Partner invalidation. +gdp_merchant_trade_opportunity.9021 = { + type = character_event + hidden = yes + + immediate = { + send_interface_toast = { + type = event_toast_text_and_effect_bad + title = trade_opportunity_invalidated_title + desc = trade_opportunity_invalidated_desc + left_icon = scope:partner + right_icon = scope:task_contract.task_contract_employer + scope:task_contract = { complete_task_contract = failure_standard } + } + } +} + +# Partner outcome setup. +gdp_merchant_trade_opportunity.9022 = { + type = character_event + hidden = yes + + trigger = { + any_character_active_contract = { + var:contract_partner ?= { + this = scope:partner + has_court_position = partner_court_position + liege = root + is_available_quick = { + imprisoned = no + incapable = no + } + } + } + } + + immediate = { + scope:partner = { + random_list = { + 10 = { + modifier = { + "aptitude(partner_court_position)" >= 3 + add = 5 + } + modifier = { + "aptitude(partner_court_position)" >= 4 + add = 5 + } + save_scope_as = contract_success + } + 10 = { + modifier = { + "aptitude(partner_court_position)" <= 0 + add = 5 + } + modifier = { + "aptitude(partner_court_position)" <= 1 + add = 5 + } + } + } + } + trigger_event = gdp_merchant_trade_opportunity.9020 + } +} diff --git a/events/dlc/gdp/gdp_merchant_unity_contract_events.txt b/events/dlc/gdp/gdp_merchant_unity_contract_events.txt new file mode 100644 index 000000000..5656533a0 --- /dev/null +++ b/events/dlc/gdp/gdp_merchant_unity_contract_events.txt @@ -0,0 +1,2099 @@ +namespace = gdp_merchant_unity_contract + +#### +# unity_irregularities +# gdp_merchant_unity_contract.1001-1100 - ? +### + +scripted_effect gdp_merchant_unity_contract_1004_organise_travel_effect = { + start_travel_plan = { + destination = scope:destination + on_arrival_event = gdp_merchant_unity_contract.1010 + travel_with_domicile = no + return_trip = yes + on_travel_planner_cancel_event = gdp_merchant_unity_contract.1005 + players_use_planner = no + on_arrival_destinations = $EVENT_FIRE$ + } +} + +# Travel set-up event. +gdp_merchant_unity_contract.1004 = { + type = character_event + title = gdp_merchant_unity_contract.1004.t + desc = gdp_merchant_unity_contract.1004.desc + theme = trade + left_portrait = { + character = root + animation = worry + } + lower_center_portrait = scope:trader + lower_right_portrait = scope:local_ruler + override_background = { reference = study } + + option = { + name = gdp_merchant_unity_contract.1004.a + custom_tooltip = gdp_merchant_unity_contract.1004.tt.destination_list + custom_tooltip = gdp_merchant_unity_contract.1004.tt.explanation + gdp_merchant_unity_contract_1004_organise_travel_effect = { + EVENT_FIRE = all_but_last + } + } +} + +# Travel invalidation event. +gdp_merchant_unity_contract.1005 = { + hidden = yes + + trigger = { is_alive = yes } + + immediate = { + random_character_active_contract = { + task_contract_type = laamp_base_2001 + save_scope_as = task_contract + } + send_interface_message = { + title = contract_invalidated_title + type = stewardship_contract_scheme_invalidated_message + desc = contract_invalidated_desc + right_icon = scope:task_contract.task_contract_employer + scope:task_contract = { complete_task_contract = failure_standard } + } + } +} + +scripted_trigger gdp_merchant_unity_contract_1010_would_rip_off_customers_trigger = { + NOR = { + # Honest chars never lie. + has_trait = honest + # Just characters won't lie unless they're actively deceitful. + AND = { + has_trait = just + NOT = { has_trait = deceitful } + } + } +} + +scripted_effect gdp_merchant_unity_contract_1010_find_partner_effect = { + # Clean the partner if they exist (in case they die between events). + clear_saved_scope = partner + # Now nab 'em afresh. + court_position:partner_court_position ?= { + if = { + limit = { + is_available_allow_travelling = yes + location = root.location + # Not subject of investigation + NOT = { this = scope:task_contract.task_contract_employer } + } + save_scope_as = partner + } + } +} + +scripted_effect gdp_merchant_unity_contract_1010_person_scope_effect = { + if = { + limit = { + NOT = { exists = scope:person_c } + } + save_scope_as = person_c + } + else_if = { + limit = { + NOT = { exists = scope:person_d } + } + save_scope_as = person_d + } +} + +scripted_trigger gdp_merchant_unity_contract_1010_person_scope_trigger = { + is_available_quick = { + ai = yes + adult = yes + imprisoned = no + incapable = no + } + NOR = { + scope:person_c ?= this + scope:person_d ?= this + } +} + +# Arrival at market event. +gdp_merchant_unity_contract.1010 = { + type = character_event + title = gdp_merchant_unity_contract.1010.t + window = visit_settlement_window + desc = { + desc = gdp_merchant_unity_contract.1010.desc.intro + triggered_desc = { + trigger = { exists = scope:partner } + desc = gdp_merchant_unity_contract.1010.desc.intro.has_partner + } + desc = gdp_merchant_unity_contract.1010.desc.midtro + desc = gdp_merchant_unity_contract.1010.desc.outro + } + theme = trade + left_portrait = { + character = root + animation = thinking + } + center_portrait = { + character = scope:local_ruler + animation = dismissal + } + right_portrait = { + character = scope:trader + animation = disapproval + } + lower_left_portrait = scope:person_c + lower_center_portrait = scope:person_d + override_background = { reference = alley_day } + + immediate = { + scope:trader = { + random_list = { + # Trader is a bad'n + 100 = { + trigger = { gdp_merchant_unity_contract_1010_would_rip_off_customers_trigger = yes } + save_scope_value_as = { + name = irregularity + value = flag:missing + } + } + # Trader is only human + 100 = { + trigger = { gdp_merchant_unity_contract_1010_would_rip_off_customers_trigger = yes } + save_scope_value_as = { + name = irregularity + value = flag:quality + } + } + # Trader is a good'n + 100 = { + save_scope_value_as = { + name = irregularity + value = flag:dues + } + } + } + } + # Find merchants + scope:market = { + every_character_in_market = { + limit = { + government_has_flag = government_is_merchant + NOT = { this = root } + gdp_merchant_unity_contract_1010_person_scope_trigger = yes + } + add_to_temporary_list = potential_merchants_1 + } + every_trade_route_in_market = { + limit = { + trade_route_owner = { + government_has_flag = government_is_merchant + NOR = { + this = root + is_in_list = potential_merchants_1 + } + gdp_merchant_unity_contract_1010_person_scope_trigger = yes + } + } + trade_route_owner = { add_to_temporary_list = potential_merchants_2 } + } + every_in_global_list = { + variable = merchants_tally + limit = { + holder = { + NOR = { + this = root + is_in_list = potential_merchants_1 + is_in_list = potential_merchants_2 + } + gdp_merchant_diplo_range_trigger = { + MERCHANT = this + TARGET = root + } + gdp_merchant_diplo_range_trigger = { + MERCHANT = this + TARGET = scope:local_ruler + } + gdp_merchant_unity_contract_1010_person_scope_trigger = yes + } + } + holder = { add_to_temporary_list = potential_merchants_3 } + } + } + hidden_effect = { + while = { + limit = { + NOT = { exists = scope:person_d } + } + random_list = { + 7 = { + trigger = { + list_size = { name = potential_merchants_1 value > 0 } + } + random_in_list = { + list = potential_merchants_1 + limit = { gdp_merchant_unity_contract_1010_person_scope_trigger = yes } + gdp_merchant_unity_contract_1010_person_scope_effect = yes + remove_from_list = potential_merchants_1 + } + } + 7 = { + trigger = { + list_size = { name = potential_merchants_1 value < 1 } + list_size = { name = potential_merchants_2 value > 0 } + } + random_in_list = { + list = potential_merchants_2 + limit = { gdp_merchant_unity_contract_1010_person_scope_trigger = yes } + gdp_merchant_unity_contract_1010_person_scope_effect = yes + remove_from_list = potential_merchants_2 + } + } + 7 = { + trigger = { + list_size = { name = potential_merchants_1 value < 1 } + list_size = { name = potential_merchants_2 value < 1 } + list_size = { name = potential_merchants_3 value > 0 } + } + random_in_list = { + list = potential_merchants_3 + limit = { gdp_merchant_unity_contract_1010_person_scope_trigger = yes } + gdp_merchant_unity_contract_1010_person_scope_effect = yes + remove_from_list = potential_merchants_3 + } + } + 10 = { + scope:local_ruler = { + ordered_courtier = { + limit = { + OR = { + location = scope:destination + location = scope:local_ruler.capital_province + } + NOR = { + is_close_or_extended_family_of = scope:local_ruler + is_consort_of = scope:local_ruler + } + gdp_merchant_unity_contract_1010_person_scope_trigger = yes + } + order_by = { + value = 0 + add = stewardship + if = { + limit = { is_councillor = yes } + add = 10 + } + if = { + limit = { has_any_court_position = yes } + add = 10 + } + } + gdp_merchant_unity_contract_1010_person_scope_effect = yes + } + } + } + 10 = { + create_character = { + template = merchant_template + location = scope:destination + culture = scope:destination.culture + faith = scope:destination.faith + after_creation = { + add_character_flag = created + gdp_merchant_unity_contract_1010_person_scope_effect = yes + } + } + } + } + } + } + ### Append them to the task contract: if they die too early, we invalidate. + #### Largely a concern for MP. + scope:task_contract = { + set_variable = { + name = person_c + value = scope:person_c + } + set_variable = { + name = person_d + value = scope:person_d + } + } + # Note that we'll be taking our background cues from scope:person_b (local_ruler). + scope:local_ruler = { save_scope_as = bg_override_char } + # Try to grab our partner. + gdp_merchant_unity_contract_1010_find_partner_effect = yes + # Plus, stop us whilst we're here. + hidden_effect = { + current_travel_plan = { pause_travel_plan = yes } + } + } + + option = { # Meet scope:local_ruler (person_b). + name = gdp_merchant_unity_contract.1010.a + scope:local_ruler = { + custom_tooltip = gdp_merchant_unity_contract.1010.a.tt + save_scope_as = char_current + } + trigger_event = gdp_merchant_unity_contract.1011 + } + + option = { # Meet scope:person_c. + name = gdp_merchant_unity_contract.1010.b + trigger = { exists = scope:person_c } + scope:person_c = { + custom_tooltip = gdp_merchant_unity_contract.1010.a.tt + save_scope_as = char_current + } + trigger_event = gdp_merchant_unity_contract.1011 + } + + option = { # Meet scope:person_d. + name = gdp_merchant_unity_contract.1010.c + trigger = { exists = scope:person_d } + scope:person_d = { + custom_tooltip = gdp_merchant_unity_contract.1010.a.tt + save_scope_as = char_current + } + trigger_event = gdp_merchant_unity_contract.1011 + } + + option = { # Fast resolution. + name = gdp_merchant_unity_contract.1010.d + custom_tooltip = gdp_merchant_unity_contract.1012.tt.boilerplate.end_investigation + trigger_event = gdp_merchant_unity_contract.1021 + } +} + +scripted_effect gdp_merchant_unity_contract_1011_duel_success_effect = { + custom_tooltip = gdp_merchant_unity_contract.1011.tt.success_increases_score + scope:task_contract = { + increment_variable_effect = { + VAR = assurances_given + VAL = 1 + } + } + scope:task_contract = { + increment_variable_effect = { + VAR = chars_checked + VAL = 1 + } + } + save_scope_value_as = { + name = result + value = flag:success + } +} + +scripted_effect gdp_merchant_unity_contract_1011_duel_failure_effect = { + custom_tooltip = gdp_merchant_unity_contract.1011.tt.failure_gives_no_score + scope:task_contract = { + increment_variable_effect = { + VAR = chars_checked + VAL = 1 + } + } + save_scope_value_as = { + name = result + value = flag:failure + } +} + +scripted_effect gdp_merchant_unity_contract_1011_duel_generic_effect = { + save_scope_value_as = { + name = method + value = flag:$SKILL$ + } + duel = { + skill = $SKILL$ + target = scope:char_current + # Victory! + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_unity_contract.1011.$SKILL$.tt.success + gdp_merchant_unity_contract_1011_duel_success_effect = yes + } + # Defeat! + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_merchant_unity_contract.1011.$SKILL$.tt.failure + gdp_merchant_unity_contract_1011_duel_failure_effect = yes + } + } +} + +# Meet with someone. +gdp_merchant_unity_contract.1011 = { + type = character_event + title = gdp_merchant_unity_contract.1011.t + window = visit_settlement_window + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:business = flag:local_ruler } + desc = gdp_merchant_unity_contract.1011.desc.business.local_ruler + } + triggered_desc = { + trigger = { scope:business = flag:merchant } + desc = gdp_merchant_unity_contract.1011.desc.business.merchant + } + triggered_desc = { + trigger = { scope:business = flag:docks } + desc = gdp_merchant_unity_contract.1011.desc.business.docks + } + triggered_desc = { + trigger = { scope:business = flag:market } + desc = gdp_merchant_unity_contract.1011.desc.business.market + } + triggered_desc = { + trigger = { scope:business = flag:smithy } + desc = gdp_merchant_unity_contract.1011.desc.business.smithy + } + triggered_desc = { + trigger = { scope:business = flag:tannery } + desc = gdp_merchant_unity_contract.1011.desc.business.tannery + } + triggered_desc = { + trigger = { scope:business = flag:carpentry } + desc = gdp_merchant_unity_contract.1011.desc.business.carpentry + } + triggered_desc = { + trigger = { scope:business = flag:town_watch } + desc = gdp_merchant_unity_contract.1011.desc.business.town_watch + } + } + desc = boilerplate.paragraph + first_valid = { + triggered_desc = { + trigger = { scope:personality = flag:local_ruler } + desc = { + desc = gdp_merchant_unity_contract.1011.desc.personality.local_ruler + first_valid = { + triggered_desc = { + trigger = { scope:irregularity = flag:missing } + desc = gdp_merchant_unity_contract.1011.desc.irregularity.missing + } + triggered_desc = { + trigger = { scope:irregularity = flag:quality } + desc = gdp_merchant_unity_contract.1011.desc.irregularity.quality + } + triggered_desc = { + trigger = { scope:irregularity = flag:dues } + desc = gdp_merchant_unity_contract.1011.desc.irregularity.dues + } + } + } + } + triggered_desc = { + trigger = { scope:personality = flag:merchant } + desc = gdp_merchant_unity_contract.1011.desc.personality.merchant + } + triggered_desc = { + trigger = { scope:personality = flag:courtier } + desc = gdp_merchant_unity_contract.1011.desc.personality.courtier + } + triggered_desc = { + trigger = { + OR = { + scope:personality = flag:market + scope:personality = flag:docks + } + } + desc = gdp_merchant_unity_contract.1011.desc.personality.market + } + triggered_desc = { + trigger = { scope:personality = flag:town_watch } + desc = gdp_merchant_unity_contract.1011.desc.personality.town_watch + } + triggered_desc = { + trigger = { scope:personality = flag:ai_honor } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_honor + } + triggered_desc = { + trigger = { scope:personality = flag:ai_zeal } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_zeal + } + triggered_desc = { + trigger = { scope:personality = flag:ai_greed } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_greed + } + triggered_desc = { + trigger = { scope:personality = flag:ai_compassion } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_compassion + } + triggered_desc = { + trigger = { scope:personality = flag:ai_boldness } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_boldness + } + triggered_desc = { + trigger = { scope:personality = flag:ai_rationality } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_rationality + } + triggered_desc = { + trigger = { scope:personality = flag:ai_vengefulness } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_vengefulness + } + triggered_desc = { + trigger = { scope:personality = flag:ai_energy } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_energy + } + triggered_desc = { + trigger = { scope:personality = flag:ai_sociability } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_sociability + } + triggered_desc = { + trigger = { scope:personality = flag:ai_personality_fallback } + desc = gdp_merchant_unity_contract.1011.desc.personality.ai_personality_fallback + } + } + triggered_desc = { + trigger = { scope:personality = flag:local_ruler } + desc = gdp_merchant_unity_contract.1011.desc.personality.local_ruler.closing + } + } + theme = trade + left_portrait = { + character = scope:partner + animation = writing + } + center_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:char_current + triggered_animation = { + trigger = { scope:personality = flag:local_ruler } + animation = admiration + } + triggered_animation = { + trigger = { scope:business = flag:docks } + animation = page_flipping + } + triggered_animation = { + trigger = { scope:personality = flag:ai_honor } + animation = personality_honorable + } + triggered_animation = { + trigger = { scope:personality = flag:ai_zeal } + animation = personality_zealous + } + triggered_animation = { + trigger = { scope:personality = flag:ai_greed } + animation = personality_greedy + } + triggered_animation = { + trigger = { scope:personality = flag:ai_compassion } + animation = personality_compassionate + } + triggered_animation = { + trigger = { scope:personality = flag:ai_boldness } + animation = personality_bold + } + triggered_animation = { + trigger = { scope:personality = flag:ai_rationality } + animation = personality_rational + } + triggered_animation = { + trigger = { scope:personality = flag:ai_vengefulness } + animation = personality_vengeful + } + triggered_animation = { + trigger = { scope:personality = flag:ai_energy } + animation = personality_bold + } + triggered_animation = { + trigger = { scope:personality = flag:ai_sociability } + animation = personality_forgiving + } + triggered_animation = { + trigger = { scope:personality = flag:ai_personality_fallback } + animation = stress + } + } + lower_left_portrait = scope:portrait_1 + lower_center_portrait = scope:portrait_2 + lower_right_portrait = scope:portrait_3 + # Backgrounds indented +1 for easier folding. + override_background = { + trigger = { scope:business = flag:local_ruler } + reference = council_chamber + } + override_background = { + trigger = { scope:business = flag:courtier } + reference = council_chamber + } + override_background = { + trigger = { scope:business = flag:merchant } + reference = study + } + override_background = { + trigger = { scope:business = flag:docks } + reference = docks + } + override_background = { + trigger = { scope:business = flag:market } + reference = market_crowd + } + override_background = { + trigger = { scope:business = flag:smithy } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { scope:business = flag:tannery } + reference = gdp_tannery + } + override_background = { + trigger = { scope:business = flag:carpentry } + reference = gdp_carpentry_workshop + } + override_background = { + trigger = { scope:business = flag:town_watch } + reference = armory + } + + immediate = { + # Try to grab our partner. + gdp_merchant_unity_contract_1010_find_partner_effect = yes + custom_tooltip = gdp_merchant_unity_contract.1011.tt.current_assurances + custom_tooltip = gdp_merchant_unity_contract.1011.tt.chars_checked + # Sort our loot. + random_list = { + # Gold. + 200 = { + trigger = { + scope:char_current = { is_clergy = no } + } + save_scope_value_as = { + name = bribe + value = flag:gold + } + } + 200 = { + trigger = { + scope:char_current = { government_has_flag = government_is_merchant } + } + save_scope_value_as = { + name = bribe + value = flag:competitiveness + } + } + 200 = { + trigger = { + scope:char_current = { + OR = { + is_clergy = yes + government_has_flag = government_is_holy_order + } + } + } + save_scope_value_as = { + name = bribe + value = flag:piety + } + } + } + # And what our secondary skill test will be. + random_list = { + # Diplomacy. + 100 = { + trigger = { + NOT = { scope:secondary_duel = flag:diplomacy } # Variety + } + modifier = { + add = 200 + scope:char_current = { highest_skill = diplomacy } + } + save_scope_value_as = { + name = secondary_duel + value = flag:diplomacy + } + } + # Intrigue. + 100 = { + trigger = { + NOT = { scope:secondary_duel = flag:intrigue } # Variety + } + modifier = { + add = 200 + scope:char_current = { highest_skill = intrigue } + } + save_scope_value_as = { + name = secondary_duel + value = flag:intrigue + } + } + } + # Personalise the event. + ## If we're looking at scope:local_ruler, then we pre-configure this stuff. + if = { + limit = { scope:char_current = scope:local_ruler } + save_scope_value_as = { + name = business + value = flag:local_ruler + } + save_scope_value_as = { + name = personality + value = flag:local_ruler + } + } + ## If we're looking at scope:trader, then we pre-configure this stuff. + else_if = { + limit = { scope:char_current = scope:trader } + save_scope_value_as = { + name = business + value = flag:merchant + } + save_scope_value_as = { + name = personality + value = flag:merchant + } + } + ## If we're looking at a courtier of the ruler, then we pre-configure this stuff. + else_if = { + limit = { scope:char_current.liege = scope:local_ruler } + save_scope_value_as = { + name = business + value = flag:courtier + } + save_scope_value_as = { + name = personality + value = flag:courtier + } + } + ## Otherwise, we're looking at one of the others and need to roll for it. + else = { + scope:char_current = { + # Select a business for them to run. + random_list = { + 100 = { + trigger = { + scope:destination = { is_coastal = yes } + } + modifier = { + add = -99 + scope:task_contract = { has_variable = had_docks_business } + } + save_scope_value_as = { + name = business + value = flag:docks + } + scope:task_contract = { set_variable = had_docks_business } + } + 100 = { + trigger = { + NOT = { has_trait = generous } + } + modifier = { + add = -99 + scope:task_contract = { has_variable = had_market_business } + } + save_scope_value_as = { + name = business + value = flag:market + } + scope:task_contract = { set_variable = had_market_business } + } + 100 = { + modifier = { + add = -99 + scope:task_contract = { has_variable = had_smithy_business } + } + save_scope_value_as = { + name = business + value = flag:smithy + } + scope:task_contract = { set_variable = had_smithy_business } + } + 100 = { + modifier = { + add = -99 + scope:task_contract = { has_variable = had_tannery_business } + } + save_scope_value_as = { + name = business + value = flag:tannery + } + scope:task_contract = { set_variable = had_tannery_business } + } + 100 = { + modifier = { + add = -99 + scope:task_contract = { has_variable = had_carpentry_business } + } + save_scope_value_as = { + name = business + value = flag:carpentry + } + scope:task_contract = { set_variable = had_carpentry_business } + } + 100 = { + trigger = { + can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = this } + } + modifier = { + add = -99 + scope:task_contract = { has_variable = had_town_watch_business } + } + save_scope_value_as = { + name = business + value = flag:town_watch + } + scope:task_contract = { set_variable = had_town_watch_business } + add_character_flag = wear_armor + } + } + select_merchant_personality_type_effect = yes + } + ## If we're looking at a merchant, then we post-configure this stuff. + if = { + limit = { + scope:char_current = { + is_ruler = yes + government_has_flag = government_is_merchant + } + } + save_scope_value_as = { + name = business + value = flag:merchant + } + } + } + ## Organise our portraits. + switch = { + trigger = scope:char_current + scope:person_b = { + scope:person_c = { save_scope_as = portrait_1 } + scope:person_d = { save_scope_as = portrait_2 } + } + scope:person_c = { + scope:person_b = { save_scope_as = portrait_1 } + scope:person_d = { save_scope_as = portrait_2 } + } + scope:person_d = { + scope:person_b = { save_scope_as = portrait_1 } + scope:person_c = { save_scope_as = portrait_2 } + } + } + # Fix values + save_scope_value_as = { + name = reimburse_value + value = { + integer_range = { + min = scope:char_current.minor_gold_value + max = scope:char_current.medium_gold_value + } + } + } + save_scope_value_as = { + name = bribe_value + value = { + integer_range = { + min = minor_gold_value + max = medium_gold_value + } + } + } + # Note that we've seen this character. + scope:char_current = { add_to_list = investigated_persons_list } + } + + # Huck partner at the problem. + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:partner } + desc = gdp_merchant_unity_contract.1011.f.partner + } + triggered_desc = { + trigger = { employs_court_position = partner_court_position } + desc = gdp_merchant_unity_contract.1011.f.partner_away + } + triggered_desc = { + trigger = { scope:partner ?= scope:trader } + desc = gdp_merchant_unity_contract.1011.f.partner_diff + } + desc = gdp_merchant_unity_contract.1011.f.no_partner + } + } + } + trigger = { + exists = scope:partner + NOT = { scope:partner ?= scope:trader } + } + show_as_unavailable = { always = yes } + reason = have_partner + save_scope_value_as = { + name = method + value = flag:partner + } + scope:partner ?= { + stress_and_fulfillment_impact = { + base = medium_stress_gain + greedy = minor_stress_impact_loss + diligent = minor_stress_impact_loss + generous = minor_stress_impact_gain + lazy = medium_stress_impact_gain + } + } + custom_tooltip = option_boilerplate.tt.partner_aptitude + # Extra exists check because otherwise show_as_unavailable'll cause errors. + if = { + limit = { exists = scope:partner } + random_list = { + 0 = { + desc = option_boilerplate.tt.partner_aptitude.success + gdp_merchant_unity_contract_1011_duel_success_effect = yes + # Raw aptitude. + modifier = { + add = { + scope:partner ?= { add = "aptitude(partner_court_position)" } + multiply = 20 + min = 5 + max = 95 + } + always = yes + } + } + 0 = { + desc = option_boilerplate.tt.partner_aptitude.failure + gdp_merchant_unity_contract_1011_duel_failure_effect = yes + # Raw aptitude. + modifier = { + add = { + scope:partner ?= { add = "aptitude(partner_court_position)" } + multiply = -20 + min = 5 + max = 95 + } + always = yes + } + } + } + } + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_loss + diligent = minor_stress_impact_gain + } + ai_chance = { + base = 1 + modifier = { + add = { + scope:partner = { add = "aptitude(partner_court_position)" } + multiply = 20 + } + exists = scope:partner + } + } + } + + # Convince with stewardship (jargon). + option = { + name = gdp_merchant_unity_contract.1011.a + gdp_merchant_unity_contract_1011_duel_generic_effect = { SKILL = stewardship } + ai_chance = { + base = 1 + # AI will prioritise this if it lines up with their highest skill. + modifier = { + add = 100 + highest_skill = stewardship + } + } + } + + # Secondary convince with diplo. + option = { + name = gdp_merchant_unity_contract.1011.b + trigger = { scope:secondary_duel = flag:diplomacy } + gdp_merchant_unity_contract_1011_duel_generic_effect = { SKILL = diplomacy } + ai_chance = { + base = 1 + # AI will prioritise this if it lines up with their highest skill. + modifier = { + add = 100 + highest_skill = diplomacy + } + } + } + + # Secondary convince with intrigue. + option = { + name = gdp_merchant_unity_contract.1011.c + trigger = { scope:secondary_duel = flag:intrigue } + gdp_merchant_unity_contract_1011_duel_generic_effect = { SKILL = intrigue } + ai_chance = { + base = 1 + # AI will prioritise this if it lines up with their highest skill. + modifier = { + add = 100 + highest_skill = intrigue + } + } + } + + # Reimburse them. + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { scope:bribe = flag:gold } + desc = gdp_merchant_unity_contract.1011.d.gold + } + triggered_desc = { + trigger = { scope:bribe = flag:competitiveness } + desc = gdp_merchant_unity_contract.1011.d.competitiveness + } + } + } + } + trigger = { + NOR = { + scope:business = flag:local_ruler + scope:business = flag:courtier + scope:business = flag:town_watch + scope:business = flag:docks + scope:business = flag:market + } + } + save_scope_value_as = { + name = method + value = flag:reimburse + } + switch = { + trigger = scope:bribe + flag:gold = { + pay_treasury_or_gold = { + target = scope:char_current + value = scope:reimburse_value + } + } + flag:competitiveness = { + scope:market = { + add_competitiveness_modifier_for_character = { + modifier = gdp_unity_irregularities_reimburse_modifier + character = scope:char_current + years = 10 + } + } + } + flag:piety = { + add_piety = medium_piety_loss + } + } + scope:char_current = { add_to_list = bribed_chars_list } + gdp_merchant_unity_contract_1011_duel_success_effect = yes + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_gain + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + just = medium_stress_impact_loss + } + ai_chance = { + base = 1 + ai_value_modifier = { ai_greed = -2 } + } + } + + # Bribe them. + option = { + name = gdp_merchant_unity_contract.1011.e + trigger = { + OR = { + scope:business = flag:local_ruler + scope:business = flag:courtier + scope:business = flag:town_watch + scope:business = flag:docks + scope:business = flag:market + } + } + save_scope_value_as = { + name = method + value = flag:bribe + } + scope:char_current = { add_to_list = bribed_chars_list } + random_list = { + 100 = { + modifier = { + add = { + value = scope:char_current.ai_greed + divide = 2 + } + } + opinion_modifier = { + who = scope:char_current + opinion_target = root + multiplier = 1 + } + min = 5 + pay_short_term_gold = { + target = scope:char_current + gold = scope:bribe_value + } + gdp_merchant_unity_contract_1011_duel_success_effect = yes + } + 10 = { + modifier = { + add = { + value = scope:char_current.ai_honor + divide = 2 + } + } + min = 5 + gdp_merchant_unity_contract_1011_duel_failure_effect = yes + reverse_add_opinion = { + target = scope:char_current + modifier = outraged_opinion + opinion = -25 + } + } + } + stress_and_fulfillment_impact = { + arbitrary = minor_stress_impact_loss + greedy = minor_stress_impact_gain + just = medium_stress_impact_gain + } + ai_chance = { + base = 1 + ai_value_modifier = { ai_honor = -2 } + } + } + + after = { trigger_event = gdp_merchant_unity_contract.1012 } +} + +# Meeting results. +gdp_merchant_unity_contract.1012 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { scope:result = flag:success } + desc = gdp_merchant_unity_contract.1012.t.success + } + triggered_desc = { + trigger = { scope:result = flag:failure } + desc = gdp_merchant_unity_contract.1012.t.failure + } + } + } + window = visit_settlement_window + desc = { + # Method fluff. + first_valid = { + triggered_desc = { + trigger = { scope:method = flag:stewardship } + desc = gdp_merchant_unity_contract.1012.desc.method.stewardship + } + triggered_desc = { + trigger = { scope:method = flag:diplomacy } + desc = gdp_merchant_unity_contract.1012.desc.method.diplomacy + } + triggered_desc = { + trigger = { scope:method = flag:intrigue } + desc = gdp_merchant_unity_contract.1012.desc.method.intrigue + } + triggered_desc = { + trigger = { scope:method = flag:learning } + desc = gdp_merchant_unity_contract.1012.desc.method.learning + } + triggered_desc = { + trigger = { scope:method = flag:partner } + desc = gdp_merchant_unity_contract.1012.desc.method.partner + } + triggered_desc = { + trigger = { + scope:method = flag:bribe + scope:bribe = flag:gold + } + desc = gdp_merchant_unity_contract.1012.desc.method.bribe.gold + } + triggered_desc = { + trigger = { scope:method = flag:reimburse } + desc = gdp_merchant_unity_contract.1012.desc.method.reimburse + } + } + desc = boilerplate.paragraph + # Result. + first_valid = { + triggered_desc = { + trigger = { + scope:method = flag:bribe + scope:result = flag:success + } + desc = gdp_merchant_unity_contract.1012.desc.result.bribe_success + } + triggered_desc = { + trigger = { + scope:method = flag:bribe + scope:result = flag:success + } + desc = gdp_merchant_unity_contract.1012.desc.result.bribe_failure + } + triggered_desc = { + trigger = { scope:method = flag:reimburse } + desc = gdp_merchant_unity_contract.1012.desc.result.reimburse + } + triggered_desc = { + trigger = { scope:result = flag:success } + desc = gdp_merchant_unity_contract.1012.desc.result.success + } + triggered_desc = { + trigger = { scope:result = flag:failure } + desc = gdp_merchant_unity_contract.1012.desc.result.failure + } + } + desc = boilerplate.paragraph + # Result. + first_valid = { + triggered_desc = { + trigger = { "list_size(investigated_persons_list)" >= 4 } + desc = gdp_merchant_unity_contract.1012.desc.result.outro.all_done + } + triggered_desc = { + trigger = { scope:result = flag:success } + desc = gdp_merchant_unity_contract.1012.desc.result.outro.success + } + triggered_desc = { + trigger = { scope:result = flag:failure } + desc = gdp_merchant_unity_contract.1012.desc.result.outro.failure + } + triggered_desc = { + trigger = { scope:result = flag:bribe } + desc = gdp_merchant_unity_contract.1012.desc.result.outro.bribe + } + triggered_desc = { + trigger = { scope:result = flag:reimburse } + desc = gdp_merchant_unity_contract.1012.desc.result.outro.reimburse + } + } + } + theme = trade + left_portrait = { + character = scope:partner + animation = debating + trigger = { scope:method = flag:partner } + } + center_portrait = { + character = root + triggered_animation = { + trigger = { scope:method = flag:reimburse } + animation = steward + } + triggered_animation = { + trigger = { scope:method = flag:bribe } + animation = bribing + } + triggered_animation = { + trigger = { scope:result = flag:success } + animation = debating + } + triggered_animation = { + trigger = { scope:result = flag:failure } + animation = stress + } + camera = camera_event_scheme_center + } + right_portrait = { + character = scope:char_current + triggered_animation = { + trigger = { scope:method = flag:reimburse } + animation = admiration + } + triggered_animation = { + trigger = { + scope:method = flag:bribe + scope:result = flag:success + } + animation = happiness + } + triggered_animation = { + trigger = { scope:method = flag:bribe } + animation = anger + } + triggered_animation = { + trigger = { scope:result = flag:success } + animation = worry + } + triggered_animation = { + trigger = { scope:result = flag:failure } + animation = dismissal + } + triggered_animation = { + trigger = { scope:result = flag:ignored } + animation = anger + } + } + lower_left_portrait = scope:portrait_1 + lower_center_portrait = scope:portrait_2 + lower_right_portrait = scope:portrait_3 + # Backgrounds indented +1 for easier folding. + override_background = { + trigger = { scope:business = flag:local_ruler } + reference = council_chamber + } + override_background = { + trigger = { scope:business = flag:courtier } + reference = council_chamber + } + override_background = { + trigger = { scope:business = flag:merchant } + reference = study + } + override_background = { + trigger = { scope:business = flag:docks } + reference = docks + } + override_background = { + trigger = { scope:business = flag:market } + reference = market_crowd + } + override_background = { + trigger = { scope:business = flag:smithy } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { scope:business = flag:tannery } + reference = gdp_tannery + } + override_background = { + trigger = { scope:business = flag:carpentry } + reference = gdp_carpentry_workshop + } + override_background = { + trigger = { scope:business = flag:town_watch } + reference = armory + } + + immediate = { + custom_tooltip = gdp_merchant_unity_contract.1011.tt.current_assurances + custom_tooltip = gdp_merchant_unity_contract.1011.tt.chars_checked + # Try to grab our partner. + gdp_merchant_unity_contract_1010_find_partner_effect = yes + } + + option = { # Investigate scope:local_ruler (person_b) next. + name = gdp_merchant_unity_contract.1012.a + trigger = { + NOT = { + scope:local_ruler = { is_in_list = investigated_persons_list } + } + } + custom_tooltip = gdp_merchant_unity_contract.1012.tt.boilerplate.continue_investigation + scope:local_ruler = { save_scope_as = char_current } + trigger_event = gdp_merchant_unity_contract.1011 + ai_chance = { + # Select a new target we haven't investigated yet at random. + base = 1000 + } + } + + option = { # Investigate scope:person_c next. + name = gdp_merchant_unity_contract.1012.b + trigger = { + NOT = { + scope:person_c = { is_in_list = investigated_persons_list } + } + } + custom_tooltip = gdp_merchant_unity_contract.1012.tt.boilerplate.continue_investigation + scope:person_c = { save_scope_as = char_current } + trigger_event = gdp_merchant_unity_contract.1011 + ai_chance = { + # Select a new target we haven't investigated yet at random. + base = 1000 + } + } + + option = { # Investigate scope:person_d next. + name = gdp_merchant_unity_contract.1012.c + trigger = { + NOT = { + scope:person_d = { is_in_list = investigated_persons_list } + } + } + custom_tooltip = gdp_merchant_unity_contract.1012.tt.boilerplate.continue_investigation + scope:person_d = { save_scope_as = char_current } + trigger_event = gdp_merchant_unity_contract.1011 + ai_chance = { + # Select a new target we haven't investigated yet at random. + base = 1000 + } + } + + option = { # Make your declaration. + name = gdp_merchant_unity_contract.1012.d + custom_tooltip = gdp_merchant_unity_contract.1012.tt.boilerplate.end_investigation + trigger_event = gdp_merchant_unity_contract.1021 + } +} + +# Settlement. +gdp_merchant_unity_contract.1021 = { + type = character_event + title = gdp_merchant_unity_contract.1021.t + window = visit_settlement_window + desc = { + desc = gdp_merchant_unity_contract.1021.desc.intro + first_valid = { + triggered_desc = { + trigger = { scope:task_contract.var:assurances_given >= 3 } + desc = gdp_merchant_unity_contract.1021.desc.assurances_given.three + } + triggered_desc = { + trigger = { scope:task_contract.var:assurances_given >= 2 } + desc = gdp_merchant_unity_contract.1021.desc.assurances_given.two + } + desc = gdp_merchant_unity_contract.1021.desc.assurances_given.one_or_less + } + desc = gdp_merchant_unity_contract.1021.desc.body + first_valid = { + triggered_desc = { + trigger = { scope:irregularity = flag:missing } + desc = gdp_merchant_unity_contract.1021.desc.irregularity.missing + } + triggered_desc = { + trigger = { scope:irregularity = flag:quality } + desc = gdp_merchant_unity_contract.1021.desc.irregularity.quality + } + triggered_desc = { + trigger = { scope:irregularity = flag:dues } + desc = gdp_merchant_unity_contract.1021.desc.irregularity.dues + } + } + } + theme = trade + left_portrait = { + character = root + animation = thinking + } + center_portrait = { + character = scope:local_ruler + animation = war_over_win + } + right_portrait = { + character = scope:trader + animation = worry + } + lower_left_portrait = scope:person_c + lower_center_portrait = scope:person_d + override_background = { reference = market } + + immediate = { + custom_tooltip = gdp_merchant_unity_contract.1011.tt.current_assurances + custom_tooltip = gdp_merchant_unity_contract.1011.tt.chars_checked + # And what does that mean? + ## Max assurances — exceptional within reach. + if = { + limit = { scope:task_contract.var:assurances_given >= 4 } + custom_tooltip = gdp_merchant_unity_contract.1021.tt.clue_total.exceptional_achievable + } + ## 2-3 assurances — normal within reach. + else_if = { + limit = { scope:task_contract.var:assurances_given >= 2 } + custom_tooltip = gdp_merchant_unity_contract.1021.tt.clue_total.normal_achievable + } + ## 1 assurances — failure possible if they're forced. + else = { custom_tooltip = gdp_merchant_unity_contract.1021.tt.clue_total.failure_possible } + } + + # Attempt to smooth over. + option = { + name = gdp_merchant_unity_contract.1021.a + custom_tooltip = gdp_merchant_unity_contract.1021.a.tt + show_as_tooltip = { + scope:task_contract = { + if = { + limit = { var:assurances_given >= 3 } + scope:task_contract = { complete_task_contract = success_critical } + } + else_if = { + limit = { var:assurances_given >= 2 } + scope:task_contract = { complete_task_contract = success_standard } + } + else = { + random_list = { + 100 = { + show_chance = no + desc = gdp_merchant_unity_contract.1021.a.tt.success_qualified + complete_task_contract = success_qualified_insufficient_assurances + } + 100 = { + show_chance = no + desc = gdp_merchant_unity_contract.1021.a.tt.failure_standard + complete_task_contract = failure_standard + } + } + } + } + } + if = { + limit = { scope:task_contract.var:assurances_given < 2 } + # A calm or craven scope:local_ruler will never do this. + if = { + limit = { + scope:local_ruler = { + OR = { + has_trait = calm + has_trait = craven + } + } + } + save_scope_value_as = { + name = total_result + value = flag:success_qualified_insufficient_assurances + } + } + # A wrathful scope:local_ruler will _only_ do this. + else_if = { + limit = { + scope:local_ruler = { has_trait = wrathful } + } + save_scope_value_as = { + name = total_result + value = flag:failure_standard + } + } + # Everyone else rolls the highest of their boldness or vengeance, min 20%. + else = { + random = { + chance = { + if = { + limit = { scope:local_ruler.ai_vengefulness >= scope:local_ruler.ai_boldness } + add = scope:local_ruler.ai_vengefulness + } + else = { add = scope:local_ruler.ai_boldness } + min = 20 + # Plus weight this down a bit for every person we bribed. + every_in_list = { + list = bribed_chars_list + add = -10 + } + } + save_scope_value_as = { + name = total_result + value = flag:failure_standard + } + } + # If our roll produced no scope, then that means we've opted for peace. + if = { + limit = { + NOT = { exists = scope:total_result } + } + save_scope_value_as = { + name = total_result + value = flag:success_qualified_insufficient_evidence + } + scope:task_contract = { complete_task_contract = success_qualified_insufficient_evidence } + } + } + } + trigger_event = gdp_merchant_unity_contract.1022 + stress_and_fulfillment_impact = { + just = minor_stress_impact_loss + } + ai_chance = { + base = 1 + modifier = { + add = 200 + scope:task_contract.var:assurances_given >= 2 + } + } + } + + # Deny, deny, deny. + option = { + name = gdp_merchant_unity_contract.1021.c + custom_tooltip = gdp_merchant_unity_contract.1021.c.tt + show_as_tooltip = { + scope:task_contract = { complete_task_contract = failure_denial } + } + trigger_event = gdp_merchant_unity_contract.1023 + stress_and_fulfillment_impact = { + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + craven = minor_stress_impact_gain + arbitrary = minor_stress_impact_loss + } + ai_chance = { + base = 1 + ai_value_modifier = { + ai_boldness = 1 + ai_honor = -1 + } + } + } + + # Punish. + option = { + name = gdp_merchant_unity_contract.1021.d + trigger = { + NOT = { is_spouse_of = scope:trader } + } + show_as_unavailable = { always = yes } + custom_tooltip = gdp_merchant_unity_contract.1021.d.tt + show_as_tooltip = { + scope:task_contract = { complete_task_contract = success_qualified_betrayed_trader } + } + if = { + limit = { has_relation_lover = scope:trader } + remove_relation_lover = scope:trader + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + } + if = { + limit = { has_relation_friend = scope:trader } + remove_relation_friend = scope:trader + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + } + trigger_event = gdp_merchant_unity_contract.1024 + stress_and_fulfillment_impact = { + callous = minor_stress_impact_loss + just = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 1 + ai_value_modifier = { + ai_compassion = -1 + ai_honor = -1 + } + } + } +} + +scripted_trigger gdp_merchant_unity_contract_1022_valid_admirer_trigger = { + "opinion(root)" >= 25 + OR = { + sum_of_all_skills_and_prowess_value >= 60 + average_of_all_skills_and_prowess >= 10 + highest_skill_value >= extremely_high_skill_rating + } +} + +# Conclusion: tried to smooth over. +gdp_merchant_unity_contract.1022 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { scope:total_result = flag:success_critical } + desc = gdp_merchant_unity_contract.1022.t.success_critical + } + triggered_desc = { + trigger = { scope:total_result = flag:success_standard } + desc = gdp_merchant_unity_contract.1022.t.success_standard + } + triggered_desc = { + trigger = { scope:total_result = flag:success_qualified_insufficient_assurances } + desc = gdp_merchant_unity_contract.1022.t.success_qualified_insufficient_assurances + } + triggered_desc = { + trigger = { scope:total_result = flag:failure_standard } + desc = gdp_merchant_unity_contract.1022.t.failure_standard + } + } + } + window = visit_settlement_window + desc = { + first_valid = { + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:total_result = flag:success_critical } + desc = gdp_merchant_unity_contract.1022.desc.success_critical + } + triggered_desc = { + trigger = { scope:total_result = flag:success_standard } + desc = gdp_merchant_unity_contract.1022.desc.success_standard + } + triggered_desc = { + trigger = { scope:total_result = flag:success_qualified_insufficient_evidence } + desc = gdp_merchant_unity_contract.1022.desc.success_qualified_insufficient_evidence + } + triggered_desc = { + trigger = { scope:total_result = flag:failure_standard } + desc = gdp_merchant_unity_contract.1022.desc.failure_standard + } + } + } + } + } + theme = trade + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:total_result = flag:failure_standard } + animation = stress + } + triggered_animation = { + trigger = { scope:total_result = flag:success_qualified_insufficient_evidence } + animation = worry + } + triggered_animation = { + trigger = { + OR = { + scope:total_result = flag:success_critical + scope:total_result = flag:success_standard + } + } + animation = happiness + } + } + center_portrait = { + character = scope:local_ruler + triggered_animation = { + trigger = { scope:total_result = flag:failure_standard } + animation = disgust + } + triggered_animation = { + trigger = { scope:total_result = flag:success_qualified_insufficient_evidence } + animation = war_over_win + } + triggered_animation = { + trigger = { + OR = { + scope:total_result = flag:success_critical + scope:total_result = flag:success_standard + } + } + animation = war_over_tie + } + } + right_portrait = { + character = scope:trader + triggered_animation = { + trigger = { scope:total_result = flag:failure_standard } + animation = disbelief + } + triggered_animation = { + trigger = { scope:total_result = flag:success_qualified_insufficient_evidence } + animation = war_over_tie + } + triggered_animation = { + trigger = { + OR = { + scope:total_result = flag:success_critical + scope:total_result = flag:success_standard + } + } + animation = admiration + } + } + lower_left_portrait = scope:person_c + lower_center_portrait = scope:person_d + override_background = { reference = market } + + immediate = { + # Alrighty, let's process our results. + ## We got a crit success. + if = { + limit = { scope:task_contract.var:assurances_given >= 3 } + save_scope_value_as = { + name = total_result + value = flag:success_critical + } + scope:task_contract = { complete_task_contract = success_critical } + } + ## We got a standard success. + else_if = { + limit = { scope:task_contract.var:assurances_given >= 2 } + save_scope_value_as = { + name = total_result + value = flag:success_standard + } + scope:task_contract = { complete_task_contract = success_standard } + } + ## We got a qualified success. + else_if = { + limit = { scope:total_result = flag:success_qualified_insufficient_assurances } + scope:task_contract = { complete_task_contract = success_qualified_insufficient_assurances } + } + ## We done failed. + else = { + scope:task_contract = { complete_task_contract = failure_standard } + } + } + + # Critical success! + option = { + name = gdp_merchant_unity_contract.1022.a + trigger = { scope:total_result = flag:success_critical } + } + + # Success! + option = { + name = gdp_merchant_unity_contract.1022.b + trigger = { scope:total_result = flag:success_standard } + } + + # Partial success! + option = { + name = gdp_merchant_unity_contract.1022.c + trigger = { scope:total_result = flag:success_qualified_insufficient_assurances } + } + + # Failure! + option = { + name = gdp_merchant_unity_contract.1022.d + trigger = { scope:total_result = flag:failure_standard } + } + + after = { + if = { + limit = { scope:total_result = flag:success_critical } + # See if we might have an admirer. + ## First, grab our candidates. + scope:person_c = { + if = { + limit = { gdp_merchant_unity_contract_1022_valid_admirer_trigger = yes } + add_to_list = potential_admirers_list + } + } + scope:person_d = { + if = { + limit = { gdp_merchant_unity_contract_1022_valid_admirer_trigger = yes } + add_to_list = potential_admirers_list + } + } + ## Then, nab the best fit. + ordered_in_list = { + list = potential_admirers_list + order_by = { + add = sum_of_all_skills_and_prowess_value + add = average_of_all_skills_and_prowess + add = highest_skill_value + } + save_scope_as = hopeful + random = { + chance = 50 + root = { + trigger_event = { + id = gdp_merchant_unity_contract.1031 + years = { 3 6 } + } + } + } + } + } + current_travel_plan = { resume_travel_plan = yes } + return_home = yes + scope:person_c = { silent_disappearance_ai_if_created_effect = yes } + scope:person_d = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# Conclusion: denial. +gdp_merchant_unity_contract.1023 = { + type = character_event + title = gdp_merchant_unity_contract.1023.t + window = visit_settlement_window + desc = gdp_merchant_unity_contract.1023.desc + theme = trade + left_portrait = { + character = root + animation = debating + } + center_portrait = { + character = scope:trader + animation = dismissal + } + right_portrait = { + character = scope:local_ruler + animation = war_over_win + } + lower_left_portrait = scope:person_c + lower_center_portrait = scope:person_d + override_background = { reference = market } + + immediate = { + scope:task_contract = { complete_task_contract = failure_denial } + } + + option = { + name = gdp_merchant_unity_contract.1023.a + } + + after = { + hidden_effect = { + current_travel_plan = { resume_travel_plan = yes } + return_home = yes + } + scope:person_c = { silent_disappearance_ai_if_created_effect = yes } + scope:person_d = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# Conclusion: punish. +gdp_merchant_unity_contract.1024 = { + type = character_event + title = gdp_merchant_unity_contract.1024.t + window = visit_settlement_window + desc = gdp_merchant_unity_contract.1024.desc + theme = trade + left_portrait = { + character = root + animation = war_over_win + } + center_portrait = { + character = scope:local_ruler + animation = dismissal + } + right_portrait = { + character = scope:trader + animation = prisonhouse + override_imprisonment_visuals = yes + } + lower_left_portrait = scope:person_c + lower_center_portrait = scope:person_d + override_background = { reference = market } + + immediate = { + scope:task_contract = { complete_task_contract = success_qualified_betrayed_trader } + } + + option = { + name = gdp_merchant_unity_contract.1024.a + } + + after = { + hidden_effect = { + current_travel_plan = { resume_travel_plan = yes } + return_home = yes + } + scope:person_c = { silent_disappearance_ai_if_created_effect = yes } + scope:person_d = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# Follow-up: impressed secondary char follows you. +gdp_merchant_unity_contract.1031 = { + type = character_event + title = gdp_merchant_unity_contract.1031.t + desc = gdp_merchant_unity_contract.1031.desc + theme = trade + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:hopeful + animation = admiration + } + override_background = { reference = market } + + trigger = { + is_location_valid_for_travel_event_on_land = yes + government_has_flag = government_is_merchant + scope:hopeful = { + is_ruler = no + is_available_quick = { + ai = yes + alive = yes + imprisoned = no + incapable = no + } + is_alive = yes + is_ruler = no + is_imprisoned = no + NOR = { + liege ?= { is_ai = no } + any_spouse = { is_ai = no } + } + } + } + + immediate = { + scope:hopeful = { + set_location = { location = root.location } + } + } + + # I accept. + option = { + name = gdp_merchant_unity_contract.1031.a + add_courtier = scope:hopeful + reverse_add_opinion = { + target = scope:hopeful + modifier = grateful_opinion + opinion = 150 + } + hidden_effect = { + reverse_add_opinion = { + target = scope:hopeful + modifier = recruited_me_opinion + opinion = 50 + } + } + ai_chance = { + # Free courtier. + base = 1000 + } + } + + # You'd be a waste of salt. + option = { + name = gdp_merchant_unity_contract.1031.b + add_prestige = minor_prestige_gain + hidden_effect = { + scope:hopeful = { silent_disappearance_effect = yes } + } + stress_and_fulfillment_impact = { + callous = medium_stress_impact_loss + sadistic = medium_stress_impact_loss + compassionate = minor_stress_impact_gain + } + # No AI chance — we always want them to take the courtier. + } +} + +# Handling expiry. +gdp_merchant_unity_contract.1041 = { + type = character_event + hidden = yes + + trigger = { + any_character_task_contract = { this = scope:task_contract } + NOT = { + any_character_active_contract = { this = scope:task_contract } + } + } + + immediate = { + scope:task_contract = { set_variable = expired } + } +} + +gdp_merchant_unity_contract.9999 = { # suppressor + type = character_event + hidden = yes + orphan = yes + + trigger = { + exists = var:expiry + } + + immediate = { + set_variable = expiry + } +} diff --git a/events/dlc/gdp/gdp_patrician_find_secrets_scheme_events.txt b/events/dlc/gdp/gdp_patrician_find_secrets_scheme_events.txt new file mode 100644 index 000000000..28930d521 --- /dev/null +++ b/events/dlc/gdp/gdp_patrician_find_secrets_scheme_events.txt @@ -0,0 +1,143 @@ +namespace = gdp_patrician_find_secrets + +gdp_patrician_find_secrets.0001 = { + hidden = yes + + immediate = { + scope:owner = { + save_scope_as = councillor + save_scope_as = councillor_liege + } + + random = { + chance = scope:scheme.scheme_success_chance + save_scope_value_as = { + name = patrician_find_secrets_successful + value = yes + } + } + + if = { + limit = { exists = scope:patrician_find_secrets_successful } + + scope:target.house ?= { + every_house_member = { + limit = { + is_alive = yes + top_liege = scope:target.top_liege + has_any_secrets = yes + } + every_secret = { + limit = { + OR = { + spymaster_task_find_secrets_suitable_major_secret_trigger = yes + spymaster_task_find_secrets_suitable_minor_secret_trigger = yes + } + NOT = { is_in_list = suitable_patrician_secrets } + } + add_to_temporary_list = suitable_patrician_secrets + } + } + } + + if = { + limit = { + any_in_list = { list = suitable_patrician_secrets } + } + random_in_list = { + list = suitable_patrician_secrets + weight = { + base = 1 + modifier = { + add = 4 + spymaster_task_find_secrets_suitable_major_secret_trigger = yes + } + modifier = { + add = 3 + secret_owner = scope:target + } + } + save_scope_as = secret_to_reveal + secret_owner = { save_scope_as = secret_holder } + } + scope:owner = { trigger_event = gdp_patrician_find_secrets.0002 } + } + else = { + scope:owner = { trigger_event = gdp_patrician_find_secrets.0003 } + } + } + else = { + scope:owner = { trigger_event = gdp_patrician_find_secrets.0003 } + } + } +} + +gdp_patrician_find_secrets.0002 = { + type = character_event + window = scheme_successful_event + title = gdp_patrician_find_secrets.0002.t + desc = gdp_patrician_find_secrets.0002.desc + theme = intrigue + + left_portrait = { + character = scope:secret_holder + animation = worry + } + lower_right_portrait = { + trigger = { + scope:secret_holder != scope:target + } + character = scope:target + } + + option = { + name = gdp_patrician_find_secrets.0002.a + scope:secret_to_reveal = { + reveal_to_without_events_effect = { + CHARACTER = root + } + } + scope:scheme = { end_scheme = yes } + } +} + +gdp_patrician_find_secrets.0003 = { + type = character_event + window = scheme_failed_event + title = gdp_patrician_find_secrets.0003.t + desc = { + triggered_desc = { + trigger = { exists = scope:patrician_find_secrets_successful } + desc = gdp_patrician_find_secrets.0003.desc.nothing_to_find + } + triggered_desc = { + trigger = { NOT = { exists = scope:patrician_find_secrets_successful } } + desc = gdp_patrician_find_secrets.0003.desc.outmatched + } + } + theme = intrigue + + left_portrait = { + character = root + animation = disappointed + } + lower_right_portrait = scope:target + + immediate = { + if = { + limit = { + NOT = { exists = scope:patrician_find_secrets_successful } + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + deceitful = minor_stress_impact_gain + } + } + } + + option = { + name = gdp_patrician_find_secrets.0003.a + scope:scheme = { end_scheme = yes } + } +} diff --git a/events/dlc/gdp/gdp_purpose_events.txt b/events/dlc/gdp/gdp_purpose_events.txt new file mode 100644 index 000000000..76a3f9a7e --- /dev/null +++ b/events/dlc/gdp/gdp_purpose_events.txt @@ -0,0 +1,376 @@ +namespace = gdp_purpose_events + +# You are in debt, ask a merchant for a loan +gdp_purpose_events.0001 = { + type = letter_event + opening = gdp_purpose_events.0001.opening + desc = gdp_purpose_events.0001.desc + sender = scope:merchant + cooldown = { years = 10 } + + trigger = { + gold <= -100 + is_landed = yes + any_in_global_list = { + variable = merchants_tally + holder = { + this != root + has_realm_law = company_purpose_creditor + NOT = { has_character_flag = merchant_lent_money_recently } + government_has_flag = government_is_merchant + gdp_merchant_would_lend_to_borrower_trigger = { + BORROWER = root + } + short_term_gold >= root.major_gold_value + } + gdp_merchant_diplo_range_trigger = { + TARGET = root + MERCHANT = holder + } + } + } + + immediate = { + save_scope_as = indebted_ruler + random_in_global_list = { + variable = merchants_tally + limit = { + holder = { + this != root + has_realm_law = company_purpose_creditor + NOT = { has_character_flag = merchant_lent_money_recently } + government_has_flag = government_is_merchant + gdp_merchant_would_lend_to_borrower_trigger = { + BORROWER = root + } + short_term_gold >= root.major_gold_value + } + # Is within diplo range + gdp_merchant_diplo_range_trigger = { + TARGET = root + MERCHANT = holder + } + } + holder = { save_scope_as = merchant } + } + } + + + option = { # Send me the money! + name = gdp_purpose_events.0001.a + custom_tooltip = gdp_purpose_events.0001.a.tt + scope:merchant = { + add_character_flag = { + flag = merchant_lent_money_recently + years = 10 + } + trigger_event = gdp_purpose_events.0002 + } + } + + option = { # Nah + name = gdp_purpose_events.0001.b + custom_tooltip = no_thanks.tt + } +} + +# A ruler is in debt, asking you for a loan +gdp_purpose_events.0002 = { + type = letter_event + opening = gdp_purpose_events.0002.opening + desc = gdp_purpose_events.0002.desc + sender = scope:indebted_ruler + + immediate = { + scope:indebted_ruler = { save_scope_as = recipient } + } + + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + scope:merchant = { + gdp_usury_condemns_loan_trigger = { + BORROWER = scope:indebted_ruler + } + } + } + desc = gdp_purpose_events.0002.a.sin + } + desc = gdp_purpose_events.0002.a + } + } + } + scope:indebted_ruler = { + set_up_new_loan_effect = { + LENDER = scope:merchant + AMOUNT = major_gold_value + INSTRUMENT = flag:open + } + } + gdp_purpose_events_0002_lend_effect = yes + } + + option = { + name = gdp_purpose_events.0002.c + trigger = { + scope:merchant = { + gdp_usury_condemns_loan_trigger = { + BORROWER = scope:indebted_ruler + } + } + } + custom_tooltip = gdp_usury_disguised_loan_tt + scope:indebted_ruler = { + set_up_new_loan_effect = { + LENDER = scope:merchant + AMOUNT = major_gold_value + INSTRUMENT = flag:disguised + } + } + gdp_purpose_events_0002_lend_effect = yes + } + + option = { + name = gdp_purpose_events.0002.d + scope:indebted_ruler = { + set_up_new_loan_effect = { + LENDER = scope:merchant + AMOUNT = major_gold_value + INSTRUMENT = flag:free + } + } + gdp_purpose_events_0002_lend_effect = yes + } + + option = { # Nah + name = gdp_purpose_events.0002.b + scope:indebted_ruler = { + send_interface_toast = { + title = gdp_purpose_events.0002_fail_notification + type = event_toast_effect_bad + left_icon = scope:indebted_ruler + right_icon = scope:merchant + } + add_opinion = { + target = scope:merchant + modifier = annoyed_opinion + opinion = -5 + } + } + } +} + +# You are at war, ask a merchant for sponsorship +gdp_purpose_events.0003 = { + type = letter_event + opening = gdp_purpose_events.0001.opening + desc = gdp_purpose_events.0003.desc + sender = scope:merchant + orphan = yes + cooldown = { years = 10 } + + trigger = { + is_available_quick = { + at_war = yes + landed = yes + } + NOT = { + government_has_flag = government_is_herder + } + any_tributary = { + is_ai = yes + has_realm_law_flag = unlock_military_merchant_patron_requests + NOT = { has_character_flag = merchant_lent_money_recently } + government_has_flag = government_is_merchant + save_temporary_scope_as = temp_merchant + root = { + any_character_war = { + NOT = { is_participant = scope:temp_merchant } + } + } + short_term_gold >= sponsor_war_value + } + } + + immediate = { + save_scope_as = ruler + save_scope_as = temp_ruler # for the sponsor_war_value check + save_temporary_scope_value_as = { + name = sponsor_war_cost + value = sponsor_war_value + } + random_tributary = { + limit = { + is_ai = yes + has_realm_law_flag = unlock_military_merchant_patron_requests + NOT = { has_character_flag = merchant_lent_money_recently } + government_has_flag = government_is_merchant + save_temporary_scope_as = temp_merchant + root = { + any_character_war = { + NOT = { is_participant = scope:temp_merchant } + } + } + short_term_gold >= sponsor_war_value + } + weight = { + modifier = { add = short_term_gold } + opinion_modifier = { + opinion_target = root + multiplier = 1 + } + } + save_scope_as = merchant + } + } + + option = { # Sponsor me! + name = gdp_purpose_events.0003.a + custom_tooltip = gdp_purpose_events.0001.a.tt + scope:merchant = { + add_character_flag = { + flag = merchant_lent_money_recently + years = 10 + } + trigger_event = gdp_purpose_events.0004 + } + } + + option = { # Nah + name = gdp_purpose_events.0003.b + custom_tooltip = no_thanks.tt + } +} + +# A ruler is at war, asking you for sponsorship +gdp_purpose_events.0004 = { + type = letter_event + opening = gdp_purpose_events.0004.opening + desc = gdp_purpose_events.0004.desc + sender = scope:ruler + + option = { # Sponsor getherhim! + name = gdp_purpose_events.0004.a + ai_chance = { base = 50 } + scope:ruler = { + send_interface_toast = { + title = gdp_purpose_events.0002_notification + type = event_toast_effect_good + left_icon = scope:ruler + right_icon = scope:merchant + scope:merchant = { + send_interface_toast = { + title = gdp_purpose_events.0002_notification + type = event_toast_effect_good + left_icon = scope:merchant + right_icon = scope:ruler + scope:merchant = { + pay_short_term_gold = { + target = scope:ruler + gold = sponsor_war_value + } + add_hook = { + target = scope:ruler + type = indebted_hook + } + add_prestige = minor_prestige_gain + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + merchant_creditor_capstone_prestige_effect = yes + } + } + } + } + } + } + + option = { # Sponsor getherhim with a mercenary discount! + name = gdp_purpose_events.0004.b + ai_chance = { base = 50 } + scope:ruler = { + send_interface_toast = { + title = gdp_purpose_events.0002_notification + type = event_toast_effect_good + left_icon = scope:ruler + right_icon = scope:merchant + scope:merchant = { + send_interface_toast = { + title = gdp_purpose_events.0002_notification + type = event_toast_effect_good + left_icon = scope:merchant + right_icon = scope:ruler + scope:ruler = { + add_character_modifier = { + modifier = merchant_patron_fund_mercenaries_modifier + years = 10 + } + } + scope:merchant = { + remove_short_term_gold = sponsor_war_value + add_hook = { + target = scope:ruler + type = indebted_hook + } + add_prestige = minor_prestige_gain + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + merchant_creditor_capstone_prestige_effect = yes + } + } + } + } + } + } + + option = { # Nah + name = gdp_purpose_events.0002.b + scope:ruler = { + } + ai_chance = { + base = 25 + modifier = { + OR = { + opinion = { + target = scope:ruler + value <= 50 + } + faith = { + faith_hostility_level = { + target = scope:ruler.faith + value >= 1 + } + } + } + add = 75 + } + modifier = { + scope:ruler = { + is_ai = no + } + factor = 0 + } + } + scope:ruler = { + send_interface_toast = { + title = gdp_purpose_events.0002_fail_notification + type = event_toast_effect_bad + left_icon = scope:ruler + right_icon = scope:merchant + } + add_opinion = { + target = scope:merchant + modifier = annoyed_opinion + opinion = -5 + } + } + } +} diff --git a/events/dlc/gdp/gdp_republic_events.txt b/events/dlc/gdp/gdp_republic_events.txt new file mode 100644 index 000000000..950b740be --- /dev/null +++ b/events/dlc/gdp/gdp_republic_events.txt @@ -0,0 +1,615 @@ +########################## +# General Republic Events +########################## +namespace = republic_event + +### Follow-up/confirmation event for founding a republic - gdp_adopt_republic_government_decision +republic_event.0001 = { + type = character_event + window = big_event_window + title = republic_event.0001.t + desc = republic_event.0001.desc + theme = republic + + override_effect_2d = { + reference = legend_glow + } + + left_portrait = { + character = root + animation = toast_goblet + camera = camera_body_left_slight + } + + immediate = { + gdp_found_a_republic_effect = yes + } + + option = { + name = republic_event.0001.a + } +} + +### Follow-up/confirmation event for tribals adopting republican ways - gdp_adopt_republican_ways_decision +republic_event.0002 = { + type = character_event + window = big_event_window + title = republic_event.0002.t + desc = republic_event.0002.desc + theme = republic + + override_effect_2d = { + reference = legend_glow + } + + left_portrait = { + character = root + animation = toast_goblet + camera = camera_body_left_slight + } + + immediate = { + gdp_convert_tribal_realm_to_republic_effect = yes + } + + option = { + name = republic_event.0002.a + } +} + +### Follow-up/confirmation event for restoring the Roman Republic - gdp_restore_roman_republic_decision +republic_event.0100 = { + type = character_event + #window = big_event_window + window = fullscreen_event + title = republic_event.0100.t + desc = republic_event.0100.desc + theme = republic + override_background = { reference = ep3_triumph } + queue_icon = "gfx/interface/icons/laws/republic_type_roman_small.dds" + + immediate = { + gdp_restore_the_roman_republic_effect = yes + } + + option = { + name = republic_event.0100.a + + # Make Rome the capital, and give it some additional benefits + # If we don't hold Rome outselves, we revoke it + if = { + limit = { + title:c_roma.holder != root + } + create_title_and_vassal_change = { + type = revoked + 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 + } + # If Rome is not the capital already, make it so + if = { + limit = { + capital_county != title:c_roma + } + set_realm_capital = title:c_roma + } + # If Rome doesn't have a Great District, we add a Great Plaza for free + title:c_roma.title_province = { + if = { + limit = { + has_great_district = no + } + add_great_district = republic_great_plaza_district + } + } + } + + option = { + name = republic_event.0100.b + } +} + +### Notification/letter event from revoke_capital_trade_post_interaction +republic_event.0010 = { + type = letter_event + opening = { + desc = republic_event.0010.opening + } + desc = republic_event.0010.desc + sender = scope:actor + + immediate = { + show_as_tooltip = { + scope:actor.capital_province ?= { + set_trade_post_owner = scope:actor + } + } + } + + option = { + name = republic_event.0010.a + } +} + +### Notification/letter event from oust_trade_post_interaction +republic_event.0012 = { + type = letter_event + opening = { + desc = republic_event.0010.opening # We re-use the same loc key + } + desc = republic_event.0012.desc + sender = scope:actor + + immediate = { + scope:target.district_province ?= { + remove_district_type = trade_post_location_district + } + } + + option = { + name = republic_event.0012.a + } +} + +### Republic ruler (i.e. doge) is enforced to enact a new budget +# Based on tgp_china_ministry.0100, but separate because republics have their own treasury and budget setup +republic_event.0020 = { + type = character_event + title = republic_event.0020.t + desc = { + desc = republic_event.0020.intro + desc = newline.desc + # Desc depending on if you have someone to tell you about the budget or not + first_valid = { + triggered_desc = { + trigger = { + exists = scope:steward + } + desc = republic_event.0020.steward_desc + } + desc = republic_event.0020.solo_desc + } + # Reason for needing a new budget + first_valid = { + triggered_desc = { + trigger = { + monthly_character_treasury_balance < -40 + } + desc = republic_event.0020.deficit_desc + } + triggered_desc = { + trigger = { + character_treasury_new_budget_capacity >= { value = character_treasury_budget_capacity multiply = 1.3 } + } + desc = republic_event.0020.income_desc + } + desc = republic_event.0020.fallback_desc + } + triggered_desc = { + trigger = { + exists = scope:steward + } + desc = single_quotation_desc + } + } + theme = stewardship + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:steward } + animation = steward + } + triggered_animation = { + trigger = { NOT = { exists = scope:steward } } + animation = stressed_teacher + } + } + right_portrait = { + character = scope:steward + animation = stressed_teacher + } + + trigger = { + gdp_is_assembly_head_trigger = yes + has_treasury = yes + is_independent_ruler = yes + OR = { # You are not travelling, but we don't mind if AI is + is_ai = yes + is_travelling = no + } + OR = { + # The AI hasn't set a new budget recently + AND = { + is_ai = yes + treasury_months_since_budget_enact_date >= 60 + } + # The player hasn't set a new budget recently (time is more generous than for the AI) + treasury_months_since_budget_enact_date >= 96 + # Left over treasury is more than 30% larger than the last budget + character_treasury_new_budget_capacity >= { value = character_treasury_budget_capacity multiply = 1.3 } + # You are running too big a deficit + monthly_character_treasury_balance < -50 + } + } + + immediate = { + save_scope_as = treasury_ruler + # We pick the steward, or a vassal, preferring assembly members + if = { + limit = { exists = cp:councillor_steward } + cp:councillor_steward = { + save_scope_as = steward + } + } + else_if = { + limit = { + any_vassal = { + count > 0 + has_same_government = liege + } + } + random_vassal = { + limit = { + has_same_government = liege + } + weight = { + base = 1 + modifier = { + is_councillor = yes + add = 5 + } + modifier = { + is_assembly_member = yes + add = 25 + } + } + + save_scope_as = steward + } + } + + if = { + limit = { + exists = scope:steward + } + random_list = { + 10 = { + trigger = { + prefers_high_salary_budget_trigger = { CHARACTER = scope:steward } + } + save_scope_as = high_salary_budget + } + 15 = { # We skew it slightly in favor of a more balanced budget - for balancing reasons + trigger = { + prefers_medium_salary_budget_trigger = { CHARACTER = scope:steward } + } + save_scope_as = medium_salary_budget + } + 10 = { + trigger = { + prefers_low_salary_budget_trigger = { CHARACTER = scope:steward } + } + save_scope_as = low_salary_budget + } + } + } + } + + option = { # Set a budget + name = republic_event.0020.a + + custom_tooltip = republic_event.0020.a_tooltip + trigger_event = republic_event.0021 + + ai_chance = { + base = 0 + } + } + + option = { # Let the steward handle the budget for you + trigger = { + exists = scope:steward + } + name = republic_event.0020.c + flavor = { + triggered_desc = { + trigger = { + OR = { + AND = { + exists = scope:high_salary_budget + has_realm_law = budget_allocation_salary_50 + } + AND = { + exists = scope:medium_salary_budget + has_realm_law = budget_allocation_salary_30 + } + AND = { + exists = scope:low_salary_budget + has_realm_law = budget_allocation_salary_15 + } + } + } + desc = republic_event.0020.c_no_change + } + } + + if = { # High salary favored budget + limit = { + exists = scope:high_salary_budget + NOT = { has_realm_law = budget_allocation_salary_50 } + } + add_realm_law = budget_allocation_salary_50 + } + else_if = { # Medium salary favored budget + limit = { + exists = scope:medium_salary_budget + NOT = { has_realm_law = budget_allocation_salary_30 } + } + add_realm_law = budget_allocation_salary_30 + } + else_if = { # Low salary favored budget + limit = { + exists = scope:low_salary_budget + NOT = { has_realm_law = budget_allocation_salary_15 } + } + add_realm_law = budget_allocation_salary_15 + } + enact_treasury_budgets_init = yes + + ai_chance = { + base = 100 + } + } + + option = { # Keep the existing budget + name = republic_event.0020.b + + enact_treasury_budgets_init = yes + + ai_chance = { + base = 0 + } + } +} + +# Follow-up: Pick which budget to enact +republic_event.0021 = { + type = character_event + title = republic_event.0020.t + desc = republic_event.0021.desc + theme = stewardship + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:steward } + animation = steward + } + triggered_animation = { + trigger = { NOT = { exists = scope:steward } } + animation = stressed_teacher + } + } + right_portrait = { + character = scope:steward + animation = stressed_teacher + } + + option = { # High salary budget + name = republic_event.0021.a + flavor = republic_event.0021.a.info_desc + + if = { # If you already have the law, we only show it as being enacted + limit = { has_realm_law = budget_allocation_salary_50 } + show_as_tooltip = { add_realm_law = budget_allocation_salary_50 } + } + else = { + add_realm_law = budget_allocation_salary_50 + } + enact_treasury_budgets_init = yes + } + + option = { # Medium salary budget + name = republic_event.0021.b + flavor = republic_event.0021.b.info_desc + + if = { # If you already have the law, we only show it as being enacted + limit = { has_realm_law = budget_allocation_salary_30 } + show_as_tooltip = { add_realm_law = budget_allocation_salary_30 } + } + else = { + add_realm_law = budget_allocation_salary_30 + } + enact_treasury_budgets_init = yes + } + + option = { # Low salary budget + name = republic_event.0021.c + flavor = republic_event.0021.c.info_desc + + if = { # If you already have the law, we only show it as being enacted + limit = { has_realm_law = budget_allocation_salary_15 } + show_as_tooltip = { add_realm_law = budget_allocation_salary_15 } + } + else = { + add_realm_law = budget_allocation_salary_15 + } + enact_treasury_budgets_init = yes + } +} + +### Notification/letter event from rescind_trade_monopoly_interaction +republic_event.0030 = { + type = letter_event + opening = { + desc = republic_event.0010.opening # Re-used loc + } + desc = republic_event.0030.desc + + sender = scope:actor + + immediate = { + custom_tooltip = rescind_trade_monopoly_notification_base_desc + if = { + limit = { exists = scope:character_monopoly } + custom_tooltip = rescind_trade_monopoly_notification_character_desc + } + if = { + limit = { exists = scope:title_monopoly } + custom_tooltip = rescind_trade_monopoly_notification_title_desc + } + if = { + limit = { exists = scope:confederation_monopoly } + custom_tooltip = rescind_trade_monopoly_notification_confederation_desc + } + } + + option = { + name = republic_event.0030.a + } +} + +### Notification/letter event from remove_from_trade_league_interaction +republic_event.0040 = { + type = letter_event + opening = { + desc = republic_event.0010.opening # Re-used loc + } + desc = republic_event.0040.desc + + sender = scope:actor + + immediate = { + # Remove recipient from trade league + scope:actor.confederation = { + set_variable = league_expelling_member + + remove_confederation_member_title = scope:recipient.primary_title + } + } + + option = { + name = republic_event.0040.a + add_opinion = { + modifier = disrespect_opinion + target = scope:actor + opinion = -20 + } + } + +} + +### Notification/letter event - vote - getting elected +republic_event.0050 = { + type = letter_event + opening = { + desc = republic_event.assembly.opening + } + desc = republic_event.0050.desc + sender = scope:new_holder + + immediate = { + show_as_tooltip = { + scope:new_holder = { get_title = scope:title } + } + } + + option = { + name = republic_event.assembly.response + } +} + +### Notification/letter event - vote - getting re-elected +republic_event.0051 = { + type = letter_event + opening = { + desc = republic_event.assembly.opening + } + desc = republic_event.0051.desc + sender = scope:new_holder + + immediate = { + show_as_tooltip = { + scope:new_holder = { get_title = scope:title } + } + } + + option = { + name = republic_event.assembly.response + } +} + +### Notification/letter event - vote - vote started +republic_event.0052 = { + type = letter_event + opening = { + desc = republic_event.assembly.opening + } + desc = republic_event.0052.desc + sender = scope:proposer + + trigger = { + exists = scope:proposer + scope:proposer = { is_alive = yes } + } + + immediate = { + custom_tooltip = republic_event.law.TT + } + + option = { + name = republic_event.assembly.response + } +} + +### Notification/letter event - vote - vote outcome +republic_event.0053 = { + type = letter_event + opening = { + desc = republic_event.assembly.opening + } + desc = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:current_law + scope:current_law = scope:new_law + } + desc = republic_event.0053.pass.desc + } + desc = republic_event.0053.rejected.desc + } + } + sender = scope:proposer + + trigger = { + exists = scope:proposer + scope:proposer = { is_alive = yes } + } + + option = { + name = republic_event.assembly.response + if = { + limit = { + exists = scope:current_law + scope:current_law = scope:new_law + } + custom_tooltip = republic_event.law_passed.TT + } + else_if = { + limit = { exists = scope:current_law } + custom_tooltip = republic_event.law_rejected.TT + custom_tooltip = republic_event.law_kept.TT + } + else = { + custom_tooltip = republic_event.law_rejected.TT + } + } +} diff --git a/events/dlc/gdp/gdp_republic_patrician_decision_events.txt b/events/dlc/gdp/gdp_republic_patrician_decision_events.txt new file mode 100644 index 000000000..7d31a507f --- /dev/null +++ b/events/dlc/gdp/gdp_republic_patrician_decision_events.txt @@ -0,0 +1,2172 @@ + +namespace = gdp_republic_patrician_decision + +################################################## +### Patrician going for a walk in *their* city ### +################################################## +# gdp_republic_patrician_decision.1000 - Come across some left behind cargo +# gdp_republic_patrician_decision.1010 - What a nice, relaxing garden stroll +# gdp_republic_patrician_decision.1020 - Explore the Great Plaza +# gdp_republic_patrician_decision.1030 - Harbor - help local fishermen invest in better nets +# gdp_republic_patrician_decision.1040 - Great Plaza/Great project -- now, who.. who contributed this? +# gdp_republic_patrician_decision.1100 - The door to your study is stuck. Shucks! + + +#Lifting out for readability +scripted_effect patrician_decision_1000_apply_deficit_modifier_effect = { + switch = { + trigger = scope:abandoned_trade_good + trade_good_type:trade_good_grain = { + add_character_modifier = { + modifier = gdp_trade_good_grain_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_millet = { + add_character_modifier = { + modifier = gdp_trade_good_millet_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_rice = { + add_character_modifier = { + modifier = gdp_trade_good_rice_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_meat = { + add_character_modifier = { + modifier = gdp_trade_good_meat_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_fish = { + add_character_modifier = { + modifier = gdp_trade_good_fish_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_cheese = { + add_character_modifier = { + modifier = gdp_trade_good_cheese_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_fruit = { + add_character_modifier = { + modifier = gdp_trade_good_fruit_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_oil = { + add_character_modifier = { + modifier = gdp_trade_good_oil_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_honey = { + add_character_modifier = { + modifier = gdp_trade_good_honey_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_tea = { + add_character_modifier = { + modifier = gdp_trade_good_tea_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_beer = { + add_character_modifier = { + modifier = gdp_trade_good_beer_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_wine = { + add_character_modifier = { + modifier = gdp_trade_good_wine_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_wood = { + add_character_modifier = { + modifier = gdp_trade_good_wood_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_hemp = { + add_character_modifier = { + modifier = gdp_trade_good_hemp_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_wool = { + add_character_modifier = { + modifier = gdp_trade_good_wool_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_cotton = { + add_character_modifier = { + modifier = gdp_trade_good_cotton_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_flax = { + add_character_modifier = { + modifier = gdp_trade_good_flax_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_textiles = { + add_character_modifier = { + modifier = gdp_trade_good_textiles_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_furs = { + add_character_modifier = { + modifier = gdp_trade_good_furs_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_leather = { + add_character_modifier = { + modifier = gdp_trade_good_leather_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_sugar = { + add_character_modifier = { + modifier = gdp_trade_good_sugar_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_spices = { + add_character_modifier = { + modifier = gdp_trade_good_spices_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_ceramics = { + add_character_modifier = { + modifier = gdp_trade_good_ceramics_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_glass = { + add_character_modifier = { + modifier = gdp_trade_good_glass_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_lacquerware = { + add_character_modifier = { + modifier = gdp_trade_good_lacquerware_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_silk = { + add_character_modifier = { + modifier = gdp_trade_good_silk_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_incense = { + add_character_modifier = { + modifier = gdp_trade_good_incense_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_medicaments = { + add_character_modifier = { + modifier = gdp_trade_good_medicaments_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_salt = { + add_character_modifier = { + modifier = gdp_trade_good_salt_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_alum = { + add_character_modifier = { + modifier = gdp_trade_good_alum_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_dyes = { + add_character_modifier = { + modifier = gdp_trade_good_dyes_deficiency_modifier + years = 10 + } + } + trade_good_type:trade_good_books_paper = { + add_character_modifier = { + modifier = gdp_trade_good_books_paper_deficiency_modifier + years = 10 + } + } + } +} + +#Come across some left behind cargo +gdp_republic_patrician_decision.1000 = { + type = character_event + window = big_event_window + title = gdp_republic_patrician_decision.1000.t + desc = gdp_republic_patrician_decision.1000.desc + theme = republic + left_portrait = { + character = root + animation = interested + } + center_portrait = { + character = scope:local_character + animation = storyteller + camera = camera_event_scheme_center_look_right + hide_info = yes + } + right_portrait = { + character = scope:local_character_2 + animation = contemplating + camera = camera_event_scheme_vs_extra_right_look_left + hide_info = yes + } + lower_right_portrait = { + trigger = { exists = scope:liege_scope } + character = scope:liege_scope + } + cooldown = { years = 5 } + trigger = { + is_available_adult = yes + } + immediate = { + capital_province = { + save_scope_as = city_location + barony.trade_market = { + if = { + limit = { + any_trade_good_with_need = { count >= 1 } + } + random_trade_good_with_need = { + limit = { + save_temporary_scope_as = trade_good_check + is_breakable_trade_good_trigger = { TRADE_GOOD = scope:trade_good_check } + } + save_scope_as = abandoned_trade_good + } + save_scope_as = is_needs_trade_good + } + else = { + random_trade_good_type = { + limit = { + save_temporary_scope_as = trade_good_check + is_breakable_trade_good_trigger = { TRADE_GOOD = scope:trade_good_check } + } + save_scope_as = abandoned_trade_good + } + } + } + } + if = { + limit = { is_independent_ruler = no } + liege = { save_scope_as = liege_scope } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created } + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + #Break it to create a deficit? + option = { + name = gdp_republic_patrician_decision.1000.a + flavor = gdp_republic_patrician_decision.1000.a.flavor + trigger = { exists = scope:is_needs_trade_good } + patrician_decision_1000_apply_deficit_modifier_effect = yes + ai_chance = { + base = 100 + } + } + #Sell it! + option = { + name = gdp_republic_patrician_decision.1000.b + add_gold = major_gold_value + ai_chance = { + base = 100 + } + } + #Gift it to the local liege + option = { + name = gdp_republic_patrician_decision.1000.c + trigger = { exists = scope:liege_scope } + if = { + limit = { + NOT = { has_relation_friend = scope:liege_scope } + } + scope:liege_scope = { + progress_towards_friend_effect = { + REASON = friend_gifted_trade_goods + CHARACTER = root + OPINION = 30 + } + } + } + else = { + reverse_add_opinion = { + target = scope:liege_scope + modifier = grateful_opinion + opinion = 30 + } + } + ai_chance = { + base = 100 + modifier = { + has_relation_rival = scope:liege_scope + factor = 0 + } + } + } + #Let's not engage + option = { + name = gdp_republic_patrician_decision.1000.d + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 5 + } + stress_impact = { + base = miniscule_stress_impact_loss + craven = minor_stress_loss + paranoid = medium_stress_loss + } + ai_chance = { + base = 200 + } + } + after = { + scope:local_character = { + silent_disappearance_ai_if_created_effect = yes + } + scope:local_character_2 = { + silent_disappearance_ai_if_created_effect = yes + } + } +} + +#What a nice, relaxing garden stroll +gdp_republic_patrician_decision.1010 = { + type = character_event + window = big_event_window + title = gdp_republic_patrician_decision.1010.t + desc = gdp_republic_patrician_decision.1010.desc + theme = republic + override_background = { reference = garden } + left_portrait = { + character = scope:local_character_2 + animation = admiration + camera = camera_event_very_left_further_back + hide_info = yes + } + center_portrait = { + character = scope:local_character + animation = laugh + camera = camera_event_right_pointing_very_right + hide_info = yes + } + right_portrait = { + character = root + animation = thinking + camera = camera_center_large + } + cooldown = { years = 5 } + trigger = { + is_available_adult = yes + } + immediate = { + capital_province = { save_scope_as = city_location } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created } + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + #You a herbalist? + option = { + name = gdp_republic_patrician_decision.1010.b + trigger = { has_trait = lifestyle_herbalist } + random_list = { + 10 = { + desc = gdp_republic_patrician_decision.1010.b.poison_plant + add_character_modifier = { + modifier = hunt_poisonous_herbs_modifier + years = 5 + } + } + 10 = { + desc = gdp_republic_patrician_decision.1010.b.health_plant + add_character_modifier = { + modifier = hunt_medicinal_herbs_modifier + years = 5 + } + } + } + ai_chance = { + base = 200 + } + } + #... deviant? + option = { + name = gdp_republic_patrician_decision.1010.c + trigger = { + is_deviant_trigger = yes + should_be_naked_trigger = no + } + flavor = gdp_republic_patrician_decision.1010.c.flavor + duel = { + skill = prowess + value = average_skill_rating + 75 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1010.c.success + send_interface_toast = { + title = gdp_republic_patrician_decision.1010.c.success + left_icon = root + } + } + 25 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1010.c.failure + send_interface_toast = { + title = gdp_republic_patrician_decision.1010.c.failure + left_icon = root + add_character_modifier = { + modifier = gdp_shamed_nudity_modifier + years = 10 + } + } + } + } + stress_and_fulfillment_impact = { + base = major_stress_impact_loss + } + ai_chance = { + base = 50 + } + } + #We should make it nicer! + option = { + name = gdp_republic_patrician_decision.1010.a + add_character_modifier = { + modifier = gdp_patrician_city_investments_modifier + years = 10 + } + scope:city_location = { + add_province_modifier = { + modifier = gdp_city_investments_province_modifier + years = 10 + } + } + remove_short_term_gold = major_gold_value + ai_chance = { + base = 100 + } + } + #Alright, alright + option = { + name = gdp_republic_patrician_decision.1010.d + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 5 + } + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_loss + } + ai_chance = { + base = 200 + } + } + after = { + scope:local_character = { + silent_disappearance_ai_if_created_effect = yes + } + scope:local_character_2 = { + silent_disappearance_ai_if_created_effect = yes + } + } +} + +scripted_trigger 1020_generic_option_trigger = { + NOR = { + exists = scope:lost_maa_brigade + exists = scope:trader_recruit + exists = scope:physician_recruit + exists = scope:scheme_to_boost + exists = scope:dropped_jewellery + } +} + +#Explore the Great Plaza +gdp_republic_patrician_decision.1020 = { + type = character_event + window = big_event_window + title = gdp_republic_patrician_decision.1020.t + desc = { + #Intro + desc = gdp_republic_patrician_decision.1020.intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:rainy_day } + desc = gdp_republic_patrician_decision.1020.intro.rain + } + random_valid = { + desc = gdp_republic_patrician_decision.1020.intro.01 + desc = gdp_republic_patrician_decision.1020.intro.02 + desc = gdp_republic_patrician_decision.1020.intro.03 + desc = gdp_republic_patrician_decision.1020.intro.04 + } + } + #Mid + triggered_desc = { + trigger = { exists = scope:lost_maa_brigade } + desc = gdp_republic_patrician_decision.1020.desc.maa + } + triggered_desc = { + trigger = { exists = scope:trader_recruit } + desc = gdp_republic_patrician_decision.1020.desc.trader + } + triggered_desc = { + trigger = { exists = scope:physician_recruit } + desc = gdp_republic_patrician_decision.1020.desc.physician + } + triggered_desc = { + trigger = { exists = scope:scheme_to_boost } + desc = gdp_republic_patrician_decision.1020.desc.scheme + } + triggered_desc = { + trigger = { exists = scope:dropped_jewellery } + desc = gdp_republic_patrician_decision.1020.desc.jewellery + } + triggered_desc = { + trigger = { 1020_generic_option_trigger = yes } + desc = gdp_republic_patrician_decision.1020.desc.generic + } + } + theme = republic + override_effect_2d = { + trigger = { exists = scope:rainy_day } + reference = rain + } + left_portrait = { + character = scope:local_character_2 + #Soldier 2 + triggered_animation = { + trigger = { exists = scope:lost_maa_brigade } + animation = relaxed_spear + } + #Trader on-looker + triggered_animation = { + trigger = { exists = scope:trader_recruit } + animation = dismissal + } + #Physician on-looker + triggered_animation = { + trigger = { exists = scope:physician_recruit } + animation = contemplating + } + #Poor people around + triggered_animation = { + trigger = { 1020_generic_option_trigger = yes } + animation = worry + } + animation = admiration + camera = camera_event_center_background_crowd_left + hide_info = yes + } + center_portrait = { + character = scope:local_character + #Soldier 1 + triggered_animation = { + trigger = { exists = scope:lost_maa_brigade } + animation = relaxed_spear + } + #Trader + triggered_animation = { + trigger = { exists = scope:trader_recruit } + animation = anger + } + #Physician + triggered_animation = { + trigger = { exists = scope:physician_recruit } + animation = storyteller + } + #Poor people around + triggered_animation = { + trigger = { 1020_generic_option_trigger = yes } + animation = stress + } + animation = laugh + camera = camera_event_center_background_crowd_right + } + right_portrait = { + character = root + animation = interested_left + camera = camera_event_center_pointing_slighty_left + } + artifact = { + target = scope:dropped_jewellery + position = lower_left_portrait + } + trigger = { + is_available_adult = yes + capital_province = { province_has_district = republic_great_plaza_district } + } + immediate = { + capital_province = { save_scope_as = city_location } + random_list = { + 50 = { + #Sunshine + } + 25 = { + save_scope_as = rainy_day + } + } + if = { + limit = { is_independent_ruler = no } + liege = { save_scope_as = liege_scope } + } + #Generate option + random_list = { + 20 = { + #Nothing at all! + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created } + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + 10 = { + save_scope_as = lost_maa_brigade + #Soldier 1 + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_soldier + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_soldier + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created_soldier } + } + } + #Soldier 2 + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_soldier + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_soldier + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created_soldier } + } + } + scope:local_character = { add_character_flag = need_military_outfit } + scope:local_character_2 = { add_character_flag = need_military_outfit } + } + 10 = { + save_scope_as = trader_recruit + #Trader + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_trader + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_trader + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = trader_diplomacy_template + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created_trader } + } + } + #On-looker + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + 10 = { + save_scope_as = physician_recruit + #Physician + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_physician + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + has_character_flag = created_physician + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = physician_high_character_template + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created_physician } + } + } + #On-looker + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + 10 = { + trigger = { + any_scheme = { + NOT = { has_scheme_modifier = gdp_opportunity_scheme_modifier } + } + } + random_scheme = { + limit = { + NOT = { has_scheme_modifier = gdp_opportunity_scheme_modifier } + } + save_scope_as = scheme_to_boost + } + } + 10 = { + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created } + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + #Create jewellery to lose + scope:local_character = { + random_list = { + 10 = { set_artifact_rarity_illustrious = yes } + 20 = { set_artifact_rarity_famed = yes } + 40 = { set_artifact_rarity_masterwork = yes } + } + save_scope_as = no_artifact_history + random_list = { + 50 = { + create_artifact_brooch_effect = { + OWNER = scope:local_character + SMITH = scope:local_character + } + } + 50 = { + create_artifact_ring_effect = { + OWNER = scope:local_character + SMITH = scope:local_character + } + } + 50 = { + create_artifact_necklace_effect = { + OWNER = scope:local_character + SMITH = scope:local_character + } + } + } + clear_saved_scope = no_artifact_history + scope:newly_created_artifact ?= { + add_scaled_artifact_modifier_prestige_effect = yes + #Don't need no notification about this + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 2 + } + save_scope_as = dropped_jewellery + } + } + } + } + } + #Donate gold + option = { + name = gdp_republic_patrician_decision.1020.a + trigger = { 1020_generic_option_trigger = yes } + add_character_modifier = { + modifier = gdp_city_stroll_alms_modifier + years = 5 + } + remove_short_term_gold = major_gold_value + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = -1 + } + modifier = { + short_term_gold <= major_gold_value + factor = 0 + } + } + } + #Lost pack of MaA + option = { + name = gdp_republic_patrician_decision.1020.b + trigger = { exists = scope:lost_maa_brigade } + spawn_army = { + name = event_troop_default_name + men_at_arms = { + type = armored_footmen + stacks = 2 + } + inheritable = no + location = root.location + } + remove_short_term_gold = major_gold_value + ai_chance = { + base = 100 + modifier = { + short_term_gold <= major_gold_value + factor = 0 + } + } + } + #Recruit the trader + option = { + name = gdp_republic_patrician_decision.1020.c + trigger = { exists = scope:trader_recruit } + add_courtier = scope:local_character + ai_chance = { + base = 200 + modifier = { + has_trait = paranoid + factor = 0 + } + } + } + #Recruit the physician + option = { + name = gdp_republic_patrician_decision.1020.d + trigger = { exists = scope:physician_recruit } + if = { + limit = { + can_appoint_char_to_court_position = { + CHAR = scope:local_character + COURT_POS = court_physician_court_position + } + } + court_position_grant_effect = { + EMPLOYER = root + POS = court_physician + CANDIDATE = scope:local_character + } + } + ai_chance = { + base = 100 + modifier = { + has_trait = paranoid + factor = 0 + } + } + } + #Scheme boost? + option = { + name = gdp_republic_patrician_decision.1020.e + trigger = { exists = scope:scheme_to_boost } + scope:scheme_to_boost = { + add_scheme_modifier = { type = gdp_opportunity_scheme_modifier } + } + remove_short_term_gold = major_gold_value + ai_chance = { + base = 100 + modifier = { + short_term_gold <= major_gold_value + factor = 0 + } + } + } + #Piece of jewellery + option = { + name = gdp_republic_patrician_decision.1020.f + trigger = { exists = scope:dropped_jewellery } + scope:dropped_jewellery = { + set_owner = { + target = root + history = { + type = discovered + actor = root + recipient = root + location = root.location + } + } + } + ai_chance = { + base = 200 + } + } + #Moving on + option = { + name = { + trigger = { 1020_generic_option_trigger = yes } + text = gdp_republic_patrician_decision.1020.g.alternate + } + name = gdp_republic_patrician_decision.1020.g + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 5 + } + ai_chance = { + base = 150 + } + } + after = { + scope:local_character ?= { + silent_disappearance_ai_if_created_effect = yes + remove_character_flag = need_military_outfit + } + scope:local_character_2 ?= { + silent_disappearance_ai_if_created_effect = yes + remove_character_flag = need_military_outfit + } + } +} + +#Harbor - help local fishermen invest in better nets +gdp_republic_patrician_decision.1030 = { + type = character_event + window = big_event_window + title = gdp_republic_patrician_decision.1030.t + desc = { + desc = gdp_republic_patrician_decision.1030.desc + first_valid = { + triggered_desc = { + trigger = { exists = scope:cat_scope } + desc = gdp_republic_patrician_decision.1030.desc.outro.cat + } + desc = gdp_republic_patrician_decision.1030.desc.outro + } + } + theme = republic + override_background = { reference = docks } + left_portrait = { + character = root + animation = thinking_all + } + center_portrait = { + character = scope:local_character_2 + animation = stress + camera = camera_event_scheme_left + hide_info = yes + } + right_portrait = { + character = scope:local_character + animation = relaxed_spear + camera = camera_event_scheme_far_right + hide_info = yes + } + trigger = { + is_available_adult = yes + capital_province = { is_coastal = yes } + } + immediate = { + capital_province = { save_scope_as = city_location } + random_list = { + 50 = { + #No cat + } + 50 = { + trigger = { has_cat_trigger = no } + save_scope_as = cat_scope + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created } + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + #Teach them how to fish... + option = { + name = gdp_republic_patrician_decision.1030.a + add_character_modifier = { + modifier = gdp_patrician_city_investments_modifier + years = 10 + } + scope:city_location = { + add_province_modifier = { + modifier = gdp_city_investments_province_modifier + years = 10 + } + } + remove_short_term_gold = major_gold_value + ai_chance = { + base = 100 + modifier = { + short_term_gold <= major_gold_value + factor = 0 + } + } + } + #Buy their fish... + option = { + name = gdp_republic_patrician_decision.1030.b + add_character_modifier = { + modifier = gdp_bulk_fish_modifier + years = 10 + } + remove_short_term_gold = medium_gold_value + ai_chance = { + base = 100 + modifier = { + short_term_gold <= medium_gold_value + factor = 0 + } + } + } + #Cat? Cat!! + option = { + name = gdp_republic_patrician_decision.1030.c + trigger = { exists = scope:cat_scope } + start_cat_story_cycle_effect = yes + ai_chance = { + base = 200 + modifier = { + has_trait = sadistic + factor = 0 + } + } + } + #Let's not engage + option = { + name = gdp_republic_patrician_decision.1030.d + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 5 + } + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_loss + } + ai_chance = { + base = 200 + } + } + after = { + scope:local_character = { + silent_disappearance_ai_if_created_effect = yes + } + scope:local_character_2 = { + silent_disappearance_ai_if_created_effect = yes + } + } +} + +#Great Plaza/Great project -- now, who.. who contributed this? +gdp_republic_patrician_decision.1040 = { + type = character_event + window = big_event_window + title = gdp_republic_patrician_decision.1040.t + desc = gdp_republic_patrician_decision.1040.desc + theme = republic + left_portrait = { + character = scope:local_character_2 + animation = debating + camera = camera_event_right_away_3_4_more_right + hide_info = yes + } + center_portrait = { + character = scope:local_character + animation = stressed_teacher + camera = camera_event_center_moved_left + hide_info = yes + } + right_portrait = { + character = root + animation = interested_left + camera = camera_event_scheme_vs_center_look_left + } + lower_right_portrait = { + trigger = { exists = scope:liege_scope } + character = scope:liege_scope + } + lower_center_portrait = { + trigger = { scope:liege_scope != scope:actual_contributor } + character = scope:actual_contributor + } + trigger = { + is_available_adult = yes + is_independent_ruler = no + capital_province = { + province_has_district = republic_great_plaza_district + #Ongoing great project + any_great_project_in_province = { + OR = { + great_project_type = gdp_republic_expand_great_plaza_project + great_project_type = gdp_republic_great_plaza_loggia_project + great_project_type = gdp_republic_great_plaza_statute_hall_project + great_project_type = gdp_republic_great_plaza_council_chamber_project + great_project_type = gdp_republic_great_plaza_debt_office_project + great_project_type = gdp_republic_great_plaza_civic_hospital_project + great_project_type = gdp_republic_great_plaza_weigh_house_project + great_project_type = gdp_republic_great_plaza_clock_tower_project + great_project_type = gdp_republic_great_plaza_civic_ward_project + great_project_type = gdp_republic_great_plaza_league_chapter_house_project + great_project_type = gdp_republic_great_plaza_podesta_residence_project + great_project_type = gdp_republic_great_plaza_fountain_project + } + great_project_construction_phase_is = planned + any_contribution = { + is_owner_only_contribution_trigger = no + contribution_is_funded = no + } + } + } + } + immediate = { + capital_province = { + save_scope_as = city_location + random_great_project_in_province = { + limit = { + OR = { + great_project_type = gdp_republic_expand_great_plaza_project + great_project_type = gdp_republic_great_plaza_loggia_project + great_project_type = gdp_republic_great_plaza_statute_hall_project + great_project_type = gdp_republic_great_plaza_council_chamber_project + great_project_type = gdp_republic_great_plaza_debt_office_project + great_project_type = gdp_republic_great_plaza_civic_hospital_project + great_project_type = gdp_republic_great_plaza_weigh_house_project + great_project_type = gdp_republic_great_plaza_clock_tower_project + great_project_type = gdp_republic_great_plaza_civic_ward_project + great_project_type = gdp_republic_great_plaza_league_chapter_house_project + great_project_type = gdp_republic_great_plaza_podesta_residence_project + great_project_type = gdp_republic_great_plaza_fountain_project + } + great_project_construction_phase_is = planned + any_contribution = { + is_owner_only_contribution_trigger = no + contribution_is_funded = no + } + } + save_scope_as = target_great_project + #Check for Mandatory first + random_contribution = { + limit = { + is_owner_only_contribution_trigger = no + contribution_is_funded = no + contribution_is_required = yes + } + alternative_limit = { + is_owner_only_contribution_trigger = no + contribution_is_funded = no + } + save_scope_as = contribution_to_fund + } + } + } + #For loc + scope:target_great_project = { + switch = { + trigger = great_project_type + gdp_republic_expand_great_plaza_project = { + root = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_expand_great_plaza + } + } + } + gdp_republic_great_plaza_loggia_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_loggia_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_loggia + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_loggia + } + } + } + } + gdp_republic_great_plaza_statute_hall_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_statute_hall_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_statute_hall + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_statute_hall + } + } + } + } + gdp_republic_great_plaza_council_chamber_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_council_chamber_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_council_chamber + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_council_chamber + } + } + } + } + gdp_republic_great_plaza_debt_office_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_debt_office_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_debt_office + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_debt_office + } + } + } + } + gdp_republic_great_plaza_civic_hospital_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_civic_hospital_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_civic_hospital + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_civic_hospital + } + } + } + } + gdp_republic_great_plaza_weigh_house_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_weigh_house_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_weigh_house + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_weigh_house + } + } + } + } + gdp_republic_great_plaza_clock_tower_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_clock_tower_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_clock_tower + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_clock_tower + } + } + } + } + gdp_republic_great_plaza_civic_ward_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_civic_ward_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_civic_ward + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_civic_ward + } + } + } + } + gdp_republic_great_plaza_league_chapter_house_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_league_chapter_house_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_league_chapter_house + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_league_chapter_house + } + } + } + } + gdp_republic_great_plaza_podesta_residence_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_podesta_residence_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_podesta_residence + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_podesta_residence + } + } + } + } + gdp_republic_great_plaza_fountain_project = { + root = { + if = { + limit = { + capital_province = { has_building_or_higher = republic_fountain_01 } + } + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_improved_fountain + } + } + else = { + set_variable = { + name = gp_great_plaza_expansion + value = flag:gp_fountain + } + } + } + } + } + } + liege = { + save_scope_as = liege_scope + if = { + limit = { + any_vassal = { this != root } + } + random_vassal = { + limit = { this != root } + save_scope_as = actual_contributor + } + } + else = { + save_scope_as = actual_contributor + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + } + weight = { + base = 1 + modifier = { + has_character_flag = created + add = 1 + } + } + save_scope_as = local_character + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character + after_creation = { add_character_flag = created } + } + } + if = { + limit = { + any_pool_character = { + province = scope:city_location + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + } + random_pool_character = { + province = scope:city_location + limit = { + is_available_healthy_ai_adult = yes + has_no_particular_noble_roots_trigger = yes + this != scope:local_character + } + save_scope_as = local_character_2 + } + } + else = { + create_character = { + template = generic_peasant_character + location = scope:city_location + culture = scope:city_location.culture + faith = scope:city_location.faith + save_scope_as = local_character_2 + after_creation = { add_character_flag = created } + } + } + } + #I contributed that, obviously + option = { + name = gdp_republic_patrician_decision.1040.a + duel = { + skills = { diplomacy intrigue } + value = average_skill_rating + 75 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1040.a.success + send_interface_toast = { + title = gdp_republic_patrician_decision.1040.a.success + left_icon = root + fund_great_project_contribution = { + contribution = scope:contribution_to_fund + cost = no + check_can_contribute = no + } + } + } + 25 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1040.a.failure + send_interface_toast = { + title = gdp_republic_patrician_decision.1040.a.failure + left_icon = root + add_character_modifier = { + modifier = gdp_publicly_shamed_modifier + years = 10 + } + } + } + } + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_loss + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + has_trait = honest + factor = 0 + } + } + } + #Liege did! + option = { + name = gdp_republic_patrician_decision.1040.b + trigger = { scope:liege_scope != scope:actual_contributor } + scope:liege_scope = { + add_popular_opinion = 10 + fund_great_project_contribution = { + contribution = scope:contribution_to_fund + cost = no + check_can_contribute = no + } + } + if = { + limit = { + has_relation_friend = scope:liege_scope + can_set_relation_best_friend_trigger = { CHARACTER = scope:liege_scope } + } + set_relation_best_friend = { + reason = friend_accredited_contribution + target = scope:liege_scope + } + } + else_if = { + limit = { + NOT = { has_relation_friend = scope:liege_scope } + } + scope:liege_scope = { + progress_towards_friend_effect = { + REASON = friend_accredited_contribution + CHARACTER = root + OPINION = 40 + } + } + } + else = { + reverse_add_opinion = { + target = scope:liege_scope + modifier = grateful_opinion + opinion = 40 + } + } + ai_chance = { + base = 100 + modifier = { + has_relation_rival = scope:liege_scope + factor = 0 + } + } + } + #Let's not engage + option = { + name = gdp_republic_patrician_decision.1040.c + flavor = gdp_republic_patrician_decision.1040.c.flavor + if = { + limit = { scope:liege_scope = scope:actual_contributor } + custom_tooltip = { + text = gdp_republic_patrician_decision.1040.c.tt + scope:actual_contributor = { + fund_great_project_contribution = { + contribution = scope:contribution_to_fund + cost = no + check_can_contribute = no + } + } + } + } + else = { + scope:actual_contributor = { + fund_great_project_contribution = { + contribution = scope:contribution_to_fund + cost = no + check_can_contribute = no + } + } + } + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 5 + } + stress_and_fulfillment_impact = { + base = miniscule_stress_impact_loss + } + ai_chance = { + base = 200 + } + } + after = { + scope:local_character = { + silent_disappearance_ai_if_created_effect = yes + } + scope:local_character_2 = { + silent_disappearance_ai_if_created_effect = yes + } + remove_variable = gp_great_plaza_expansion + } +} + +#The door to your study is stuck. Shucks! +gdp_republic_patrician_decision.1100 = { + type = character_event + window = big_event_window + title = gdp_republic_patrician_decision.1100.t + desc = gdp_republic_patrician_decision.1100.desc + theme = republic + override_background = study + left_portrait = { + character = root + triggered_animation = { + trigger = { has_trait = athletic } + animation = ecstasy + } + animation = stress + } + cooldown = { years = 5 } + trigger = { + is_available_adult = yes + } + immediate = { + capital_province = { save_scope_as = city_location } + } + #ANYONE?! + option = { + name = gdp_republic_patrician_decision.1100.a + flavor = gdp_republic_patrician_decision.1100.a.flavor + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 15 + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + } + ai_chance = { + base = 100 + } + } + #Jumping that window + option = { + name = gdp_republic_patrician_decision.1100.b + duel = { + skill = prowess + value = average_skill_rating + 25 = { + trigger = { prowess < medium_skill_rating } + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1100.b.success + send_interface_toast = { + title = gdp_republic_patrician_decision.1100.b.success + left_icon = root + add_prowess_skill = 1 + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 10 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1100.b.success + send_interface_toast = { + title = gdp_republic_patrician_decision.1100.b.success + left_icon = root + add_character_modifier = { + modifier = gdp_city_stroll_modifier + years = 10 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + desc = gdp_republic_patrician_decision.1100.b.failure + send_interface_toast = { + title = gdp_republic_patrician_decision.1100.b.failure + left_icon = root + increase_wounds_no_death_effect = { REASON = fall } + } + } + } + ai_chance = { + base = 50 + } + } + #Workout! + option = { + name = gdp_republic_patrician_decision.1100.c + if = { + limit = { + NOT = { has_trait = athletic } + } + random = { + chance = 10 + add_trait = athletic + } + } + else = { + stress_and_fulfillment_impact = { + athletic = major_stress_impact_loss + } + } + ai_chance = { + base = 200 + } + } + #Let's not engage + option = { + name = gdp_republic_patrician_decision.1100.d + add_character_modifier = { + modifier = gdp_armchair_patrician_modifier + years = 5 + } + stress_impact = { + base = miniscule_stress_impact_loss + athletic = minor_stress_impact_gain + } + ai_chance = { + base = 200 + } + } +} diff --git a/events/dlc/gdp/gdp_republic_popular_opinion_events.txt b/events/dlc/gdp/gdp_republic_popular_opinion_events.txt new file mode 100644 index 000000000..4a308a2fd --- /dev/null +++ b/events/dlc/gdp/gdp_republic_popular_opinion_events.txt @@ -0,0 +1,952 @@ +################################## +# Popular Opinion Republic Events# +################################## +namespace = republic_popular_opinion_event + +### Tier: severe negative - capital popular_opinion -51 and below +republic_popular_opinion_event.1001 = { + type = character_event + title = republic_popular_opinion_event.1001.t + desc = republic_popular_opinion_event.1001.desc + theme = republic + + cooldown = { years = 10 } + + left_portrait = { + character = root + animation = worry + camera = camera_body_left_slight + } + right_portrait = { + character = scope:relation_01 + animation = disapproval + camera = camera_body + } + + + trigger = { + government_has_flag = government_is_republic + is_healthy = yes + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + OR = { + any_relation = { + type = friend + type = lover + this != liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_close_or_extended_family_member = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_spouse = { + this != root.liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + } + + immediate = { + location = { save_scope_as = event_location_01 } + every_relation = { + type = friend + type = lover + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.liege + } + add_to_list = relation_candidates + } + every_close_or_extended_family_member = { + limit = { + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.liege + } + add_to_list = relation_candidates + } + every_spouse = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.liege + } + add_to_list = relation_candidates + } + random_in_list = { + list = relation_candidates + weight = { + base = 1 + modifier = { + add = 30 + has_relation_soulmate = root + } + modifier = { + add = 15 + OR = { + has_relation_friend = root + has_relation_lover = root + is_primary_heir_of = root + } + } + modifier = { + add = 5 + OR = { + is_child_of = root + is_grandchild_of = root + } + } + modifier = { + factor = 1.5 + opinion = { + target = root + value >= 50 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = relation_01 + } + if = { + limit = { + can_employ_court_position_type = bodyguard_court_position + short_term_gold >= medium_gold_value + } + create_character = { + template = bodyguard_court_position_template + location = scope:event_location_01 + culture = root.culture + faith = root.faith + save_scope_as = hired_bodyguard + after_creation = { add_character_flag = created } + } + } + } + + ## "You are right. We need to hold our heads high." + option = { + name = republic_popular_opinion_event.1001.a + trigger = { + NOT = { has_trait = craven } + } + add_character_modifier = { + modifier = gdp_head_held_high_modifier + years = 5 + } + + stress_and_fulfillment_impact = { + # Gain + humble = minor_stress_impact_gain + # Loss + arrogant = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = humble + } + } + } + + ## "Might be a good time to get myself a bodyguard." + option = { + name = republic_popular_opinion_event.1001.b + trigger = { + can_employ_court_position_type = bodyguard_court_position + } + remove_short_term_gold = medium_gold_value + add_courtier = scope:hired_bodyguard + scope:hired_bodyguard = { remove_character_flag = created } + appoint_court_position = { + recipient = scope:hired_bodyguard + court_position = bodyguard_court_position + } + + stress_and_fulfillment_impact = { + # Gain + trusting = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = trusting + } + modifier = { + factor = 0 + NOT = { short_term_gold >= medium_gold_value } + } + } + } + + ## "The mob are going to kill us all!" + option = { + name = republic_popular_opinion_event.1001.c + add_character_modifier = { + modifier = gdp_fear_of_the_mob_modifier + years = 5 + } + + stress_and_fulfillment_impact = { + # Loss + paranoid = major_stress_impact_loss + craven = major_stress_impact_loss + } + + ai_chance = { base = 100 } + } + + ## "They won't find me easy prey." + option = { + name = republic_popular_opinion_event.1001.d + trigger = { + OR = { + has_trait = brave + has_trait = wrathful + has_lifestyle = martial_lifestyle + } + } + add_character_modifier = { + modifier = gdp_training_for_the_worst_modifier + years = 5 + } + + stress_and_fulfillment_impact = { + # Loss + diligent = minor_stress_impact_loss + brave = minor_stress_impact_loss + wrathful = minor_stress_impact_loss + } + + ai_chance = { base = 100 } + } + + after = { + scope:hired_bodyguard = { + silent_disappear_ai_if_not_hired_with_flag = yes + } + } +} + +### Tier: mild negative - capital popular_opinion -50 to -1 +scripted_effect patrician_aggrandizement_signorial_opinion_effect = { + every_vassal = { + limit = { + this != root + this.domicile ?= { + is_domicile_type = merchant_company + } + this = { + government_has_flag = government_is_republic + } + this.house ?= { + OR = { + has_house_aspiration_parameter = republic_aggrandizement + has_house_aspiration_parameter = republic_signorial + } + } + } + custom = custom.every_patrician_aggrandizement_signorial + this = { + add_opinion = { + target = root + modifier = respect_opinion + opinion = 20 + } + } + } +} + +scripted_effect patrician_agitation_communal_opinion_effect = { + every_vassal = { + limit = { + this != root + this.domicile ?= { + is_domicile_type = merchant_company + } + this = { + government_has_flag = government_is_republic + } + this.house ?= { + OR = { + has_house_aspiration_parameter = republic_agitation + has_house_aspiration_parameter = republic_communal + } + } + } + custom = custom.every_patrician_agitation_communal + this = { + add_opinion = { + target = root + modifier = disrespect_opinion + opinion = -20 + } + } + } +} + +republic_popular_opinion_event.1002 = { + type = character_event + title = republic_popular_opinion_event.1002.t + desc = { + desc = republic_popular_opinion_event.1002.desc_1 + desc = republic_popular_opinion_event.1002.desc_2 + desc = republic_popular_opinion_event.1002.desc_3 + } + override_background = bp1_relaxing_room_western + theme = republic + + cooldown = { years = 10 } + + left_portrait = { + character = root + animation = stress + } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + } + + immediate = { + location = { save_scope_as = event_location_01 } + save_scope_as = patrician_ambition_display_ruler + } + + option = { + name = republic_popular_opinion_event.1002.a + + add_character_modifier = { + modifier = gdp_champion_of_the_state_modifier + years = 20 + } + + if = { + limit = { + gdp_is_assembly_head_trigger = yes + } + patrician_aggrandizement_signorial_opinion_effect = yes + patrician_agitation_communal_opinion_effect = yes + } + else_if = { + limit = { + liege = { + gdp_is_assembly_head_trigger = yes + } + } + liege = { + if = { + limit = { + this != root + gdp_is_assembly_head_trigger = yes + } + add_opinion = { + target = root + modifier = political_ally_opinion + opinion = 20 + } + } + patrician_aggrandizement_signorial_opinion_effect = yes + patrician_agitation_communal_opinion_effect = yes + } + } + + stress_and_fulfillment_impact = { + # Gain + craven = medium_stress_impact_gain + shy = medium_stress_impact_gain + # Loss + ambitious = major_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 300 + house ?= { + OR = { + has_house_aspiration_parameter = republic_aggrandizement + has_house_aspiration_parameter = republic_signorial + } + } + } + modifier = { + factor = 0.25 + OR = { + has_trait = craven + has_trait = shy + } + } + } + } + + option = { + name = republic_popular_opinion_event.1002.b + + add_character_modifier = { + modifier = gdp_champion_of_the_people_modifier + years = 20 + } + + liege = { + if = { + limit = { this != root } + add_opinion = { + target = root + modifier = political_enemy_opinion + opinion = -20 + } + } + every_vassal = { + limit = { + this != root + this.domicile ?= { + is_domicile_type = merchant_company + } + this = { + AND = { + government_has_flag = government_is_republic + } + } + this.house ?= { + OR = { + has_house_aspiration_parameter = republic_agitation + has_house_aspiration_parameter = republic_communal + } + } + } + custom = custom.every_patrician_agitation_communal + this = { + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 20 + } + } + } + + every_vassal = { + limit = { + this != root + this.domicile ?= { + is_domicile_type = merchant_company + } + this = { + AND = { + government_has_flag = government_is_republic + } + } + this.house ?= { + OR = { + has_house_aspiration_parameter = republic_aggrandizement + has_house_aspiration_parameter = republic_signorial + } + } + } + custom = custom.every_patrician_aggrandizement_signorial + this = { + add_opinion = { + target = root + modifier = disrespect_opinion + opinion = -20 + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + craven = medium_stress_impact_gain + shy = medium_stress_impact_gain + # Loss + ambitious = major_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 300 + house ?= { + OR = { + has_house_aspiration_parameter = republic_agitation + has_house_aspiration_parameter = republic_communal + } + } + } + modifier = { + factor = 0.25 + OR = { + has_trait = craven + has_trait = shy + } + } + } + } + + option = { + name = republic_popular_opinion_event.1002.c + + stress_and_fulfillment_impact = { + # Gain + ambitious = medium_stress_impact_gain + # Loss + temperate = minor_stress_impact_loss + craven = major_stress_impact_loss + shy = major_stress_impact_loss + calm = minor_stress_impact_loss + cynical = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0.25 + has_trait = ambitious + } + } + } +} + +### Tier: strong positive - capital popular_opinion 50 and above +republic_popular_opinion_event.1003 = { + type = character_event + title = republic_popular_opinion_event.1003.t + desc = republic_popular_opinion_event.1003.desc + theme = republic + + override_background = gdp_artisan_street + + left_portrait = { + character = root + animation = laugh + camera = camera_event_crowd + } + + right_portrait = { + character = scope:craftsman_character + animation = donkey_petting + camera = camera_event_center_pointing_forward_fov35 + } + + trigger = { + } + + immediate = { + location = { save_scope_as = event_location_01 } + create_character = { + template = craftman_carnival_character + culture = root.location.culture + faith = root.location.faith + location = root.location + + save_scope_as = craftsman_character + + } + } + + option = { + name = republic_popular_opinion_event.1003.a + custom_tooltip = republic_popular_opinion_event.1003.tt + add_character_modifier = { + modifier = gdp_guild_sponsored_feast_modifier + desc = republic_popular_opinion_event.1003.tt + } + + stress_and_fulfillment_impact = { + # Gain + shy = minor_stress_impact_gain + # Loss + gregarious = minor_stress_impact_loss + generous = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0.25 + has_trait = shy + } + } + } + + option = { + name = republic_popular_opinion_event.1003.b + add_short_term_gold = medium_gold_value + add_character_modifier = { + modifier = gdp_broken_trust_modifier + years = 20 + } + + stress_and_fulfillment_impact = { + # Gain + generous = minor_stress_impact_gain + honest = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + # Loss + greedy = minor_stress_impact_loss + deceitful = minor_stress_impact_loss + callous = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0.25 + OR = { + has_trait = generous + has_trait = honest + has_trait = compassionate + } + } + } + } + + option = { + name = republic_popular_opinion_event.1003.c + if = { + limit = { + is_attracted_to_gender_of = scope:craftsman_character + can_set_relation_lover_trigger = { CHARACTER = scope:craftsman_character } + } + set_relation_lover = { reason = lover_citizen_chance_meeting target = scope:craftsman_character } + add_courtier = scope:craftsman_character + } + else = { + set_relation_friend = { reason = friend_citizen_chance_meeting target = scope:craftsman_character } + add_courtier = scope:craftsman_character + } + + stress_and_fulfillment_impact = { + # Gain + callous = minor_stress_impact_gain + # Loss + compassionate = minor_stress_impact_loss + shy = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0.25 + has_trait = callous + } + } + } + + after = { + scope:craftsman_character = { + if = { + limit = { + NOR = { + liege_or_court_owner = root + has_relation_lover = root + has_relation_friend = root + } + } + silent_disappearance_effect = yes + } + } + } +} + +### Tier: mild positive - capital popular_opinion 25 to 49 +republic_popular_opinion_event.1004 = { + type = character_event + title = republic_popular_opinion_event.1004.t + desc = republic_popular_opinion_event.1004.desc + theme = republic + + override_background = gdp_artisan_street + + left_portrait = { + character = root + animation = happiness + } + + right_portrait = { + character = scope:relation_01 + animation = drink_goblet + } + + trigger = { + government_has_flag = government_is_republic + is_healthy = yes + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + OR = { + any_relation = { + type = friend + type = lover + this != root.liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_close_or_extended_family_member = { + this != root.liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_spouse = { + this != root.liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + } + + immediate = { + location = { save_scope_as = event_location_01 } + every_relation = { + type = friend + type = lover + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.liege + } + add_to_list = relation_candidates + } + every_close_or_extended_family_member = { + limit = { + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.liege + } + add_to_list = relation_candidates + } + every_spouse = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.liege + } + add_to_list = relation_candidates + } + random_in_list = { + list = relation_candidates + weight = { + base = 1 + modifier = { + add = 30 + has_relation_soulmate = root + } + modifier = { + add = 15 + OR = { + has_relation_friend = root + has_relation_lover = root + is_primary_heir_of = root + } + } + modifier = { + add = 5 + OR = { + is_child_of = root + is_grandchild_of = root + } + } + modifier = { + factor = 1.5 + opinion = { + target = root + value >= 50 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = relation_01 + } + } + + option = { + name = republic_popular_opinion_event.1004.a + add_character_modifier = { + modifier = gdp_toast_to_adventure_modifier + years = 30 + } + + stress_and_fulfillment_impact = { + # Gain + craven = minor_stress_impact_gain + content = minor_stress_impact_gain + # Loss + brave = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = craven + has_trait = content + } + } + } + } + + option = { + name = republic_popular_opinion_event.1004.b + add_character_modifier = { + modifier = gdp_toast_to_romance_modifier + years = 30 + } + + stress_and_fulfillment_impact = { + # Gain + chaste = minor_stress_impact_gain + # Loss + lustful = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = chaste + } + } + } + + option = { + name = republic_popular_opinion_event.1004.c + add_character_modifier = { + modifier = gdp_toast_to_glory_modifier + years = 30 + } + + stress_and_fulfillment_impact = { + # Gain + humble = minor_stress_impact_gain + content = minor_stress_impact_gain + shy = minor_stress_impact_gain + # Loss + arrogant = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = humble + has_trait = content + has_trait = shy + } + } + } + } + + option = { + name = republic_popular_opinion_event.1004.d + add_character_modifier = { + modifier = gdp_toast_to_relations_modifier + years = 30 + } + + stress_and_fulfillment_impact = { + # Gain + callous = minor_stress_impact_gain + # Loss + compassionate = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + content = minor_stress_impact_loss + shy = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = callous + } + } + } +} diff --git a/events/dlc/gdp/gdp_republic_unrest_events.txt b/events/dlc/gdp/gdp_republic_unrest_events.txt new file mode 100644 index 000000000..698d237b8 --- /dev/null +++ b/events/dlc/gdp/gdp_republic_unrest_events.txt @@ -0,0 +1,2335 @@ +namespace = gdp_republic_unrest + +### Severity 1 +# A List of Grievances +gdp_republic_unrest.0001 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0001.t + desc = gdp_republic_unrest.0001.desc + theme = republic + override_background = { reference = courtyard } + left_portrait = { + character = root + animation = dismissal + } + + trigger = { + exists = scope:faction + } + + # Option A - Disperse the Crowd + option = { + name = gdp_republic_unrest.0001.a + capital_county = { + add_popular_opinion = -15 + change_county_control = 15 + } + add_dread = 15 + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + just = minor_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } + + # Option B - Stewardship duel (shown when stewardship >= diplomacy) + option = { + name = gdp_republic_unrest.0001.b + trigger = { + stewardship >= diplomacy + } + duel = { + skill = stewardship + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0001.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0001.b.success.toast + left_icon = root + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 10 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0001.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0001.b.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -15 } + add_prestige = minor_prestige_loss + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + add_stress = minor_stress_impact_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= medium_gold_value } + } + } + } + + # Option C - Diplomacy duel (shown when diplomacy > stewardship) + option = { + name = gdp_republic_unrest.0001.c + trigger = { + diplomacy > stewardship + } + duel = { + skill = diplomacy + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0001.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0001.c.success.toast + left_icon = root + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 10 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0001.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0001.c.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -15 } + add_prestige = minor_prestige_loss + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + add_stress = minor_stress_impact_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= medium_gold_value } + } + } + } + + # Option D - Concessions + option = { + name = gdp_republic_unrest.0001.d + trigger = { + gold >= medium_gold_value + } + remove_short_term_gold = medium_gold_value + capital_county = { add_popular_opinion = 10 } + add_prestige = minor_prestige_gain + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + generous = minor_stress_impact_loss + } + ai_chance = { base = 100 } + } +} + +# The Cold Reception - A visible shift in the city's mood +gdp_republic_unrest.0011 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0011.t + desc = gdp_republic_unrest.0011.desc + theme = republic + override_background = { reference = gdp_artisan_street_crowd } + left_portrait = { + character = root + animation = worry + } + + trigger = { + exists = scope:faction + } + + # Option B - Investigate quietly (Intrigue duel, shown when intrigue >= diplomacy) + option = { + name = gdp_republic_unrest.0011.b + trigger = { intrigue >= diplomacy } + duel = { + skill = intrigue + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0011.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0011.b.success.toast + left_icon = root + capital_county = { add_popular_opinion = 10 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0011.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0011.b.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -10 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= minor_gold_value } + } + } + } + + # Option C - Stop and talk to people (Diplomacy duel, shown when diplomacy > intrigue) + option = { + name = gdp_republic_unrest.0011.c + trigger = { diplomacy > intrigue } + duel = { + skill = diplomacy + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0011.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0011.c.success.toast + left_icon = root + capital_county = { add_popular_opinion = 10 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0011.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0011.c.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -10 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= minor_gold_value } + } + } + } + + # Option D - Order a public gesture (gated on gold >= minor_gold_value) + option = { + name = gdp_republic_unrest.0011.d + trigger = { + gold >= minor_gold_value + } + remove_short_term_gold = minor_gold_value + capital_county = { add_popular_opinion = 10 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + generous = minor_stress_impact_loss + } + ai_chance = { base = 100 } + } + + # Option A - Keep moving (always available) + option = { + name = gdp_republic_unrest.0011.a + capital_county = { add_popular_opinion = -5 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_gain + just = minor_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } +} + +# The Anonymous Letter - A private note of criticism arrives at the palace +gdp_republic_unrest.0021 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0021.t + desc = gdp_republic_unrest.0021.desc + theme = republic + override_background = { reference = study } + left_portrait = { + character = root + animation = worry + } + + trigger = { + exists = scope:faction + } + + # Option B - Investigate who wrote it (Intrigue duel, always available) + option = { + name = gdp_republic_unrest.0021.b + duel = { + skill = intrigue + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0021.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0021.b.success.toast + left_icon = root + add_dread = 10 + capital_county = { + add_popular_opinion = 10 + change_county_control = 5 + } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0021.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0021.b.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -15 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 50 } + } + + # Option C - Draft a public response (Diplomacy duel, always available) + option = { + name = gdp_republic_unrest.0021.c + duel = { + skill = diplomacy + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0021.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0021.c.success.toast + left_icon = root + capital_county = { add_popular_opinion = 15 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0021.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0021.c.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -10 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 50 } + } + + # Option A - Burn it (always available) + option = { + name = gdp_republic_unrest.0021.a + capital_county = { add_popular_opinion = -5 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + stress_and_fulfillment_impact = { + just = minor_stress_impact_gain + diligent = minor_stress_impact_gain + arrogant = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } +} + +### Severity 2 +# The Square Belongs to Them Now +gdp_republic_unrest.0101 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0101.t + desc = gdp_republic_unrest.0101.desc + theme = republic + override_background = { reference = market } + left_portrait = { + character = root + animation = stress + } + right_portrait = { + character = scope:demagogue + animation = anger + } + + trigger = { + exists = scope:faction + } + + immediate = { + random_courtier = { + limit = { + is_available_ai_adult = yes + opinion = { target = root value < -10 } + OR = { + NOT = { exists = house } + AND = { + exists = root.house + house = { NOT = { has_same_house_aspiration_as = root.house } } + } + } + } + weight = { + base = 1 + modifier = { + add = 20 + opinion = { target = root value < -20 } + } + modifier = { + add = 40 + opinion = { target = root value < -40 } + } + } + save_scope_as = demagogue + } + if = { + limit = { NOT = { exists = scope:demagogue } } + create_character = { + template = gdp_republic_demagogue_template + location = root.capital_province + save_scope_as = demagogue + } + } + } + + # Option A - Disperse the Crowd + option = { + name = gdp_republic_unrest.0101.a + capital_county = { + add_popular_opinion = -20 + change_county_control = 20 + } + add_dread = 20 + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + just = minor_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } + + # Option B - Intrigue duel (shown when intrigue >= diplomacy) + option = { + name = gdp_republic_unrest.0101.b + trigger = { + intrigue >= diplomacy + } + duel = { + skill = intrigue + value = very_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0101.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0101.b.success.toast + left_icon = root + right_icon = scope:demagogue + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0101.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0101.b.fail.toast + left_icon = root + right_icon = scope:demagogue + capital_county = { + add_popular_opinion = -20 + change_county_control = -15 + } + add_prestige = minor_prestige_loss + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + add_stress = minor_stress_impact_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= major_gold_value } + } + } + } + + # Option C - Diplomacy duel (shown when diplomacy > intrigue) + option = { + name = gdp_republic_unrest.0101.c + trigger = { + diplomacy > intrigue + } + duel = { + skill = diplomacy + value = very_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0101.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0101.c.success.toast + left_icon = root + right_icon = scope:demagogue + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0101.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0101.c.fail.toast + left_icon = root + right_icon = scope:demagogue + capital_county = { + add_popular_opinion = -20 + change_county_control = -15 + } + add_prestige = minor_prestige_loss + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + add_stress = minor_stress_impact_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= major_gold_value } + } + } + } + + # Option D - Concessions + option = { + name = gdp_republic_unrest.0101.d + trigger = { + gold >= major_gold_value + } + remove_short_term_gold = major_gold_value + capital_county = { add_popular_opinion = 20 } + add_prestige = minor_prestige_gain + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + generous = minor_stress_impact_loss + } + ai_chance = { base = 100 } + } + + after = { + if = { + limit = { + scope:demagogue ?= { has_character_flag = created } + } + scope:demagogue ?= { silent_disappearance_effect = yes } + } + } +} + +scripted_trigger district_types_for_gdp_unrest = { + OR = { + district_type = district_type:guild_district + district_type = district_type:market_district + district_type = district_type:port_district + district_type = district_type:bureaucratic_district + district_type = district_type:temple_district + district_type = district_type:entertainment_district + district_type = district_type:urban_housing_district + } +} + +# The Closed Quarter - A district shuts itself off from city authority +gdp_republic_unrest.0111 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0111.t + desc = gdp_republic_unrest.0111.desc + theme = republic + override_background = { reference = gdp_artisan_street } + left_portrait = { + character = root + animation = worry + } + + trigger = { + exists = scope:faction + capital_county.title_province = { + any_built_regular_district = { + district_types_for_gdp_unrest = yes + } + } + } + + immediate = { + capital_county.title_province = { + random_built_regular_district = { + limit = { + district_types_for_gdp_unrest = yes + } + save_scope_as = closed_district + } + } + } + + # Option A - Force entry (always available) + option = { + name = gdp_republic_unrest.0111.a + add_dread = 15 + capital_county = { + add_popular_opinion = -20 + change_county_control = 15 + } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } + + # Option B - Negotiate (Stewardship duel, shown when stewardship >= diplomacy) + option = { + name = gdp_republic_unrest.0111.b + trigger = { stewardship >= diplomacy } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + duel = { + skill = stewardship + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0111.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0111.b.success.toast + left_icon = root + remove_short_term_gold = minor_gold_value + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0111.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0111.b.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -10 } + gdp_republic_unrest_district_shutdown_modifier_effect = yes + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 100 } + } + + # Option C - Persuade (Diplomacy duel, shown when diplomacy > stewardship) + option = { + name = gdp_republic_unrest.0111.c + trigger = { diplomacy > stewardship } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + duel = { + skill = diplomacy + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0111.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0111.c.success.toast + left_icon = root + add_prestige = medium_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0111.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0111.c.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -10 } + gdp_republic_unrest_district_shutdown_modifier_effect = yes + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 100 } + } + + # Option D - Leave it (always available) + option = { + name = gdp_republic_unrest.0111.d + capital_county = { add_popular_opinion = -5 } + gdp_republic_unrest_district_shutdown_modifier_effect = yes + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + stress_and_fulfillment_impact = { + just = minor_stress_impact_gain + diligent = minor_stress_impact_gain + arbitrary = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } +} + +# The Effigy - A likeness of the ruler is put on display in the public square +gdp_republic_unrest.0121 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0121.t + desc = gdp_republic_unrest.0121.desc + theme = republic + override_background = { reference = market } + left_portrait = { + character = root + animation = stress + } + + trigger = { + exists = scope:faction + } + + # Option A - Tear it down (always available) + option = { + name = gdp_republic_unrest.0121.a + flavor = gdp_republic_unrest.0121.a.flavor + capital_county = { + add_popular_opinion = -15 + change_county_control = 10 + } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } + + # Option B - Hunt the organizers (Intrigue duel, shown when intrigue >= diplomacy) + option = { + name = gdp_republic_unrest.0121.b + trigger = { intrigue >= diplomacy } + stress_and_fulfillment_impact = { + honest = minor_stress_impact_gain + deceitful = minor_stress_impact_loss + } + duel = { + skill = intrigue + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0121.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0121.b.success.toast + left_icon = root + add_dread = 10 + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0121.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0121.b.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -20 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 0 } + } + + # Option C - Address it publicly (Diplomacy duel, shown when diplomacy > intrigue) + option = { + name = gdp_republic_unrest.0121.c + trigger = { diplomacy > intrigue } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + duel = { + skill = diplomacy + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0121.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0121.c.success.toast + left_icon = root + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0121.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0121.c.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -20 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { base = 0 } + } + + # Option D - Ignore it (always available) + option = { + name = gdp_republic_unrest.0121.d + capital_county = { add_popular_opinion = -10 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + stress_and_fulfillment_impact = { + arrogant = medium_stress_impact_gain + just = minor_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 100 } + } +} + +### Severity 3 +# The City is Burning +gdp_republic_unrest.0201 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0201.t + desc = gdp_republic_unrest.0201.desc + theme = republic + override_background = { reference = burning_building } + left_portrait = { + character = root + animation = stress + } + right_portrait = { + character = scope:demagogue + animation = anger + } + + trigger = { + exists = scope:faction + } + + immediate = { + random_courtier = { + limit = { + is_ai = yes + is_adult = yes + opinion = { target = root value < -10 } + OR = { + NOT = { exists = house } + AND = { + exists = root.house + house = { NOT = { has_same_house_aspiration_as = root.house } } + } + } + } + weight = { + base = 1 + modifier = { + add = 20 + opinion = { target = root value < -20 } + } + modifier = { + add = 40 + opinion = { target = root value < -40 } + } + } + save_scope_as = demagogue + } + if = { + limit = { NOT = { exists = scope:demagogue } } + create_character = { + template = gdp_republic_demagogue_template + location = root.capital_province + save_scope_as = demagogue + } + } + } + + # Option A - Military crackdown + option = { + name = gdp_republic_unrest.0201.a + capital_county = { + add_popular_opinion = -30 + change_county_control = 30 + change_prosperity_level = -5 + add_county_modifier = { + modifier = gdp_republic_riot_aftermath + years = 2 + } + } + add_dread = 30 + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + stress_and_fulfillment_impact = { + compassionate = major_stress_impact_gain + just = medium_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } + + # Option B - Lead the guard (Martial duel - shown when martial >= diplomacy) + option = { + name = gdp_republic_unrest.0201.b + trigger = { + martial >= diplomacy + } + duel = { + skill = martial + value = extremely_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0201.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0201.b.success.toast + left_icon = root + right_icon = scope:demagogue + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0201.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0201.b.fail.toast + left_icon = root + right_icon = scope:demagogue + capital_county = { + add_popular_opinion = -30 + change_county_control = -20 + change_prosperity_level = -5 + } + add_prestige = minor_prestige_loss + increase_wounds_no_death_effect = { REASON = fight } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + add_stress = minor_stress_impact_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { base = 0 } + } + + # Option C - Address the crowd (Diplomacy duel - shown when diplomacy > martial) + option = { + name = gdp_republic_unrest.0201.c + trigger = { + diplomacy > martial + } + duel = { + skill = diplomacy + value = extremely_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0201.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0201.c.success.toast + left_icon = root + right_icon = scope:demagogue + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0201.c.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0201.c.fail.toast + left_icon = root + right_icon = scope:demagogue + capital_county = { + add_popular_opinion = -30 + change_county_control = -20 + change_prosperity_level = -5 + } + add_prestige = minor_prestige_loss + increase_wounds_no_death_effect = { REASON = fight } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + add_stress = minor_stress_impact_gain + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + } + } + } + } + ai_chance = { base = 0 } + } + + # Option D - Empty the treasury + option = { + name = gdp_republic_unrest.0201.d + remove_short_term_gold = root.gold + remove_short_term_treasury = root.treasury + capital_county = { add_popular_opinion = 25 } + add_prestige = minor_prestige_gain + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + every_vassal = { + custom = republic_vassals + limit = { government_has_flag = government_is_republic } + add_opinion = { + modifier = wasted_treasury_opinion + target = root + opinion = -20 + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + generous = minor_stress_impact_loss + } + ai_chance = { base = 100 } + } + + after = { + if = { + limit = { + exists = scope:demagogue + scope:demagogue = { has_character_flag = created } + } + scope:demagogue = { silent_disappearance_effect = yes } + } + } +} + +# The Strike - The guilds and merchants have shut down commerce +gdp_republic_unrest.0211 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0211.t + desc = gdp_republic_unrest.0211.desc + theme = republic + override_background = { reference = gdp_artisan_street } + left_portrait = { + character = root + animation = stress + } + + trigger = { + exists = scope:faction + } + + # Option A - Negotiate (Diplomacy duel, shown when diplomacy >= stewardship) + option = { + name = gdp_republic_unrest.0211.a + trigger = { diplomacy >= stewardship } + duel = { + skill = diplomacy + value = very_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0211.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0211.a.success.toast + left_icon = root + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0211.a.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0211.a.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -20 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 0 } + } + + # Option B - Pay their demands (Stewardship duel, shown when stewardship > diplomacy) + option = { + name = gdp_republic_unrest.0211.b + trigger = { stewardship > diplomacy } + duel = { + skill = stewardship + value = very_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0211.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0211.b.success.toast + left_icon = root + remove_short_term_gold = medium_gold_value + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0211.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0211.b.fail.toast + left_icon = root + capital_county = { add_popular_opinion = -20 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { base = 0 } + } + + # Option C - Force them back (always available) + option = { + name = gdp_republic_unrest.0211.c + add_dread = 20 + capital_county = { + add_popular_opinion = -25 + change_county_control = 20 + } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 0 } + } + + # Option D - Give in entirely (always available) + option = { + name = gdp_republic_unrest.0211.d + remove_short_term_treasury = major_treasury_value + capital_county = { + add_popular_opinion = 30 + change_county_control = -20 + } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + stress_and_fulfillment_impact = { + base = 50 + } + ai_chance = { base = 100 } + } +} + +# The Manuscript - Anonymous accusations spread across the city +gdp_republic_unrest.0221 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0221.t + desc = gdp_republic_unrest.0221.desc + theme = republic + override_background = { reference = study } + left_portrait = { + character = root + animation = worry + } + + trigger = { + exists = scope:faction + } + + # Option A - Hunt the author (Intrigue duel, shown when intrigue >= diplomacy) + option = { + name = gdp_republic_unrest.0221.a + trigger = { intrigue >= diplomacy } + duel = { + skill = intrigue + value = very_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0221.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0221.a.success.toast + left_icon = root + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0221.a.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0221.a.fail.toast + left_icon = root + add_prestige = minor_prestige_loss + capital_county = { add_popular_opinion = -20 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= major_gold_value } + } + } + } + + # Option B - Counter publicly (Diplomacy duel, shown when diplomacy > intrigue) + option = { + name = gdp_republic_unrest.0221.b + trigger = { diplomacy > intrigue } + duel = { + skill = diplomacy + value = very_high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0221.b.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_republic_unrest.0221.b.success.toast + left_icon = root + add_prestige = minor_prestige_gain + capital_county = { add_popular_opinion = 20 } + scope:faction = { gdp_republic_unrest_resolve_full_effect = yes } + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0221.b.fail + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_republic_unrest.0221.b.fail.toast + left_icon = root + add_prestige = minor_prestige_loss + capital_county = { add_popular_opinion = -20 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + } + } + } + ai_chance = { + base = 0 + modifier = { + add = 50 + NOT = { gold >= major_gold_value } + } + } + } + + # Option C - Buy up the copies (gated on gold >= major_gold_value) + option = { + name = gdp_republic_unrest.0221.c + trigger = { + gold >= major_gold_value + } + remove_short_term_gold = major_gold_value + capital_county = { add_popular_opinion = 10 } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + ai_chance = { base = 100 } + } + + # Option D - Ignore it (always available) + option = { + name = gdp_republic_unrest.0221.d + capital_county = { add_popular_opinion = -10 } + scope:faction = { gdp_republic_unrest_resolve_fail_effect = yes } + ai_chance = { base = 0 } + } +} + +### Severity 4 +# They Are at the Gates +gdp_republic_unrest.0301 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0301.t + desc = gdp_republic_unrest.0301.desc + theme = republic + override_background = { reference = throne_room } + left_portrait = { + character = root + animation = fear + } + lower_right_portrait = scope:republic_heir + + trigger = { + exists = scope:faction + } + + immediate = { + play_music_cue = mx_cue_combat_stinger + save_scope_as = despot + primary_title = { save_scope_as = republic_title } + capital_county = { save_scope_as = republic_capital } + gdp_find_deposed_republic_successor_effect = yes + } + + # Option A - Last stand (Prowess duel) + option = { + name = gdp_republic_unrest.0301.a + skill = prowess + stress_and_fulfillment_impact = { + base = 100 + craven = major_stress_impact_gain + } + scope:faction = { destroy_faction = yes } + scope:republic_capital = { + add_county_modifier = { + modifier = gdp_republic_uprising_aftermath + years = 5 + } + } + duel = { + skill = prowess + value = 100 + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -45 + } + desc = gdp_republic_unrest.0301.a.success + if = { + limit = { NOT = { has_any_nickname = yes } } + give_nickname = nick_the_defiant + } + trigger_event = { id = gdp_republic_unrest.0302 } + scope:republic_heir = { + if = { + limit = { has_character_flag = generated_character } + death = { death_reason = death_battle killer = scope:despot } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0301.a.fail + save_scope_as = old_doge + every_vassal = { + limit = { government_has_flag = government_is_republic } + trigger_event = { id = gdp_republic_unrest.0304 } + } + gdp_restore_republic_elections_effect = yes + death = { death_reason = death_battle } + } + } + ai_chance = { base = 0 } + } + + # Option B - Fight your way out (Martial duel) + option = { + name = gdp_republic_unrest.0301.b + skill = martial + show_as_tooltip = { gdp_restore_republic_elections_effect = yes } # tooltipped here, but order of effects is maintained below + duel = { + skill = martial + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0301.b.success + save_scope_as = old_doge + every_vassal = { + limit = { government_has_flag = government_is_republic } + trigger_event = { id = gdp_republic_unrest.0305 } + } + hidden_effect = { gdp_restore_republic_elections_merchant_effect = yes } + show_as_tooltip = { change_government = merchant_government } + trigger_event = { id = gdp_republic_unrest.0303 } + stress_and_fulfillment_impact = { + brave = minor_stress_impact_loss + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0301.b.fail + save_scope_as = old_doge + every_vassal = { + limit = { government_has_flag = government_is_republic } + trigger_event = { id = gdp_republic_unrest.0304 } + } + hidden_effect = { gdp_restore_republic_elections_effect = yes } + death = { death_reason = death_battle } + } + } + gdp_republic_unrest_0301_aftermath_effect = yes + ai_chance = { base = 0 } + } + + # Option C - Slip away in disguise (Intrigue duel) + option = { + name = gdp_republic_unrest.0301.c + skill = intrigue + show_as_tooltip = { gdp_restore_republic_elections_effect = yes } # tooltipped here, but order of effects is maintained below + duel = { + skill = intrigue + value = high_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0301.c.success + save_scope_as = old_doge + every_vassal = { + limit = { government_has_flag = government_is_republic } + trigger_event = { id = gdp_republic_unrest.0305 } + } + hidden_effect = { gdp_restore_republic_elections_merchant_effect = yes } + show_as_tooltip = { change_government = merchant_government } + trigger_event = { id = gdp_republic_unrest.0303 } + stress_and_fulfillment_impact = { + arrogant = major_stress_impact_gain + } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0301.c.fail + save_scope_as = old_doge + every_vassal = { + limit = { government_has_flag = government_is_republic } + trigger_event = { id = gdp_republic_unrest.0304 } + } + hidden_effect = { gdp_restore_republic_elections_effect = yes } + death = { death_reason = death_murder } + } + } + gdp_republic_unrest_0301_aftermath_effect = yes + ai_chance = { base = 0 } + } + + # Option D - Retire + option = { + name = gdp_republic_unrest.0301.d + flavor = gdp_republic_unrest.0301.d.flavor + gdp_restore_republic_elections_effect = yes + gdp_republic_unrest_0301_aftermath_effect = yes + stress_and_fulfillment_impact = { + arrogant = major_stress_impact_gain + humble = minor_stress_impact_loss + } + ai_chance = { base = 100 } + } +} + +# Survived the onslaught +gdp_republic_unrest.0302 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0302.t + desc = gdp_republic_unrest.0302.desc + theme = republic + override_background = { reference = throne_room } + left_portrait = { + character = root + animation = sword_yield_start + } + + option = { + name = gdp_republic_unrest.0302.a + if = { + limit = { NOT = { has_trait = brave } } + add_trait = brave + } + add_dread = 50 + capital_county = { change_county_control = 30 } + } +} + +# A merchant's new beginning +gdp_republic_unrest.0303 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0303.t + desc = gdp_republic_unrest.0303.desc + theme = republic + left_portrait = { + character = root + animation = biting_coin + } + + widgets = { + widget = { + gui = "event_window_widget_name_child" + container = "dynamic_birth_name" + controller = name_character + setup_scope = { root = { save_scope_as = name_character_target } } + } + + widget = { + gui = event_window_widget_vfx_godray + container = foreground_shader_vfx_container + } + } + + immediate = { + hidden_effect = { + gdp_republic_unrest_flee_reset_domicile_effect = yes + } + custom_tooltip = gdp_republic_unrest.0303.tt + capital_county = { save_scope_as = old_capital_county } + hidden_effect = { + capital_county.empire = { + every_de_jure_county = { + limit = { + NOT = { this = scope:old_capital_county } + title_province = { province_size_level > 3 } + } + add_to_list = potential_new_home + } + every_title_to_title_neighboring_empire = { + every_de_jure_county = { + limit = { + NOT = { this = scope:old_capital_county } + title_province = { province_size_level > 3 } + } + add_to_list = potential_new_home + } + } + } + ordered_in_list = { + list = potential_new_home + order_by = { + subtract = "squared_distance(root.location)" + } + save_scope_as = destination_a + } + ordered_in_list = { + list = potential_new_home + limit = { + exists = scope:destination_a + NOT = { this = scope:destination_a } + } + order_by = { + subtract = "squared_distance(root.location)" + } + save_scope_as = destination_b + } + ordered_in_list = { + list = potential_new_home + limit = { + exists = scope:destination_a + exists = scope:destination_b + NOR = { + this = scope:destination_a + this = scope:destination_b + } + } + order_by = { + subtract = "squared_distance(root.location)" + } + save_scope_as = destination_c + } + } + } + + option = { + name = gdp_republic_unrest.0303.a + trigger = { exists = scope:destination_a } + custom_tooltip = gdp_republic_unrest.0303.a.tt + start_travel_plan = { + destination = scope:destination_a.title_province + on_arrival_event = gdp_republic_unrest.0306 + on_arrival_destinations = last + players_use_planner = no + return_trip = no + } + } + + option = { + name = gdp_republic_unrest.0303.b + trigger = { exists = scope:destination_b } + custom_tooltip = gdp_republic_unrest.0303.b.tt + start_travel_plan = { + destination = scope:destination_b.title_province + on_arrival_event = gdp_republic_unrest.0306 + on_arrival_destinations = last + players_use_planner = no + return_trip = no + } + } + + option = { + name = gdp_republic_unrest.0303.c + trigger = { exists = scope:destination_c } + custom_tooltip = gdp_republic_unrest.0303.c.tt + start_travel_plan = { + destination = scope:destination_c.title_province + on_arrival_event = gdp_republic_unrest.0306 + on_arrival_destinations = last + players_use_planner = no + return_trip = no + } + } + + option = { + name = gdp_republic_unrest.0303.d + trigger = { + NOR = { + exists = scope:destination_a + exists = scope:destination_b + exists = scope:destination_c + } + } + start_tributary_interaction_effect = { + TRIBUTARY = root + SUZERAIN = capital_county.holder + } + } +} + +# Patrician notification - the doge died +gdp_republic_unrest.0304 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0304.t + desc = gdp_republic_unrest.0304.desc + theme = republic + left_portrait = { + character = scope:old_doge + animation = stress + } + + immediate = { + show_as_tooltip = { + gdp_restore_republic_elections_effect = yes + } + } + + option = { + name = gdp_republic_unrest.0304.a + } +} + +# Patrician notification - the doge vanished +gdp_republic_unrest.0305 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0305.t + desc = gdp_republic_unrest.0305.desc + theme = republic + left_portrait = { + character = scope:old_doge + animation = standing + } + + immediate = { + show_as_tooltip = { + gdp_restore_republic_elections_effect = yes + } + } + + option = { + name = gdp_republic_unrest.0305.a + } +} + +# Arrived at new home +gdp_republic_unrest.0306 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0306.t + desc = gdp_republic_unrest.0306.desc + theme = republic + override_background = { reference = market } + left_portrait = { + character = root + animation = personality_content + } + + immediate = { + hidden_effect = { + start_tributary_interaction_effect = { + TRIBUTARY = root + SUZERAIN = location.county.holder + } + gdp_move_company_invalidate_trade_effect = yes + } + domicile = { move_domicile = root.location } + } + + option = { + name = gdp_republic_unrest.0306.a + } +} + +# An Assassin in Broad Daylight +gdp_republic_unrest.0311 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0311.t + desc = gdp_republic_unrest.0311.desc + theme = republic + override_background = { reference = market } + left_portrait = { + character = root + animation = fear + } + right_portrait = { + character = scope:assassin + animation = aggressive_dagger + hide_info = yes + } + + trigger = { + exists = scope:faction + } + + immediate = { + play_music_cue = mx_cue_combat_stinger + create_character = { + template = gdp_republic_assassin_template + location = root.capital_province + save_scope_as = assassin + } + } + + # Option A - Fight back (Prowess duel) + option = { + name = gdp_republic_unrest.0311.a + duel = { + skill = prowess + value = medium_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0311.a.success + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + trigger_event = { id = gdp_republic_unrest.0312 } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0311.a.fail + scope:faction = { destroy_faction = yes } + capital_county = { add_popular_opinion = 75 } + death = { death_reason = death_murder } + } + } + ai_chance = { base = 50 } + } + + # Option B - Slip away (Intrigue duel) + option = { + name = gdp_republic_unrest.0311.b + duel = { + skill = intrigue + value = medium_skill_rating + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = 1 + } + desc = gdp_republic_unrest.0311.b.success + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + trigger_event = { id = gdp_republic_unrest.0312 } + } + 10 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = 1 + } + desc = gdp_republic_unrest.0311.b.fail + scope:faction = { destroy_faction = yes } + capital_county = { add_popular_opinion = 75 } + death = { death_reason = death_murder } + } + } + ai_chance = { base = 50 } + } + + after = { + scope:assassin = { silent_disappearance_effect = yes } + } +} + +# Survived the assassination attempt +gdp_republic_unrest.0312 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0312.t + desc = gdp_republic_unrest.0312.desc + theme = republic + override_background = { reference = market } + left_portrait = { + character = root + animation = stress + } + + option = { + name = gdp_republic_unrest.0312.a + stress_and_fulfillment_impact = { + base = 50 + } + } +} + +# Blood for Blood - The heir has been kidnapped by the mob +gdp_republic_unrest.0321 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0321.t + desc = gdp_republic_unrest.0321.desc + theme = republic + override_background = { reference = study } + left_portrait = { + character = root + animation = chancellor + camera = camera_event_center_away_pointing_left_fov25 + } + lower_right_portrait = { + character = scope:heir + animation = fear + } + + trigger = { + exists = scope:faction + OR = { + exists = root.player_heir + exists = root.primary_heir + } + } + + immediate = { + play_music_cue = mx_cue_combat_stinger + save_scope_as = despot + if = { + limit = { is_ai = no } + player_heir = { save_scope_as = heir } + } + else = { + primary_heir = { save_scope_as = heir } + } + primary_title = { save_scope_as = republic_title } + capital_county = { save_scope_as = republic_capital } + if = { + limit = { + has_relation_rival = scope:heir + } + save_scope_value_as = { + name = heir_was_rival + value = yes + } + } + else = { + save_scope_value_as = { + name = heir_was_rival + value = no + } + stress_and_fulfillment_impact = { + base = 50 + } + } + save_scope_value_as = { + name = abdicated_for_heir + value = no + } + } + + # Option R - Let them have the heir (only available if rival/nemesis with heir) + option = { + name = gdp_republic_unrest.0321.rival + trigger = { + scope:heir_was_rival = yes + } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + scope:heir = { death = { death_reason = death_murder } } + trigger_event = { id = gdp_republic_unrest.0323 } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + callous = minor_stress_impact_loss + } + ai_chance = { base = 50 } + } + + # Option A - Rescue by force (Martial duel, shown when martial >= intrigue) + option = { + name = gdp_republic_unrest.0321.a + trigger = { martial >= intrigue } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + duel = { + skill = martial + value = high_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0321.a.success + custom_tooltip = gdp_republic_unrest.0321.heir_survives + trigger_event = { id = gdp_republic_unrest.0322 } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0321.a.fail + scope:heir = { death = { death_reason = death_murder } } + trigger_event = { id = gdp_republic_unrest.0323 } + } + } + ai_chance = { base = 0 } + } + + # Option B - Outsmart them (Intrigue duel, shown when intrigue > martial) + option = { + name = gdp_republic_unrest.0321.b + trigger = { intrigue > martial } + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + duel = { + skill = intrigue + value = high_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + desc = gdp_republic_unrest.0321.b.success + custom_tooltip = gdp_republic_unrest.0321.heir_survives + trigger_event = { id = gdp_republic_unrest.0322 } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + desc = gdp_republic_unrest.0321.b.fail + scope:heir = { death = { death_reason = death_murder } } + trigger_event = { id = gdp_republic_unrest.0323 } + } + } + ai_chance = { base = 0 } + } + + # Option C - Pay the ransom (requires at least 12 months of income) + option = { + name = gdp_republic_unrest.0321.c + trigger = { + gold >= { + value = monthly_character_income + multiply = 12 + } + } + remove_short_term_gold = root.gold + scope:faction = { gdp_republic_unrest_resolve_partial_effect = yes } + custom_tooltip = gdp_republic_unrest.0321.heir_survives + trigger_event = { id = gdp_republic_unrest.0322 } + ai_chance = { base = 100 } + } + + # Option D - Abdicate to save the heir + option = { + name = gdp_republic_unrest.0321.d + flavor = gdp_republic_unrest.0321.d.flavor + scope:faction = { destroy_faction = yes } + gdp_restore_republic_elections_effect = yes + custom_tooltip = gdp_republic_unrest.0321.heir_survives + stress_and_fulfillment_impact = { + arrogant = major_stress_impact_gain + humble = minor_stress_impact_loss + } + ai_chance = { + base = 0 + modifier = { + add = 75 + NOT = { + gold >= { + value = monthly_character_income + multiply = 12 + } + } + } + } + } +} + +# Heir recovered +gdp_republic_unrest.0322 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0322.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:heir_was_rival = yes + } + desc = gdp_republic_unrest.0322.desc.rival + } + desc = gdp_republic_unrest.0322.desc + } + } + theme = republic + override_background = { reference = sitting_room } + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:heir_was_rival = yes } + animation = writing + } + triggered_animation = { + trigger = { scope:heir_was_rival = no } + animation = wedding_happy_cry + } + } + right_portrait = { + trigger = { scope:heir_was_rival = no } + character = scope:heir + animation = happiness + } + lower_right_portrait = { + trigger = { scope:heir_was_rival = yes } + character = scope:heir + animation = personality_content + } + + override_effect_2d = { + trigger = { scope:heir_was_rival = no } + reference = legend_glow + } + + option = { + name = { + trigger = { scope:heir_was_rival = no } + text = gdp_republic_unrest.0322.a + } + name = { + trigger = { scope:heir_was_rival = yes } + text = gdp_republic_unrest.0322.a.rival + } + + if = { + limit = { scope:heir_was_rival = no } + stress_and_fulfillment_impact = { + base = -50 + } + } + } +} + +# Heir died +gdp_republic_unrest.0323 = { + type = character_event + window = big_event_window + title = gdp_republic_unrest.0323.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:heir_was_rival = yes + } + desc = gdp_republic_unrest.0323.desc.rival + } + desc = gdp_republic_unrest.0323.desc + } + } + theme = republic + override_background = { reference = courtyard } + left_portrait = { + character = root + animation = grief + } + lower_right_portrait = { + character = scope:heir + animation = dead + } + + widgets = { + widget = { + gui = event_window_widget_vfx_background_night_scene + container = foreground_shader_vfx_container + } + + widget = { + gui = event_window_widget_vfx_left_character_night_scene + container = foreground_shader_vfx_container + } + } + + option = { + name = { + trigger = { + scope:heir_was_rival = no + scope:heir = { + OR = { + is_child_of = root + is_grandchild_of = root + } + } + } + text = gdp_republic_unrest.0323.a.child + } + name = { + trigger = { + OR = { + scope:heir_was_rival = yes + scope:heir = { + NOR = { + is_child_of = root + is_grandchild_of = root + } + } + } + } + text = gdp_republic_unrest.0323.a + } + + if = { + limit = { scope:heir_was_rival = no } + stress_and_fulfillment_impact = { + base = 100 + } + add_character_modifier = { + modifier = gdp_republic_grieving_parent_modifier + years = 6 + } + } + else = { + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_gain + } + } + } +} diff --git a/events/dlc/gdp/gdp_trade_good_flavor_events.txt b/events/dlc/gdp/gdp_trade_good_flavor_events.txt new file mode 100644 index 000000000..4e49e98c8 --- /dev/null +++ b/events/dlc/gdp/gdp_trade_good_flavor_events.txt @@ -0,0 +1,15798 @@ +namespace = gdp_trade_good_flavor + +#### +## Trade-good flavor events, fired only from gdp_merchant_yearly_events +## 1000-1999 - Generic events (any good) +# gdp_trade_good_flavor.1001 - Counting Stock +# gdp_trade_good_flavor.1002 - Word Travels (buyer praise) +# gdp_trade_good_flavor.1003 - From the Source (origin report) +# gdp_trade_good_flavor.1004 - An Open Road (route boost) +# gdp_trade_good_flavor.1005 - Dreams of Profit +# gdp_trade_good_flavor.1006 - Fools Who Check (low-quality goods) +# gdp_trade_good_flavor.1007 - Ask for It by Name (your name on the crate) +# gdp_trade_good_flavor.1008 - The Appraiser (called to judge) +# gdp_trade_good_flavor.1009 - Learn to Count (teach the heir) +# gdp_trade_good_flavor.1010 - The Imitator +# gdp_trade_good_flavor.1011 - The Price of Names (they want your suppliers) +# gdp_trade_good_flavor.1012 - A Truce of Traders (the trade ally) +# gdp_trade_good_flavor.1013 - A Private Price +# gdp_trade_good_flavor.1014 - Ask the Old Hands +# gdp_trade_good_flavor.1015 - A Beginner's Mistake +# gdp_trade_good_flavor.1016 - The Merchant's Handbook +# gdp_trade_good_flavor.1017 - The Feel of It (buy the sample) +# gdp_trade_good_flavor.1018 - Wrong Measure +# gdp_trade_good_flavor.1019 - Two Goods, One Buyer +# gdp_trade_good_flavor.1020 - The Builder's Rate +# gdp_trade_good_flavor.1021 - Know the Goods (study the good) +# gdp_trade_good_flavor.1022 - A Name for the Trade +# gdp_trade_good_flavor.1023 - A Choke on Supply +# gdp_trade_good_flavor.1024 - Under the Hammer +# gdp_trade_good_flavor.1025 - First at the Quay +# gdp_trade_good_flavor.1026 - By the Handful +# gdp_trade_good_flavor.1027 - Market Day +# gdp_trade_good_flavor.1028 - Foreign Coin +# gdp_trade_good_flavor.1029 - Years on the Road +# gdp_trade_good_flavor.1030 - Watching It Sell (renowned) +# gdp_trade_good_flavor.1031 - Outside Money +# gdp_trade_good_flavor.1032 - The Display Room +# gdp_trade_good_flavor.1033 - Keeping Your Hand In +# gdp_trade_good_flavor.1034 - The Itinerary (fledgling) +# gdp_trade_good_flavor.1035 - Talking Shop +# gdp_trade_good_flavor.1036 - The Packing Floor +# gdp_trade_good_flavor.1037 - The Market Seal +# gdp_trade_good_flavor.1038 - The Broker +# gdp_trade_good_flavor.1039 - The Trader's Apprentice (player-only) +# gdp_trade_good_flavor.1040 - Swimming in It (wealthy) +# gdp_trade_good_flavor.1041 - The First Sale (wealthy, once) +# gdp_trade_good_flavor.1042 - Coin Under the Pillow (wealthy) +# gdp_trade_good_flavor.1043 - Portrait With Coins (wealthy, once) +# gdp_trade_good_flavor.1044 - A Purse Too Heavy (wealthy) +# gdp_trade_good_flavor.1045 - Profit and Piety (zealous, or forbidden alcohol) +# gdp_trade_good_flavor.1046 - One of Their Own (trader shares the market's faith or culture) +# gdp_trade_good_flavor.1047 - Flooded Market (rival dumping) +# gdp_trade_good_flavor.1048 - Manuscript in a Bale +# gdp_trade_good_flavor.1049 - Merchants From Home (diaspora) +# gdp_trade_good_flavor.1050 - The Salt Road (smuggler) +## 2000-2999 - Category events +# gdp_trade_good_flavor.2001 - A Heavy Harvest (farmed goods) +# gdp_trade_good_flavor.2002 - The Hunter's Haul (forest goods) +# gdp_trade_good_flavor.2003 - A Rich Vein (minerals) +# gdp_trade_good_flavor.2004 - Worth Its Secret (artisanal goods) +# gdp_trade_good_flavor.2005 - A Matter of Taste (comforts) +# gdp_trade_good_flavor.2006 - Dress the Part (clothes) +# gdp_trade_good_flavor.2007 - Face Value (precious metals) +# gdp_trade_good_flavor.2008 - Intact (fragile goods) +# gdp_trade_good_flavor.2009 - Other Men See Armies (selling into a war) +# gdp_trade_good_flavor.2010 - The Guild Knocks (guild goods) +# gdp_trade_good_flavor.2011 - Rulers Set Fashions (wearable luxuries) +# gdp_trade_good_flavor.2012 - Sample the Goods (alcohol, stressed) +# gdp_trade_good_flavor.2013 - A Masterwork Order +# gdp_trade_good_flavor.2014 - Their Dish, Our Goods (food) +# gdp_trade_good_flavor.2015 - Paid in Goods (forest goods) +# gdp_trade_good_flavor.2016 - Money Doesn't Stink (smelly goods) +# gdp_trade_good_flavor.2017 - Seven Fat Years (food goods) +# gdp_trade_good_flavor.2018 - Somebody's Cattle (livestock raiders) +# gdp_trade_good_flavor.2019 - A Dry Court's Thirst (alcohol, dry faith) +## 3000-3999 - Good-specific events +# gdp_trade_good_flavor.3001 - A Perfect Wheel (cheese) +# gdp_trade_good_flavor.3002 - A Famous Complaint (copper, Ea-nasir) +# gdp_trade_good_flavor.3003 - Rent in Pepper (spices) +# gdp_trade_good_flavor.3004 - A Letter Full of Complaints (flax) +# gdp_trade_good_flavor.3005 - A Subtlety (sugar) +# gdp_trade_good_flavor.3006 - The Swarm (honey) +# gdp_trade_good_flavor.3007 - Another Pot of Tea (tea) +# gdp_trade_good_flavor.3008 - Before It Turns (fruit) +# gdp_trade_good_flavor.3009 - The Midnight Oil (oil) +# gdp_trade_good_flavor.3010 - In the Blade (grain) +# gdp_trade_good_flavor.3011 - Ten-Year Millet (millet) +# gdp_trade_good_flavor.3012 - Polished or Not (rice) +# gdp_trade_good_flavor.3013 - Before the Fast (meat) +# gdp_trade_good_flavor.3014 - Look It in the Mouth (horses) +# gdp_trade_good_flavor.3015 - Fatten for Market (cattle) +# gdp_trade_good_flavor.3016 - Calfskin for the Scribes (leather) +# gdp_trade_good_flavor.3017 - Buying the Clip (wool) +# gdp_trade_good_flavor.3018 - The Vegetable Lamb (cotton) +# gdp_trade_good_flavor.3019 - Spolia (stone) +# gdp_trade_good_flavor.3020 - The Mast Trunk (wood) +# gdp_trade_good_flavor.3021 - The Tent of Smoke (hemp) +# gdp_trade_good_flavor.3022 - A Blade From My Best (iron) +# gdp_trade_good_flavor.3023 - The Lapidary's Claim (gems) +# gdp_trade_good_flavor.3024 - The Gentleman's Stone (jade) +# gdp_trade_good_flavor.3025 - Porcelain Ballast (ceramics) +# gdp_trade_good_flavor.3026 - The Sap Bites (lacquerware) +# gdp_trade_good_flavor.3027 - Reading Stones (glass) +# gdp_trade_good_flavor.3028 - Feast-Day Prices (incense) +# gdp_trade_good_flavor.3029 - Theriac (medicaments) +# gdp_trade_good_flavor.3030 - No Paper for Charters (books and paper) +# gdp_trade_good_flavor.3031 - Gruit or Hops (beer) +# gdp_trade_good_flavor.3032 - A Basket of Fruit (any merchant, regional fruit) + +# Counting Stock +gdp_trade_good_flavor.1001 = { + type = character_event + title = gdp_trade_good_flavor.1001.t + desc = gdp_trade_good_flavor.1001.desc + theme = merchant + override_background = bp1_wine_cellar + + left_portrait = { + character = root + animation = holding_tally_stick + camera = camera_event_right_away + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + } + + immediate = { + add_character_flag = { + flag = use_sickness_clothes + days = 7 + } + gdp_tgf_setup_good_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1001.a + add_stress = medium_stress_loss + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1001.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + remove_character_flag = use_sickness_clothes + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = market someone else owns, where $ROUTE$ sells a needed good. Expects root = the merchant +scripted_trigger gdp_tgf_praise_market_trigger = { + save_temporary_scope_as = tgf_praise_market_temp + gdp_tgf_stranger_holder_market_trigger = yes + any_trade_good_with_need = { + save_temporary_scope_as = tgf_praise_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_praise_market_temp + trade_good_type = scope:tgf_praise_good_temp + } + } + } +} + +# this = trade route. Expects root = the merchant +scripted_trigger gdp_tgf_praise_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_praise_route_temp + any_trade_market_on_route = { + gdp_tgf_praise_market_trigger = { ROUTE = scope:tgf_praise_route_temp } + } +} + +# Word Travels +gdp_trade_good_flavor.1002 = { + type = character_event + title = gdp_trade_good_flavor.1002.t + desc = gdp_trade_good_flavor.1002.desc + theme = merchant + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = royal_wave + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_praise_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_praise_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_praise_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + random_trade_good_with_need = { + limit = { + save_temporary_scope_as = tgf_praise_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_praise_good_temp + } + } + } + save_scope_as = tgf_good + } + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1002.a + pay_short_term_gold = { + target = scope:tgf_market_holder + gold = minor_gold_value + } + add_prestige = medium_prestige_gain + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1002.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1002.c + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# From the Source +gdp_trade_good_flavor.1003 = { + type = character_event + title = gdp_trade_good_flavor.1003.t + desc = gdp_trade_good_flavor.1003.desc + theme = trade + override_background = { + trigger = { + OR = { + scope:tgf_category = trade_good_category:trade_category_base_metals + scope:tgf_category = trade_good_category:trade_category_precious_metals + scope:tgf_good = trade_good_type:trade_good_jewelry + } + } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_wood + scope:tgf_good = trade_good_type:trade_good_hemp + scope:tgf_good = trade_good_type:trade_good_lacquerware + } + } + reference = gdp_carpentry_workshop + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_leather + scope:tgf_good = trade_good_type:trade_good_furs + scope:tgf_good = trade_good_type:trade_good_dyes + } + } + reference = gdp_tannery + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_glass + scope:tgf_good = trade_good_type:trade_good_ceramics + scope:tgf_good = trade_good_type:trade_good_textiles + } + } + reference = gdp_artisan_street + } + override_background = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + reference = bp1_wine_cellar + } + override_background = { reference = sitting_room } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left + } + + right_portrait = { + character = scope:tgf_trader + animation = writing + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_report_route_trigger = yes } + } + + immediate = { + gdp_tgf_setup_buy_report_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1003.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1003.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1003.c + trigger = { + NOT = { culture = scope:tgf_source_culture } + } + scope:tgf_source_culture = { + change_cultural_acceptance = { + target = root.culture + value = minor_cultural_acceptance_gain + desc = cultural_acceptance_gain_event + } + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# An Open Road +gdp_trade_good_flavor.1004 = { + type = character_event + title = gdp_trade_good_flavor.1004.t + desc = gdp_trade_good_flavor.1004.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_right_away + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + is_commission_route = no + has_trader = yes + any_traded_good = { always = yes } + } + } + + immediate = { + random_trade_route = { + limit = { + is_commission_route = no + has_trader = yes + any_traded_good = { always = yes } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_traded_good = { save_scope_as = tgf_good } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1004.a + add_gold = minor_gold_value + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1004.b + add_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1004.c + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_heavier_loads + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = craven factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Dreams of Profit +gdp_trade_good_flavor.1005 = { + type = character_event + title = gdp_trade_good_flavor.1005.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1005.desc.livestock + } + desc = gdp_trade_good_flavor.1005.desc + } + desc = gdp_trade_good_flavor.1005.desc.outro + } + theme = merchant + override_background = { reference = bedchamber } + + left_portrait = { + character = root + animation = laugh + camera = camera_event_right_forward + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_night_scene container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_night_scene container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + } + + immediate = { + add_character_flag = { + flag = use_sickness_clothes + days = 7 + } + gdp_tgf_setup_good_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1005.a + trigger = { + can_create_task_contract = { type_name = promote_goods } + } + custom_tooltip = gdp_trade_good_flavor.1005.a.tt + trigger_event = { on_action = gdp_promote_goods } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1005.b + add_stress = minor_stress_gain + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1005.c + add_stress = minor_stress_loss + ai_chance = { + base = 100 + modifier = { has_trait = diligent factor = 0 } + } + } + + after = { + remove_character_flag = use_sickness_clothes + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Fools Who Check +gdp_trade_good_flavor.1006 = { + type = character_event + title = gdp_trade_good_flavor.1006.t + desc = gdp_trade_good_flavor.1006.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_left_crowning_observation + } + right_portrait = { + character = scope:tgf_trader + animation = arguing + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_report_route_trigger = yes } + } + + immediate = { + gdp_tgf_setup_buy_report_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1006.a + add_prestige = minor_prestige_loss + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1006.b + add_prestige = minor_prestige_gain + stress_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route with a trader that sells a good in a market with an origin county +scripted_trigger gdp_tgf_crate_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_crate_route_temp + any_trade_market_on_route = { + gdp_tgf_route_sells_here_trigger = { ROUTE = scope:tgf_crate_route_temp } + } +} + +# Ask for It by Name +gdp_trade_good_flavor.1007 = { + type = character_event + title = gdp_trade_good_flavor.1007.t + desc = gdp_trade_good_flavor.1007.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = merchant_gesturing + camera = camera_event_center + } + right_portrait = { + character = scope:tgf_trader + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + exists = house + any_trade_route = { gdp_tgf_crate_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_crate_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_route_sells_here_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_crate_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_crate_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1007.a + add_prestige = medium_prestige_gain + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_known_mark + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1007.b + add_prestige = minor_prestige_gain + add_gold = minor_gold_value + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = market with a stranger holder, where $ROUTE$ buys or sells. Expects root = the merchant +scripted_trigger gdp_tgf_judge_market_trigger = { + gdp_tgf_stranger_holder_market_trigger = yes + OR = { + gdp_tgf_route_buys_here_trigger = { ROUTE = $ROUTE$ } + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + } +} + +# this = route where a market has a foreign holder and trades one of the route's goods. Expects root = the merchant +scripted_trigger gdp_tgf_judge_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_judge_route_temp + any_trade_market_on_route = { + gdp_tgf_judge_market_trigger = { ROUTE = scope:tgf_judge_route_temp } + } +} + +# The Appraiser +gdp_trade_good_flavor.1008 = { + type = character_event + title = gdp_trade_good_flavor.1008.t + desc = gdp_trade_good_flavor.1008.desc + theme = trade + override_background = { reference = study } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = worry + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_judge_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_judge_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_judge_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_judge_good_temp + scope:tgf_route = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_judge_good_temp + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_judge_good_temp + } + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1008.a + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 35 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + add_prestige = medium_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = deceitful factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1008.b + trigger = { + is_ai = no + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + scope:tgf_market_holder = { + pay_short_term_gold = { + target = root + gold = minor_gold_value + } + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 15 + } + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1008.c + trigger = { + is_ai = no + scope:tgf_market_holder = { short_term_gold >= medium_gold_value } + } + show_as_unavailable = { always = yes } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + scope:tgf_market_holder = { + pay_short_term_gold = { + target = root + gold = medium_gold_value + } + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Learn to Count +gdp_trade_good_flavor.1009 = { + type = character_event + title = gdp_trade_good_flavor.1009.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1009.desc.livestock + } + desc = gdp_trade_good_flavor.1009.desc + } + desc = gdp_trade_good_flavor.1009.desc.outro + } + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = holding_tally_stick + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_heir + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available = yes + gdp_tgf_eligible_trigger = yes + exists = player_heir + player_heir = { + is_ai = yes + age >= 8 + is_physically_able = yes + } + } + + immediate = { + gdp_tgf_setup_good_effect = yes + player_heir = { save_scope_as = tgf_heir } + } + + option = { + name = gdp_trade_good_flavor.1009.a + scope:tgf_heir = { + add_stewardship_skill = 1 + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1009.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + scope:tgf_heir = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_minor_value + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ sells a good and an AI rival with an AI-headed house trades too +scripted_trigger gdp_tgf_imitator_market_trigger = { + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + any_potential_trade_rival_in_market = { + target = root + gdp_tgf_valid_rival_trigger = yes + exists = house + house.house_head ?= { is_ai = yes } + NOT = { house = root.house } + } +} + +# this = trade route where a market has an AI rival from an AI-led house. Expects root = the merchant +scripted_trigger gdp_tgf_imitator_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_imitator_route_temp + any_trade_market_on_route = { + gdp_tgf_imitator_market_trigger = { ROUTE = scope:tgf_imitator_route_temp } + } +} + +# The Imitator +gdp_trade_good_flavor.1010 = { + type = character_event + title = gdp_trade_good_flavor.1010.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1010.desc.livestock + } + desc = gdp_trade_good_flavor.1010.desc + } + desc = gdp_trade_good_flavor.1010.desc.outro + } + theme = merchant + override_background = { reference = market } + + left_portrait = { + character = root + animation = anger + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + animation = arguing + camera = camera_event_right + } + lower_center_portrait = { + character = scope:tgf_rival + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + house.house_head ?= { + OR = { + this = root + is_ai = yes + } + } + any_trade_route = { gdp_tgf_imitator_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_imitator_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_imitator_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_imitator_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_imitator_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + random_potential_trade_rival_in_market = { + target = root + limit = { + gdp_tgf_valid_rival_trigger = yes + exists = house + house.house_head ?= { is_ai = yes } + NOT = { house = root.house } + } + save_scope_as = tgf_rival + } + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_rival = { + random_held_title = { + limit = { gdp_merchant_company_title_trigger = yes } + save_scope_as = tgf_rival_company + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1010.a + remove_short_term_gold = minor_gold_value + add_prestige = medium_prestige_gain + scope:tgf_rival = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = forgiving factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1010.b + add_prestige = minor_prestige_gain + scope:tgf_rival = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + house = { + if = { + limit = { + NOT = { has_house_relation_with = scope:tgf_rival.house } + } + set_house_relation = { + target = scope:tgf_rival.house + level = quarrel + description = house_relation_tgf_imitation_desc + } + } + else = { + change_house_relation_effect = { + HOUSE = scope:tgf_rival.house + VALUE = house_relation_damage_minor_value + REASON = tgf_imitation + CHAR = root + TARGET_CHAR = scope:tgf_rival + TITLE = scope:tgf_rival_company + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1010.c + add_prestige = medium_prestige_loss + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = vengeful factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = a rival with money on hand and an adult to send, since we create no one for the errand +scripted_trigger gdp_tgf_supplier_rival_trigger = { + gdp_tgf_valid_rival_trigger = yes + short_term_gold >= medium_gold_value + OR = { + any_trade_route = { + has_trader = yes + trader ?= { is_physically_able_adult = yes } + } + any_courtier = { is_physically_able_adult = yes } + } +} + +# this = trade market where $ROUTE$ buys a good and a rival with means trades too. Expects root = the merchant +scripted_trigger gdp_tgf_supplier_market_trigger = { + gdp_tgf_route_buys_here_trigger = { ROUTE = $ROUTE$ } + any_potential_trade_rival_in_market = { + target = root + gdp_tgf_supplier_rival_trigger = yes + } +} + +# this = trade route with a supplier market on it. Expects root = the merchant +scripted_trigger gdp_tgf_supplier_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_supplier_route_temp + any_trade_market_on_route = { + gdp_tgf_supplier_market_trigger = { ROUTE = scope:tgf_supplier_route_temp } + } +} + +# The Price of Names +gdp_trade_good_flavor.1011 = { + type = character_event + title = gdp_trade_good_flavor.1011.t + desc = gdp_trade_good_flavor.1011.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = biting_coin + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_envoy + animation = bribing + camera = camera_event_right + } + lower_center_portrait = { + character = scope:tgf_rival + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_supplier_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_supplier_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_supplier_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_supplier_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_supplier_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + random_potential_trade_rival_in_market = { + target = root + limit = { gdp_tgf_supplier_rival_trigger = yes } + save_scope_as = tgf_rival + } + } + scope:tgf_rival = { + random_held_title = { + limit = { gdp_merchant_company_title_trigger = yes } + save_scope_as = tgf_rival_company + } + if = { + limit = { + any_trade_route = { + has_trader = yes + trader ?= { is_physically_able_adult = yes } + } + } + random_trade_route = { + limit = { + has_trader = yes + trader ?= { is_physically_able_adult = yes } + } + trader = { save_scope_as = tgf_envoy } + } + } + else = { + random_courtier = { + limit = { is_physically_able_adult = yes } + save_scope_as = tgf_envoy + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1011.a + trigger = { is_ai = no } + scope:tgf_rival = { + pay_short_term_gold = { + target = root + gold = medium_gold_value + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_massive_value + } + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1011.b + add_trade_good_price_modifier = { + type = buy_mult + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_kept_edge + YEARS = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = an ally merchant candidate who does not resent root. Expects root = the merchant +scripted_trigger gdp_tgf_valid_ally_trigger = { + gdp_tgf_valid_rival_trigger = yes + exists = house + house.house_head ?= { is_ai = yes } + NOT = { house = root.house } + opinion = { + target = root + value >= 0 + } +} + +# this = trade market where $ROUTE$ sells a good that a friendly AI merchant also sells +scripted_trigger gdp_tgf_ally_market_trigger = { + save_temporary_scope_as = tgf_ally_market_temp + exists = trade_market_owner.title_province.county + $ROUTE$ = { + any_traded_good = { + save_temporary_scope_as = tgf_ally_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_ally_market_temp + trade_good_type = scope:tgf_ally_good_temp + } + } + root = { + any_potential_trade_ally_on_routes = { + trade_market = scope:tgf_ally_market_temp + trade_good_type = scope:tgf_ally_good_temp + gdp_tgf_valid_ally_trigger = yes + } + } + } + } +} + +# this = trade route. Expects root = the merchant +scripted_trigger gdp_tgf_ally_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_ally_route_temp + any_trade_market_on_route = { + gdp_tgf_ally_market_trigger = { ROUTE = scope:tgf_ally_route_temp } + } +} + +# A Truce of Traders +gdp_trade_good_flavor.1012 = { + type = character_event + title = gdp_trade_good_flavor.1012.t + desc = gdp_trade_good_flavor.1012.desc + theme = merchant + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_ally + animation = merchant_gesturing + camera = camera_event_very_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + house.house_head ?= { + OR = { + this = root + is_ai = yes + } + } + any_trade_route = { gdp_tgf_ally_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_ally_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_ally_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_ally_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_ally_good_temp + } + } + root = { + any_potential_trade_ally_on_routes = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_ally_good_temp + gdp_tgf_valid_ally_trigger = yes + } + } + } + save_scope_as = tgf_good + } + } + random_potential_trade_ally_on_routes = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_good + limit = { gdp_tgf_valid_ally_trigger = yes } + save_scope_as = tgf_ally + } + scope:tgf_ally = { + random_held_title = { + limit = { gdp_merchant_company_title_trigger = yes } + save_scope_as = tgf_ally_company + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1012.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + add_price_modifier_for_character = { + type = sell_mult + character = scope:tgf_ally + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_ally = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + house = { + if = { + limit = { + NOT = { has_house_relation_with = scope:tgf_ally.house } + } + set_house_relation = { + target = scope:tgf_ally.house + level = cordial + description = house_relation_tgf_truce_desc + } + } + else = { + change_house_relation_effect = { + HOUSE = scope:tgf_ally.house + VALUE = house_relation_improve_minor_value + REASON = tgf_truce + CHAR = root + TARGET_CHAR = scope:tgf_ally + TITLE = scope:tgf_ally_company + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1012.b + add_prestige = medium_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.02 + years = 10 + } + } + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_price_war + YEARS = 10 + } + scope:tgf_ally = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = market with a stranger holder, where $ROUTE$ buys. Expects root = the merchant +scripted_trigger gdp_tgf_private_market_trigger = { + gdp_tgf_stranger_holder_market_trigger = yes + gdp_tgf_route_buys_here_trigger = { ROUTE = $ROUTE$ } +} + +# this = trade route where a foreign holder's market sells a good the route buys. Expects root = the merchant +scripted_trigger gdp_tgf_private_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_private_route_temp + any_trade_market_on_route = { + gdp_tgf_private_market_trigger = { ROUTE = scope:tgf_private_route_temp } + } +} + +# A Private Price +gdp_trade_good_flavor.1013 = { + type = character_event + title = gdp_trade_good_flavor.1013.t + desc = gdp_trade_good_flavor.1013.desc + theme = trade + override_background = { reference = study } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = debating + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_private_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_private_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_private_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_private_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_private_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1013.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.05 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + add_trade_good_price_modifier = { + type = buy_mult + trade_good_type = scope:tgf_good + value = 0.025 + years = 10 + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1013.b + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = fledgling buy market with a graying commoner in the local pool +scripted_trigger gdp_tgf_oldhands_market_trigger = { + gdp_tgf_fledgling_buy_market_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_oldhands_province_temp + any_pool_character = { + province = scope:tgf_oldhands_province_temp + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + age >= 40 + is_physically_able_adult = yes + } + } +} + +# this = trade route where an old porter waits at a fledgling buy market +scripted_trigger gdp_tgf_oldhands_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_oldhands_route_temp + any_trade_market_on_route = { + gdp_tgf_oldhands_market_trigger = { ROUTE = scope:tgf_oldhands_route_temp } + } +} + +# Ask the Old Hands +gdp_trade_good_flavor.1014 = { + type = character_event + title = gdp_trade_good_flavor.1014.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1014.desc.livestock + } + desc = gdp_trade_good_flavor.1014.desc + } + } + theme = trade + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left_to_the_left + } + right_portrait = { + character = scope:tgf_porter + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_horses } + animation = standing_horse + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_cattle } + animation = holding_yoke + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_wool } + animation = shepherd_with_sheep + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_wine scope:tgf_good = trade_good_type:trade_good_beer } } + animation = drink_goblet + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_meat } + animation = holding_salami + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_cheese scope:tgf_good = trade_good_type:trade_good_tea scope:tgf_good = trade_good_type:trade_good_sugar scope:tgf_good = trade_good_type:trade_good_rice scope:tgf_good = trade_good_type:trade_good_fruit scope:tgf_good = trade_good_type:trade_good_honey } } + animation = serving_tray + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_salt scope:tgf_good = trade_good_type:trade_good_spices scope:tgf_good = trade_good_type:trade_good_grain scope:tgf_good = trade_good_type:trade_good_millet } } + animation = holding_scales + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_incense } + animation = thurible + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_medicaments } + animation = physician + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + animation = lantern + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_books_paper } + animation = holding_scrolls + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_gold scope:tgf_good = trade_good_type:trade_good_silver scope:tgf_good = trade_good_type:trade_good_copper scope:tgf_good = trade_good_type:trade_good_fish } } + animation = merchant_box + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_furs } + animation = hunting_carcass_start + } + animation = holding_yoke + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + lowest_traded_good_category_xp_level < gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_oldhands_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_oldhands_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_oldhands_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_fledgling_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_fledgling_good_temp + } + } + trade_good_need_category = { + save_temporary_scope_as = tgf_fledgling_cat_temp + } + root = { + gdp_tgf_fledgling_in_category_trigger = { CATEGORY = scope:tgf_fledgling_cat_temp } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + age >= 40 + is_physically_able_adult = yes + } + save_scope_as = tgf_porter + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1014.a + pay_short_term_gold = { + target = scope:tgf_porter + gold = miniscule_gold_value + } + scope:tgf_porter = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + add_courtier = scope:tgf_porter + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1014.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route that buys a good whose category root is still fledgling in. Expects root = the merchant +scripted_trigger gdp_tgf_fledgling_buy_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_fledgling_route_temp + any_trade_market_on_route = { + gdp_tgf_fledgling_buy_market_trigger = { ROUTE = scope:tgf_fledgling_route_temp } + } +} + +# A Beginner's Mistake +gdp_trade_good_flavor.1015 = { + type = character_event + title = gdp_trade_good_flavor.1015.t + desc = gdp_trade_good_flavor.1015.desc + theme = merchant + + left_portrait = { + character = root + animation = mental_anguish + camera = camera_event_table_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + lowest_traded_good_category_xp_level < gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + short_term_gold >= minor_gold_value + any_trade_route = { gdp_tgf_fledgling_buy_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_fledgling_buy_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_fledgling_buy_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_fledgling_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_fledgling_good_temp + } + } + trade_good_need_category = { + save_temporary_scope_as = tgf_fledgling_cat_temp + } + root = { + gdp_tgf_fledgling_in_category_trigger = { CATEGORY = scope:tgf_fledgling_cat_temp } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + remove_short_term_gold = minor_gold_value + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1015.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_minor_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1015.b + add_stress = minor_stress_loss + ai_chance = { + base = 100 + modifier = { has_trait = diligent factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = character who owns the handbook artifact of $HANDBOOK$ (practice, roads or mirror) +scripted_trigger gdp_tgf_owns_handbook_trigger = { + any_character_artifact = { var:tgf_handbook ?= flag:$HANDBOOK$ } +} + +# Creates the masterwork handbook named by scope:tgf_handbook, tagged so the same title is never found twice +scripted_effect gdp_tgf_create_handbook_effect = { + gdp_tgf_roll_artifact_rarity_effect = { RARITY = masterwork } + if = { + limit = { scope:tgf_handbook = flag:practice } + create_artifact = { + name = gdp_tgf_handbook_practice_artifact + description = gdp_tgf_handbook_practice_artifact_desc + type = journal + visuals = book + modifier = artifact_trade_category_all_xp_gain_mult_1_modifier + modifier = artifact_stewardship_1_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + } + else_if = { + limit = { scope:tgf_handbook = flag:roads } + create_artifact = { + name = gdp_tgf_handbook_roads_artifact + description = gdp_tgf_handbook_roads_artifact_desc + type = journal + visuals = book + modifier = artifact_trade_category_all_xp_gain_mult_1_modifier + modifier = artifact_stewardship_1_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + } + else_if = { + limit = { scope:tgf_handbook = flag:mirror } + create_artifact = { + name = gdp_tgf_handbook_mirror_artifact + description = gdp_tgf_handbook_mirror_artifact_desc + type = journal + visuals = book + modifier = artifact_trade_category_all_xp_gain_mult_1_modifier + modifier = artifact_stewardship_1_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + } + scope:newly_created_artifact ?= { + set_variable = { + name = tgf_handbook + value = scope:tgf_handbook + } + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes +} + +# The Merchant's Handbook +gdp_trade_good_flavor.1016 = { + type = character_event + title = gdp_trade_good_flavor.1016.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1016.desc.intro_livestock + } + desc = gdp_trade_good_flavor.1016.desc.intro + } + first_valid = { + triggered_desc = { + trigger = { scope:tgf_handbook = flag:practice } + desc = gdp_trade_good_flavor.1016.desc.book_1 + } + triggered_desc = { + trigger = { scope:tgf_handbook = flag:roads } + desc = gdp_trade_good_flavor.1016.desc.book_2 + } + desc = gdp_trade_good_flavor.1016.desc.book_3 + } + desc = gdp_trade_good_flavor.1016.desc.outro + } + theme = merchant + override_background = { reference = study } + + left_portrait = { + character = root + animation = reading + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + lowest_traded_good_category_xp_level < gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + NOR = { + gdp_tgf_owns_handbook_trigger = { HANDBOOK = practice } + gdp_tgf_owns_handbook_trigger = { HANDBOOK = roads } + gdp_tgf_owns_handbook_trigger = { HANDBOOK = mirror } + } + } + + immediate = { + gdp_tgf_setup_good_effect = yes + random_list = { + 1 = { + trigger = { NOT = { gdp_tgf_owns_handbook_trigger = { HANDBOOK = practice } } } + save_scope_value_as = { name = tgf_handbook value = flag:practice } + } + 1 = { + trigger = { NOT = { gdp_tgf_owns_handbook_trigger = { HANDBOOK = roads } } } + save_scope_value_as = { name = tgf_handbook value = flag:roads } + } + 1 = { + trigger = { NOT = { gdp_tgf_owns_handbook_trigger = { HANDBOOK = mirror } } } + save_scope_value_as = { name = tgf_handbook value = flag:mirror } + } + } + } + + option = { + name = gdp_trade_good_flavor.1016.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + gdp_tgf_create_handbook_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1016.b + add_gold = minor_gold_value + add_prestige = medium_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = curious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = fledgling buy market with a commoner seller in the local pool +scripted_trigger gdp_tgf_sample_market_trigger = { + gdp_tgf_fledgling_buy_market_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_sample_province_temp + any_pool_character = { + province = scope:tgf_sample_province_temp + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route where a local seller waits at a fledgling buy market +scripted_trigger gdp_tgf_sample_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_sample_route_temp + any_trade_market_on_route = { + gdp_tgf_sample_market_trigger = { ROUTE = scope:tgf_sample_route_temp } + } +} + +# The Feel of It +gdp_trade_good_flavor.1017 = { + type = character_event + title = gdp_trade_good_flavor.1017.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1017.desc.livestock + } + desc = gdp_trade_good_flavor.1017.desc + } + desc = gdp_trade_good_flavor.1017.desc.outro + } + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_seller + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + lowest_traded_good_category_xp_level < gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_sample_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_sample_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_sample_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_fledgling_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_fledgling_good_temp + } + } + trade_good_need_category = { + save_temporary_scope_as = tgf_fledgling_cat_temp + } + root = { + gdp_tgf_fledgling_in_category_trigger = { CATEGORY = scope:tgf_fledgling_cat_temp } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_seller + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_seller + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1017.a + pay_short_term_gold = { + target = scope:tgf_seller + gold = minor_gold_value + } + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_minor_value + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_massive_value + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1017.b + add_prestige = miniscule_prestige_gain + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = sell market whose county culture differs from root's +# We leave out livestock, since it is sold by the head and not by measure +scripted_trigger gdp_tgf_measure_market_trigger = { + save_temporary_scope_as = tgf_measure_market_temp + exists = trade_market_owner.title_province.county + trade_market_owner.title_province.county.culture = { + NOT = { this = root.culture } + } + $ROUTE$ = { + any_traded_good = { + trade_good_need_category = { save_temporary_scope_as = tgf_measure_cat_temp } + NOT = { scope:tgf_measure_cat_temp = trade_good_category:trade_category_beasts_of_burden } + save_temporary_scope_as = tgf_measure_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_measure_market_temp + trade_good_type = scope:tgf_measure_good_temp + } + } + } + } +} + +# this = trade route where a sell market uses another culture's measures. Expects root = the merchant +scripted_trigger gdp_tgf_measure_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_measure_route_temp + any_trade_market_on_route = { + gdp_tgf_measure_market_trigger = { ROUTE = scope:tgf_measure_route_temp } + } +} + +# Wrong Measure +gdp_trade_good_flavor.1018 = { + type = character_event + title = gdp_trade_good_flavor.1018.t + desc = gdp_trade_good_flavor.1018.desc + theme = merchant + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + animation = holding_scales + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + lowest_traded_good_category_xp_level < gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_measure_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_measure_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_measure_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + trade_good_need_category = { save_temporary_scope_as = tgf_measure_cat_temp } + NOT = { scope:tgf_measure_cat_temp = trade_good_category:trade_category_beasts_of_burden } + save_temporary_scope_as = tgf_measure_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_measure_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1018.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + stress_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1018.b + add_prestige = minor_prestige_loss + add_gold = miniscule_gold_value + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1018.c + add_prestige = miniscule_prestige_gain + scope:tgf_source_culture = { + change_cultural_acceptance = { + target = root.culture + value = minor_cultural_acceptance_gain + desc = cultural_acceptance_gain_event + } + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good that $ROUTE$ sells in some market on it +scripted_trigger gdp_tgf_bundle_sold_on_route_trigger = { + save_temporary_scope_as = tgf_bundle_sold_good_temp + $ROUTE$ = { + any_trade_market_on_route = { + save_temporary_scope_as = tgf_bundle_sold_market_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_bundle_sold_market_temp + trade_good_type = scope:tgf_bundle_sold_good_temp + } + } + } + } +} + +# Either order of $X$ and $Y$. Expects scope:tgf_pair_a_temp and scope:tgf_pair_b_temp +scripted_trigger gdp_tgf_bundle_pair_match_trigger = { + OR = { + AND = { + scope:tgf_pair_a_temp = trade_good_type:trade_good_$X$ + scope:tgf_pair_b_temp = trade_good_type:trade_good_$Y$ + } + AND = { + scope:tgf_pair_a_temp = trade_good_type:trade_good_$Y$ + scope:tgf_pair_b_temp = trade_good_type:trade_good_$X$ + } + } +} + +# this = trade good that makes a natural pair with $OTHER$, so the buyer wants both together +scripted_trigger gdp_tgf_bundle_pair_trigger = { + save_temporary_scope_as = tgf_pair_a_temp + $OTHER$ = { save_temporary_scope_as = tgf_pair_b_temp } + OR = { + gdp_tgf_bundle_pair_match_trigger = { X = salt Y = fish } + gdp_tgf_bundle_pair_match_trigger = { X = salt Y = meat } + gdp_tgf_bundle_pair_match_trigger = { X = salt Y = cheese } + gdp_tgf_bundle_pair_match_trigger = { X = alum Y = dyes } + gdp_tgf_bundle_pair_match_trigger = { X = dyes Y = wool } + gdp_tgf_bundle_pair_match_trigger = { X = dyes Y = cotton } + gdp_tgf_bundle_pair_match_trigger = { X = dyes Y = silk } + gdp_tgf_bundle_pair_match_trigger = { X = dyes Y = textiles } + gdp_tgf_bundle_pair_match_trigger = { X = beer Y = grain } + gdp_tgf_bundle_pair_match_trigger = { X = wine Y = cheese } + gdp_tgf_bundle_pair_match_trigger = { X = wood Y = hemp } + gdp_tgf_bundle_pair_match_trigger = { X = iron Y = wood } + gdp_tgf_bundle_pair_match_trigger = { X = spices Y = meat } + gdp_tgf_bundle_pair_match_trigger = { X = gems Y = gold } + gdp_tgf_bundle_pair_match_trigger = { X = gems Y = silver } + gdp_tgf_bundle_pair_match_trigger = { X = leather Y = books_paper } + } +} + +# this = good $ROUTE$ sells in $MARKET$, while root also trades another. Expects root = the merchant +scripted_trigger gdp_tgf_bundle_first_good_trigger = { + save_temporary_scope_as = tgf_bundle_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = $MARKET$ + trade_good_type = scope:tgf_bundle_good_temp + } + } + root = { + any_trade_route = { + is_commission_route = no + save_temporary_scope_as = tgf_bundle_other_route_temp + any_traded_good = { + NOT = { this = scope:tgf_bundle_good_temp } + gdp_tgf_bundle_sold_on_route_trigger = { ROUTE = scope:tgf_bundle_other_route_temp } + } + } + } +} + +# this = market a stranger holds, where $ROUTE$ sells and root trades a second good on any route +scripted_trigger gdp_tgf_bundle_market_trigger = { + save_temporary_scope_as = tgf_bundle_market_temp + exists = trade_market_owner.title_province.county + gdp_tgf_stranger_holder_market_trigger = yes + $ROUTE$ = { + any_traded_good = { + gdp_tgf_bundle_first_good_trigger = { + ROUTE = $ROUTE$ + MARKET = scope:tgf_bundle_market_temp + } + } + } +} + +# this = trade route. Expects root = the merchant +scripted_trigger gdp_tgf_bundle_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_bundle_route_temp + any_trade_market_on_route = { + gdp_tgf_bundle_market_trigger = { ROUTE = scope:tgf_bundle_route_temp } + } +} + +# Two Goods, One Buyer +gdp_trade_good_flavor.1019 = { + type = character_event + title = gdp_trade_good_flavor.1019.t + desc = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:tgf_bundle_paired } + desc = gdp_trade_good_flavor.1019.desc + } + desc = gdp_trade_good_flavor.1019.desc.generic + } + desc = gdp_trade_good_flavor.1019.desc.outro + } + theme = trade + + left_portrait = { + character = root + animation = donkey_standing_baggage + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_good_traded_in = { count >= 2 } + any_trade_route = { gdp_tgf_bundle_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_bundle_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_bundle_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_bundle_first_good_trigger = { + ROUTE = scope:tgf_route + MARKET = scope:tgf_market + } + } + save_scope_as = tgf_good + } + } + every_trade_route = { + limit = { is_commission_route = no } + save_temporary_scope_as = tgf_bundle_other_route_temp + every_traded_good = { + limit = { + NOT = { this = scope:tgf_good } + gdp_tgf_bundle_sold_on_route_trigger = { ROUTE = scope:tgf_bundle_other_route_temp } + } + add_to_list = tgf_bundle_candidates + } + } + if = { + limit = { + any_in_list = { + list = tgf_bundle_candidates + gdp_tgf_bundle_pair_trigger = { OTHER = scope:tgf_good } + } + } + random_in_list = { + list = tgf_bundle_candidates + limit = { + gdp_tgf_bundle_pair_trigger = { OTHER = scope:tgf_good } + } + save_scope_as = tgf_good_b + } + save_scope_value_as = { + name = tgf_bundle_paired + value = yes + } + } + else = { + random_in_list = { + list = tgf_bundle_candidates + save_scope_as = tgf_good_b + } + } + random_trade_route = { + limit = { + is_commission_route = no + save_temporary_scope_as = tgf_bundle_b_route_temp + scope:tgf_good_b = { + gdp_tgf_bundle_sold_on_route_trigger = { ROUTE = scope:tgf_bundle_b_route_temp } + } + } + save_scope_as = tgf_route_b + } + scope:tgf_route_b = { + random_trade_market_on_route = { + limit = { + save_temporary_scope_as = tgf_bundle_b_market_temp + scope:tgf_route_b = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_bundle_b_market_temp + trade_good_type = scope:tgf_good_b + } + } + } + save_scope_as = tgf_market_b + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1019.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_market_b = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good_b + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1019.b + add_gold = minor_gold_value + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good used in construction +scripted_trigger gdp_tgf_construction_good_trigger = { + OR = { + this = trade_good_type:trade_good_stone + this = trade_good_type:trade_good_wood + this = trade_good_type:trade_good_hemp + this = trade_good_type:trade_good_iron + this = trade_good_type:trade_good_copper + } +} + +# this = trade market with a foreign holder building a holding, where $ROUTE$ sells a construction good +scripted_trigger gdp_tgf_builders_market_trigger = { + save_temporary_scope_as = tgf_builders_market_temp + trade_market_owner ?= { + exists = title_province.county + title_province = { + has_ongoing_holding_construction = yes + } + } + gdp_tgf_stranger_holder_market_trigger = yes + $ROUTE$ = { + any_traded_good = { + gdp_tgf_construction_good_trigger = yes + save_temporary_scope_as = tgf_builders_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_builders_market_temp + trade_good_type = scope:tgf_builders_good_temp + } + } + } + } +} + +# this = trade route where a building holder's market buys its construction goods +scripted_trigger gdp_tgf_builders_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_builders_route_temp + any_trade_market_on_route = { + gdp_tgf_builders_market_trigger = { ROUTE = scope:tgf_builders_route_temp } + } +} + +scripted_effect gdp_tgf_builders_rate_apply_effect = { + scope:tgf_build_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + if = { + limit = { scope:tgf_build_province = { has_holding_type = castle_holding } } + add_county_modifier = { + modifier = gdp_tgf_builders_rate_castle_$SIZE$_modifier + years = $YEARS$ + } + } + else_if = { + limit = { scope:tgf_build_province = { has_holding_type = church_holding } } + add_county_modifier = { + modifier = gdp_tgf_builders_rate_church_$SIZE$_modifier + years = $YEARS$ + } + } + else_if = { + limit = { scope:tgf_build_province = { has_holding_type = city_holding } } + add_county_modifier = { + modifier = gdp_tgf_builders_rate_city_$SIZE$_modifier + years = $YEARS$ + } + } + else = { + add_county_modifier = { + modifier = gdp_tgf_builders_rate_generic_$SIZE$_modifier + years = $YEARS$ + } + } + } + } +} + +# Applies the builder's-rate county modifier for the market holding type, doubled when root is renowned in scope:tgf_category +# $SIZE$ is full or small. Expects scope:tgf_build_county and scope:tgf_build_province +scripted_effect gdp_tgf_builders_rate_modifier_effect = { + if = { + limit = { gdp_tgf_root_renowned_in_event_category_trigger = yes } + gdp_tgf_builders_rate_apply_effect = { + SIZE = $SIZE$_renowned + YEARS = 10 + } + } + else = { + gdp_tgf_builders_rate_apply_effect = { + SIZE = $SIZE$ + YEARS = 5 + } + } +} + +# The Builder's Rate +gdp_trade_good_flavor.1020 = { + type = character_event + title = gdp_trade_good_flavor.1020.t + desc = gdp_trade_good_flavor.1020.desc + theme = trade + override_background = pam_cathedral_construction + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = merchant_gesturing + camera = camera_event_very_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_builders_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_builders_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_builders_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_construction_good_trigger = yes + save_temporary_scope_as = tgf_builders_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_builders_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_build_province + county = { save_scope_as = tgf_build_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_market_holder + PROVINCE = scope:tgf_build_province + } + } + + option = { + name = gdp_trade_good_flavor.1020.a + gdp_tgf_builders_rate_modifier_effect = { SIZE = full } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + add_prestige = minor_prestige_gain + if = { + limit = { + scope:tgf_build_province = { has_holding_type = church_holding } + } + add_piety = miniscule_piety_gain + } + if = { + limit = { + gdp_tgf_fledgling_in_category_trigger = { CATEGORY = scope:tgf_category } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1020.b + gdp_tgf_builders_rate_modifier_effect = { SIZE = small } + add_gold = minor_gold_value + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1020.c + gdp_tgf_builders_rate_modifier_effect = { SIZE = full } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + if = { + limit = { + scope:tgf_build_province = { has_holding_type = church_holding } + } + add_piety = miniscule_piety_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1020.d + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_keep_the_best + YEARS = 10 + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = character whose company knows $CATEGORY$ well enough to study its goods +scripted_trigger gdp_tgf_studied_in_category_trigger = { + any_held_title = { + gdp_merchant_company_title_trigger = yes + trade_good_category_level = { + target = $CATEGORY$ + value >= gdp_tgf_study_expertise_level_value + } + } +} + +# this = trade route that carries a good root has studied. Expects root = the merchant +scripted_trigger gdp_tgf_study_route_trigger = { + is_commission_route = no + any_traded_good = { + trade_good_need_category = { save_temporary_scope_as = tgf_study_cat_temp } + root = { + gdp_tgf_studied_in_category_trigger = { CATEGORY = scope:tgf_study_cat_temp } + } + } +} + +# Know the Goods +gdp_trade_good_flavor.1021 = { + type = character_event + title = gdp_trade_good_flavor.1021.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1021.desc.livestock + } + triggered_desc = { + trigger = { scope:tgf_good = trade_good_type:trade_good_books_paper } + desc = gdp_trade_good_flavor.1021.desc.books + } + desc = gdp_trade_good_flavor.1021.desc + } + } + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_horses } + animation = standing_horse + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_cattle } + animation = holding_yoke + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_wool } + animation = shepherd_with_sheep + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_wine scope:tgf_good = trade_good_type:trade_good_beer } } + animation = drink_goblet + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_meat } + animation = holding_salami + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_cheese scope:tgf_good = trade_good_type:trade_good_tea scope:tgf_good = trade_good_type:trade_good_sugar scope:tgf_good = trade_good_type:trade_good_rice scope:tgf_good = trade_good_type:trade_good_fruit scope:tgf_good = trade_good_type:trade_good_honey } } + animation = serving_tray + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_salt scope:tgf_good = trade_good_type:trade_good_spices scope:tgf_good = trade_good_type:trade_good_grain scope:tgf_good = trade_good_type:trade_good_millet } } + animation = holding_scales + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_incense } + animation = thurible + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_medicaments } + animation = physician + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + animation = lantern + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_books_paper } + animation = holding_scrolls + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_gold scope:tgf_good = trade_good_type:trade_good_silver scope:tgf_good = trade_good_type:trade_good_copper scope:tgf_good = trade_good_type:trade_good_fish } } + animation = merchant_box + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_furs } + animation = hunting_carcass_start + } + animation = holding_scales + camera = camera_event_left + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_1021 } + is_available = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_study_route_trigger = yes } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_1021 + random_trade_route = { + limit = { gdp_tgf_study_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_traded_good = { + limit = { + trade_good_need_category = { save_temporary_scope_as = tgf_study_cat_temp } + root = { + gdp_tgf_studied_in_category_trigger = { CATEGORY = scope:tgf_study_cat_temp } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1021.a + gdp_tgf_create_study_curio_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1021.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route that carries a good whose category root is renowned in. Expects root = the merchant +scripted_trigger gdp_tgf_nickname_route_trigger = { + is_commission_route = no + any_trade_market_on_route = { exists = trade_market_owner.title_province.county } + any_traded_good = { + trade_good_need_category = { save_temporary_scope_as = tgf_nickname_cat_temp } + root = { + gdp_tgf_renowned_in_category_trigger = { CATEGORY = scope:tgf_nickname_cat_temp } + } + } +} + +# Grants the per-good trade nickname. Expects scope:tgf_good +scripted_effect gdp_tgf_trade_nickname_effect = { + if = { + limit = { scope:tgf_good = trade_good_type:trade_good_grain } + set_nickname_effect = { NICKNAME = nick_tgf_grain } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_millet } + set_nickname_effect = { NICKNAME = nick_tgf_millet } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_rice } + set_nickname_effect = { NICKNAME = nick_tgf_rice } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_meat } + set_nickname_effect = { NICKNAME = nick_tgf_meat } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_fish } + set_nickname_effect = { NICKNAME = nick_tgf_fish } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_cheese } + set_nickname_effect = { NICKNAME = nick_tgf_cheese } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_fruit } + set_nickname_effect = { NICKNAME = nick_tgf_fruit } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_oil } + set_nickname_effect = { NICKNAME = nick_tgf_oil } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_honey } + set_nickname_effect = { NICKNAME = nick_tgf_honey } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_tea } + set_nickname_effect = { NICKNAME = nick_tgf_tea } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_horses } + set_nickname_effect = { NICKNAME = nick_tgf_horses } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_cattle } + set_nickname_effect = { NICKNAME = nick_tgf_cattle } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_silver } + set_nickname_effect = { NICKNAME = nick_tgf_silver } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_gold } + set_nickname_effect = { NICKNAME = nick_tgf_gold } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_iron } + set_nickname_effect = { NICKNAME = nick_tgf_iron } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_copper } + set_nickname_effect = { NICKNAME = nick_tgf_copper } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_beer } + set_nickname_effect = { NICKNAME = nick_tgf_beer } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_wine } + set_nickname_effect = { NICKNAME = nick_tgf_wine } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_gems } + set_nickname_effect = { NICKNAME = nick_tgf_gems } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_amber } + set_nickname_effect = { NICKNAME = nick_tgf_amber } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_ivory } + set_nickname_effect = { NICKNAME = nick_tgf_ivory } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_jade } + set_nickname_effect = { NICKNAME = nick_tgf_jade } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_wood } + set_nickname_effect = { NICKNAME = nick_tgf_wood } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_hemp } + set_nickname_effect = { NICKNAME = nick_tgf_hemp } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_wool } + set_nickname_effect = { NICKNAME = nick_tgf_wool } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_cotton } + set_nickname_effect = { NICKNAME = nick_tgf_cotton } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_flax } + set_nickname_effect = { NICKNAME = nick_tgf_flax } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_textiles } + set_nickname_effect = { NICKNAME = nick_tgf_textiles } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_furs } + set_nickname_effect = { NICKNAME = nick_tgf_furs } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_leather } + set_nickname_effect = { NICKNAME = nick_tgf_leather } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_sugar } + set_nickname_effect = { NICKNAME = nick_tgf_sugar } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_spices } + set_nickname_effect = { NICKNAME = nick_tgf_spices } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_ceramics } + set_nickname_effect = { NICKNAME = nick_tgf_ceramics } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_glass } + set_nickname_effect = { NICKNAME = nick_tgf_glass } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_jewelry } + set_nickname_effect = { NICKNAME = nick_tgf_jewelry } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_lacquerware } + set_nickname_effect = { NICKNAME = nick_tgf_lacquerware } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_silk } + set_nickname_effect = { NICKNAME = nick_tgf_silk } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_incense } + set_nickname_effect = { NICKNAME = nick_tgf_incense } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_medicaments } + set_nickname_effect = { NICKNAME = nick_tgf_medicaments } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_stone } + set_nickname_effect = { NICKNAME = nick_tgf_stone } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_salt } + set_nickname_effect = { NICKNAME = nick_tgf_salt } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_alum } + set_nickname_effect = { NICKNAME = nick_tgf_alum } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_dyes } + set_nickname_effect = { NICKNAME = nick_tgf_dyes } + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_books_paper } + set_nickname_effect = { NICKNAME = nick_tgf_books_paper } + } +} + +# A Name for the Trade +gdp_trade_good_flavor.1022 = { + type = character_event + title = gdp_trade_good_flavor.1022.t + desc = gdp_trade_good_flavor.1022.desc + theme = merchant + override_background = { reference = market } + + left_portrait = { + character = root + animation = biting_coin + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= 75 + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_1022 } + OR = { + has_any_nickname = no + has_bad_nickname = yes + } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + highest_traded_good_category_xp_level >= 50 + any_trade_route = { gdp_tgf_nickname_route_trigger = yes } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_1022 + random_trade_route = { + limit = { gdp_tgf_nickname_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_traded_good = { + limit = { + trade_good_need_category = { save_temporary_scope_as = tgf_nickname_cat_temp } + root = { + gdp_tgf_renowned_in_category_trigger = { CATEGORY = scope:tgf_nickname_cat_temp } + } + } + save_scope_as = tgf_good + } + random_trade_market_on_route = { + limit = { exists = trade_market_owner.title_province.county } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = root + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1022.a + gdp_tgf_trade_nickname_effect = yes + add_prestige = major_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1022.b + gdp_tgf_trade_nickname_effect = yes + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ buys a good from a stranger's county and the local pool holds a foreman +scripted_trigger gdp_tgf_supply_market_trigger = { + gdp_tgf_stranger_holder_market_trigger = yes + gdp_tgf_route_buys_here_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_supply_province_temp + any_pool_character = { + province = scope:tgf_supply_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_supply_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_supply_route_temp + any_trade_market_on_route = { + gdp_tgf_supply_market_trigger = { ROUTE = scope:tgf_supply_route_temp } + } +} + +# A Choke on Supply +gdp_trade_good_flavor.1023 = { + type = character_event + title = gdp_trade_good_flavor.1023.t + desc = gdp_trade_good_flavor.1023.desc + theme = trade + override_background = { + trigger = { + OR = { + scope:tgf_category = trade_good_category:trade_category_base_metals + scope:tgf_category = trade_good_category:trade_category_precious_metals + scope:tgf_good = trade_good_type:trade_good_jewelry + } + } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_wood + scope:tgf_good = trade_good_type:trade_good_hemp + scope:tgf_good = trade_good_type:trade_good_lacquerware + } + } + reference = gdp_carpentry_workshop + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_leather + scope:tgf_good = trade_good_type:trade_good_furs + scope:tgf_good = trade_good_type:trade_good_dyes + } + } + reference = gdp_tannery + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_glass + scope:tgf_good = trade_good_type:trade_good_ceramics + scope:tgf_good = trade_good_type:trade_good_textiles + } + } + reference = gdp_artisan_street + } + override_background = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + reference = bp1_wine_cellar + } + override_background = { reference = farmland } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left_away_3_4 + } + right_portrait = { + character = scope:tgf_foreman + animation = merchant_gesturing + camera = camera_event_very_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_supply_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_supply_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_supply_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_supply_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_supply_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_foreman + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_foreman + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1023.a + remove_short_term_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + gdp_tgf_add_tiered_county_modifier_effect = { + MODIFIER = gdp_tgf_extra_hands + YEARS = 10 + } + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + ai_chance = { + base = 10 # Dont stack too many goods modifiers + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1023.b + add_courtier = scope:tgf_foreman + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 30 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1023.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ trades a good and an AI rival trades too +scripted_trigger gdp_tgf_auction_market_trigger = { + OR = { + gdp_tgf_route_buys_here_trigger = { ROUTE = $ROUTE$ } + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + } + any_potential_trade_rival_in_market = { + target = root + gdp_tgf_auction_rival_trigger = yes + } +} + +# this = trade route +scripted_trigger gdp_tgf_auction_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_auction_route_temp + any_trade_market_on_route = { + gdp_tgf_auction_market_trigger = { ROUTE = scope:tgf_auction_route_temp } + } +} + +# Under the Hammer +gdp_trade_good_flavor.1024 = { + type = character_event + title = gdp_trade_good_flavor.1024.t + desc = gdp_trade_good_flavor.1024.desc + theme = trade + override_background = { + trigger = { + scope:tgf_source_province = { geographical_region = mediteranean_coast } + } + reference = gdp_italian_market + } + override_background = { reference = market_crowd } + + left_portrait = { + character = root + animation = betting + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_rival + animation = wedding_objection_start + camera = camera_event_very_left_fov35 + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_auction_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_auction_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_auction_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_auction_good_temp + scope:tgf_route = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_auction_good_temp + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_auction_good_temp + } + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + random_potential_trade_rival_in_market = { + target = root + limit = { gdp_tgf_auction_rival_trigger = yes } + save_scope_as = tgf_rival + } + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_rival = { + random_held_title = { + limit = { gdp_merchant_company_title_trigger = yes } + save_scope_as = tgf_rival_company + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_rival + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1024.a + add_prestige = medium_prestige_gain + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_outbid + YEARS = 10 + } + remove_short_term_gold = minor_gold_value + scope:tgf_rival = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -15 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + add_price_modifier_for_character = { + type = buy_mult + character = scope:tgf_rival + trade_good_type = scope:tgf_good + value = 0.01 + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1024.b + scope:tgf_rival = { + remove_short_term_gold = medium_gold_value + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -30 + } + } + add_intrigue_lifestyle_xp = minor_lifestyle_xp + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = scope:tgf_rival + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1024.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_watched_bidding + YEARS = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = coastal trade market where $ROUTE$ sells a good and the local pool holds someone to run the docks +scripted_trigger gdp_tgf_quay_market_trigger = { + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + is_coastal = yes + save_temporary_scope_as = tgf_quay_province_temp + any_pool_character = { + province = scope:tgf_quay_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_quay_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_quay_route_temp + any_trade_market_on_route = { + gdp_tgf_quay_market_trigger = { ROUTE = scope:tgf_quay_route_temp } + } +} + +# First at the Quay +gdp_trade_good_flavor.1025 = { + type = character_event + title = gdp_trade_good_flavor.1025.t + desc = gdp_trade_good_flavor.1025.desc + theme = trade + override_background = { reference = docks } + + left_portrait = { + character = root + animation = bribing + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_docks_boss + animation = personality_greedy + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_quay_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_quay_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_quay_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_quay_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_quay_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_docks_boss + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_docks_boss + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1025.a + trigger = { short_term_gold >= medium_gold_value } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:tgf_docks_boss + gold = medium_gold_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1025.b + add_gold = medium_gold_value + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1025.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ sells a non-livestock good and the local pool holds a stallholder +scripted_trigger gdp_tgf_handful_market_trigger = { + save_temporary_scope_as = tgf_handful_market_temp + exists = trade_market_owner.title_province.county + $ROUTE$ = { + any_traded_good = { + gdp_tgf_not_livestock_good_trigger = yes + save_temporary_scope_as = tgf_handful_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_handful_market_temp + trade_good_type = scope:tgf_handful_good_temp + } + } + } + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_handful_province_temp + any_pool_character = { + province = scope:tgf_handful_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_handful_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_handful_route_temp + any_trade_market_on_route = { + gdp_tgf_handful_market_trigger = { ROUTE = scope:tgf_handful_route_temp } + } +} + +# By the Handful +gdp_trade_good_flavor.1026 = { + type = character_event + title = gdp_trade_good_flavor.1026.t + desc = gdp_trade_good_flavor.1026.desc + theme = trade + override_background = { reference = gdp_artisan_street_crowd } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_stallholder + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_handful_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_handful_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_handful_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_not_livestock_good_trigger = yes + save_temporary_scope_as = tgf_handful_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_handful_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_stallholder + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_stallholder + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1026.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + add_county_modifier = { + modifier = gdp_tgf_bled_by_the_handful_modifier + years = 10 + } + } + } + scope:tgf_stallholder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + stress_impact = { + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1026.b + add_prestige = medium_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + change_prosperity_progress = minor_prosperity_progress_gain + } + } + stress_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1026.c + add_gold = minor_gold_value + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Market Day +gdp_trade_good_flavor.1027 = { + type = character_event + title = gdp_trade_good_flavor.1027.t + desc = gdp_trade_good_flavor.1027.desc + theme = trade + override_background = { reference = market_crowd } + + left_portrait = { + character = root + animation = merchant_gesturing + camera = camera_event_very_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_market_day_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_market_day_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_market_day_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_market_day_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_market_day_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_market_holder + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1027.a + remove_short_term_gold = minor_gold_value + add_stress = medium_stress_gain + scope:tgf_market = { + add_trade_market_modifier = { + modifier = gdp_tgf_market_day_crowds_modifier + years = 10 + } + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1027.b + add_diplomacy_lifestyle_xp = minor_lifestyle_xp + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = market where $ROUTE$ sells and the pool holds a buyer of another heritage than root's +scripted_trigger gdp_tgf_coin_market_trigger = { + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_coin_province_temp + any_pool_character = { + province = scope:tgf_coin_province_temp + is_healthy = yes + is_physically_able_adult = yes + NOT = { culture ?= { has_same_culture_heritage = root.culture } } + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_coin_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_coin_route_temp + any_trade_market_on_route = { + gdp_tgf_coin_market_trigger = { ROUTE = scope:tgf_coin_route_temp } + } +} + +# Foreign Coin +gdp_trade_good_flavor.1028 = { + type = character_event + title = gdp_trade_good_flavor.1028.t + desc = gdp_trade_good_flavor.1028.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = biting_coin + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_buyer + animation = betting + camera = camera_event_right_pointing_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_coin_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_coin_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_coin_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_coin_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_coin_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + is_physically_able_adult = yes + NOT = { culture ?= { has_same_culture_heritage = root.culture } } + } + save_scope_as = tgf_buyer + } + random_trade_good_traded_in = { + limit = { + NOT = { this = scope:tgf_good } + exists = trade_good_need_category + } + save_scope_as = tgf_good_b + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_buyer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1028.a + add_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = stubborn factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1028.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.005 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_buyer = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1028.c + trigger = { exists = scope:tgf_good_b } + scope:tgf_good_b = { + trade_good_need_category = { save_scope_as = tgf_category_b } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category_b + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good_b + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route with a trader that has run for three years +scripted_trigger gdp_tgf_old_road_route_trigger = { + is_commission_route = no + has_trader = yes + trader ?= { + NOT = { this = root } + } + age_in_months >= 36 + any_traded_good = { always = yes } +} + +# Years on the Road +gdp_trade_good_flavor.1029 = { + type = character_event + title = gdp_trade_good_flavor.1029.t + desc = gdp_trade_good_flavor.1029.desc + theme = merchant + override_background = { reference = sitting_room } + + left_portrait = { + character = root + animation = happiness + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + animation = toast_goblet + camera = camera_event_right + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_right_character_flickering_candlelight container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_old_road_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_old_road_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_traded_good = { save_scope_as = tgf_good } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1029.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_trader = { + add_stewardship_skill = 2 + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1029.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_trader = { + add_stewardship_skill = 2 + add_stress = massive_stress_loss + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1029.c + scope:tgf_trader = { + add_stewardship_skill = 2 + } + if = { + limit = { NOT = { has_character_modifier = gdp_tgf_further_roads_renowned_modifier } } + if = { + limit = { gdp_tgf_root_renowned_in_event_category_trigger = yes } + remove_character_modifier = gdp_tgf_further_roads_modifier + add_character_modifier = gdp_tgf_further_roads_renowned_modifier + } + else_if = { + limit = { NOT = { has_character_modifier = gdp_tgf_further_roads_modifier } } + add_character_modifier = gdp_tgf_further_roads_modifier + } + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good in a category root is renowned in, which $ROUTE$ sells in a market with a county +scripted_trigger gdp_tgf_renowned_sold_good_trigger = { + save_temporary_scope_as = tgf_renowned_good_temp + trade_good_need_category = { save_temporary_scope_as = tgf_renowned_cat_temp } + root = { + gdp_tgf_renowned_in_category_trigger = { CATEGORY = scope:tgf_renowned_cat_temp } + } + $ROUTE$ = { + any_trade_market_on_route = { + save_temporary_scope_as = tgf_renowned_market_temp + exists = trade_market_owner.title_province.county + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_watching_province_temp + any_pool_character = { + province = scope:tgf_watching_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_renowned_market_temp + trade_good_type = scope:tgf_renowned_good_temp + } + } + } + } +} + +# this = trade route that sells a good root is renowned in +scripted_trigger gdp_tgf_watching_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_watching_route_temp + any_traded_good = { + gdp_tgf_renowned_sold_good_trigger = { ROUTE = scope:tgf_watching_route_temp } + } +} + +# this = character who already has Ear to the Market in some category +scripted_trigger gdp_tgf_has_ear_to_the_market_trigger = { + OR = { + has_character_modifier = gdp_tgf_ear_alcohol_modifier + has_character_modifier = gdp_tgf_ear_comforts_modifier + has_character_modifier = gdp_tgf_ear_cereals_modifier + has_character_modifier = gdp_tgf_ear_meat_modifier + has_character_modifier = gdp_tgf_ear_beasts_of_burden_modifier + has_character_modifier = gdp_tgf_ear_salt_modifier + has_character_modifier = gdp_tgf_ear_clothes_modifier + has_character_modifier = gdp_tgf_ear_fabrics_modifier + has_character_modifier = gdp_tgf_ear_dyes_modifier + has_character_modifier = gdp_tgf_ear_alum_modifier + has_character_modifier = gdp_tgf_ear_stone_modifier + has_character_modifier = gdp_tgf_ear_carpentry_supplies_modifier + has_character_modifier = gdp_tgf_ear_base_metals_modifier + has_character_modifier = gdp_tgf_ear_luxury_items_modifier + has_character_modifier = gdp_tgf_ear_jewelry_materials_modifier + has_character_modifier = gdp_tgf_ear_precious_metals_modifier + has_character_modifier = gdp_tgf_ear_medicaments_modifier + has_character_modifier = gdp_tgf_ear_incense_modifier + has_character_modifier = gdp_tgf_ear_luxury_consumption_modifier + has_character_modifier = gdp_tgf_ear_books_modifier + } +} + +# Ear to the Market for scope:tgf_category, the category of the event's good +scripted_effect gdp_tgf_add_ear_to_the_market_effect = { + if = { + limit = { scope:tgf_category = trade_good_category:trade_category_alcohol } + add_character_modifier = gdp_tgf_ear_alcohol_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_comforts } + add_character_modifier = gdp_tgf_ear_comforts_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_cereals } + add_character_modifier = gdp_tgf_ear_cereals_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_meat } + add_character_modifier = gdp_tgf_ear_meat_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + add_character_modifier = gdp_tgf_ear_beasts_of_burden_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_salt } + add_character_modifier = gdp_tgf_ear_salt_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_clothes } + add_character_modifier = gdp_tgf_ear_clothes_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_fabrics } + add_character_modifier = gdp_tgf_ear_fabrics_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_dyes } + add_character_modifier = gdp_tgf_ear_dyes_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_alum } + add_character_modifier = gdp_tgf_ear_alum_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_stone } + add_character_modifier = gdp_tgf_ear_stone_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_carpentry_supplies } + add_character_modifier = gdp_tgf_ear_carpentry_supplies_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_base_metals } + add_character_modifier = gdp_tgf_ear_base_metals_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_luxury_items } + add_character_modifier = gdp_tgf_ear_luxury_items_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_jewelry_materials } + add_character_modifier = gdp_tgf_ear_jewelry_materials_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_precious_metals } + add_character_modifier = gdp_tgf_ear_precious_metals_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_medicaments } + add_character_modifier = gdp_tgf_ear_medicaments_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_incense } + add_character_modifier = gdp_tgf_ear_incense_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_luxury_consumption } + add_character_modifier = gdp_tgf_ear_luxury_consumption_modifier + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_books } + add_character_modifier = gdp_tgf_ear_books_modifier + } +} + +# Watching It Sell +gdp_trade_good_flavor.1030 = { + type = character_event + title = gdp_trade_good_flavor.1030.t + desc = gdp_trade_good_flavor.1030.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_buyer + animation = pointing + camera = camera_event_left_away_3_4 + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + exists = house + gdp_tgf_has_ear_to_the_market_trigger = no + any_trade_route = { gdp_tgf_watching_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_watching_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_traded_good = { + limit = { gdp_tgf_renowned_sold_good_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_good + } + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + save_temporary_scope_as = tgf_watching_market_temp + exists = trade_market_owner.title_province.county + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_watching_province_temp + any_pool_character = { + province = scope:tgf_watching_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_watching_market_temp + trade_good_type = scope:tgf_good + } + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_buyer + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_buyer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1030.a + gdp_tgf_add_ear_to_the_market_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1030.b + add_prestige = medium_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ sells a good and the local pool holds two adults to invest +scripted_trigger gdp_tgf_investors_market_trigger = { + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_investors_province_temp + any_pool_character = { + province = scope:tgf_investors_province_temp + is_healthy = yes + is_physically_able_adult = yes + count >= 2 + } + } +} + +# this = trade route with a trader that has run for at least two years +scripted_trigger gdp_tgf_investors_route_trigger = { + is_commission_route = no + has_trader = yes + age_in_months >= 24 + save_temporary_scope_as = tgf_investors_route_temp + any_trade_market_on_route = { + gdp_tgf_investors_market_trigger = { ROUTE = scope:tgf_investors_route_temp } + } +} + +# Outside Money +gdp_trade_good_flavor.1031 = { + type = character_event + title = gdp_trade_good_flavor.1031.t + desc = gdp_trade_good_flavor.1031.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = scope:tgf_investor_a + animation = holding_yoke + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_investor_b + animation = holding_scales + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + exists = house + any_trade_route = { + count >= 2 + is_commission_route = no + } + any_trade_route = { gdp_tgf_investors_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_investors_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_investors_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_outside_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_outside_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder ?= { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_investor_a + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + is_physically_able_adult = yes + NOT = { this = scope:tgf_investor_a } + } + save_scope_as = tgf_investor_b + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_investor_a + PROVINCE = scope:tgf_source_province + } + } + + option = { + name = gdp_trade_good_flavor.1031.a + add_gold = medium_gold_value + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_outside_capital + YEARS = 10 + } + } + gdp_tgf_add_category_modifier_effect = { MODIFIER = outside_partners } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1031.b + house = { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_tgf_kept_in_family_unity_desc + } + } + gdp_tgf_add_category_modifier_effect = { MODIFIER = kept_in_family } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Display Room +gdp_trade_good_flavor.1032 = { + type = character_event + title = gdp_trade_good_flavor.1032.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.1032.desc.livestock + } + desc = gdp_trade_good_flavor.1032.desc + } + } + theme = merchant + + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + exists = domicile + } + + immediate = { + gdp_tgf_setup_good_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1032.a + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1032.b + add_prestige = medium_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good category root's company is renowned in but no longer trades +scripted_trigger gdp_tgf_lapsed_category_trigger = { + has_trade_good_category_xp_track = yes + save_temporary_scope_as = tgf_lapsed_cat_temp + root = { + gdp_tgf_renowned_in_category_trigger = { CATEGORY = scope:tgf_lapsed_cat_temp } + NOT = { + any_trade_category_traded_in = { this = scope:tgf_lapsed_cat_temp } + } + } +} + +# Keeping Your Hand In +gdp_trade_good_flavor.1033 = { + type = character_event + title = gdp_trade_good_flavor.1033.t + desc = gdp_trade_good_flavor.1033.desc + theme = merchant + override_background = { reference = study } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_good_category = { gdp_tgf_lapsed_category_trigger = yes } + } + + immediate = { + random_trade_good_category = { + limit = { gdp_tgf_lapsed_category_trigger = yes } + save_scope_as = tgf_category + } + scope:tgf_category = { + random_trade_good_in_category = { save_scope_as = tgf_good } + } + random_trade_route = { + limit = { + is_commission_route = no + any_traded_good = { always = yes } + } + random_traded_good = { + trade_good_need_category = { save_scope_as = tgf_current_category } + } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1033.a + remove_short_term_gold = minor_gold_value + gdp_tgf_add_category_modifier_effect = { MODIFIER = old_habits } + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1033.b + add_gold = miniscule_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = gdp_tgf_sold_expertise_xp_value + } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1033.c + add_stress = minor_stress_loss + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_current_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = diligent factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route with a pilgrim in a market's local pool, carrying a good root is still fledgling in +scripted_trigger gdp_tgf_itinerary_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_itinerary_route_temp + any_trade_market_on_route = { + gdp_tgf_broker_market_trigger = { ROUTE = scope:tgf_itinerary_route_temp } + } + any_traded_good = { + trade_good_need_category = { save_temporary_scope_as = tgf_itinerary_cat_temp } + root = { + gdp_tgf_fledgling_in_category_trigger = { CATEGORY = scope:tgf_itinerary_cat_temp } + } + } +} + +scripted_effect gdp_tgf_create_itinerary_effect = { + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = gdp_tgf_itinerary_artifact + description = gdp_tgf_itinerary_artifact_desc + type = library_item + visuals = book + modifier = gdp_tgf_itinerary_artifact_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes +} + +# The Itinerary +gdp_trade_good_flavor.1034 = { + type = character_event + title = gdp_trade_good_flavor.1034.t + desc = gdp_trade_good_flavor.1034.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = reading + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_pilgrim + animation = holding_staff + camera = camera_event_very_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + lowest_traded_good_category_xp_level < gdp_tgf_renowned_expertise_level_value + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_1034 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_itinerary_route_trigger = yes } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_1034 + random_trade_route = { + limit = { gdp_tgf_itinerary_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_broker_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + trade_good_need_category = { save_temporary_scope_as = tgf_itinerary_cat_temp } + root = { gdp_tgf_fledgling_in_category_trigger = { CATEGORY = scope:tgf_itinerary_cat_temp } } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_pilgrim + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_pilgrim + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1034.a + pay_short_term_gold = { + target = scope:tgf_pilgrim + gold = minor_gold_value + } + gdp_tgf_create_itinerary_effect = yes + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1034.b + gdp_tgf_create_itinerary_effect = yes + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1034.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + ai_chance = { + base = 100 + modifier = { has_trait = curious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = character, a guest or local commoner fit to dine with root +scripted_trigger gdp_tgf_dinner_guest_trigger = { + NOT = { this = root } + is_ai = yes + is_physically_able_adult = yes +} + +# Talking Shop +gdp_trade_good_flavor.1035 = { + type = character_event + title = gdp_trade_good_flavor.1035.t + desc = gdp_trade_good_flavor.1035.desc + theme = merchant + + left_portrait = { + character = root + animation = merchant_gesturing + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_guest + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_horses } + animation = standing_horse + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_cattle } + animation = holding_yoke + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_wool } + animation = shepherd_with_sheep + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_wine scope:tgf_good = trade_good_type:trade_good_beer } } + animation = drink_goblet + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_meat } + animation = holding_salami + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_cheese scope:tgf_good = trade_good_type:trade_good_tea scope:tgf_good = trade_good_type:trade_good_sugar scope:tgf_good = trade_good_type:trade_good_rice scope:tgf_good = trade_good_type:trade_good_fruit scope:tgf_good = trade_good_type:trade_good_honey } } + animation = serving_tray + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_salt scope:tgf_good = trade_good_type:trade_good_spices scope:tgf_good = trade_good_type:trade_good_grain scope:tgf_good = trade_good_type:trade_good_millet } } + animation = holding_scales + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_incense } + animation = thurible + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_medicaments } + animation = physician + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + animation = lantern + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_books_paper } + animation = holding_scrolls + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_gold scope:tgf_good = trade_good_type:trade_good_silver scope:tgf_good = trade_good_type:trade_good_copper scope:tgf_good = trade_good_type:trade_good_fish } } + animation = merchant_box + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_furs } + animation = hunting_carcass_start + } + animation = pondering + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + OR = { + any_pool_guest = { gdp_tgf_dinner_guest_trigger = yes } + any_foreign_court_guest = { gdp_tgf_dinner_guest_trigger = yes } + location = { + save_temporary_scope_as = tgf_guest_province_temp + any_pool_character = { + province = scope:tgf_guest_province_temp + is_healthy = yes + gdp_tgf_dinner_guest_trigger = yes + } + } + } + } + + immediate = { + gdp_tgf_setup_good_effect = yes + if = { + limit = { any_pool_guest = { gdp_tgf_dinner_guest_trigger = yes } } + random_pool_guest = { + limit = { gdp_tgf_dinner_guest_trigger = yes } + save_scope_as = tgf_guest + } + } + else_if = { + limit = { any_foreign_court_guest = { gdp_tgf_dinner_guest_trigger = yes } } + random_foreign_court_guest = { + limit = { gdp_tgf_dinner_guest_trigger = yes } + save_scope_as = tgf_guest + } + } + else = { + location = { + save_scope_as = tgf_guest_province + random_pool_character = { + province = scope:tgf_guest_province + limit = { + gdp_tgf_dinner_guest_trigger = yes + is_healthy = yes + } + save_scope_as = tgf_guest + } + } + } + } + + option = { + name = gdp_trade_good_flavor.1035.a + trigger = { + is_ai = no + scope:tgf_guest = { short_term_gold >= miniscule_gold_value } + } + show_as_unavailable = { always = yes } + scope:tgf_guest = { + pay_short_term_gold = { + target = root + gold = miniscule_gold_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1035.b + add_trade_good_price_modifier = { + type = buy_mult + trade_good_type = scope:tgf_good + value = { value = -0.003 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1035.c + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route with a trader that carries a packable good +scripted_trigger gdp_tgf_packing_route_trigger = { + is_commission_route = no + has_trader = yes + any_traded_good = { gdp_tgf_not_livestock_good_trigger = yes } +} + +# The Packing Floor +gdp_trade_good_flavor.1036 = { + type = character_event + title = gdp_trade_good_flavor.1036.t + desc = gdp_trade_good_flavor.1036.desc + theme = trade + override_background = { reference = gdp_carpentry_workshop } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + animation = holding_yoke + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_packing_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_packing_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_traded_good = { + limit = { gdp_tgf_not_livestock_good_trigger = yes } + save_scope_as = tgf_good + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1036.a + add_prestige = minor_prestige_loss + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_packed_tight + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1036.b + add_prestige = minor_prestige_gain + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + scope:tgf_route = { + add_trade_route_modifier = { + modifier = gdp_tgf_packed_well_modifier + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1036.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = diligent factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ buys a packable good and the local pool holds an adult to seal it +scripted_trigger gdp_tgf_seal_market_trigger = { + save_temporary_scope_as = tgf_seal_market_temp + exists = trade_market_owner.title_province.county + $ROUTE$ = { + any_traded_good = { + gdp_tgf_not_livestock_good_trigger = yes + save_temporary_scope_as = tgf_seal_good_temp + $ROUTE$ = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_seal_market_temp + trade_good_type = scope:tgf_seal_good_temp + } + } + } + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_seal_province_temp + any_pool_character = { + province = scope:tgf_seal_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_seal_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_seal_route_temp + any_trade_market_on_route = { + gdp_tgf_seal_market_trigger = { ROUTE = scope:tgf_seal_route_temp } + } +} + +# The Market Seal +gdp_trade_good_flavor.1037 = { + type = character_event + title = gdp_trade_good_flavor.1037.t + desc = gdp_trade_good_flavor.1037.desc + theme = trade + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = root + animation = arguing + camera = camera_event_left_to_the_left + } + right_portrait = { + character = scope:tgf_sealer + animation = holding_scales + camera = camera_event_right + } + + widgets = { + widget = { + is_shown = { + scope:tgf_source_province = { + OR = { + terrain = desert + terrain = desert_mountains + terrain = drylands + terrain = oasis + arid_region_trigger = yes + AND = { + tropical_seasons_region_trigger = yes + has_winter_trigger = no + } + } + } + } + gui = event_window_widget_vfx_heat_wave + container = background_shader_vfx_container + } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_seal_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_seal_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_seal_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_not_livestock_good_trigger = yes + save_temporary_scope_as = tgf_seal_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_seal_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_sealer + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_sealer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1037.a + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + scope:tgf_route = { + add_trade_route_modifier = { + modifier = gdp_tgf_sealed_stock_wait_modifier + years = 1 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1037.b + pay_short_term_gold = { + target = scope:tgf_sealer + gold = miniscule_gold_value + } + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_quick_seal + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1037.c + if = { + limit = { gdp_tgf_root_renowned_in_event_category_trigger = yes } + add_prestige = minor_prestige_gain + } + else = { + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route +scripted_trigger gdp_tgf_broker_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_broker_route_temp + any_trade_market_on_route = { + gdp_tgf_broker_market_trigger = { ROUTE = scope:tgf_broker_route_temp } + } +} + +# The Broker +gdp_trade_good_flavor.1038 = { + type = character_event + title = gdp_trade_good_flavor.1038.t + desc = gdp_trade_good_flavor.1038.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = drink + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_broker + animation = merchant_gesturing + camera = camera_event_right_away + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_broker_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_broker_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_broker_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_broker_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_broker_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_broker + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_broker + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1038.a + add_courtier = scope:tgf_broker + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + if = { + limit = { NOT = { has_character_modifier = gdp_tgf_broker_reach_renowned_modifier } } + if = { + limit = { gdp_tgf_root_renowned_in_event_category_trigger = yes } + remove_character_modifier = gdp_tgf_broker_reach_modifier + add_character_modifier = gdp_tgf_broker_reach_renowned_modifier + } + else_if = { + limit = { NOT = { has_character_modifier = gdp_tgf_broker_reach_modifier } } + add_character_modifier = gdp_tgf_broker_reach_modifier + } + } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1038.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_minor_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Trader's Apprentice +gdp_trade_good_flavor.1039 = { + type = character_event + title = gdp_trade_good_flavor.1039.t + desc = gdp_trade_good_flavor.1039.desc + theme = merchant + override_background = { + trigger = { + OR = { scope:tgf_category = trade_good_category:trade_category_base_metals scope:tgf_category = trade_good_category:trade_category_precious_metals scope:tgf_category = trade_good_category:trade_category_jewelry_materials scope:tgf_good = trade_good_type:trade_good_jewelry } + } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { + OR = { scope:tgf_good = trade_good_type:trade_good_leather scope:tgf_good = trade_good_type:trade_good_furs scope:tgf_good = trade_good_type:trade_good_dyes } + } + reference = gdp_tannery + } + override_background = { + trigger = { + OR = { scope:tgf_good = trade_good_type:trade_good_wood scope:tgf_good = trade_good_type:trade_good_hemp scope:tgf_good = trade_good_type:trade_good_lacquerware } + } + reference = gdp_carpentry_workshop + } + override_background = { + trigger = { + OR = { scope:tgf_good = trade_good_type:trade_good_horses scope:tgf_good = trade_good_type:trade_good_cattle scope:tgf_good = trade_good_type:trade_good_wool scope:tgf_good = trade_good_type:trade_good_grain scope:tgf_good = trade_good_type:trade_good_millet scope:tgf_good = trade_good_type:trade_good_rice scope:tgf_good = trade_good_type:trade_good_cotton scope:tgf_good = trade_good_type:trade_good_flax scope:tgf_good = trade_good_type:trade_good_fruit } + } + reference = farmland + } + override_background = { + trigger = { + OR = { scope:tgf_category = trade_good_category:trade_category_alcohol scope:tgf_category = trade_good_category:trade_category_salt scope:tgf_category = trade_good_category:trade_category_meat scope:tgf_good = trade_good_type:trade_good_oil scope:tgf_good = trade_good_type:trade_good_cheese scope:tgf_good = trade_good_type:trade_good_honey scope:tgf_good = trade_good_type:trade_good_sugar scope:tgf_good = trade_good_type:trade_good_spices scope:tgf_good = trade_good_type:trade_good_tea } + } + reference = bp1_wine_cellar + } + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_left_forward + } + right_portrait = { + character = scope:tgf_youth + animation = holding_tally_stick + camera = camera_event_right_forward + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 0.25 + modifier = { + factor = 4 + NOT = { exists = player_heir } + } + } + + cooldown = { years = 15 } + + trigger = { + is_ai = no + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + is_commission_route = no + has_trader = yes + trader ?= { + NOT = { this = root } + } + any_traded_good = { always = yes } + } + } + + immediate = { + random_trade_route = { + limit = { + is_commission_route = no + has_trader = yes + trader ?= { + NOT = { this = root } + } + any_traded_good = { always = yes } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_traded_good = { save_scope_as = tgf_good } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + create_character = { + age = 16 + gender_female_chance = 50 + dynasty = none + culture = scope:tgf_trader.culture + faith = scope:tgf_trader.faith + location = root.location + stewardship = 14 + trait = education_stewardship_3 + trait = diligent + save_scope_as = tgf_youth + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = root.location + } + } + + option = { + name = gdp_trade_good_flavor.1039.a + add_courtier = scope:tgf_youth + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1039.b + add_courtier = scope:tgf_youth + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_trained_hand + YEARS = 10 + } + } + scope:tgf_trader = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1039.c + house = { + add_unity_value = { + value = minor_unity_gain + character = root + desc = gdp_tgf_family_only_unity_desc + } + } + scope:tgf_trader = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Swimming in It +gdp_trade_good_flavor.1040 = { + type = character_event + title = gdp_trade_good_flavor.1040.t + desc = gdp_trade_good_flavor.1040.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_torso_center_fov30 + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_trait = greedy + } + } + + cooldown = { years = 15 } + + trigger = { + stress > 0 + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + gdp_tgf_flush_with_money_trigger = yes + any_trade_route = { + is_commission_route = no + any_traded_good = { gdp_tgf_not_livestock_good_trigger = yes } + } + } + + immediate = { + gdp_tgf_setup_packable_good_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1040.a + add_stress = major_stress_loss + random = { + chance = 30 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.1040.a.toast + left_icon = root + add_character_modifier = { + modifier = gdp_tgf_bruised_modifier + years = 1 + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1040.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The First Sale +gdp_trade_good_flavor.1041 = { + type = character_event + title = gdp_trade_good_flavor.1041.t + desc = gdp_trade_good_flavor.1041.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_horses } + animation = standing_horse + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_cattle } + animation = holding_yoke + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_wool } + animation = shepherd_with_sheep + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_wine scope:tgf_good = trade_good_type:trade_good_beer } } + animation = drink_goblet + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_meat } + animation = holding_salami + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_cheese scope:tgf_good = trade_good_type:trade_good_tea scope:tgf_good = trade_good_type:trade_good_sugar scope:tgf_good = trade_good_type:trade_good_rice scope:tgf_good = trade_good_type:trade_good_fruit scope:tgf_good = trade_good_type:trade_good_honey } } + animation = serving_tray + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_salt scope:tgf_good = trade_good_type:trade_good_spices scope:tgf_good = trade_good_type:trade_good_grain scope:tgf_good = trade_good_type:trade_good_millet } } + animation = holding_scales + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_incense } + animation = thurible + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_medicaments } + animation = physician + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + animation = lantern + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_books_paper } + animation = holding_scrolls + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_gold scope:tgf_good = trade_good_type:trade_good_silver scope:tgf_good = trade_good_type:trade_good_copper scope:tgf_good = trade_good_type:trade_good_fish } } + animation = merchant_box + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_furs } + animation = hunting_carcass_start + } + animation = happiness + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_trait = greedy + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_1041 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + gdp_tgf_flush_with_money_trigger = yes + any_trade_route = { + is_commission_route = no + any_traded_good = { gdp_tgf_not_livestock_good_trigger = yes } + } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_1041 + gdp_tgf_setup_packable_good_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1041.a + gdp_tgf_roll_artifact_rarity_effect = { RARITY = illustrious } + save_scope_as = tgf_first_seller + create_artifact = { + name = gdp_tgf_first_sale_artifact + description = gdp_tgf_first_sale_artifact_desc + type = curio + visuals = pocket_pouch + modifier = artifact_monthly_minor_prestige_1_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1041.b + add_gold = minor_gold_value + if = { + limit = { has_trait = lifestyle_merchant } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Coin Under the Pillow +gdp_trade_good_flavor.1042 = { + type = character_event + title = gdp_trade_good_flavor.1042.t + desc = gdp_trade_good_flavor.1042.desc + theme = merchant + override_background = { reference = bedchamber } + + left_portrait = { + character = root + animation = merchant_box + camera = camera_torso_center_fov30 + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_night_scene container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_night_scene container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_trait = greedy + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + gdp_tgf_flush_with_money_trigger = yes + } + + immediate = { + add_character_flag = { + flag = use_sickness_clothes + days = 7 + } + gdp_tgf_setup_good_effect = yes + } + + option = { + name = gdp_trade_good_flavor.1042.a + add_stress = medium_stress_loss + add_character_modifier = { + modifier = gdp_tgf_stiff_neck_modifier + years = 1 + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1042.b + remove_short_term_gold = miniscule_gold_value + add_trade_good_price_modifier = { + type = buy_mult + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + remove_character_flag = use_sickness_clothes + gdp_tgf_clear_widget_good_effect = yes + } +} + +scripted_effect gdp_tgf_create_merchant_portrait_effect = { + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = gdp_tgf_merchant_portrait_artifact + description = gdp_tgf_merchant_portrait_artifact_desc + type = wall_small + visuals = icon_court_small + modifier = artifact_monthly_prestige_1_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes +} + +# Portrait With Coins +gdp_trade_good_flavor.1043 = { + type = character_event + title = gdp_trade_good_flavor.1043.t + desc = gdp_trade_good_flavor.1043.desc + theme = merchant + override_background = council_chamber + + left_portrait = { + character = root + animation = steward + camera = camera_event_crowd + } + right_portrait = { + character = scope:tgf_painter + animation = pondering + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_trait = greedy + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_1043 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + gdp_tgf_flush_with_money_trigger = yes + exists = location.county + location = { + save_temporary_scope_as = tgf_painter_province_temp + any_pool_character = { + province = scope:tgf_painter_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_1043 + gdp_tgf_setup_good_effect = yes + location = { + save_scope_as = tgf_painter_province + county = { save_scope_as = tgf_source_county } + random_pool_character = { + province = scope:tgf_painter_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_painter + } + } + } + + option = { + name = gdp_trade_good_flavor.1043.a + pay_short_term_gold = { + target = scope:tgf_painter + gold = minor_gold_value + } + gdp_tgf_create_merchant_portrait_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1043.b + trigger = { short_term_gold >= medium_gold_value } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:tgf_painter + gold = medium_gold_value + } + gdp_tgf_create_merchant_portrait_effect = yes + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1043.c + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.005 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = courtier who fits the servant's line to root +scripted_trigger gdp_tgf_purse_servant_trigger = { + is_physically_able_adult = yes + NOR = { + is_close_or_extended_family_of = root + is_spouse_of = root + is_concubine_of = root + } +} + +# A Purse Too Heavy +gdp_trade_good_flavor.1044 = { + type = character_event + title = gdp_trade_good_flavor.1044.t + desc = gdp_trade_good_flavor.1044.desc + theme = merchant + + left_portrait = { + character = scope:tgf_servant + animation = merchant_box + camera = camera_event_very_left + } + right_portrait = { + character = root + animation = biting_coin + camera = camera_event_very_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + has_trait = greedy + } + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + gdp_tgf_flush_with_money_trigger = yes + any_courtier = { gdp_tgf_purse_servant_trigger = yes } + } + + immediate = { + gdp_tgf_setup_good_effect = yes + random_courtier = { + limit = { gdp_tgf_purse_servant_trigger = yes } + weight = { + base = 1 + modifier = { + add = 4 + has_no_particular_noble_roots_trigger = yes + } + } + save_scope_as = tgf_servant + } + } + + option = { + name = gdp_trade_good_flavor.1044.a + remove_short_term_gold = miniscule_gold_value + add_prestige = medium_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1044.b + trigger = { short_term_gold >= medium_gold_value } + show_as_unavailable = { always = yes } + remove_short_term_gold = medium_gold_value + add_prestige = major_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1044.c + add_prestige = minor_prestige_gain + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = character who trades alcohol under a faith that forbids it +scripted_trigger gdp_tgf_forbidden_alcohol_trigger = { + faith = { has_doctrine_parameter = alcohol_forbidden } + any_trade_route = { + is_commission_route = no + any_traded_good = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + } + } +} + +# Profit and Piety +gdp_trade_good_flavor.1045 = { + type = character_event + title = gdp_trade_good_flavor.1045.t + desc = gdp_trade_good_flavor.1045.desc + theme = trade + override_background = { reference = study } + + left_portrait = { + character = root + animation = page_flipping + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + NOT = { has_trait = cynical } + ai_zeal >= 1 + OR = { + has_trait = zealous + has_trait = humble + ai_zeal >= 50 + gdp_tgf_forbidden_alcohol_trigger = yes + } + } + + immediate = { + if = { + limit = { gdp_tgf_forbidden_alcohol_trigger = yes } + random_trade_route = { + limit = { + is_commission_route = no + any_traded_good = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + } + save_scope_as = tgf_good + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + else = { + gdp_tgf_setup_good_effect = yes + } + } + + option = { + name = gdp_trade_good_flavor.1045.a + remove_short_term_gold = minor_gold_value + add_piety = major_piety_gain + stress_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1045.b + add_stress = minor_stress_loss + add_piety = miniscule_piety_gain + ai_chance = { + base = 100 + modifier = { has_trait = cynical factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1045.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + stress_impact = { + zealous = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = zealous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ buys, in a county of the route trader's culture but not root's +scripted_trigger gdp_tgf_kin_trader_market_trigger = { + gdp_tgf_route_buys_here_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province.county = { + culture = $ROUTE$.trader.culture + NOT = { culture = root.culture } + } +} + +# this = trade route whose trader is at home in a market on it where root is not +scripted_trigger gdp_tgf_kin_trader_route_trigger = { + is_commission_route = no + has_trader = yes + trader ?= { + NOT = { this = root } + is_physically_able_adult = yes + } + save_temporary_scope_as = tgf_kin_route_temp + any_trade_market_on_route = { + gdp_tgf_kin_trader_market_trigger = { ROUTE = scope:tgf_kin_route_temp } + } +} + +# One of Their Own +gdp_trade_good_flavor.1046 = { + type = character_event + title = gdp_trade_good_flavor.1046.t + desc = gdp_trade_good_flavor.1046.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = donkey_standing_baggage + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_trader + animation = holding_scales + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_kin_trader_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_kin_trader_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_kin_trader_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_kin_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_kin_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1046.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_trader = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1046.b + pay_short_term_gold = { + target = scope:tgf_trader + gold = miniscule_gold_value + } + scope:tgf_trader = { + add_stewardship_skill = 1 + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1046.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + scope:tgf_source_culture = { + change_cultural_acceptance = { + target = root.culture + value = minor_cultural_acceptance_gain + desc = cultural_acceptance_gain_event + } + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ sells a good and an AI rival trades too +scripted_trigger gdp_tgf_flood_market_trigger = { + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + any_potential_trade_rival_in_market = { + target = root + gdp_tgf_auction_rival_trigger = yes + } +} + +# this = trade route with a trader. Expects root = the merchant +scripted_trigger gdp_tgf_flood_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_flood_route_temp + any_trade_market_on_route = { + gdp_tgf_flood_market_trigger = { ROUTE = scope:tgf_flood_route_temp } + } +} + +# Flooded Market +gdp_trade_good_flavor.1047 = { + type = character_event + title = gdp_trade_good_flavor.1047.t + desc = gdp_trade_good_flavor.1047.desc + theme = trade + override_background = { reference = market_crowd } + + left_portrait = { + character = scope:tgf_trader + animation = arguing + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_rival + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 15 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_flood_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_flood_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_flood_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_flood_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_flood_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + random_potential_trade_rival_in_market = { + target = root + limit = { gdp_tgf_auction_rival_trigger = yes } + save_scope_as = tgf_rival + } + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_rival = { + random_held_title = { + limit = { gdp_merchant_company_title_trigger = yes } + save_scope_as = tgf_rival_company + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1047.a + trigger = { short_term_gold >= medium_gold_value } + show_as_unavailable = { always = yes } + remove_short_term_gold = medium_gold_value + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_price_war + YEARS = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1047.b + add_prestige = minor_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.005 + years = 10 + } + } + stress_impact = { + impatient = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good a book could be packed in +scripted_trigger gdp_tgf_manuscript_good_trigger = { + gdp_tgf_not_livestock_good_trigger = yes + NOT = { any_trade_category = { this = trade_good_category:trade_category_alcohol } } + NOR = { + this = trade_good_type:trade_good_oil + this = trade_good_type:trade_good_honey + this = trade_good_type:trade_good_books_paper + this = trade_good_type:trade_good_stone + this = trade_good_type:trade_good_wood + } +} + +# this = trade market far from root's domicile with a stranger holder, where $ROUTE$ buys a packable good +scripted_trigger gdp_tgf_manuscript_market_trigger = { + save_temporary_scope_as = tgf_manuscript_market_temp + exists = trade_market_owner.title_province.county + exists = root.domicile.domicile_location + gdp_tgf_stranger_holder_market_trigger = yes + trade_market_owner.title_province = { + squared_distance = { + target = root.domicile.domicile_location + value > squared_distance_medium + } + } + $ROUTE$ = { + any_traded_good = { + gdp_tgf_manuscript_good_trigger = yes + save_temporary_scope_as = tgf_manuscript_good_temp + $ROUTE$ = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_manuscript_market_temp + trade_good_type = scope:tgf_manuscript_good_temp + } + } + } + } +} + +# this = trade route with a trader. Expects root = the merchant +scripted_trigger gdp_tgf_manuscript_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_manuscript_route_temp + any_trade_market_on_route = { + gdp_tgf_manuscript_market_trigger = { ROUTE = scope:tgf_manuscript_route_temp } + } +} + +# Manuscript in a Bale +gdp_trade_good_flavor.1048 = { + type = character_event + title = gdp_trade_good_flavor.1048.t + desc = gdp_trade_good_flavor.1048.desc + theme = trade + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = reading + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_manuscript_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_manuscript_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_manuscript_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_manuscript_good_trigger = yes + save_temporary_scope_as = tgf_manuscript_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_manuscript_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.1048.a + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = gdp_tgf_bale_book_artifact + description = gdp_tgf_bale_book_artifact_desc + modifier = artifact_monthly_learning_lifestyle_xp_1_modifier + type = miscellaneous + visuals = book + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1048.b + add_gold = minor_gold_value + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1048.c + add_prestige = minor_prestige_gain + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.005 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = pool character, an elder of root's culture +scripted_trigger gdp_tgf_diaspora_elder_trigger = { + culture = root.culture + is_physically_able_adult = yes + age >= 35 +} + +# this = market where $ROUTE$ sells, in another culture's county whose pool holds an elder of root's culture +scripted_trigger gdp_tgf_diaspora_market_trigger = { + gdp_tgf_route_sells_here_trigger = { ROUTE = $ROUTE$ } + trade_market_owner.title_province = { + county = { + NOT = { culture = root.culture } + } + save_temporary_scope_as = tgf_diaspora_province_temp + any_pool_character = { + province = scope:tgf_diaspora_province_temp + is_healthy = yes + gdp_tgf_diaspora_elder_trigger = yes + } + } +} + +# this = trade route with a trader. Expects root = the merchant +scripted_trigger gdp_tgf_diaspora_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_diaspora_route_temp + any_trade_market_on_route = { + gdp_tgf_diaspora_market_trigger = { ROUTE = scope:tgf_diaspora_route_temp } + } +} + +# Merchants From Home +gdp_trade_good_flavor.1049 = { + type = character_event + title = gdp_trade_good_flavor.1049.t + desc = gdp_trade_good_flavor.1049.desc + theme = trade + override_background = { reference = market_crowd } + + left_portrait = { + character = scope:tgf_trader + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_elder + animation = donkey_standing_baggage + camera = camera_event_right_forward + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + exists = house + any_trade_route = { gdp_tgf_diaspora_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_diaspora_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_diaspora_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + save_temporary_scope_as = tgf_diaspora_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_diaspora_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + ordered_pool_character = { + province = scope:tgf_source_province + limit = { + gdp_tgf_diaspora_elder_trigger = yes + is_healthy = yes + } + order_by = age + save_scope_as = tgf_elder + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_elder + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1049.a + add_prestige = medium_prestige_gain + scope:tgf_source_culture = { + change_cultural_acceptance = { + target = root.culture + value = minor_cultural_acceptance_gain + desc = cultural_acceptance_gain_event + } + } + scope:tgf_elder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1049.b + add_courtier = scope:tgf_elder + scope:tgf_elder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1049.c + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + stress_impact = { + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = pool character, a smuggler worth hiring +scripted_trigger gdp_tgf_smuggler_candidate_trigger = { + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + intrigue >= 10 +} + +# this = stranger's market where $ROUTE$ buys a non-livestock good and the pool holds a sly commoner +scripted_trigger gdp_tgf_smuggler_market_trigger = { + save_temporary_scope_as = tgf_smuggler_market_temp + exists = trade_market_owner.title_province.county + gdp_tgf_stranger_holder_market_trigger = yes + $ROUTE$ = { + any_traded_good = { + gdp_tgf_not_livestock_good_trigger = yes + save_temporary_scope_as = tgf_smuggler_good_temp + $ROUTE$ = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_smuggler_market_temp + trade_good_type = scope:tgf_smuggler_good_temp + } + } + } + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_smuggler_province_temp + any_pool_character = { + province = scope:tgf_smuggler_province_temp + is_healthy = yes + gdp_tgf_smuggler_candidate_trigger = yes + } + } +} + +# this = trade route with a trader. Expects root = the merchant +scripted_trigger gdp_tgf_smuggler_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_smuggler_route_temp + any_trade_market_on_route = { + gdp_tgf_smuggler_market_trigger = { ROUTE = scope:tgf_smuggler_route_temp } + } +} + +# The Salt Road +gdp_trade_good_flavor.1050 = { + type = character_event + title = gdp_trade_good_flavor.1050.t + desc = gdp_trade_good_flavor.1050.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_smuggler + animation = holding_scales + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_smuggler_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_smuggler_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_smuggler_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_not_livestock_good_trigger = yes + save_temporary_scope_as = tgf_smuggler_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_smuggler_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + ordered_pool_character = { + province = scope:tgf_source_province + limit = { + gdp_tgf_smuggler_candidate_trigger = yes + is_healthy = yes + } + order_by = intrigue + save_scope_as = tgf_smuggler + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_smuggler + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.1050.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + random = { + chance = 25 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.1050.a.toast + right_icon = scope:tgf_market_holder + add_prestige = medium_prestige_loss + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -15 + } + } + } + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1050.b + scope:tgf_smuggler = { + death = { + death_reason = death_chopped_to_pieces + killer = scope:tgf_market_holder + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + if = { + limit = { + NOT = { has_hook = scope:tgf_market_holder } + } + add_hook = { + type = favor_hook + target = scope:tgf_market_holder + } + } + stress_impact = { + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.1050.c + add_courtier = scope:tgf_smuggler + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Heavy Harvest +gdp_trade_good_flavor.2001 = { + type = character_event + title = gdp_trade_good_flavor.2001.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + desc = gdp_trade_good_flavor.2001.desc.livestock + } + desc = gdp_trade_good_flavor.2001.desc + } + desc = gdp_trade_good_flavor.2001.desc.outro + } + theme = trade + override_background = { reference = farmland } + + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_horses } + animation = standing_horse + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_cattle } + animation = holding_yoke + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_wool } + animation = shepherd_with_sheep + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_wine } + animation = drink_goblet + } + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_oil } + animation = lantern + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_rice scope:tgf_good = trade_good_type:trade_good_fruit scope:tgf_good = trade_good_type:trade_good_sugar } } + animation = serving_tray + } + triggered_animation = { + trigger = { OR = { scope:tgf_good = trade_good_type:trade_good_grain scope:tgf_good = trade_good_type:trade_good_millet } } + animation = holding_scales + } + animation = happiness + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_farmed_goods } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_farmed_goods } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_category_buy_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_farmed_goods + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_farmed_goods } + save_temporary_scope_as = tgf_catbuy_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catbuy_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2001.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = { + trigger = { NOT = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } } + text = gdp_trade_good_flavor.2001.b + } + name = { + trigger = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + text = gdp_trade_good_flavor.2001.b.livestock + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_massive_value + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Hunter's Haul +gdp_trade_good_flavor.2002 = { + type = character_event + title = gdp_trade_good_flavor.2002.t + desc = gdp_trade_good_flavor.2002.desc + theme = trade + override_background = { reference = wilderness } + + left_portrait = { + character = root + animation = betting + camera = camera_event_center + } + right_portrait = { + character = scope:tgf_trader + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_forest_goods } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_forest_goods } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_category_buy_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_forest_goods + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_forest_goods } + save_temporary_scope_as = tgf_catbuy_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catbuy_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2002.a + add_gold = minor_gold_value + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2002.b + trigger = { + NOT = { has_character_flag = gdp_tgf_kept_haul_curio } + } + add_character_flag = gdp_tgf_kept_haul_curio + gdp_tgf_create_study_curio_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2002.c + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + gdp_tgf_add_tiered_county_modifier_effect = { + MODIFIER = gdp_tgf_plentiful_stalls + YEARS = 10 + } + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Rich Vein +gdp_trade_good_flavor.2003 = { + type = character_event + title = gdp_trade_good_flavor.2003.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_good = trade_good_type:trade_good_amber } + desc = gdp_trade_good_flavor.2003.desc.amber + } + desc = gdp_trade_good_flavor.2003.desc + } + } + theme = trade + + left_portrait = { + character = root + animation = interested + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_trader + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_minerals } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_minerals } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_category_buy_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_minerals + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_minerals } + save_temporary_scope_as = tgf_catbuy_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catbuy_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = { + trigger = { NOT = { scope:tgf_good = trade_good_type:trade_good_amber } } + text = gdp_trade_good_flavor.2003.a + } + name = { + trigger = { scope:tgf_good = trade_good_type:trade_good_amber } + text = gdp_trade_good_flavor.2003.a.amber + } + remove_short_term_gold = minor_gold_value + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 12 + } + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + gdp_tgf_add_tiered_county_modifier_effect = { + MODIFIER = gdp_tgf_vein_share + YEARS = 12 + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2003.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Worth Its Secret +gdp_trade_good_flavor.2004 = { + type = character_event + title = gdp_trade_good_flavor.2004.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_good = trade_good_type:trade_good_ceramics } + desc = gdp_trade_good_flavor.2004.desc.ceramics + } + desc = gdp_trade_good_flavor.2004.desc + } + desc = gdp_trade_good_flavor.2004.desc.outro + } + theme = trade + override_background = { + trigger = { + OR = { + scope:tgf_category = trade_good_category:trade_category_base_metals + scope:tgf_category = trade_good_category:trade_category_precious_metals + scope:tgf_good = trade_good_type:trade_good_jewelry + scope:tgf_good = trade_good_type:trade_good_glass + } + } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_leather + scope:tgf_good = trade_good_type:trade_good_furs + scope:tgf_good = trade_good_type:trade_good_dyes + } + } + reference = gdp_tannery + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_wood + scope:tgf_good = trade_good_type:trade_good_lacquerware + } + } + reference = gdp_carpentry_workshop + } + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_trader + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_artisanal_goods } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_artisanal_goods } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_category_buy_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_artisanal_goods + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_artisanal_goods } + save_temporary_scope_as = tgf_catbuy_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catbuy_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2004.a + remove_short_term_gold = minor_gold_value + add_prestige = medium_prestige_gain + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2004.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Matter of Taste +gdp_trade_good_flavor.2005 = { + type = character_event + title = gdp_trade_good_flavor.2005.t + desc = gdp_trade_good_flavor.2005.desc + theme = merchant + override_background = { reference = bp1_kitchen_western } + + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:tgf_good = trade_good_type:trade_good_tea } + animation = drink + } + animation = eating + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_category_sell_route_trigger = { CATEGORY = trade_category_comforts } + } + NOR = { + has_trait = temperate + has_trait = inappetetic + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_category_sell_route_trigger = { CATEGORY = trade_category_comforts } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_category_sell_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_comforts + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_comforts } + save_temporary_scope_as = tgf_catsell_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catsell_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2005.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2005.b + add_stress = medium_stress_loss + hidden_effect = { + change_current_weight = 25 + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good worn as a cloak in Dress the Part +scripted_trigger gdp_tgf_dress_good_trigger = { + OR = { + any_trade_category = { this = trade_good_category:trade_category_clothes } + this = trade_good_type:trade_good_silk + } +} + +# this = trade market where $ROUTE$ sells a cloak good +scripted_trigger gdp_tgf_dress_market_trigger = { + save_temporary_scope_as = tgf_dress_market_temp + exists = trade_market_owner.title_province.county + $ROUTE$ = { + any_traded_good = { + gdp_tgf_dress_good_trigger = yes + save_temporary_scope_as = tgf_dress_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_dress_market_temp + trade_good_type = scope:tgf_dress_good_temp + } + } + } + } +} + +# this = trade route that sells a cloak good in one of its markets +scripted_trigger gdp_tgf_dress_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_dress_route_temp + any_trade_market_on_route = { + gdp_tgf_dress_market_trigger = { ROUTE = scope:tgf_dress_route_temp } + } +} + +scripted_effect gdp_tgf_dress_off_effect = { + remove_character_flag = tgf_dress_furs + remove_character_flag = tgf_dress_leather + remove_character_flag = tgf_dress_textiles + remove_character_flag = tgf_dress_silk +} + +# Dress the Part +gdp_trade_good_flavor.2006 = { + type = character_event + title = gdp_trade_good_flavor.2006.t + desc = gdp_trade_good_flavor.2006.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = royal_wave + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_dress_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_dress_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_dress_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_dress_good_trigger = yes + save_temporary_scope_as = tgf_catsell_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catsell_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_dress_off_effect = yes + if = { + limit = { scope:tgf_good = trade_good_type:trade_good_furs } + add_character_flag = tgf_dress_furs + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_leather } + add_character_flag = tgf_dress_leather + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_silk } + add_character_flag = tgf_dress_silk + } + else = { + add_character_flag = tgf_dress_textiles + } + gdp_tgf_set_background_location_effect = { + CHAR = root + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2006.a + add_prestige = medium_prestige_gain + if = { + limit = { scope:tgf_good = trade_good_type:trade_good_furs } + custom_tooltip = gdp_trade_good_flavor.2006.a.tt_furs + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_leather } + custom_tooltip = gdp_trade_good_flavor.2006.a.tt_leather + } + else_if = { + limit = { scope:tgf_good = trade_good_type:trade_good_silk } + custom_tooltip = gdp_trade_good_flavor.2006.a.tt_silk + } + else = { + custom_tooltip = gdp_trade_good_flavor.2006.a.tt_textiles + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2006.b + hidden_effect = { gdp_tgf_dress_off_effect = yes } + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.015 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route where a stranger's market buys $CATEGORY$ goods from it +scripted_trigger gdp_tgf_category_sell_holder_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_catsell_route_temp + any_trade_market_on_route = { + gdp_tgf_category_sell_holder_market_trigger = { + ROUTE = scope:tgf_catsell_route_temp + CATEGORY = $CATEGORY$ + } + } +} + +# Face Value +gdp_trade_good_flavor.2007 = { + type = character_event + title = gdp_trade_good_flavor.2007.t + desc = gdp_trade_good_flavor.2007.desc + theme = trade + override_background = { reference = gdp_smithy_workshop } + + left_portrait = { + character = root + animation = merchant_box + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = biting_coin + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_2007 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_category_sell_holder_route_trigger = { CATEGORY = trade_category_precious_metals } + } + } + + immediate = { + save_scope_as = tgf_coin_merchant + add_character_flag = gdp_tgf_had_event_2007 + random_trade_route = { + limit = { + gdp_tgf_category_sell_holder_route_trigger = { CATEGORY = trade_category_precious_metals } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_category_sell_holder_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_precious_metals + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_precious_metals } + save_temporary_scope_as = tgf_catsell_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catsell_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2007.a + add_prestige = medium_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = gdp_tgf_coin_artifact + description = gdp_tgf_coin_artifact_desc + type = curio + modifier = artifact_monthly_prestige_1_modifier + visuals = medallion + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2007.b + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2007.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Adds Careful Handling for scope:tgf_category +scripted_effect gdp_tgf_add_careful_handling_effect = { + if = { + limit = { scope:tgf_category = trade_good_category:trade_category_alcohol } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_alcohol_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_comforts } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_comforts_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_cereals } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_cereals_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_meat } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_meat_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_beasts_of_burden } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_beasts_of_burden_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_salt } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_salt_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_clothes } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_clothes_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_fabrics } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_fabrics_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_dyes } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_dyes_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_alum } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_alum_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_stone } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_stone_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_carpentry_supplies } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_carpentry_supplies_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_base_metals } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_base_metals_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_luxury_items } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_luxury_items_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_jewelry_materials } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_jewelry_materials_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_precious_metals } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_precious_metals_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_medicaments } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_medicaments_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_incense } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_incense_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_luxury_consumption } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_luxury_consumption_modifier + years = 25 + } + } + else_if = { + limit = { scope:tgf_category = trade_good_category:trade_category_books } + add_character_modifier = { + modifier = gdp_tgf_careful_handling_books_modifier + years = 25 + } + } +} + +# Intact +gdp_trade_good_flavor.2008 = { + type = character_event + title = gdp_trade_good_flavor.2008.t + desc = gdp_trade_good_flavor.2008.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = happiness + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + is_commission_route = no + has_trader = yes + any_traded_good = { is_breakable_trade_good_trigger = { TRADE_GOOD = this } } + } + } + + immediate = { + random_trade_route = { + limit = { + is_commission_route = no + has_trader = yes + any_traded_good = { is_breakable_trade_good_trigger = { TRADE_GOOD = this } } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_traded_good = { + limit = { is_breakable_trade_good_trigger = { TRADE_GOOD = this } } + save_scope_as = tgf_good + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2008.a + gdp_tgf_add_careful_handling_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2008.b + scope:tgf_trader = { + add_stewardship_skill = 2 + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2008.c + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good used to supply a war +scripted_trigger gdp_tgf_war_good_trigger = { + OR = { + trade_good_need_category = { this = trade_good_category:trade_category_base_metals } + trade_good_need_category = { this = trade_good_category:trade_category_beasts_of_burden } + trade_good_need_category = { this = trade_good_category:trade_category_carpentry_supplies } + } +} + +# this = trade market with a valid stranger holder at war, where $ROUTE$ sells a war-supply good +scripted_trigger gdp_tgf_war_market_trigger = { + save_temporary_scope_as = tgf_war_market_temp + exists = trade_market_owner.title_province.county + gdp_tgf_stranger_holder_market_trigger = yes + trade_market_owner.holder = { is_at_war = yes } + $ROUTE$ = { + any_traded_good = { + gdp_tgf_war_good_trigger = yes + save_temporary_scope_as = tgf_war_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_war_market_temp + trade_good_type = scope:tgf_war_good_temp + } + } + } + } +} + +# this = trade route where a warring stranger's market buys its war-supply goods +scripted_trigger gdp_tgf_war_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_war_route_temp + any_trade_market_on_route = { + gdp_tgf_war_market_trigger = { ROUTE = scope:tgf_war_route_temp } + } +} + +# Other Men See Armies +gdp_trade_good_flavor.2009 = { + type = character_event + title = gdp_trade_good_flavor.2009.t + desc = gdp_trade_good_flavor.2009.desc + theme = trade + override_background = { reference = army_camp } + + left_portrait = { + character = root + animation = biting_coin + camera = camera_event_left_to_the_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = inspect_weapon + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_war_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_war_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_war_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_war_good_trigger = yes + save_temporary_scope_as = tgf_war_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_war_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2009.a + trigger = { + is_ai = no + scope:tgf_market_holder = { short_term_gold >= minor_gold_value } + } + show_as_unavailable = { always = yes } + scope:tgf_market_holder = { + pay_short_term_gold = { + target = root + gold = minor_gold_value + } + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_well_supplied_host + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2009.b + add_prestige = minor_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_market_holder = { + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_well_supplied_host + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2009.c + trigger = { + NOT = { has_hook = scope:tgf_market_holder } + } + add_hook = { + type = favor_hook + target = scope:tgf_market_holder + } + scope:tgf_market_holder = { + gdp_tgf_add_tiered_character_modifier_effect = { + MODIFIER = gdp_tgf_well_supplied_host + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Guild Knocks +gdp_trade_good_flavor.2010 = { + type = character_event + title = gdp_trade_good_flavor.2010.t + desc = gdp_trade_good_flavor.2010.desc + theme = merchant + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = root + triggered_animation = { + trigger = { + scope:tgf_market.trade_market_owner.title_province ?= { + OR = { arid_region_trigger = yes terrain = desert terrain = desert_mountains terrain = drylands terrain = oasis } + } + } + animation = dromedary_holding + } + triggered_animation = { + trigger = { scope:tgf_market.trade_market_owner.title_province ?= { terrain = steppe } } + animation = standing_horse + } + animation = donkey_standing_baggage + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_category_sell_route_trigger = { CATEGORY = trade_category_guild_goods } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_category_sell_route_trigger = { CATEGORY = trade_category_guild_goods } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_category_sell_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_guild_goods + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_guild_goods } + save_temporary_scope_as = tgf_catsell_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catsell_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = root + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2010.a + remove_short_term_gold = miniscule_gold_value + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = stubborn factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2010.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.005 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good worn as a luxury +scripted_trigger gdp_tgf_wearable_good_trigger = { + OR = { + this = trade_good_type:trade_good_silk + this = trade_good_type:trade_good_jewelry + this = trade_good_type:trade_good_gems + this = trade_good_type:trade_good_amber + this = trade_good_type:trade_good_jade + this = trade_good_type:trade_good_ivory + } +} + +# this = trade market with a valid stranger holder, where $ROUTE$ sells a wearable luxury +scripted_trigger gdp_tgf_worn_market_trigger = { + save_temporary_scope_as = tgf_worn_market_temp + exists = trade_market_owner.title_province.county + gdp_tgf_stranger_holder_market_trigger = yes + trade_market_owner.holder = { + has_any_illness = no + } + $ROUTE$ = { + any_traded_good = { + gdp_tgf_wearable_good_trigger = yes + save_temporary_scope_as = tgf_worn_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_worn_market_temp + trade_good_type = scope:tgf_worn_good_temp + } + } + } + } +} + +# this = trade route where a stranger's market buys its wearable luxuries +scripted_trigger gdp_tgf_worn_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_worn_route_temp + any_trade_market_on_route = { + gdp_tgf_worn_market_trigger = { ROUTE = scope:tgf_worn_route_temp } + } +} + +# this = the ruler now seen wearing scope:tgf_good +scripted_effect gdp_tgf_wear_finery_effect = { + if = { + limit = { scope:tgf_good = trade_good_type:trade_good_silk } + add_character_modifier = { + modifier = gdp_tgf_silk_clad_modifier + years = 5 + } + } + else = { + add_character_modifier = { + modifier = gdp_tgf_bejeweled_modifier + years = 5 + } + } +} + +# Rulers Set Fashions +gdp_trade_good_flavor.2011 = { + type = character_event + title = gdp_trade_good_flavor.2011.t + desc = gdp_trade_good_flavor.2011.desc + theme = trade + override_background = { reference = throne_room_scope } + + left_portrait = { + character = scope:tgf_market_holder + animation = royal_wave + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_worn_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_worn_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_worn_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_wearable_good_trigger = yes + save_temporary_scope_as = tgf_worn_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_worn_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { + save_scope_as = tgf_market_holder + save_scope_as = background_throne_room_scope + } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2011.a + add_prestige = minor_prestige_gain + add_character_modifier = { + modifier = gdp_tgf_renowned_dealer_modifier + years = 10 + } + scope:tgf_market_holder = { gdp_tgf_wear_finery_effect = yes } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2011.b + scope:tgf_market_holder = { gdp_tgf_wear_finery_effect = yes } + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Sample the Goods +gdp_trade_good_flavor.2012 = { + type = character_event + title = gdp_trade_good_flavor.2012.t + desc = gdp_trade_good_flavor.2012.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = wedding_drunk + camera = camera_torso + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_double_vision_milder container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_double_vision_milder container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + is_adult = yes + stress >= 1 + NOT = { has_trait = drunkard } + any_trade_route = { + is_commission_route = no + any_traded_good = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + } + } + } + + immediate = { + random_trade_route = { + limit = { + is_commission_route = no + any_traded_good = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + } + save_scope_as = tgf_good + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2012.a + add_stress = massive_stress_loss + random = { + chance = 5 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.2012.a.toast + left_icon = root + add_trait = drunkard + } + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2012.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + stress_impact = { + temperate = minor_stress_impact_loss + } + ai_chance = { + base = 100 + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good worth a master's showpiece +scripted_trigger gdp_tgf_masterwork_good_trigger = { + OR = { + trade_good_need_category = { this = trade_good_category:trade_category_luxury_items } + trade_good_need_category = { this = trade_good_category:trade_category_jewelry_materials } + trade_good_need_category = { this = trade_good_category:trade_category_precious_metals } + } +} + +# this = trade market where $ROUTE$ trades a masterwork-worthy good and the local pool holds an adult craftsman +scripted_trigger gdp_tgf_masterwork_market_trigger = { + save_temporary_scope_as = tgf_masterwork_market_temp + exists = trade_market_owner.title_province.county + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_masterwork_province_temp + any_pool_character = { + province = scope:tgf_masterwork_province_temp + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + } + $ROUTE$ = { + any_traded_good = { + gdp_tgf_masterwork_good_trigger = yes + save_temporary_scope_as = tgf_masterwork_good_temp + $ROUTE$ = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_masterwork_market_temp + trade_good_type = scope:tgf_masterwork_good_temp + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_masterwork_market_temp + trade_good_type = scope:tgf_masterwork_good_temp + } + } + } + } + } +} + +# this = trade route where a market trades its masterwork-worthy goods and has a craftsman in the local pool +scripted_trigger gdp_tgf_masterwork_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_masterwork_route_temp + any_trade_market_on_route = { + gdp_tgf_masterwork_market_trigger = { ROUTE = scope:tgf_masterwork_route_temp } + } +} + +# A Masterwork Order +gdp_trade_good_flavor.2013 = { + type = character_event + title = gdp_trade_good_flavor.2013.t + desc = gdp_trade_good_flavor.2013.desc + theme = trade + override_background = { + trigger = { + OR = { + scope:tgf_category = trade_good_category:trade_category_jewelry_materials + scope:tgf_category = trade_good_category:trade_category_precious_metals + scope:tgf_good = trade_good_type:trade_good_jewelry + } + } + reference = gdp_smithy_workshop + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_leather + scope:tgf_good = trade_good_type:trade_good_furs + scope:tgf_good = trade_good_type:trade_good_dyes + } + } + reference = gdp_tannery + } + override_background = { + trigger = { + OR = { + scope:tgf_good = trade_good_type:trade_good_wood + scope:tgf_good = trade_good_type:trade_good_lacquerware + } + } + reference = gdp_carpentry_workshop + } + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_crafter + triggered_animation = { + trigger = { exists = scope:tgf_good } + scripted_animation = gdp_tgf_good_animation + } + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + weight_multiplier = { + base = 1 + modifier = { + factor = 2 + highest_traded_good_category_xp_level >= gdp_tgf_renowned_expertise_level_value + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_2013 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_masterwork_route_trigger = yes } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_2013 + random_trade_route = { + limit = { gdp_tgf_masterwork_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_masterwork_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_masterwork_good_trigger = yes + save_temporary_scope_as = tgf_masterwork_good_temp + scope:tgf_route = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_masterwork_good_temp + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_masterwork_good_temp + } + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_crafter + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_crafter + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2013.a + trigger = { short_term_gold >= medium_gold_value } + show_as_unavailable = { always = yes } + add_prestige = medium_prestige_gain + pay_short_term_gold = { + target = scope:tgf_crafter + gold = medium_gold_value + } + save_scope_as = tgf_showpiece_merchant + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = gdp_tgf_showpiece_artifact + description = gdp_tgf_showpiece_artifact_desc + type = curio + modifier = artifact_monthly_prestige_2_modifier + visuals = cabinet_trinket + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2013.b + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route with a trader that sells a food good in a market with a county +scripted_trigger gdp_tgf_dish_route_trigger = { + is_commission_route = no + has_trader = yes + gdp_tgf_category_sell_route_trigger = { CATEGORY = trade_category_food } +} + +# Their Dish, Our Goods +gdp_trade_good_flavor.2014 = { + type = character_event + title = gdp_trade_good_flavor.2014.t + desc = gdp_trade_good_flavor.2014.desc + theme = trade + override_background = { reference = gdp_artisan_street_crowd } + + left_portrait = { + character = root + animation = holding_salami + camera = camera_event_right + } + right_portrait = { + character = scope:tgf_trader + animation = eating + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_dish_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_dish_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_category_sell_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_food + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + has_category = trade_good_category:trade_category_food + save_temporary_scope_as = tgf_dish_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_dish_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2014.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2014.b + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_kitchen_demand + YEARS = 10 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = market where $ROUTE$ buys a forest good and the pool holds someone to speak for the gatherers +scripted_trigger gdp_tgf_gatherers_market_trigger = { + gdp_tgf_category_buy_market_trigger = { + ROUTE = $ROUTE$ + CATEGORY = trade_category_forest_goods + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_gatherers_province_temp + any_pool_character = { + province = scope:tgf_gatherers_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_gatherers_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_gatherers_route_temp + any_trade_market_on_route = { + gdp_tgf_gatherers_market_trigger = { ROUTE = scope:tgf_gatherers_route_temp } + } +} + +# Paid in Goods +gdp_trade_good_flavor.2015 = { + type = character_event + title = gdp_trade_good_flavor.2015.t + desc = gdp_trade_good_flavor.2015.desc + theme = trade + override_background = { reference = wilderness } + + left_portrait = { + character = root + animation = debating + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_spokesperson + animation = arguing + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_gatherers_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_gatherers_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_gatherers_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_forest_goods } + save_temporary_scope_as = tgf_gatherers_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_gatherers_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_spokesperson + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_spokesperson + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2015.a + remove_short_term_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + gdp_tgf_add_tiered_county_modifier_effect = { + MODIFIER = gdp_tgf_fair_wages + YEARS = 10 + } + } + } + scope:tgf_spokesperson = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2015.b + add_prestige = minor_prestige_loss + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_spokesperson = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2015.c + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + add_county_modifier = { + modifier = gdp_tgf_underpaid_gatherers_modifier + years = 10 + } + } + } + scope:tgf_spokesperson = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + modifier = { has_trait = compassionate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade good that smells +scripted_trigger gdp_tgf_smelly_good_trigger = { + OR = { + this = trade_good_type:trade_good_fish + this = trade_good_type:trade_good_leather + this = trade_good_type:trade_good_dyes + this = trade_good_type:trade_good_cheese + this = trade_good_type:trade_good_hemp + } +} + +# this = trade market where $ROUTE$ sells a smelly good and the local pool holds a buyer to complain +scripted_trigger gdp_tgf_stink_market_trigger = { + save_temporary_scope_as = tgf_stink_market_temp + exists = trade_market_owner.title_province.county + $ROUTE$ = { + any_traded_good = { + gdp_tgf_smelly_good_trigger = yes + save_temporary_scope_as = tgf_stink_good_temp + $ROUTE$ = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_stink_market_temp + trade_good_type = scope:tgf_stink_good_temp + } + } + } + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_stink_province_temp + any_pool_character = { + province = scope:tgf_stink_province_temp + is_healthy = yes + is_physically_able_adult = yes + } + } +} + +# this = trade route +scripted_trigger gdp_tgf_stink_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_stink_route_temp + any_trade_market_on_route = { + gdp_tgf_stink_market_trigger = { ROUTE = scope:tgf_stink_route_temp } + } +} + +# Money Doesn't Stink +gdp_trade_good_flavor.2016 = { + type = character_event + title = gdp_trade_good_flavor.2016.t + desc = gdp_trade_good_flavor.2016.desc + theme = trade + override_background = { reference = market } + override_effect_2d = { reference = flies } + + left_portrait = { + character = root + animation = biting_coin + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_buyer + animation = disgust + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_stink_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_stink_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_stink_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_smelly_good_trigger = yes + save_temporary_scope_as = tgf_stink_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_stink_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_physically_able_adult = yes + is_healthy = yes + } + save_scope_as = tgf_buyer + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_buyer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.2016.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.015 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + if = { + limit = { can_contract_disease_trigger = { DISEASE = ill } } + random = { + chance = 10 + contract_disease_effect = { + DISEASE = ill + TREATMENT_EVENT = yes + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2016.b + remove_short_term_gold = miniscule_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = trade_good_category:trade_category_salt + VALUE = trade_expertise_xp_massive_value + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = trade_good_category:trade_category_medicaments + VALUE = trade_expertise_xp_massive_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2016.c + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Seven Fat Years +gdp_trade_good_flavor.2017 = { + type = character_event + title = gdp_trade_good_flavor.2017.t + desc = gdp_trade_good_flavor.2017.desc + theme = merchant + override_background = { reference = bedchamber } + + left_portrait = { + character = root + animation = delirium + camera = camera_event_left + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_night_scene container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_night_scene container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_food } } + NOT = { + has_character_modifier = gdp_tgf_seven_storehouses_modifier + } + } + + immediate = { + add_character_flag = { + flag = use_sickness_clothes + days = 7 + } + random_trade_route = { + limit = { gdp_tgf_category_buy_route_trigger = { CATEGORY = trade_category_food } } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_category_buy_market_trigger = { + ROUTE = scope:tgf_route + CATEGORY = trade_category_food + } + } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_food } + save_temporary_scope_as = tgf_storehouse_good_temp + scope:tgf_route = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_storehouse_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2017.a + remove_short_term_gold = minor_gold_value + add_character_modifier = gdp_tgf_seven_storehouses_modifier + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2017.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.007 multiply = gdp_tgf_renown_tier_value } + years = 7 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2017.c + add_stress = medium_stress_loss + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + after = { + remove_character_flag = use_sickness_clothes + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = pool character, a cattle raider +scripted_trigger gdp_tgf_raider_candidate_trigger = { + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + prowess >= medium_skill_rating +} + +# this = trade market with a stranger holder, where $ROUTE$ trades livestock and the local pool holds a raider +scripted_trigger gdp_tgf_raider_market_trigger = { + save_temporary_scope_as = tgf_raider_market_temp + exists = trade_market_owner.title_province.county + gdp_tgf_stranger_holder_market_trigger = yes + $ROUTE$ = { + any_traded_good = { + gdp_tgf_not_livestock_good_trigger = no + save_temporary_scope_as = tgf_raider_good_temp + $ROUTE$ = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_raider_market_temp + trade_good_type = scope:tgf_raider_good_temp + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_raider_market_temp + trade_good_type = scope:tgf_raider_good_temp + } + } + } + } + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_raider_province_temp + any_pool_character = { + province = scope:tgf_raider_province_temp + is_healthy = yes + gdp_tgf_raider_candidate_trigger = yes + } + } +} + +# this = trade route with a trader. Expects root = the merchant +scripted_trigger gdp_tgf_raider_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_raider_route_temp + any_trade_market_on_route = { + gdp_tgf_raider_market_trigger = { ROUTE = scope:tgf_raider_route_temp } + } +} + +# Somebody's Cattle +gdp_trade_good_flavor.2018 = { + type = character_event + title = gdp_trade_good_flavor.2018.t + desc = gdp_trade_good_flavor.2018.desc + theme = trade + override_background = { reference = farmland } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_very_left_fov35 + } + right_portrait = { + character = scope:tgf_raider + animation = donkey_standing_baggage + camera = camera_event_right_forward + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_raider_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_raider_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_raider_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + gdp_tgf_not_livestock_good_trigger = no + save_temporary_scope_as = tgf_raider_good_temp + scope:tgf_route = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_raider_good_temp + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_raider_good_temp + } + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + ordered_pool_character = { + province = scope:tgf_source_province + limit = { + gdp_tgf_raider_candidate_trigger = yes + is_healthy = yes + } + order_by = prowess + save_scope_as = tgf_raider + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2018.a + add_trade_good_price_modifier = { + type = buy_mult + trade_good_type = scope:tgf_good + value = { value = -0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + random = { + chance = 25 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.2018.a.toast + right_icon = scope:tgf_market_holder + add_prestige = minor_prestige_loss + scope:tgf_market_holder = { + progress_towards_rival_effect = { + REASON = rival_tgf_bought_stolen_herd + CHARACTER = root + OPINION = default_rival_opinion + } + } + } + } + stress_impact = { + just = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = just factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2018.b + scope:tgf_raider = { + death = { + death_reason = death_chopped_to_pieces + killer = scope:tgf_market_holder + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + if = { + limit = { + NOT = { has_hook = scope:tgf_market_holder } + } + add_hook = { + type = favor_hook + target = scope:tgf_market_holder + } + } + stress_impact = { + compassionate = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2018.c + add_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ sells alcohol to a stranger holder whose faith forbids it +scripted_trigger gdp_tgf_dry_court_market_trigger = { + gdp_tgf_category_sell_holder_market_trigger = { + ROUTE = $ROUTE$ + CATEGORY = trade_category_alcohol + } + trade_market_owner.holder.faith = { has_doctrine_parameter = alcohol_forbidden } +} + +# this = trade route with a trader. Expects root = the merchant +scripted_trigger gdp_tgf_dry_court_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_dry_court_route_temp + any_trade_market_on_route = { + gdp_tgf_dry_court_market_trigger = { ROUTE = scope:tgf_dry_court_route_temp } + } +} + +# A Dry Court's Thirst +gdp_trade_good_flavor.2019 = { + type = character_event + title = gdp_trade_good_flavor.2019.t + desc = gdp_trade_good_flavor.2019.desc + theme = trade + override_background = { reference = feast } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = drink_goblet + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 25 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_dry_court_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_dry_court_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_dry_court_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + random_traded_good = { + limit = { + any_trade_category = { this = trade_good_category:trade_category_alcohol } + save_temporary_scope_as = tgf_catsell_good_temp + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_catsell_good_temp + } + } + } + save_scope_as = tgf_good + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { + save_scope_as = tgf_market_holder + save_scope_as = bg_override_char + } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.2019.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 20 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2019.b + random_list = { + 70 = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_trade_good_flavor.2019.b.toast_good + right_icon = scope:tgf_market_holder + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + } + } + 30 = { + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.2019.b.toast + right_icon = scope:tgf_market_holder + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.01 + years = 10 + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.2019.c + add_stress = minor_stress_loss + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Perfect Wheel +gdp_trade_good_flavor.3001 = { + type = character_event + title = gdp_trade_good_flavor.3001.t + desc = gdp_trade_good_flavor.3001.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = clutching_ball + camera = camera_event_left_to_the_left + } + right_portrait = { + trigger = { exists = scope:tgf_guard } + character = scope:tgf_guard + animation = throne_room_two_handed_passive_shield + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + override_effect_2d = { reference = flies } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_3001 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_route_trigger = { GOOD = trade_good_cheese } + } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_3001 + random_courtier = { + limit = { is_physically_able_adult = yes } + weight = { + base = 1 + modifier = { + add = 4 + is_knight = yes + } + } + save_scope_as = tgf_guard + } + trade_good_type:trade_good_cheese = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3001.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_massive_value + } + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = fp2_cheese_artifact + description = fp2_cheese_artifact_desc + modifier = artifact_health_gain_1_modifier + modifier = artifact_attraction_opinion_negative_1_modifier + type = miscellaneous + visuals = pouch + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + hidden_effect = { + scope:newly_created_artifact = { + flag_as_trash_artifact = yes + set_variable = has_cheese_artifact + } + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3001.b + add_gold = minor_gold_value + ai_chance = { + base = 100 + modifier = { has_trait = gluttonous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Famous Complaint +gdp_trade_good_flavor.3002 = { + type = character_event + title = gdp_trade_good_flavor.3002.t + desc = gdp_trade_good_flavor.3002.desc + theme = merchant + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = arguing + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_copper } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_copper } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_copper + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_copper = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3002.a + random_list = { + 70 = { + send_interface_toast = { + type = event_toast_effect_good + title = gdp_trade_good_flavor.3002.a.toast_good + right_icon = scope:tgf_market_holder + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + } + } + 30 = { + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3002.a.toast + right_icon = scope:tgf_market_holder + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = -0.02 + years = 10 + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3002.b + duel = { + skill = diplomacy + target = scope:tgf_market_holder + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_trade_good_flavor.3002.b.toast_good + send_interface_toast = { + type = event_toast_effect_good + title = gdp_trade_good_flavor.3002.b.toast_good + right_icon = scope:tgf_market_holder + add_prestige = medium_prestige_gain + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 10 + desc = gdp_trade_good_flavor.3002.b.toast_bad + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3002.b.toast_bad + right_icon = scope:tgf_market_holder + scope:tgf_market_holder = { + progress_towards_rival_effect = { + REASON = rival_tgf_light_ingots + CHARACTER = root + OPINION = default_rival_opinion + } + } + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3002.c + add_prestige = miniscule_prestige_loss + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 15 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market whose local pool holds a poor adult commoner +scripted_trigger gdp_tgf_debtor_market_trigger = { + exists = trade_market_owner.title_province.county + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_debtor_province_temp + any_pool_character = { + province = scope:tgf_debtor_province_temp + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + short_term_gold < 5 + } + } +} + +# this = trade route where a market has a destitute commoner in the local pool +scripted_trigger gdp_tgf_debtor_route_trigger = { + is_commission_route = no + gdp_tgf_good_route_trigger = { GOOD = trade_good_spices } + any_trade_market_on_route = { + gdp_tgf_debtor_market_trigger = yes + } +} + +# Rent in Pepper +gdp_trade_good_flavor.3003 = { + type = character_event + title = gdp_trade_good_flavor.3003.t + desc = gdp_trade_good_flavor.3003.desc + theme = merchant + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_debtor + animation = beg + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_debtor_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_debtor_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_debtor_market_trigger = yes } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + short_term_gold < 5 + } + save_scope_as = tgf_debtor + } + trade_good_type:trade_good_spices = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3003.a + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 20 + } + ai_chance = { + base = 100 + modifier = { has_trait = stubborn factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3003.b + trigger = { + is_ai = no + } + show_as_unavailable = { always = yes } + scope:tgf_debtor = { + pay_short_term_gold = { + target = root + gold = miniscule_gold_value + } + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = compassionate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3003.c + add_courtier = scope:tgf_debtor + scope:tgf_debtor = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 30 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Letter Full of Complaints +gdp_trade_good_flavor.3004 = { + type = character_event + title = gdp_trade_good_flavor.3004.t + desc = gdp_trade_good_flavor.3004.desc + theme = merchant + override_background = { reference = terrain_scope } + + left_portrait = { + character = scope:tgf_trader + animation = mental_anguish + } + + widgets = { + widget = { + is_shown = { scope:tgf_weather = flag:rain } + gui = event_window_widget_vfx_rain_storm + container = foreground_shader_vfx_container + } + widget = { + is_shown = { scope:tgf_weather = flag:snow } + gui = event_window_widget_vfx_snowstorm + container = foreground_shader_vfx_container + } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_sell_route_trigger = { GOOD = trade_good_flax } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_sell_route_trigger = { GOOD = trade_good_flax } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_flax + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_flax = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + scope:tgf_trader.location ?= { save_scope_as = background_terrain_scope } + if = { + limit = { NOT = { exists = scope:background_terrain_scope } } + scope:tgf_market.trade_market_owner.title_province = { save_scope_as = background_terrain_scope } + } + if = { + limit = { scope:background_terrain_scope = { has_winter_trigger = yes } } + save_scope_value_as = { name = tgf_weather value = flag:snow } + } + else = { + save_scope_value_as = { name = tgf_weather value = flag:rain } + } + } + + option = { + name = gdp_trade_good_flavor.3004.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = diligent factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3004.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# A Subtlety +gdp_trade_good_flavor.3005 = { + type = character_event + title = gdp_trade_good_flavor.3005.t + desc = gdp_trade_good_flavor.3005.desc + theme = trade + override_background = { reference = feast } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = eating + camera = camera_event_right + } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_sugar } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_sugar } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_sugar + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { + save_scope_as = tgf_market_holder + save_scope_as = bg_override_char + } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_sugar = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3005.a + duel = { + skill = stewardship + value = decent_skill_rating + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_trade_good_flavor.3005.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_trade_good_flavor.3005.a.success + right_icon = scope:tgf_market_holder + add_prestige = medium_prestige_gain + add_character_modifier = gdp_tgf_sweet_reputation_modifier + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_trade_good_flavor.3005.a.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3005.a.failure + right_icon = scope:tgf_market_holder + add_prestige = minor_prestige_loss + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = craven factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3005.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = generous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3005.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Swarm +gdp_trade_good_flavor.3006 = { + type = character_event + title = gdp_trade_good_flavor.3006.t + desc = gdp_trade_good_flavor.3006.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + override_effect_2d = { reference = flies } + + left_portrait = { + character = root + animation = shock + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_route_trigger = { GOOD = trade_good_honey } + } + NOT = { + has_character_modifier = gdp_tgf_beekeeper_modifier + } + } + + immediate = { + trade_good_type:trade_good_honey = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3006.a + add_character_modifier = gdp_tgf_beekeeper_modifier + random = { + chance = 25 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3006.a.toast + left_icon = root + add_character_modifier = { + modifier = gdp_tgf_bee_stung_modifier + years = 1 + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = craven factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3006.b + add_stress = minor_stress_loss + add_gold = miniscule_gold_value + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Another Pot of Tea +gdp_trade_good_flavor.3007 = { + type = character_event + title = gdp_trade_good_flavor.3007.t + desc = gdp_trade_good_flavor.3007.desc + theme = merchant + override_background = { reference = sitting_room } + + left_portrait = { + character = root + animation = drink + camera = camera_event_left + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + trigger = { + NOR = { + has_character_flag = gdp_tgf_had_event_3007 + has_character_modifier = gdp_tgf_awake_and_alert_modifier + } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_route_trigger = { GOOD = trade_good_tea } + } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_3007 + trade_good_type:trade_good_tea = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3007.a + add_character_modifier = gdp_tgf_awake_and_alert_modifier + add_stress = minor_stress_gain + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3007.b + every_courtier = { + limit = { + is_adult = yes + NOT = { has_character_modifier = gdp_tgf_tea_drinker_modifier } + } + add_character_modifier = gdp_tgf_tea_drinker_modifier + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Before It Turns +gdp_trade_good_flavor.3008 = { + type = character_event + title = gdp_trade_good_flavor.3008.t + desc = gdp_trade_good_flavor.3008.desc + theme = merchant + override_background = { reference = docks } + + left_portrait = { + character = root + animation = worry + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_trader + animation = poison + camera = camera_event_right + } + override_effect_2d = { reference = flies } + + widgets = { + widget = { gui = event_window_widget_vfx_fog container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_route_trigger = { GOOD = trade_good_fruit } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_route_trigger = { GOOD = trade_good_fruit } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + } + trade_good_type:trade_good_fruit = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3008.a + remove_short_term_gold = miniscule_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.005 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3008.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = trade_good_category:trade_category_alcohol + VALUE = trade_expertise_xp_massive_value + } + add_character_modifier = { + modifier = gdp_tgf_alcohol_opportunist_modifier + years = 15 + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Midnight Oil +gdp_trade_good_flavor.3009 = { + type = character_event + title = gdp_trade_good_flavor.3009.t + desc = gdp_trade_good_flavor.3009.desc + theme = merchant + override_background = { reference = study } + + left_portrait = { + character = root + animation = writing + camera = camera_event_left + } + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_route_trigger = { GOOD = trade_good_oil } + } + NOT = { + has_character_modifier = gdp_tgf_two_grades_modifier + } + } + + immediate = { + trade_good_type:trade_good_oil = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3009.a + add_character_modifier = gdp_tgf_two_grades_modifier + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3009.b + add_stewardship_lifestyle_xp = major_lifestyle_xp + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3009.c + add_stress = medium_stress_loss + ai_chance = { + base = 100 + modifier = { has_trait = diligent factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# In the Blade +gdp_trade_good_flavor.3010 = { + type = character_event + title = gdp_trade_good_flavor.3010.t + desc = { + desc = gdp_trade_good_flavor.3010.desc.intro + first_valid = { + triggered_desc = { + trigger = { + gdp_usury_condemns_loan_trigger = { BORROWER = scope:tgf_peasant } + } + desc = gdp_trade_good_flavor.3010.desc.condemned + } + desc = gdp_trade_good_flavor.3010.desc.permitted + } + } + theme = trade + override_background = { reference = farmland } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_peasant + animation = beg + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_grain } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_grain } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_buy_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_grain + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_peasant + } + trade_good_type:trade_good_grain = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3010.a + remove_short_term_gold = minor_gold_value + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.02 multiply = gdp_tgf_renown_tier_value } + years = 25 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + scope:tgf_peasant = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + if = { + limit = { + gdp_usury_condemns_loan_trigger = { BORROWER = scope:tgf_peasant } + } + add_piety = minor_piety_loss + } + ai_chance = { + base = 100 + modifier = { has_trait = zealous factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3010.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + if = { + limit = { + gdp_usury_condemns_loan_trigger = { BORROWER = scope:tgf_peasant } + } + add_piety = miniscule_piety_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Ten-Year Millet +gdp_trade_good_flavor.3011 = { + type = character_event + title = gdp_trade_good_flavor.3011.t + desc = gdp_trade_good_flavor.3011.desc + theme = merchant + override_background = { reference = bp1_wine_cellar } + + left_portrait = { + character = root + animation = holding_tally_stick + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_route_trigger = { GOOD = trade_good_millet } + } + } + + immediate = { + trade_good_type:trade_good_millet = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3011.a + add_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3011.b + add_character_modifier = gdp_tgf_road_millet_modifier + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3011.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + add_trade_good_price_modifier = { + type = buy_mult + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Polished or Not +gdp_trade_good_flavor.3012 = { + type = character_event + title = gdp_trade_good_flavor.3012.t + desc = gdp_trade_good_flavor.3012.desc + theme = merchant + override_background = { reference = farmland } + + left_portrait = { + character = root + animation = donkey_standing_baggage + camera = camera_event_table_left_2 + } + right_portrait = { + character = scope:tgf_trader + animation = holding_scales + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_route_trigger = { GOOD = trade_good_rice } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_route_trigger = { GOOD = trade_good_rice } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + save_temporary_scope_as = tgf_rice_market_temp + exists = trade_market_owner.title_province.county + scope:tgf_route = { + OR = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_rice_market_temp + trade_good_type = trade_good_type:trade_good_rice + } + is_buying_trade_good_in_market = { + trade_market = scope:tgf_rice_market_temp + trade_good_type = trade_good_type:trade_good_rice + } + } + } + } + trade_market_owner.title_province.county = { save_scope_as = tgf_source_county } + } + } + trade_good_type:trade_good_rice = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3012.a + remove_short_term_gold = minor_gold_value + add_prestige = medium_prestige_gain + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + ai_chance = { + base = 100 + modifier = { has_trait = humble factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3012.b + scope:tgf_source_county ?= { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + add_county_modifier = { + modifier = gdp_tgf_cheap_rice_modifier + years = 10 + } + } + } + add_piety = minor_piety_gain + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3012.c + add_prestige = miniscule_prestige_gain + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_miniscule_value + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market where $ROUTE$ sells meat, in a county that keeps Lent or Ramadan +scripted_trigger gdp_tgf_fast_market_trigger = { + gdp_tgf_good_sell_market_trigger = { + ROUTE = $ROUTE$ + GOOD = trade_good_meat + } + trade_market_owner.title_province.county.faith = { + OR = { + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } + religion = religion:islam_religion + } + } +} + +# this = trade route with a trader and a market that keeps a meat fast +scripted_trigger gdp_tgf_fast_route_trigger = { + is_commission_route = no + has_trader = yes + save_temporary_scope_as = tgf_fast_route_temp + any_trade_market_on_route = { + gdp_tgf_fast_market_trigger = { ROUTE = scope:tgf_fast_route_temp } + } +} + +# Before the Fast +gdp_trade_good_flavor.3013 = { + type = character_event + title = gdp_trade_good_flavor.3013.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:tgf_source_faith = { religion = religion:islam_religion } + } + desc = gdp_trade_good_flavor.3013.desc_ramadan + } + desc = gdp_trade_good_flavor.3013.desc + } + } + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = holding_salami + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_trader + animation = eating_salami + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_fast_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_fast_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_fast_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + faith = { save_scope_as = tgf_source_faith } + } + } + } + } + trade_good_type:trade_good_meat = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3013.a + trigger = { faith.religion = scope:tgf_source_faith.religion } + reason = faith + add_piety = minor_piety_gain + add_character_modifier = gdp_tgf_keeps_the_fast_modifier + ai_chance = { + base = 100 + modifier = { has_trait = cynical factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3013.b + if = { + limit = { + NOT = { + any_trade_route = { + is_commission_route = no + any_traded_good = { this = trade_good_type:trade_good_salt } + } + } + } + remove_short_term_gold = minor_gold_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = trade_good_category:trade_category_salt + VALUE = trade_expertise_xp_massive_value + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3013.c + add_gold = minor_gold_value + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route that buys horses where a dealer waits, while root is still fledgling with beasts of burden +scripted_trigger gdp_tgf_horse_dealer_route_trigger = { + is_commission_route = no + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_horses } + root = { + gdp_tgf_fledgling_in_category_trigger = { CATEGORY = trade_good_category:trade_category_beasts_of_burden } + } +} + +# Look It in the Mouth +gdp_trade_good_flavor.3014 = { + type = character_event + title = gdp_trade_good_flavor.3014.t + desc = gdp_trade_good_flavor.3014.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left_away + } + right_portrait = { + character = scope:tgf_dealer + animation = standing_horse + camera = camera_event_right_away_3_4 + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_horse_dealer_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_horse_dealer_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_buy_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_horses + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { save_scope_as = tgf_source_province } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_dealer + } + trade_good_type:trade_good_horses = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_dealer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3014.a + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.01 multiply = gdp_tgf_renown_tier_value } + years = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = trusting factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3014.b + trigger = { + NOR = { + has_character_flag = had_warhorse_story + any_owned_story = { type = story_cycle_martial_lifestyle_warhorse } + } + } + pay_short_term_gold = { + target = scope:tgf_dealer + gold = miniscule_gold_value + } + start_warhorse_story_cycle_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = craven factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3014.c + add_courtier = scope:tgf_dealer + scope:tgf_dealer = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 30 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = paranoid factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Fatten for Market +gdp_trade_good_flavor.3015 = { + type = character_event + title = gdp_trade_good_flavor.3015.t + desc = gdp_trade_good_flavor.3015.desc + theme = trade + override_background = { reference = farmland } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = biting_coin + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_cattle } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_cattle } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_cattle + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_cattle = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3015.a + pay_short_term_gold = { + target = scope:tgf_market_holder + gold = miniscule_gold_value + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 20 + } + } + scope:tgf_source_county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + gdp_tgf_add_tiered_county_modifier_effect = { + MODIFIER = gdp_tgf_well_grazed_meadows + YEARS = 20 + } + } + } + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_heavier_loads + YEARS = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3015.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = market where $ROUTE$ sells leather to a holder whose available chaplain follows a parchment-scripture faith +scripted_trigger gdp_tgf_chaplain_market_trigger = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = $ROUTE$ + GOOD = trade_good_leather + } + trade_market_owner.holder = { + cp:councillor_court_chaplain ?= { + is_available_ai_adult = yes + OR = { + religion = { is_in_family = rf_abrahamic } + religion = religion:zoroastrianism_religion + } + } + } +} + +# this = trade route that sells leather to a holder whose court chaplain can write +scripted_trigger gdp_tgf_chaplain_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_chaplain_route_temp + any_trade_market_on_route = { + gdp_tgf_chaplain_market_trigger = { ROUTE = scope:tgf_chaplain_route_temp } + } +} + +# Calfskin for the Scribes +gdp_trade_good_flavor.3016 = { + type = character_event + title = gdp_trade_good_flavor.3016.t + desc = gdp_trade_good_flavor.3016.desc + theme = trade + override_background = { reference = gdp_tannery } + + left_portrait = { + character = root + animation = merchant_gesturing + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_chaplain + animation = reading + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + NOR = { + religion = religion:hinduism_religion + religion = religion:jainism_religion + } + any_trade_route = { gdp_tgf_chaplain_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_chaplain_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_chaplain_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { + save_scope_as = tgf_market_holder + cp:councillor_court_chaplain = { save_scope_as = tgf_chaplain } + } + } + } + trade_good_type:trade_good_leather = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3016.a + if = { + limit = { faith = scope:tgf_chaplain.faith } + add_piety = medium_piety_gain + } + else = { + add_prestige = medium_prestige_gain + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = trade_good_category:trade_category_books + VALUE = trade_expertise_xp_minor_value + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3016.b + add_character_modifier = gdp_tgf_parchment_supplier_modifier + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = trade_good_category:trade_category_books + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = cynical factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3016.c + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = zealous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = province with a church holding held by an AI Christian other than root +scripted_trigger gdp_tgf_abbey_province_trigger = { + has_holding_type = church_holding + barony.holder ?= { + NOT = { this = root } + is_ai = yes + is_physically_able_adult = yes + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } + } +} + +# this = trade market where $ROUTE$ buys wool in a county with a Christian church holding +scripted_trigger gdp_tgf_abbey_market_trigger = { + gdp_tgf_good_buy_market_trigger = { + ROUTE = $ROUTE$ + GOOD = trade_good_wool + } + trade_market_owner.title_province.county = { + any_county_province = { gdp_tgf_abbey_province_trigger = yes } + } +} + +# this = trade route that buys wool in a county with a Christian church holding +scripted_trigger gdp_tgf_abbey_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_goodbuy_route_temp + any_trade_market_on_route = { + gdp_tgf_abbey_market_trigger = { ROUTE = scope:tgf_goodbuy_route_temp } + } +} + +# Buying the Clip +gdp_trade_good_flavor.3017 = { + type = character_event + title = gdp_trade_good_flavor.3017.t + desc = gdp_trade_good_flavor.3017.desc + theme = trade + override_background = { reference = hills } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_left_away_3_4_small + } + right_portrait = { + character = scope:tgf_abbot + animation = shepherd_with_sheep + camera = camera_event_very_right_fov50 + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_abbey_route_trigger = yes + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_abbey_route_trigger = yes + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_abbey_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + random_county_province = { + limit = { gdp_tgf_abbey_province_trigger = yes } + save_scope_as = tgf_abbey_province + barony = { save_scope_as = tgf_abbey } + barony.holder = { save_scope_as = tgf_abbot } + } + } + } + } + } + trade_good_type:trade_good_wool = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3017.a + pay_short_term_gold = { + target = scope:tgf_abbot + gold = minor_gold_value + } + add_prestige = minor_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = 0.05 + years = 3 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.03 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3017.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Vegetable Lamb +gdp_trade_good_flavor.3018 = { + type = character_event + title = gdp_trade_good_flavor.3018.t + desc = gdp_trade_good_flavor.3018.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_buyer + animation = admiration + camera = camera_event_very_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_sell_pool_route_trigger = { GOOD = trade_good_cotton } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_good_sell_pool_route_trigger = { GOOD = trade_good_cotton } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_cotton + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_buyer + } + trade_good_type:trade_good_cotton = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_buyer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3018.a + add_prestige = miniscule_prestige_gain + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + stress_impact = { + honest = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3018.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = deceitful factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route that buys $GOOD$ in a market with an origin county +scripted_trigger gdp_tgf_good_buy_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_goodbuy_route_temp + any_trade_market_on_route = { + gdp_tgf_good_buy_market_trigger = { + ROUTE = scope:tgf_goodbuy_route_temp + GOOD = $GOOD$ + } + } +} + +# Spolia +gdp_trade_good_flavor.3019 = { + type = character_event + title = gdp_trade_good_flavor.3019.t + desc = gdp_trade_good_flavor.3019.desc + theme = trade + + left_portrait = { + character = scope:tgf_trader + animation = holding_scales_horse + camera = camera_activity_horse + } + override_background = pam_cathedral_construction + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_3019 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_buy_route_trigger = { GOOD = trade_good_stone } + } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_3019 + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_buy_route_trigger = { GOOD = trade_good_stone } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_good_buy_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_stone + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_stone = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3019.a + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 20 + } + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3019.b + gdp_tgf_create_study_curio_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = coastal trade market whose stranger holder buys $ROUTE$'s wood +scripted_trigger gdp_tgf_mast_market_trigger = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = $ROUTE$ + GOOD = trade_good_wood + } + trade_market_owner.title_province = { is_coastal = yes } +} + +# this = trade route that sells wood to the holder of a coastal market +scripted_trigger gdp_tgf_mast_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_goodsell_route_temp + any_trade_market_on_route = { + gdp_tgf_mast_market_trigger = { ROUTE = scope:tgf_goodsell_route_temp } + } +} + +# The Mast Trunk +gdp_trade_good_flavor.3020 = { + type = character_event + title = gdp_trade_good_flavor.3020.t + desc = gdp_trade_good_flavor.3020.desc + theme = trade + override_background = { reference = docks } + + left_portrait = { + character = scope:tgf_trader + animation = merchant_gesturing + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = survey + camera = camera_event_right_away + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_mast_route_trigger = yes + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_mast_route_trigger = yes + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { gdp_tgf_mast_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_wood = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_market_holder + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3020.a + remove_short_term_gold = minor_gold_value + add_character_modifier = gdp_tgf_tall_mast_modifier + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3020.b + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_our_timber + YEARS = 15 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3020.c + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.05 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = hashish eater other than root +scripted_trigger gdp_tgf_hashish_eater_trigger = { + has_trait = hashishiyah + this != root + is_ai = yes + is_healthy = yes +} + +# this = trade market where $ROUTE$ sells hemp or medicaments to a hemp-using culture or a hashish eater +scripted_trigger gdp_tgf_hemp_custom_market_trigger = { + OR = { + gdp_tgf_good_sell_market_trigger = { + ROUTE = $ROUTE$ + GOOD = trade_good_hemp + } + gdp_tgf_good_sell_market_trigger = { + ROUTE = $ROUTE$ + GOOD = trade_good_medicaments + } + } + OR = { + trade_market_owner.title_province.county.culture = { + OR = { + has_building_gfx = steppe_building_gfx + has_building_gfx = indian_building_gfx + AND = { + current_year >= 1100 + OR = { + has_building_gfx = mena_building_gfx + has_building_gfx = iranian_building_gfx + } + } + } + } + any_character_in_market = { gdp_tgf_hashish_eater_trigger = yes } + } +} + +# this = trade route that sells hemp or medicaments in such a market +scripted_trigger gdp_tgf_hemp_custom_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_goodsell_route_temp + any_trade_market_on_route = { + gdp_tgf_hemp_custom_market_trigger = { ROUTE = scope:tgf_goodsell_route_temp } + } +} + +# The Tent of Smoke +gdp_trade_good_flavor.3021 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { scope:tgf_hemp_custom = flag:bhang } + desc = gdp_trade_good_flavor.3021.t_bhang + } + triggered_desc = { + trigger = { scope:tgf_hemp_custom = flag:hashish } + desc = gdp_trade_good_flavor.3021.t_hashish + } + desc = gdp_trade_good_flavor.3021.t + } + } + desc = { + desc = gdp_trade_good_flavor.3021.desc.intro + first_valid = { + triggered_desc = { + trigger = { scope:tgf_hemp_custom = flag:bhang } + desc = gdp_trade_good_flavor.3021.desc_bhang + } + triggered_desc = { + trigger = { scope:tgf_hemp_custom = flag:hashish } + desc = gdp_trade_good_flavor.3021.desc_hashish + } + desc = gdp_trade_good_flavor.3021.desc + } + } + theme = trade + override_background = { + trigger = { scope:tgf_hemp_custom = flag:smoke } + reference = mpo_tent_interior_mongol + } + override_background = { + trigger = { scope:tgf_hemp_custom = flag:bhang } + reference = bp2_indian_garden + } + override_background = { + trigger = { scope:tgf_hemp_custom = flag:hashish } + reference = bp2_tavern_mena + } + + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:tgf_hemp_custom = flag:bhang } + animation = drink_goblet + } + animation = delirium + camera = camera_event_very_left + } + + right_portrait = { + character = scope:tgf_hemp_host + animation = laugh + } + + widgets = { + widget = { + is_shown = { scope:tgf_hemp_custom = flag:smoke } + gui = event_window_widget_vfx_heavy_smoke + container = foreground_shader_vfx_container + } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_hemp_custom_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_hemp_custom_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_hemp_custom_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + culture = { save_scope_as = tgf_source_culture } + } + } + } + } + if = { + limit = { + scope:tgf_source_culture = { has_building_gfx = steppe_building_gfx } + } + save_scope_value_as = { + name = tgf_hemp_custom + value = flag:smoke + } + } + else_if = { + limit = { + scope:tgf_source_culture = { has_building_gfx = indian_building_gfx } + } + save_scope_value_as = { + name = tgf_hemp_custom + value = flag:bhang + } + } + else = { + save_scope_value_as = { + name = tgf_hemp_custom + value = flag:hashish + } + scope:tgf_market = { + random_character_in_market = { + limit = { gdp_tgf_hashish_eater_trigger = yes } + save_scope_as = tgf_hashish_eater + } + } + } + if = { + limit = { + scope:tgf_market = { + gdp_tgf_good_sell_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_hemp + } + } + } + trade_good_type:trade_good_hemp = { save_scope_as = tgf_good } + } + else = { + trade_good_type:trade_good_medicaments = { save_scope_as = tgf_good } + } + scope:tgf_good = { + trade_good_need_category = { save_scope_as = tgf_category } + } + if = { + limit = { scope:tgf_good = trade_good_type:trade_good_hemp } + trade_good_type:trade_good_medicaments = { save_scope_as = tgf_cross_good } + } + else = { + trade_good_type:trade_good_hemp = { save_scope_as = tgf_cross_good } + } + scope:tgf_cross_good = { + trade_good_need_category = { save_scope_as = tgf_cross_category } + } + if = { + limit = { exists = scope:tgf_hashish_eater } + scope:tgf_hashish_eater = { save_scope_as = tgf_hemp_host } + } + else = { + random_pool_character = { + province = scope:tgf_source_county.title_province + limit = { + is_healthy = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_hemp_host + } + } + if = { + limit = { + NOT = { exists = scope:tgf_hemp_host } + } + create_character = { + age = { 25 55 } + gender_female_chance = 50 + dynasty = none + culture = scope:tgf_source_culture + faith = scope:tgf_source_county.faith + location = scope:tgf_source_county.title_province + after_creation = { + add_character_flag = created + } + save_scope_as = tgf_hemp_host + } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = { + trigger = { scope:tgf_hemp_custom = flag:smoke } + text = gdp_trade_good_flavor.3021.a + } + name = { + trigger = { scope:tgf_hemp_custom = flag:bhang } + text = gdp_trade_good_flavor.3021.a_bhang + } + name = { + trigger = { scope:tgf_hemp_custom = flag:hashish } + text = gdp_trade_good_flavor.3021.a_hashish + } + add_stress = medium_stress_loss + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.05 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_cross_good + value = { value = 0.05 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + if = { + limit = { + NOT = { has_trait = hashishiyah } + } + random = { + chance = 5 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3021.a.toast_habit + left_icon = root + add_trait = hashishiyah + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3021.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_cross_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = gregarious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + scope:tgf_hemp_host = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# Creates the weapon scope:tgf_smith forges for scope:tgf_smith_patron +# $TYPE$ is both the artifact type and the visuals +scripted_effect gdp_tgf_create_smith_weapon_effect = { + create_artifact = { + name = gdp_tgf_smith_weapon_$TYPE$ + description = gdp_tgf_smith_weapon_desc + creator = scope:tgf_smith + type = $TYPE$ + visuals = $TYPE$ + modifier = artifact_prowess_1_modifier + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } +} + +# A Blade From My Best +gdp_trade_good_flavor.3022 = { + type = character_event + title = gdp_trade_good_flavor.3022.t + desc = gdp_trade_good_flavor.3022.desc + theme = trade + override_background = { reference = gdp_smithy_workshop } + + left_portrait = { + character = root + animation = interested + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_smith + animation = merchant_box + camera = camera_event_right + } + + widgets = { + widget = { gui = event_window_widget_vfx_heat_wave container = background_shader_vfx_container } + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + } + + trigger = { + NOT = { has_character_flag = gdp_tgf_had_event_3022 } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_iron } + } + } + + immediate = { + save_scope_as = tgf_smith_patron + add_character_flag = gdp_tgf_had_event_3022 + random_trade_route = { + limit = { + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_iron } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_buy_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_iron + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + weight = { + base = 1 + modifier = { + add = martial + } + } + save_scope_as = tgf_smith + } + trade_good_type:trade_good_iron = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + random_list = { + 1 = { + save_scope_value_as = { + name = tgf_weapon_type + value = flag:axe + } + } + 1 = { + save_scope_value_as = { + name = tgf_weapon_type + value = flag:dagger + } + } + 1 = { + save_scope_value_as = { + name = tgf_weapon_type + value = flag:hammer + } + } + 1 = { + save_scope_value_as = { + name = tgf_weapon_type + value = flag:mace + } + } + 1 = { + save_scope_value_as = { + name = tgf_weapon_type + value = flag:spear + } + } + 1 = { + save_scope_value_as = { + name = tgf_weapon_type + value = flag:sword + } + } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3022.a + trigger = { short_term_gold >= medium_gold_value } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:tgf_smith + gold = medium_gold_value + } + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + if = { + limit = { scope:tgf_weapon_type = flag:axe } + gdp_tgf_create_smith_weapon_effect = { TYPE = axe } + } + else_if = { + limit = { scope:tgf_weapon_type = flag:dagger } + gdp_tgf_create_smith_weapon_effect = { TYPE = dagger } + } + else_if = { + limit = { scope:tgf_weapon_type = flag:hammer } + gdp_tgf_create_smith_weapon_effect = { TYPE = hammer } + } + else_if = { + limit = { scope:tgf_weapon_type = flag:mace } + gdp_tgf_create_smith_weapon_effect = { TYPE = mace } + } + else_if = { + limit = { scope:tgf_weapon_type = flag:spear } + gdp_tgf_create_smith_weapon_effect = { TYPE = spear } + } + else = { + gdp_tgf_create_smith_weapon_effect = { TYPE = sword } + } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3022.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Lapidary's Claim +gdp_trade_good_flavor.3023 = { + type = character_event + title = gdp_trade_good_flavor.3023.t + desc = gdp_trade_good_flavor.3023.desc + theme = trade + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = root + animation = holding_yoke + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_lapidary + animation = merchant_box + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_sell_pool_route_trigger = { GOOD = trade_good_gems } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_good_sell_pool_route_trigger = { GOOD = trade_good_gems } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_gems + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + weight = { + base = 1 + modifier = { + add = learning + } + } + save_scope_as = tgf_lapidary + } + random_list = { + 1 = { + set_variable = { + name = tgf_ailment + value = flag:fever + } + } + 1 = { + set_variable = { + name = tgf_ailment + value = flag:poison + } + } + 1 = { + set_variable = { + name = tgf_ailment + value = flag:nightmares + } + } + } + trade_good_type:trade_good_gems = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_lapidary + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3023.a + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 20 + } + } + add_prestige = minor_prestige_loss + ai_chance = { + base = 100 + modifier = { has_trait = honest factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3023.b + add_courtier = scope:tgf_lapidary + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3023.c + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + remove_variable = tgf_ailment + } +} + +# this = pool character skilled enough to be worth hiring as a jade connoisseur +scripted_trigger gdp_tgf_connoisseur_candidate_trigger = { + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + OR = { + stewardship >= decent_skill_rating + learning >= decent_skill_rating + } +} + +# this = trade market; $ROUTE$ buys or sells jade here and the local pool holds a skilled connoisseur +scripted_trigger gdp_tgf_connoisseur_market_trigger = { + save_temporary_scope_as = tgf_connoisseur_market_temp + exists = trade_market_owner.title_province.county + $ROUTE$ = { + OR = { + is_buying_trade_good_in_market = { + trade_market = scope:tgf_connoisseur_market_temp + trade_good_type = trade_good_type:trade_good_jade + } + is_selling_trade_good_in_market = { + trade_market = scope:tgf_connoisseur_market_temp + trade_good_type = trade_good_type:trade_good_jade + } + } + } + trade_market_owner.title_province = { + save_temporary_scope_as = tgf_connoisseur_province_temp + any_pool_character = { + province = scope:tgf_connoisseur_province_temp + is_healthy = yes + gdp_tgf_connoisseur_candidate_trigger = yes + } + } +} + +# this = trade route that trades jade in a market whose pool holds a skilled connoisseur +scripted_trigger gdp_tgf_connoisseur_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_connoisseur_route_temp + any_trade_market_on_route = { + gdp_tgf_connoisseur_market_trigger = { ROUTE = scope:tgf_connoisseur_route_temp } + } +} + +# The Gentleman's Stone +gdp_trade_good_flavor.3024 = { + type = character_event + title = gdp_trade_good_flavor.3024.t + desc = gdp_trade_good_flavor.3024.desc + theme = trade + override_background = { reference = gdp_artisan_street } + + left_portrait = { + character = root + animation = pondering + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_connoisseur + animation = holding_scales + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_connoisseur_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_connoisseur_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { gdp_tgf_connoisseur_market_trigger = { ROUTE = scope:tgf_route } } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + ordered_pool_character = { + province = scope:tgf_source_province + limit = { + gdp_tgf_connoisseur_candidate_trigger = yes + is_healthy = yes + } + order_by = { + value = stewardship + add = learning + } + save_scope_as = tgf_connoisseur + } + trade_good_type:trade_good_jade = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_connoisseur + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3024.a + remove_short_term_gold = minor_gold_value + if = { + limit = { + scope:tgf_route = { + is_selling_trade_good_in_market = { + trade_market = scope:tgf_market + trade_good_type = scope:tgf_good + } + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + } + else = { + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.03 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3024.b + add_courtier = scope:tgf_connoisseur + scope:tgf_connoisseur = { + add_stewardship_skill = 2 + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3024.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade route with a trader that carries ceramics across the sea +scripted_trigger gdp_tgf_sea_ceramics_route_trigger = { + is_commission_route = no + has_trader = yes + gdp_tgf_good_route_trigger = { GOOD = trade_good_ceramics } + any_road_on_route = { + any_road_province = { is_sea_province = yes } + } +} + +# Porcelain Ballast +gdp_trade_good_flavor.3025 = { + type = character_event + title = gdp_trade_good_flavor.3025.t + desc = gdp_trade_good_flavor.3025.desc + theme = trade + override_background = { reference = docks } + + left_portrait = { + character = root + animation = holding_tally_stick + camera = camera_event_very_left + } + right_portrait = { + character = scope:tgf_trader + animation = holding_yoke + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { gdp_tgf_sea_ceramics_route_trigger = yes } + } + + immediate = { + random_trade_route = { + limit = { gdp_tgf_sea_ceramics_route_trigger = yes } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + } + trade_good_type:trade_good_ceramics = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3025.a + add_trade_good_price_modifier = { + type = sell_mult + trade_good_type = scope:tgf_good + value = { value = 0.02 multiply = gdp_tgf_renown_tier_value } + years = 20 + } + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_ballast_trick + YEARS = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3025.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# The Sap Bites +gdp_trade_good_flavor.3026 = { + type = character_event + title = gdp_trade_good_flavor.3026.t + desc = gdp_trade_good_flavor.3026.desc + theme = merchant + override_background = { reference = gdp_carpentry_workshop } + + left_portrait = { + character = root + animation = trade_deal + camera = camera_body_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_route_trigger = { GOOD = trade_good_lacquerware } + } + } + + immediate = { + trade_good_type:trade_good_lacquerware = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3026.a + remove_short_term_gold = minor_gold_value + add_character_modifier = gdp_tgf_curing_room_modifier + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3026.b + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + random = { + chance = 30 + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3026.b.toast_rash + left_icon = root + add_character_modifier = { + modifier = gdp_tgf_lacquer_rash_modifier + years = 1 + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = patient factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3026.c + stress_impact = { + base = minor_stress_loss + impatient = major_stress_impact_gain + patient = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Creates the Reading Stones scope:tgf_glassmaker grinds for this character +# $OWNER$ is merchant or lord and picks the name key +scripted_effect gdp_tgf_create_reading_stones_effect = { + gdp_tgf_roll_artifact_rarity_effect = { RARITY = random } + create_artifact = { + name = gdp_tgf_reading_stones_artifact_$OWNER$ + description = gdp_tgf_reading_stones_artifact_desc + creator = scope:tgf_glassmaker + modifier = artifact_stewardship_1_modifier + type = miscellaneous + visuals = pocket_fancy_case + quality = scope:quality + wealth = scope:wealth + save_scope_as = newly_created_artifact + } + scope:newly_created_artifact = { set_variable = tgf_reading_stones } +} + +# Reading Stones +gdp_trade_good_flavor.3027 = { + type = character_event + title = gdp_trade_good_flavor.3027.t + desc = { + desc = gdp_trade_good_flavor.3027.desc.intro + first_valid = { + triggered_desc = { + trigger = { + OR = { + age >= 50 + has_trait = clouded_eyes + } + } + desc = gdp_trade_good_flavor.3027.desc.old_eyes + } + desc = gdp_trade_good_flavor.3027.desc.young_eyes + } + } + theme = trade + override_background = { reference = study } + + left_portrait = { + character = root + animation = reading + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_glassmaker + animation = merchant_box + camera = camera_event_right + } + lower_center_portrait = { + trigger = { + scope:tgf_market = { gdp_tgf_stranger_holder_market_trigger = yes } + } + character = scope:tgf_market_holder + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + trigger = { + NOR = { + has_character_flag = gdp_tgf_had_event_3027 + has_trait = blind + } + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_glass } + } + } + + immediate = { + add_character_flag = gdp_tgf_had_event_3027 + save_scope_as = tgf_lens_merchant + random_trade_route = { + limit = { + gdp_tgf_good_buy_pool_route_trigger = { GOOD = trade_good_glass } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_buy_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_glass + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder ?= { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_glassmaker + } + trade_good_type:trade_good_glass = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3027.a + pay_short_term_gold = { + target = scope:tgf_glassmaker + gold = minor_gold_value + } + gdp_tgf_create_reading_stones_effect = { OWNER = merchant } + gdp_tgf_add_artifact_trade_modifiers_effect = yes + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3027.b + trigger = { + scope:tgf_market = { gdp_tgf_stranger_holder_market_trigger = yes } + } + pay_short_term_gold = { + target = scope:tgf_glassmaker + gold = minor_gold_value + } + scope:tgf_market_holder = { + gdp_tgf_create_reading_stones_effect = { OWNER = lord } + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + scope:tgf_market = { + add_price_modifier_for_character = { + type = buy_mult + character = root + trade_good_type = scope:tgf_good + value = { value = -0.03 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = arrogant factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3027.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Feast-Day Prices +gdp_trade_good_flavor.3028 = { + type = character_event + title = gdp_trade_good_flavor.3028.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:tgf_source_faith = { OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } } + } + desc = gdp_trade_good_flavor.3028.desc.christian + } + desc = gdp_trade_good_flavor.3028.desc + } + desc = gdp_trade_good_flavor.3028.desc.outro + } + theme = trade + override_background = { reference = temple } + override_effect_2d = { reference = smoke } + + left_portrait = { + character = scope:tgf_trader + animation = thurible + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_sell_route_trigger = { GOOD = trade_good_incense } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_sell_route_trigger = { GOOD = trade_good_incense } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_incense + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + county = { + save_scope_as = tgf_source_county + faith = { save_scope_as = tgf_source_faith } + } + } + } + } + trade_good_type:trade_good_incense = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_trader + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3028.a + trigger = { faith = scope:tgf_source_faith } + reason = faith + add_stress = medium_stress_loss + add_piety = minor_piety_gain + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_minor_value + } + ai_chance = { + base = 100 + modifier = { has_trait = cynical factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3028.b + add_prestige = minor_prestige_loss + add_character_modifier = gdp_tgf_temple_supplier_modifier + ai_chance = { + base = 100 + modifier = { has_trait = greedy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3028.c + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = zealous factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# Theriac +gdp_trade_good_flavor.3029 = { + type = character_event + title = gdp_trade_good_flavor.3029.t + desc = gdp_trade_good_flavor.3029.desc + theme = trade + override_background = { reference = physicians_study } + + left_portrait = { + character = root + animation = holding_scales + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_apothecary + animation = physician + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_sell_pool_route_trigger = { GOOD = trade_good_medicaments } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_good_sell_pool_route_trigger = { GOOD = trade_good_medicaments } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_medicaments + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + weight = { + base = 1 + modifier = { + add = learning + } + } + save_scope_as = tgf_apothecary + } + trade_good_type:trade_good_medicaments = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3029.a + scope:tgf_route = { + gdp_tgf_add_tiered_route_modifier_effect = { + MODIFIER = gdp_tgf_theriac_peddlers + YEARS = 20 + } + every_trade_market_on_route = { + limit = { exists = trade_market_owner.title_province.county } + trade_market_owner.title_province.county = { + if = { + limit = { gdp_tgf_county_held_by_root_or_ai_trigger = yes } + gdp_tgf_add_tiered_county_modifier_effect = { + MODIFIER = gdp_tgf_theriac_supply + YEARS = 20 + } + } + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = lazy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3029.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3029.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + add_character_modifier = { + modifier = gdp_tgf_theriac_dose_modifier + years = 20 + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# No Paper for Charters +gdp_trade_good_flavor.3030 = { + type = character_event + title = gdp_trade_good_flavor.3030.t + desc = gdp_trade_good_flavor.3030.desc + theme = trade + override_background = { reference = study } + + left_portrait = { + character = scope:tgf_trader + animation = holding_scrolls + camera = camera_event_very_right_pointing_very_left + } + right_portrait = { + character = scope:tgf_market_holder + animation = dismissal + camera = camera_event_right + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + has_trader = yes + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_books_paper } + } + } + + immediate = { + random_trade_route = { + limit = { + has_trader = yes + gdp_tgf_good_sell_holder_route_trigger = { GOOD = trade_good_books_paper } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + trader = { save_scope_as = tgf_trader } + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_books_paper + } + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + county = { save_scope_as = tgf_source_county } + } + } + } + trade_good_type:trade_good_books_paper = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + trade_good_type:trade_good_leather = { + trade_good_need_category = { save_scope_as = tgf_leather_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + } + + option = { + name = gdp_trade_good_flavor.3030.a + duel = { + skill = diplomacy + target = scope:tgf_market_holder + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = gdp_trade_good_flavor.3030.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_trade_good_flavor.3030.a.success + right_icon = scope:tgf_market_holder + add_character_modifier = gdp_tgf_chancery_stationer_modifier + add_prestige = minor_prestige_gain + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = gdp_trade_good_flavor.3030.a.failure + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_trade_good_flavor.3030.a.failure + right_icon = scope:tgf_market_holder + add_prestige = minor_prestige_loss + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -10 + } + } + } + } + } + ai_chance = { + base = 100 + modifier = { has_trait = shy factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3030.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = trade_good_type:trade_good_leather + value = { value = 0.03 multiply = gdp_tgf_renown_tier_value } + years = 15 + } + } + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_leather_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3030.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_medium_value + } + ai_chance = { + base = 100 + modifier = { has_trait = impatient factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = trade market in a county of Frankish or Germanic culture, where brewers paid for gruit +scripted_trigger gdp_tgf_gruit_market_trigger = { + trade_market_owner.title_province.county.culture = { + OR = { + has_cultural_pillar = heritage_frankish + has_cultural_pillar = heritage_west_germanic + has_cultural_pillar = heritage_central_germanic + has_cultural_pillar = heritage_north_germanic + } + } +} + +# this = trade route that sells $GOOD$ to a stranger holder whose local pool holds an adult commoner +scripted_trigger gdp_tgf_good_sell_holder_pool_route_trigger = { + is_commission_route = no + save_temporary_scope_as = tgf_goodsell_route_temp + any_trade_market_on_route = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = scope:tgf_goodsell_route_temp + GOOD = $GOOD$ + } + gdp_tgf_good_sell_pool_market_trigger = { + ROUTE = scope:tgf_goodsell_route_temp + GOOD = $GOOD$ + } + gdp_tgf_gruit_market_trigger = yes + } +} + +# Gives root Hop Trader, or its renowned version when renowned in scope:tgf_category, upgrading an existing plain one +scripted_effect gdp_tgf_add_hop_trader_effect = { + if = { + limit = { NOT = { has_character_modifier = gdp_tgf_hop_trader_renowned_modifier } } + if = { + limit = { gdp_tgf_root_renowned_in_event_category_trigger = yes } + remove_character_modifier = gdp_tgf_hop_trader_modifier + add_character_modifier = gdp_tgf_hop_trader_renowned_modifier + } + else_if = { + limit = { NOT = { has_character_modifier = gdp_tgf_hop_trader_modifier } } + add_character_modifier = gdp_tgf_hop_trader_modifier + } + } +} + +# Gruit or Hops +gdp_trade_good_flavor.3031 = { + type = character_event + title = gdp_trade_good_flavor.3031.t + desc = gdp_trade_good_flavor.3031.desc + theme = trade + override_background = { reference = tavern } + + left_portrait = { + character = root + animation = toast_goblet + camera = camera_event_left + } + right_portrait = { + character = scope:tgf_brewer + animation = drink_goblet + camera = camera_event_right + } + lower_right_portrait = { + character = scope:tgf_market_holder + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + any_trade_route = { + gdp_tgf_good_sell_holder_pool_route_trigger = { GOOD = trade_good_beer } + } + } + + immediate = { + random_trade_route = { + limit = { + gdp_tgf_good_sell_holder_pool_route_trigger = { GOOD = trade_good_beer } + } + save_scope_as = tgf_route + } + scope:tgf_route = { + random_trade_market_on_route = { + limit = { + gdp_tgf_good_sell_holder_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_beer + } + gdp_tgf_good_sell_pool_market_trigger = { + ROUTE = scope:tgf_route + GOOD = trade_good_beer + } + gdp_tgf_gruit_market_trigger = yes + } + save_scope_as = tgf_market + } + } + scope:tgf_market = { + trade_market_owner = { + holder = { save_scope_as = tgf_market_holder } + title_province = { + save_scope_as = tgf_source_province + county = { save_scope_as = tgf_source_county } + } + } + } + random_pool_character = { + province = scope:tgf_source_province + limit = { + is_healthy = yes + has_no_particular_noble_roots_trigger = yes + is_physically_able_adult = yes + } + save_scope_as = tgf_brewer + } + trade_good_type:trade_good_beer = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = scope:tgf_brewer + PROVINCE = scope:tgf_market.trade_market_owner.title_province + } + } + + option = { + name = gdp_trade_good_flavor.3031.a + add_prestige = minor_prestige_loss + gdp_tgf_add_hop_trader_effect = yes + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = annoyed_opinion + opinion = -20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3031.b + scope:tgf_market = { + add_price_modifier_for_character = { + type = sell_mult + character = root + trade_good_type = scope:tgf_good + value = { value = 0.01 multiply = gdp_tgf_renown_tier_value } + years = 10 + } + } + scope:tgf_market_holder = { + add_opinion = { + target = root + modifier = grateful_opinion + opinion = 20 + } + } + ai_chance = { + base = 100 + modifier = { has_trait = ambitious factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3031.c + gdp_increase_trade_expertise_xp_effect = { + CATEGORY = scope:tgf_category + VALUE = trade_expertise_xp_major_value + } + ai_chance = { + base = 100 + modifier = { has_trait = stubborn factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} + +# this = province where get_region_fruit_plural knows a regional fruit +scripted_trigger gdp_tgf_has_region_fruit_trigger = { + OR = { + geographical_region = world_africa + geographical_region = world_africa_north + geographical_region = world_africa_sahara + geographical_region = world_asia_china + geographical_region = world_asia_japan + geographical_region = world_asia_korea + geographical_region = world_asia_minor + geographical_region = world_asia_sakhalin_hokkaido + geographical_region = world_asia_southeast + geographical_region = world_europe + geographical_region = world_europe_south + geographical_region = world_himalaya + geographical_region = world_india + geographical_region = world_middle_east + geographical_region = world_steppe + geographical_region = world_steppe_west + geographical_region = world_tibet + } +} + +# A Basket of Fruit +gdp_trade_good_flavor.3032 = { + type = character_event + title = gdp_trade_good_flavor.3032.t + desc = gdp_trade_good_flavor.3032.desc + theme = trade + override_background = { reference = market } + + left_portrait = { + character = root + animation = eating + camera = camera_event_left + } + + widget = { + gui = "event_window_widget_trade_good" + container = "custom_widgets_container" + } + + cooldown = { years = 50 } + + trigger = { + is_available_allow_travelling = yes + gdp_tgf_eligible_trigger = yes + exists = location.county + location = { gdp_tgf_has_region_fruit_trigger = yes } + } + + immediate = { + location = { + save_scope_as = tgf_fruit_province + county = { save_scope_as = tgf_source_county } + } + trade_good_type:trade_good_fruit = { + save_scope_as = tgf_good + trade_good_need_category = { save_scope_as = tgf_category } + } + gdp_tgf_set_widget_good_effect = { GOOD = scope:tgf_good } + gdp_tgf_set_background_location_effect = { + CHAR = root + PROVINCE = scope:tgf_fruit_province + } + } + + option = { + name = gdp_trade_good_flavor.3032.a + add_character_modifier = { + modifier = gdp_tgf_eye_for_fruit_modifier + years = 20 + } + ai_chance = { + base = 100 + modifier = { has_trait = content factor = 0 } + } + } + + option = { + name = gdp_trade_good_flavor.3032.b + add_stress = minor_stress_loss + ai_chance = { + base = 100 + modifier = { has_trait = temperate factor = 0 } + } + } + + after = { + gdp_tgf_clear_widget_good_effect = yes + } +} diff --git a/events/dlc/gdp/gdp_trade_league_events.txt b/events/dlc/gdp/gdp_trade_league_events.txt new file mode 100644 index 000000000..a25692e7b --- /dev/null +++ b/events/dlc/gdp/gdp_trade_league_events.txt @@ -0,0 +1,22 @@ +namespace = gdp_trade_league + +#Trade League Acceptance Letter +gdp_trade_league.1001 = { + + type = letter_event + opening = trade_league.1001.t + desc = trade_league.1001.desc + sender = scope:recipient + + trigger = { + is_ai = no + } + + immediate = { + } + + option = { + name = trade_league.1001.a + } +} + diff --git a/events/dlc/gdp/gdp_trade_scheme_events.txt b/events/dlc/gdp/gdp_trade_scheme_events.txt new file mode 100644 index 000000000..879157096 --- /dev/null +++ b/events/dlc/gdp/gdp_trade_scheme_events.txt @@ -0,0 +1,280 @@ +################################################## +# Events for the Merchant and Republic trade schemes +################################################## +namespace = gdp_trade_scheme + +### Improve Trade Routes +# One hidden roll event serves all three improve schemes, and every failure goes to .0003 +# It branches on the scheme type only to pick the success event + +# Resolution : rolled when the owner executes from the scheme preparation popup +gdp_trade_scheme.0001 = { + hidden = yes + + immediate = { + scope:scheme = { + scheme_owner = { + save_scope_as = owner + + random = { + chance = scope:scheme.scheme_success_chance + save_scope_value_as = { + name = scheme_successful + value = yes + } + } + + if = { + limit = { exists = scope:scheme_successful } + gdp_improve_trade_scheme_read_focus_effect = yes + } + + # A success with no surviving route left to improve resolves as a failure. + if = { + limit = { + NOT = { exists = scope:improved_trade_route } + } + trigger_event = gdp_trade_scheme.0003 + } + else_if = { + limit = { + scope:scheme = { scheme_type = gdp_improve_trade_capacity } + } + trigger_event = gdp_trade_scheme.0002 + } + else_if = { + limit = { + scope:scheme = { scheme_type = gdp_improve_trade_competitiveness } + } + trigger_event = gdp_trade_scheme.0004 + } + else_if = { + limit = { + scope:scheme = { scheme_type = gdp_improve_trade_expertise } + } + trigger_event = gdp_trade_scheme.0005 + } + # An improve scheme with no branch here still ends, as a failure. + else = { + trigger_event = gdp_trade_scheme.0003 + } + } + } + } +} + +# Success : Capacity +# We apply here, not in a show_as_tooltip option, so the modifier is not shown twice +gdp_trade_scheme.0002 = { + type = character_event + title = gdp_trade_scheme.0002.t + desc = gdp_trade_scheme.0002.desc + theme = stewardship + left_portrait = { + character = root + animation = trade_deal + } + + immediate = { + gdp_improve_trade_route_apply_effect = { MODIFIER = gdp_improve_trade_routes_capacity_modifier } + } + + option = { + name = gdp_trade_scheme.0002.a + scope:scheme ?= { end_scheme = yes } + } +} + +# Failure : shared by all three improve schemes +gdp_trade_scheme.0003 = { + type = character_event + title = gdp_trade_scheme.0003.t + desc = gdp_trade_scheme.0003.desc + # Shared by all three improve schemes, so the theme cannot be skill-specific. + theme = trade + left_portrait = { + character = root + animation = disapproval + } + + option = { + name = gdp_trade_scheme.0003.a + scope:scheme ?= { end_scheme = yes } + } +} + +# Success : Competitiveness +gdp_trade_scheme.0004 = { + type = character_event + title = gdp_trade_scheme.0004.t + desc = gdp_trade_scheme.0004.desc + theme = diplomacy + left_portrait = { + character = root + animation = trade_deal + } + + immediate = { + gdp_improve_trade_route_apply_effect = { MODIFIER = gdp_improve_trade_routes_competitiveness_modifier } + } + + option = { + name = gdp_trade_scheme.0004.a + scope:scheme ?= { end_scheme = yes } + } +} + +# Success : Expertise +gdp_trade_scheme.0005 = { + type = character_event + title = gdp_trade_scheme.0005.t + desc = gdp_trade_scheme.0005.desc + theme = learning + left_portrait = { + character = root + animation = trade_deal + } + + immediate = { + gdp_improve_trade_route_apply_effect = { MODIFIER = gdp_improve_trade_routes_expertise_modifier } + } + + option = { + name = gdp_trade_scheme.0005.a + scope:scheme ?= { end_scheme = yes } + } +} + +### Disrupt Trade Routes + +# Resolution : rolled when the owner executes from the scheme preparation popup +gdp_trade_scheme.0011 = { + hidden = yes + + immediate = { + scope:scheme = { + scheme_target_character = { save_scope_as = target } + scheme_owner = { + save_scope_as = owner + + # Secret schemes also roll for discovery at payoff + # We skip it when already exposed so the opinion is not charged twice + if = { + limit = { scope:scheme ?= { is_scheme_exposed = no } } + save_scope_value_as = { + name = discovery_chance + value = { + value = 100 + subtract = scope:scheme.scheme_secrecy + } + } + random = { + chance = scope:discovery_chance + save_scope_value_as = { + name = scheme_discovered + value = yes + } + } + } + + random = { + chance = scope:scheme.scheme_success_chance + save_scope_value_as = { + name = scheme_successful + value = yes + } + } + + if = { + limit = { exists = scope:scheme_successful } + gdp_disrupt_trade_routes_roll_effect = yes + } + + # A success with no surviving route left to hit resolves as a failure. + if = { + limit = { exists = scope:disrupted_trade_route } + trigger_event = gdp_trade_scheme.0012 + } + else = { + trigger_event = gdp_trade_scheme.0013 + } + } + } + } +} + +# Success +gdp_trade_scheme.0012 = { + type = character_event + title = gdp_trade_scheme.0012.t + desc = { + first_valid = { + triggered_desc = { + trigger = { scope:disrupted_route_stat ?= flag:capacity } + desc = gdp_trade_scheme.0012.desc_capacity + } + desc = gdp_trade_scheme.0012.desc_competitiveness + } + triggered_desc = { + trigger = { exists = scope:scheme_discovered } + desc = gdp_trade_scheme.0012.desc_discovered + } + } + theme = intrigue + left_portrait = { + character = root + animation = scheme + } + right_portrait = { + character = scope:target + animation = worry + } + + immediate = { + gdp_disrupt_trade_routes_apply_effect = yes + gdp_disrupt_trade_routes_notify_target_effect = yes + gdp_disrupt_trade_routes_discovered_effect = yes + } + + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:scheme_discovered } + desc = gdp_trade_scheme.0012.a_discovered + } + desc = gdp_trade_scheme.0012.a + } + } + } + scope:scheme ?= { end_scheme = yes } + } +} + +# Failure +gdp_trade_scheme.0013 = { + type = character_event + title = gdp_trade_scheme.0013.t + desc = { + desc = gdp_trade_scheme.0013.desc + triggered_desc = { + trigger = { exists = scope:scheme_discovered } + desc = gdp_trade_scheme.0013.desc_discovered + } + } + theme = intrigue + left_portrait = { + character = root + animation = disapproval + } + + immediate = { + gdp_disrupt_trade_routes_discovered_effect = yes + } + + option = { + name = gdp_trade_scheme.0013.a + scope:scheme ?= { end_scheme = yes } + } +} diff --git a/events/dlc/gdp/gdp_visit_holding_decision_event.txt b/events/dlc/gdp/gdp_visit_holding_decision_event.txt new file mode 100644 index 000000000..806607bce --- /dev/null +++ b/events/dlc/gdp/gdp_visit_holding_decision_event.txt @@ -0,0 +1,5003 @@ +namespace = gdp_visit_holding_decision_event + +###################################################################### +# MAIN +# gdp_visit_holding_decision_event.1000 +###################################################################### +# > Visit Market/Docks +# > Visit Guild +# > Holding Option (Visit Church / Visit Patron) + +#Enter Holding Main Hub +gdp_visit_holding_decision_event.1000 = { + type = character_event + title = gdp_visit_holding_decision_event.1000.t + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1000.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = courtyard } + + center_portrait = { + character = root + animation = deliberation + } + immediate = { + suzerain = { save_scope_as = patron } + #For loc purposes + if = { + limit = { + NOT = { exists = scope:visiting_location } + } + location = { save_scope_as = visiting_location } + } + visit_holding_ensure_visiting_associate_effect = yes + gdp_merchant_legacy_4_visit_entrepot_effect = yes + } + #Visit Craftsmen Guilds + option = { + name = gdp_visit_holding_decision_event.1000.a + reason = craftsmen_guild + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1000.guilds.inaccessible.tt + visit_holding_guilds_blocked_trigger = no + } + } + show_as_unavailable = { always = yes } + custom_tooltip = gdp_visit_holding_decision_event.1000.a.tt + visit_holding_mark_hub_area_visited_effect = yes + trigger_event = gdp_visit_holding_decision_event.1110 + } + #Visit Holder: Patron + option = { + name = gdp_visit_holding_decision_event.1000.b + reason = patron + trigger = { + NOT = { + location = { + holding_is_church = yes + } + } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1000.patron.no_patron.tt + is_landless_merchant = yes + suzerain = { + NOT = { this = root } + is_ai = yes + } + } + custom_tooltip = { + text = gdp_guards_were_summoned.tt + NOT = { has_variable = 1200_guards_summoned } + } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1000.patron.inaccessible.tt + visit_holding_patron_blocked_trigger = no + } + } + custom_tooltip = gdp_visit_holding_decision_event.1000.b.tt + visit_holding_mark_hub_area_visited_effect = yes + trigger_event = gdp_visit_holding_decision_event.1200 + } + #Visit Market + option = { + name = gdp_visit_holding_decision_event.1000.c + trigger = { + location = { is_coastal = no } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1000.market.inaccessible.tt + visit_holding_market_dock_blocked_trigger = no + } + } + show_as_unavailable = { + location = { is_coastal = no } + } + reason = marketplace + custom_tooltip = gdp_visit_holding_decision_event.1000.c.tt + visit_holding_mark_hub_area_visited_effect = yes + trigger_event = gdp_visit_holding_decision_event.1300 + } + #Visit Holy Site: Visit the local Holy Site + option = { + name = gdp_visit_holding_decision_event.1000.f + trigger = { + location = { + OR = { + has_holding_type = church_holding + has_holding_type = temple_citadel_holding + } + } + + # What about critically failing? + custom_tooltip = { + text = gdp_visit_holding_caught_stealing.tt + NOT = { has_variable = 1500_caught_stealing } + } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1000.worship.inaccessible.tt + visit_holding_worship_blocked_trigger = no + } + } + show_as_unavailable = { + location = { + OR = { + has_holding_type = church_holding + has_holding_type = temple_citadel_holding + } + } + } + reason = church_holding + #Actual transition event + custom_tooltip = gdp_visit_holding_decision_event.1000.f.tt + visit_holding_mark_hub_area_visited_effect = yes + trigger_event = gdp_visit_holding_decision_event.1500 + } + #Visit Docks + option = { + name = gdp_visit_holding_decision_event.1000.e + trigger = { + location = { is_coastal = yes } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1000.docks.inaccessible.tt + visit_holding_market_dock_blocked_trigger = no + } + } + show_as_unavailable = { + location = { is_coastal = yes } + } + reason = docks + custom_tooltip = gdp_visit_holding_decision_event.1000.e.tt + visit_holding_mark_hub_area_visited_effect = yes + trigger_event = gdp_visit_holding_decision_event.1400 + } + #Leave/Opt out + option = { + name = { + text = { + first_valid = { + # Been everywhere, done everything + triggered_desc = { + trigger = { visit_holding_decision_all_options_exhausted_trigger = yes } + desc = gdp_visit_holding_decision_event.1000.d.exhausted + } + # Been nowhere at all, turning on the spot + triggered_desc = { + trigger = { + NOT = { has_variable = gdp_visit_holding_been_to_area } + } + desc = gdp_visit_holding_decision_event.1000.d.changed_mind + } + # Fallback + desc = gdp_visit_holding_decision_event.1000.d + } + } + } + flavor = { + # Not been anywhere + triggered_desc = { + trigger = { + NOT = { has_variable = gdp_visit_holding_been_to_area } + } + desc = gdp_visit_holding_decision_event.1000.d.changed_mind.tt + } + # Fallback + desc = gdp_visit_holding_decision_event.1000.d.tt + } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit ?= { visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit ?= {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit ?= {visit_holding_clean_up_variables_effect = yes } + if = { + limit = { scope:negotiator ?= { has_character_flag = gdp_1200_temp_negotiator } } + scope:negotiator = { silent_disappearance_effect = yes } + } + } +} + +###################################################################### +# CRAFTSMEN GUILD +# gdp_visit_holding_decision_event.1110 +###################################################################### +# > Improve Artifacts +# > Arms and Armor +# > The Guild Master + +#Visit Craftsmen Guild +gdp_visit_holding_decision_event.1110 = { + type = character_event + title = gdp_visit_holding_decision_event.1110.t + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1110.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = gdp_artisan_street_crowd } + + left_portrait = { + character = root + animation = steward + camera = camera_event_scheme_center + } + #Visit Curator + option = { + name = gdp_visit_holding_decision_event.1110.a + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1110.a.no.arfitfacts.tt + any_character_artifact = { + OR = { + rarity = common + rarity = masterwork + } + NOT = { artifact_type = creature } + } + } + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1110.a.cooldown.tt + NOT = { has_variable = 1111_has_improved_artifact_recently } + } + } + show_as_unavailable = { always = yes } + reason = curator + custom_tooltip = gdp_visit_holding_decision_event.1110.a.tt + trigger_event = gdp_visit_holding_decision_event.1111 + } + #Visit Blacksmith + option = { + name = gdp_visit_holding_decision_event.1110.b + trigger = { + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1110.b.cooldown.tt + NOT = { has_variable = 1111_has_bought_artifact_recently } + } + } + show_as_unavailable = { always = yes } + reason = blacksmith + custom_tooltip = gdp_visit_holding_decision_event.1110.b.tt + trigger_event = gdp_visit_holding_decision_event.1112 + } + #Visit Guild Master + option = { + name = gdp_visit_holding_decision_event.1110.c + trigger = { + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1110.c.cooldown.tt + NOT = { has_variable = 1110_visited_guild_master_recently } + } + } + show_as_unavailable = { always = yes } + reason = guild_master + custom_tooltip = gdp_visit_holding_decision_event.1110.c.tt + trigger_event = gdp_visit_holding_decision_event.1113 + } + #Leave + option = { + name = gdp_visit_holding_decision_event.1110.d + custom_tooltip = gdp_visit_holding_decision_event.1110.d.tt + trigger_event = gdp_visit_holding_decision_event.1000 + } +} + +#Find common and masterwork artifacts to improve +scripted_effect 1111_set_artifact_effect = { + every_character_artifact = { + limit = { + OR = { + rarity = common + rarity = masterwork + } + # Animals are living creatures and cannot be improved by the Curator + NOT = { artifact_type = creature } + } + add_to_list = owned_artifacts + } + random_in_list = { + list = owned_artifacts + weight = { + base = 1 + modifier = { + add = 9 + rarity = common + } + modifier = { + add = 5 + rarity = masterwork + } + } + save_scope_as = artifact_target_1 + } + random_in_list = { + list = owned_artifacts + limit = { this != scope:artifact_target_1 } + weight = { + base = 1 + modifier = { + add = 9 + rarity = common + } + modifier = { + add = 5 + rarity = masterwork + } + } + save_scope_as = artifact_target_2 + } + random_in_list = { + list = owned_artifacts + limit = { + AND = { + this != scope:artifact_target_1 + this != scope:artifact_target_2 + } + } + weight = { + base = 1 + modifier = { + add = 9 + rarity = common + } + modifier = { + add = 5 + rarity = masterwork + } + } + save_scope_as = artifact_target_3 + } +} +#Discount if you are good at stewardship or learning +scripted_effect 1111_artifact_cost_effect = { + save_scope_value_as = { + name = $COST_NAME$ + value = { + value = $GOLD_VALUE$ + if = { + limit = { + scope:liege = { stewardship >= average_skill_level } + } + subtract = { + value = $GOLD_VALUE$ + multiply = 0.1 + } + } + if = { + limit = { + scope:liege = { learning >= average_skill_level } + } + subtract = { + value = $GOLD_VALUE$ + multiply = 0.1 + } + } + if = { + limit = { + scope:liege = { learning >= good_skill_level } + } + subtract = { + value = $GOLD_VALUE$ + multiply = 0.1 + } + } + } + } +} +scripted_effect 1111_artifact_value_effect = { + #Expensive + if = { + limit = { rarity = masterwork } + 1111_artifact_cost_effect = { GOLD_VALUE = root.major_gold_value COST_NAME = $COST_NAME$ } + } + #OK price + else_if = { + limit = { rarity = common } + 1111_artifact_cost_effect = { GOLD_VALUE = root.medium_gold_value COST_NAME = $COST_NAME$ } + } +} +scripted_effect 1111_artifact_increase_rarity_effect = { + switch = { + trigger = rarity + common = { set_artifact_rarity = masterwork } + masterwork = { set_artifact_rarity = famed } + } +} + +#Visit Curator: Improve Artifacts +gdp_visit_holding_decision_event.1111 = { + type = character_event + title = gdp_visit_holding_decision_event.1111.t + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1111.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = study } + + artifact = { + target = scope:artifact_target_1 + position = lower_left_portrait + } + artifact = { + target = scope:artifact_target_2 + position = lower_center_portrait + } + artifact = { + target = scope:artifact_target_3 + position = lower_right_portrait + } + left_portrait = { + character = root + animation = chess_certain_win + camera = camera_event_scheme_center_look_right + } + right_portrait = { + character = scope:curator + animation = eccentric + } + + immediate = { + 1111_set_artifact_effect = yes + root = { save_scope_as = liege } + suzerain = { save_scope_as = patron } + if = { + limit = { + NOT = { exists = scope:curator } + } + create_character = { + template = curator_template + location = root.location + culture = root.location.culture + faith = root.location.faith + save_scope_as = curator + } + } + scope:curator = { save_scope_as = antiquarian_from_task } + #Pre-compute each offered artifact's cost so options can be gated on available gold + if = { + limit = { exists = scope:artifact_target_1 } + scope:artifact_target_1 = { 1111_artifact_value_effect = { COST_NAME = 1111_artifact_cost_1 } } + } + else = { save_scope_value_as = { name = 1111_artifact_cost_1 value = 0 } } + if = { + limit = { exists = scope:artifact_target_2 } + scope:artifact_target_2 = { 1111_artifact_value_effect = { COST_NAME = 1111_artifact_cost_2 } } + } + else = { save_scope_value_as = { name = 1111_artifact_cost_2 value = 0 } } + if = { + limit = { exists = scope:artifact_target_3 } + scope:artifact_target_3 = { 1111_artifact_value_effect = { COST_NAME = 1111_artifact_cost_3 } } + } + else = { save_scope_value_as = { name = 1111_artifact_cost_3 value = 0 } } + } + + option = { + name = gdp_visit_holding_decision_event.1111.a + trigger = { + short_term_gold >= scope:1111_artifact_cost_1 + } + show_as_unavailable = { short_term_gold < scope:1111_artifact_cost_1 } + scope:artifact_target_1 = { + save_scope_as = artifact_target + 1111_artifact_increase_rarity_effect = yes + hidden_effect = { antiquarian_improve_artifact_effect = yes } + } + custom_tooltip = gdp_visit_holding_decision_event.1111.a.tt + pay_short_term_gold = { + target = scope:patron + gold = scope:1111_artifact_cost_1 + } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1111_has_improved_artifact_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + + option = { + name = gdp_visit_holding_decision_event.1111.b + trigger = { + exists = scope:artifact_target_2 + short_term_gold >= scope:1111_artifact_cost_2 + } + show_as_unavailable = { exists = scope:artifact_target_2 short_term_gold < scope:1111_artifact_cost_2 } + scope:artifact_target_2 = { + save_scope_as = artifact_target + 1111_artifact_increase_rarity_effect = yes + hidden_effect = { antiquarian_improve_artifact_effect = yes } + } + custom_tooltip = gdp_visit_holding_decision_event.1111.b.tt + pay_short_term_gold = { + target = scope:patron + gold = scope:1111_artifact_cost_2 + } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1111_has_improved_artifact_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + + option = { + name = gdp_visit_holding_decision_event.1111.c + trigger = { + exists = scope:artifact_target_3 + short_term_gold >= scope:1111_artifact_cost_3 + } + show_as_unavailable = { exists = scope:artifact_target_3 short_term_gold < scope:1111_artifact_cost_3 } + scope:artifact_target_3 = { + save_scope_as = artifact_target + 1111_artifact_increase_rarity_effect = yes + hidden_effect = { antiquarian_improve_artifact_effect = yes } + } + custom_tooltip = gdp_visit_holding_decision_event.1111.c.tt + pay_short_term_gold = { + target = scope:patron + gold = scope:1111_artifact_cost_3 + } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1111_has_improved_artifact_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + #Go Back To Previous + option = { + name = gdp_visit_holding_decision_event.1111.d + custom_tooltip = gdp_visit_holding_decision_event.1111.d.tt + trigger_event = gdp_visit_holding_decision_event.1110 + } +} +scripted_effect 1112_artifact_arms_armor_creation_effect = { + if = { + limit = { + NOT = { exists = scope:arms_armor_artifact_1 } + } + 1112_artifact_arms_armor_rarity_effect = yes + #Generate weapon + create_artifact_weapon_effect = { + OWNER = scope:blacksmith + CREATOR = scope:blacksmith + SET_WEAPON_TYPE = flag:no + } + #Finalization + scope:newly_created_artifact ?= { save_scope_as = arms_armor_artifact_1 } + } + if = { + limit = { + NOT = { exists = scope:arms_armor_artifact_2 } + } + 1112_artifact_arms_armor_rarity_effect = yes + #Generate armor + create_artifact_armor_effect = { + OWNER = scope:blacksmith + CREATOR = scope:blacksmith + SET_ARMOR_TYPE = flag:no + } + #Finalization + scope:newly_created_artifact ?= { save_scope_as = arms_armor_artifact_2 } + } + if = { + limit = { + NOT = { exists = scope:arms_armor_artifact_3 } + } + 1112_artifact_arms_armor_rarity_effect = yes + random_list = { + #Generate weapon OR armor + 50 = { + create_artifact_weapon_effect = { + OWNER = scope:blacksmith + CREATOR = scope:blacksmith + SET_WEAPON_TYPE = flag:no + } + } + 50 = { + create_artifact_armor_effect = { + OWNER = scope:blacksmith + CREATOR = scope:blacksmith + SET_ARMOR_TYPE = flag:no + } + } + } + #Finalization + scope:newly_created_artifact ?= { save_scope_as = arms_armor_artifact_3 } + } + scope:arms_armor_artifact_1 = { 1112_artifact_arms_armor_value_effect = yes } + scope:arms_armor_artifact_2 = { 1112_artifact_arms_armor_value_effect = yes } + scope:arms_armor_artifact_3 = { 1112_artifact_arms_armor_value_effect = yes } +} +scripted_effect 1112_artifact_arms_armor_rarity_effect = { + random_list = { + 20 = { set_artifact_rarity_famed = yes } + 40 = { set_artifact_rarity_masterwork = yes } + 80 = { set_artifact_rarity_common = yes } + } +} +scripted_effect 1112_artifact_arms_armor_value_effect = { + set_variable = { + name = 1112_artifact_value + value = { + value = artifact_wealth_quality_average_value + multiply = 4 + multiply = { 0.9 1.1 } + } + } +} + +#Visit Blacksmith : Arms and Armor +gdp_visit_holding_decision_event.1112 = { + type = character_event + title = gdp_visit_holding_decision_event.1112.t + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1112.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = gdp_smithy_workshop } + + artifact = { + target = scope:arms_armor_artifact_1 + position = lower_left_portrait + } + artifact = { + target = scope:arms_armor_artifact_2 + position = lower_center_portrait + } + artifact = { + target = scope:arms_armor_artifact_3 + position = lower_right_portrait + } + left_portrait = { + character = root + animation = inspect_weapon + camera = camera_event_group_talking_left_left + } + right_portrait = { + character = scope:blacksmith + animation = menacing + camera = camera_event_center_away_pointing_left_fov25 + } + + immediate = { + if = { + limit = { + NOT = { exists = scope:blacksmith } + } + create_character = { + template = generic_peasant_character + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + save_scope_as = blacksmith + after_creation = { remove_character_flag = peasant_outfit } + } + } + scope:blacksmith = { + #Create New Artifact + hidden_effect_new_object = { 1112_artifact_arms_armor_creation_effect = yes } + } + } + option = { + name = gdp_visit_holding_decision_event.1112.a + trigger = { + short_term_gold >= scope:arms_armor_artifact_1.var:1112_artifact_value + } + show_as_unavailable = { short_term_gold < scope:arms_armor_artifact_1.var:1112_artifact_value } + pay_short_term_gold = { + target = scope:blacksmith + gold = scope:arms_armor_artifact_1.var:1112_artifact_value + } + scope:arms_armor_artifact_1 = { set_owner = root } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1111_has_bought_artifact_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + option = { + name = gdp_visit_holding_decision_event.1112.b + trigger = { + short_term_gold >= scope:arms_armor_artifact_2.var:1112_artifact_value + } + show_as_unavailable = { short_term_gold < scope:arms_armor_artifact_2.var:1112_artifact_value } + pay_short_term_gold = { + target = scope:blacksmith + gold = scope:arms_armor_artifact_2.var:1112_artifact_value + } + scope:arms_armor_artifact_2 = { set_owner = root } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1111_has_bought_artifact_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + option = { + name = gdp_visit_holding_decision_event.1112.c + trigger = { + short_term_gold >= scope:arms_armor_artifact_3.var:1112_artifact_value + } + show_as_unavailable = { short_term_gold < scope:arms_armor_artifact_3.var:1112_artifact_value } + pay_short_term_gold = { + target = scope:blacksmith + gold = scope:arms_armor_artifact_3.var:1112_artifact_value + } + scope:arms_armor_artifact_3 = { set_owner = root } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1111_has_bought_artifact_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + option = { + name = gdp_visit_holding_decision_event.1112.d + custom_tooltip = gdp_visit_holding_decision_event.1112.d.tt + trigger_event = gdp_visit_holding_decision_event.1110 + } +} + +scripted_effect 1113_guild_master_duel_skill_effect = { + if = { + limit = { + scope:guild_master = { has_trait = education_stewardship_4 } + } + 1113_duel_effect = { SKILL = stewardship } + } + else_if = { + limit = { + scope:guild_master = { has_trait = education_learning_4 } + } + 1113_duel_effect = { SKILL = learning } + } + else_if = { + limit = { + scope:guild_master = { has_trait = education_diplomacy_4 } + } + 1113_duel_effect = { SKILL = diplomacy } + } +} +scripted_effect 1113_lifestyle_xp_gain_per_type_effect = { + if = { + limit = { has_trait = education_diplomacy } + add_diplomacy_lifestyle_xp = minor_lifestyle_xp + } + else_if = { + limit = { has_trait = education_martial } + add_martial_lifestyle_xp = minor_lifestyle_xp + } + else_if = { + limit = { has_trait = education_stewardship } + add_stewardship_lifestyle_xp = minor_lifestyle_xp + } + else_if = { + limit = { has_trait = education_intrigue } + add_intrigue_lifestyle_xp = minor_lifestyle_xp + } + else_if = { + limit = { has_trait = education_learning } + add_learning_lifestyle_xp = minor_lifestyle_xp + } + else = { + custom_tooltip = gdp_visit_holding_decision_event.1113.a.child + education_point_acquisition_additional_points_effect = { LEVEL = low } + } +} +scripted_effect 1113_duel_effect = { + duel = { + skill = $SKILL$ + target = scope:guild_master + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -35 + } + desc = gdp_visit_holding_decision_event.1113.a.success + send_interface_toast = { + title = gdp_visit_holding_decision_event.1113.a.success + left_icon = root + right_icon = scope:guild_master + add_character_modifier = { + modifier = gdp_guild_master_inpiration_$SKILL$_modifier + years = 5 + } + scope:visiting_associate = { + 1113_lifestyle_xp_gain_per_type_effect = yes + } + } + + } + #Failure: Increased price for supplies + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1113.a_$SKILL$.failure + send_interface_toast = { + title = gdp_visit_holding_decision_event.1113.a_$SKILL$.failure + left_icon = root + right_icon = scope:guild_master + custom_tooltip = gdp_visit_holding_decision_event.1113.a.failure.tt + } + } + } +} + +#Visit Guild Master +gdp_visit_holding_decision_event.1113 = { + type = character_event + title = gdp_visit_holding_decision_event.1113.t + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1113.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = study } + + left_portrait = { + character = scope:visiting_associate + animation = stressed_teacher + camera = camera_event_donkey_left_forward_centered + } + center_portrait = { + character = root + animation = throne_room_writer + camera = camera_event_horse_right_facing_left_close + } + + right_portrait = { + character = scope:guild_master + animation = debating + camera = camera_event_scheme_vs_extra_right_look_left + } + + immediate = { + if = { + limit = { + NOT = { exists = scope:guild_master } + } + create_character = { + template = guild_master_template + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + save_scope_as = guild_master + } + } + visit_holding_ensure_visiting_associate_effect = yes + } + option = { + name = gdp_visit_holding_decision_event.1113.a + 1113_guild_master_duel_skill_effect = yes + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1110_visited_guild_master_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + option = { + name = gdp_visit_holding_decision_event.1113.b + custom_tooltip = gdp_visit_holding_decision_event.1113.b.tt + scope:visiting_associate = { 1113_lifestyle_xp_gain_per_type_effect = yes } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1110_visited_guild_master_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + option = { + name = gdp_visit_holding_decision_event.1113.c + custom_tooltip = gdp_visit_holding_decision_event.1113.c.tt + 1113_lifestyle_xp_gain_per_type_effect = yes + if = { + limit = { has_trait = lifestyle_merchant } + if = { + limit = { has_realm_law = company_purpose_creditor } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + } + else_if = { + limit = { has_realm_law = company_purpose_artisan } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_minor_value + } + } + else_if = { + limit = { has_realm_law = company_purpose_caravaneer } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_minor_value + } + } + } + visit_holding_set_option_cooldown_guilds_effect = { VAR = 1110_visited_guild_master_recently } + trigger_event = gdp_visit_holding_decision_event.1110 + } + option = { + name = gdp_visit_holding_decision_event.1113.d + custom_tooltip = gdp_visit_holding_decision_event.1113.d.tt + trigger_event = gdp_visit_holding_decision_event.1110 + } +} + +###################################################################### +# VISIT MARKET (Inland Location) +# gdp_visit_holding_decision_event.1300 +# VISIT DOCKS (Coastal Location) +# gdp_visit_holding_decision_event.1400 +###################################################################### +# > Recruit Interesting People +# > Visit Foreign Traders + +scripted_effect set_foreign_caravaneer_culture = { + random_empire = { + limit = { + any_de_jure_county = { + culture != root.culture + culture = { has_cultural_tradition = tradition_saharan_traders } + } + } + random_de_jure_county = { + limit = { + culture != root.culture + culture = { has_cultural_tradition = tradition_saharan_traders } + } + save_scope_as = carvaneer_origin + } + } +} + +#Rare: Spawn Monk +scripted_effect visit_holding_try_spawn_monk_effect = { + if = { + limit = { + NOT = { has_variable = visit_holding_checked_for_monk } + NOT = { exists = scope:monk } + NOT = { visit_holding_rare_spawn_already_seen_trigger = { SCENE = monk } } + } + random_list = { + 100 = { + #Search for monk in pool + if = { + limit = { + NOT = { exists = scope:monk } + } + random_pool_character = { + province = scope:visiting_location + limit = { + is_available_healthy_adult = yes + has_trait = devoted + faith = scope:visiting_location.faith + learning >= high_skill_rating + } + save_scope_as = monk + } + } + #Otherwise create them + if = { + limit = { + NOT = { exists = scope:monk } + } + create_character = { + template = monk_character_template + location = scope:visiting_location + dynasty = none + culture = scope:visiting_location.culture + faith = scope:visiting_location.faith + learning = { high_skill_rating very_high_skill_rating } + save_scope_as = monk + after_creation = { + add_character_flag = created + } + } + } + if = { + limit = { exists = scope:monk } + visit_holding_mark_rare_spawn_seen_effect = { SCENE = monk } + } + } + } + set_variable = visit_holding_checked_for_monk + } +} +#Rare: Spawn seasoned Caravaneer +scripted_effect visit_holding_try_spawn_caravaneer_effect = { + if = { + limit = { + NOT = { has_variable = visit_holding_checked_for_caravaneer } + NOT = { exists = scope:caravaneer } + NOT = { visit_holding_rare_spawn_already_seen_trigger = { SCENE = caravaneer } } + } + random_list = { + 100 = { + #Search for caravaneer in pool + if = { + limit = { + NOT = { exists = scope:caravaneer } + } + random_pool_character = { + province = scope:visiting_location + limit = { + is_available_healthy_adult = yes + culture = { has_cultural_tradition = tradition_saharan_traders } + has_education_stewardship_trigger = yes + stewardship >= high_skill_rating + } + save_scope_as = caravaneer + } + } + #Otherwise create them + if = { + limit = { + NOT = { exists = scope:caravaneer } + } + set_foreign_caravaneer_culture = yes + if = { + limit = { + NOT = { exists = scope:carvaneer_origin } + } + scope:visiting_location = { save_scope_as = carvaneer_origin } + } + create_character = { + template = gdp_seasoned_caravaneer_template + location = scope:visiting_location + dynasty = none + culture = scope:carvaneer_origin.culture + faith = scope:carvaneer_origin.faith + gender_female_chance = 50 + save_scope_as = caravaneer + after_creation = { + add_character_flag = created + set_location = root.location + random_list = { + 50 = { + add_random_tiered_trait_track_xp_effect = { + TRAIT = lifestyle_traveler + TRACK = travel + LEVEL_1 = yes + LEVEL_3 = no + } + } + 50 = { + add_random_tiered_trait_track_xp_effect = { + TRAIT = lifestyle_traveler + TRACK = danger + LEVEL_1 = yes + LEVEL_3 = no + } + } + } + } + } + } + if = { + limit = { exists = scope:caravaneer } + visit_holding_mark_rare_spawn_seen_effect = { SCENE = caravaneer } + } + } + } + set_variable = visit_holding_checked_for_caravaneer + } +} +#Rare: Spawn Seasoned Sea Captain +scripted_effect visit_holding_try_spawn_sea_captain_effect = { + if = { + limit = { + NOT = { has_variable = visit_holding_checked_for_sea_captain } + NOT = { exists = scope:sea_captain } + location ?= { is_coastal = yes } + NOT = { visit_holding_rare_spawn_already_seen_trigger = { SCENE = sea_captain } } + } + random_list = { + 100 = { + #Search for sea captain in pool + if = { + limit = { + NOT = { exists = scope:sea_captain } + } + random_pool_character = { + province = scope:visiting_location + limit = { + is_available_healthy_adult = yes + has_trait = forder + visit_holding_stewardship_education_min_2_trigger = yes + stewardship >= high_skill_rating + } + save_scope_as = sea_captain + if = { + limit = { + NOT = { has_trait = one_legged } + } + add_trait = one_legged + } + } + } + #Otherwise create them + if = { + limit = { + NOT = { exists = scope:sea_captain } + } + create_character = { + template = weird_sailor_template + location = scope:visiting_location + dynasty = none + culture = scope:visiting_location.culture + faith = scope:visiting_location.faith + trait = education_stewardship_2 + stewardship = { high_skill_rating very_high_skill_rating } + save_scope_as = sea_captain + after_creation = { + add_character_flag = created + } + } + } + if = { + limit = { exists = scope:sea_captain } + visit_holding_ensure_stewardship_education_min_2_effect = { CHARACTER = scope:sea_captain } + visit_holding_mark_rare_spawn_seen_effect = { SCENE = sea_captain } + } + } + } + set_variable = visit_holding_checked_for_sea_captain + } +} +#Rare: Spawn Carnival Character +scripted_effect visit_holding_try_spawn_carnival_jester_effect = { + if = { + limit = { + NOT = { has_variable = visit_holding_checked_for_carnival_jester } + NOT = { exists = scope:carnival_jester } + location ?= { is_coastal = no } + NOT = { visit_holding_rare_spawn_already_seen_trigger = { SCENE = carnival_jester } } + } + random_list = { + 100 = { + #Search for carnival jester in pool + if = { + limit = { + NOT = { exists = scope:carnival_jester } + } + random_pool_character = { + province = scope:visiting_location + limit = { + is_available_healthy_adult = yes + has_trait = gregarious + intrigue >= high_skill_rating + } + save_scope_as = carnival_jester + add_character_flag = jester_outfit + } + } + #Otherwise create them + if = { + limit = { + NOT = { exists = scope:carnival_jester } + } + create_character = { + template = jester_template + location = scope:visiting_location + dynasty = none + culture = scope:visiting_location.culture + faith = scope:visiting_location.faith + gender_female_chance = 50 + intrigue = { high_skill_rating very_high_skill_rating } + save_scope_as = carnival_jester + after_creation = { + add_character_flag = jester_outfit + add_character_flag = created + } + } + } + if = { + limit = { exists = scope:carnival_jester } + visit_holding_mark_rare_spawn_seen_effect = { SCENE = carnival_jester } + } + } + } + set_variable = visit_holding_checked_for_carnival_jester + } +} +#Fallback: Spawn a former palace cook if no other rare character appeared +scripted_effect visit_holding_try_spawn_cook_effect = { + if = { + limit = { + NOT = { has_variable = visit_holding_checked_for_cook } + NOT = { visit_holding_rare_spawn_already_seen_trigger = { SCENE = cook } } + } + random_list = { + 100 = { + #Search for a cook in pool + if = { + limit = { + NOT = { exists = scope:cook } + } + random_pool_character = { + province = scope:visiting_location + limit = { + is_available_healthy_adult = yes + NOT = { has_trait = devoted } + stewardship >= high_skill_rating + NOR = { + has_trait = generous + has_trait = profligate + has_trait = improvident + } + } + save_scope_as = cook + } + } + #Otherwise create them + if = { + limit = { + NOT = { exists = scope:cook } + } + create_character = { + template = bp1_yearly_2021_stewardship_person_template + location = scope:visiting_location + trait = arrogant + trait = gluttonous + dynasty = none + culture = scope:visiting_location.culture + faith = scope:visiting_location.faith + stewardship = { high_skill_rating very_high_skill_rating } + gender_female_chance = 50 + save_scope_as = cook + after_creation = { + add_character_flag = created + } + } + scope:cook ?= { + if = { + limit = { + NOR = { + has_trait = possessed_1 + has_trait = lunatic_1 + has_trait = depressed_1 + has_trait = drunkard + has_trait = hashishiyah + has_trait = irritable + } + } + hidden_effect = { + random = { + chance = 20 + random_list = { + 10 = { add_trait = possessed_1 } + 10 = { add_trait = lunatic_1 } + 10 = { add_trait = depressed_1 } + 10 = { add_trait = drunkard } + 10 = { add_trait = hashishiyah } + 10 = { add_trait = irritable } + } + } + } + } + } + } + if = { + limit = { exists = scope:cook } + visit_holding_mark_rare_spawn_seen_effect = { SCENE = cook } + } + } + } + set_variable = visit_holding_checked_for_cook + } +} + +scripted_trigger visit_holding_relax_tea_trigger = { + location = { + OR = { + culture = { + OR = { + has_cultural_pillar = heritage_chinese + has_cultural_pillar = heritage_japonic + has_cultural_pillar = heritage_korean + has_cultural_pillar = heritage_buyeo + } + } + geographical_region = world_asia + } + } +} + +#Visit Market +gdp_visit_holding_decision_event.1300 = { + type = character_event + title = gdp_visit_holding_decision_event.1300.t + window = visit_settlement_window + desc = { + first_valid = { + triggered_desc = { + trigger = { + location ?= { + OR = { + culture ?= { has_graphical_east_asia_culture_group_trigger = yes } + steppe_building_gfx_use_east_asian_trigger = yes + steppe_building_gfx_use_southeast_asian_trigger = yes + culture ?= { has_building_gfx = southeast_asian_building_gfx } + } + } + location.county ?= { + NOR = { + title_province ?= { + OR = { + has_holding_type = tribal_holding + has_holding_type = nomad_holding + has_holding_type = herder_holding + } + } + prosperity_level < 5 + } + } + } + desc = gdp_visit_holding_decision_event.1300.asia + } + triggered_desc = { + trigger = { + location ?= { + OR = { + geographical_region = graphical_mena + geographical_region = graphical_india + culture ?= { has_building_gfx = iranian_building_gfx } + culture ?= { has_building_gfx = indian_building_gfx } + AND = { + geographical_region = world_europe_west_iberia + faith ?= { religion = religion:islam_religion } + } + steppe_building_gfx_use_indian_trigger = yes + AND = { + steppe_building_gfx_use_mena_trigger = yes + NOT = { + root = { government_has_flag = government_is_tribal } + geographical_region = world_steppe + } + } + } + } + } + desc = gdp_visit_holding_decision_event.1300.mena_india + } + desc = gdp_visit_holding_decision_event.1300.default + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:monk + exists = scope:been_to_monk + } + desc = gdp_visit_holding_decision_event.monk_hint_return + } + triggered_desc = { + trigger = { exists = scope:monk } + desc = gdp_visit_holding_decision_event.monk_hint + } + triggered_desc = { + trigger = { + exists = scope:caravaneer + exists = scope:been_to_caravaneer + } + desc = gdp_visit_holding_decision_event.caravaneer_hint_return + } + triggered_desc = { + trigger = { exists = scope:caravaneer } + desc = gdp_visit_holding_decision_event.caravaneer_hint + } + triggered_desc = { + trigger = { + exists = scope:carnival_jester + exists = scope:been_to_carnival_jester + } + desc = gdp_visit_holding_decision_event.carnival_jester_hint_return + } + triggered_desc = { + trigger = { exists = scope:carnival_jester } + desc = gdp_visit_holding_decision_event.carnival_jester_hint + } + triggered_desc = { + trigger = { + exists = scope:cook + exists = scope:been_to_cook + } + desc = gdp_visit_holding_decision_event.cook_hint_return + } + triggered_desc = { + trigger = { exists = scope:cook } + desc = gdp_visit_holding_decision_event.cook_hint + } + desc = gdp_visit_holding_decision_event.1300.desc.fallback + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = market } + + left_portrait = { + character = root + animation = steward + } + immediate = { + if = { + limit = { + NOT = { exists = scope:visiting_location } + } + location = { save_scope_as = visiting_location } + } + random = { + chance = 20 + location = { + # Rare Spawn: Monk + if = { + limit = { + OR = { + geographical_region = world_asia_japan + geographical_region = world_asia_china + geographical_region = world_asia_korea + } + } + root = { visit_holding_try_spawn_monk_effect = yes } + } + # Rare Spawn: Caravaneer + else_if = { + limit = { + OR = { + # Check for cultures + culture ?= { has_cultural_tradition = tradition_caravaneers } + # Check for terrain + geographical_region = world_africa_sahara + geographical_region = world_africa_north + geographical_region = sahel_sub_saharan_africa_nomad_area + } + } + root = { visit_holding_try_spawn_caravaneer_effect = yes } + } + # Rare Spawn: Carnival Entertainer + else_if = { + limit = { + is_coastal = no + county.holder ?= { government_has_flag = government_is_republic } + } + root = { visit_holding_try_spawn_carnival_jester_effect = yes } + } + # Fallback: Cook + else = { + root = { visit_holding_try_spawn_cook_effect = yes } + } + } + } + } + #Eavesdrop on traders + option = { + name = gdp_visit_holding_decision_event.1300.a + trigger = { + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1300.a.cooldown.tt + NOT = { has_variable = 1310_has_created_contract_recently } + } + } + show_as_unavailable = { always = yes } + reason = traders + custom_tooltip = gdp_visit_holding_decision_event.1300.a.tt + trigger_event = gdp_visit_holding_decision_event.1310 + } + #Look for recruits + option = { + name = gdp_visit_holding_decision_event.1300.b + trigger = { + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1300.b.cooldown.tt + NOT = { has_variable = 1320_has_recruited_recently } + } + } + show_as_unavailable = { always = yes } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1300.b.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } + #Visit potential interesting character(s) + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:been_to_monk } + desc = gdp_visit_holding_decision_event.1300.d_second + } + desc = gdp_visit_holding_decision_event.1300.d + } + } + } + trigger = { + exists = scope:monk + NOT = { exists = scope:recruited_interesting_character } + is_ai = no + } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1300.d.tt + trigger_event = gdp_visit_holding_decision_event.1330 + } + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:been_to_caravaneer } + desc = gdp_visit_holding_decision_event.1300.g_second + } + desc = gdp_visit_holding_decision_event.1300.g + } + } + } + trigger = { + exists = scope:caravaneer + NOT = { exists = scope:recruited_interesting_character } + is_ai = no + } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1300.g.tt + trigger_event = gdp_visit_holding_decision_event.1333 + } + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:been_to_carnival_jester } + desc = gdp_visit_holding_decision_event.1300.h_second + } + desc = gdp_visit_holding_decision_event.1300.h + } + } + } + trigger = { + exists = scope:carnival_jester + NOT = { exists = scope:recruited_interesting_character } + is_ai = no + } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1300.h.tt + trigger_event = gdp_visit_holding_decision_event.1335 + } + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:been_to_cook } + desc = gdp_visit_holding_decision_event.1300.i_second + } + desc = gdp_visit_holding_decision_event.1300.i + } + } + } + trigger = { + exists = scope:cook + NOT = { exists = scope:recruited_interesting_character } + is_ai = no + } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1300.i.tt + trigger_event = gdp_visit_holding_decision_event.1336 + } + # Just relax + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + visit_holding_relax_tea_trigger = yes + NOR = { + AND = { + has_trait = drunkard + location = { + NOR = { + geographical_region = world_europe + geographical_region = world_asia + } + } + } + has_trait = comfort_eater + } + } + desc = gdp_visit_holding_decision_event.1300.j_tea + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = hashishiyah + } + trigger_if = { + limit = { + NOT = { has_trait = hashishiyah } + } + NOT = { has_trait = comfort_eater } + } + can_be_hashishiyah = yes + location = { + NOR = { + geographical_region = world_europe + geographical_region = world_asia + } + } + } + desc = gdp_visit_holding_decision_event.1300.j_hashish + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = drunkard + } + trigger_if = { + limit = { + NOT = { has_trait = drunkard } + } + NOT = { has_trait = comfort_eater } + } + location = { # Not offering booze + NOR = { + religion = religion:islam_religion + religion = religion:jainism_religion + faith = faith:mandaean_faith + } + } + } + desc = gdp_visit_holding_decision_event.1300.j_drink + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = comfort_eater + } + NOR = { + has_trait = inappetetic + has_trait = temperate + } + } + desc = gdp_visit_holding_decision_event.1300.j_food + } + desc = gdp_visit_holding_decision_event.1300.j_bath + } + } + } + trigger = { + trigger_if = { # stop too many simultaneous options + limit = { + OR = { + exists = scope:monk + exists = scope:caravaneer + exists = scope:carnival_jester + exists = scope:cook + } + } + exists = scope:recruited_interesting_character + } + stress > 0 + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1300.j.cooldown.tt + NOT = { has_variable = 1320_has_relaxed_recently } + } + } + show_as_unavailable = { has_variable = 1320_has_relaxed_recently } + reason = stress_loss + custom_tooltip = gdp_visit_holding_decision_event.1300.j.tt + if = { + limit = { exists = scope:visiting_associate } + custom_tooltip = gdp_visit_holding_decision_event.1300.j.associate.tt + } + trigger_event = gdp_visit_holding_decision_event.1340 + } + #Go Back To Main Hub + option = { + name = gdp_visit_holding_decision_event.1300.c + custom_tooltip = gdp_visit_holding_decision_event.1300.c.tt + trigger_event = gdp_visit_holding_decision_event.1000 + } +} +#Visit Docks +gdp_visit_holding_decision_event.1400 = { + type = character_event + title = gdp_visit_holding_decision_event.1400.t + window = visit_settlement_window + desc = { + desc = gdp_visit_holding_decision_event.1400.intro + first_valid = { + triggered_desc = { + trigger = { + location ?= { + OR = { + culture ?= { + has_graphical_east_asia_culture_group_trigger = yes + } + steppe_building_gfx_use_east_asian_trigger = yes + steppe_building_gfx_use_southeast_asian_trigger = yes + culture ?= { + has_building_gfx = southeast_asian_building_gfx + } + } + } + location.county ?= { + NOR = { + title_province ?= { + OR = { + has_holding_type = tribal_holding + has_holding_type = nomad_holding + has_holding_type = herder_holding + } + } + prosperity_level < 5 + } + } + } + desc = gdp_visit_holding_decision_event.1400.asia + } + triggered_desc = { + trigger = { + location ?= { + OR = { + geographical_region = graphical_mena + geographical_region = graphical_india + culture ?= { has_building_gfx = iranian_building_gfx } + culture ?= { has_building_gfx = indian_building_gfx } + AND = { + geographical_region = world_europe_west_iberia + faith ?= { religion = religion:islam_religion } + } + steppe_building_gfx_use_indian_trigger = yes + AND = { + steppe_building_gfx_use_mena_trigger = yes + NOT = { + root = { government_has_flag = government_is_tribal } + geographical_region = world_steppe + } + } + } + } + } + desc = gdp_visit_holding_decision_event.1400.mena_india + } + desc = gdp_visit_holding_decision_event.1400.default + } + first_valid = { + triggered_desc = { + trigger = { + exists = scope:sea_captain + exists = scope:been_to_sea_captain + } + desc = gdp_visit_holding_decision_event.sea_captain_hint_return + } + triggered_desc = { + trigger = { + exists = scope:sea_captain + NOT = { exists = scope:been_to_sea_captain } + } + desc = gdp_visit_holding_decision_event.sea_captain_hint + } + desc = gdp_visit_holding_decision_event.1400.outro + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { reference = docks } + + center_portrait = { + character = root + animation = steward + } + immediate = { + if = { + limit = { + NOT = { exists = scope:visiting_location } + } + location = { save_scope_as = visiting_location } + } + visit_holding_try_spawn_sea_captain_effect = yes + } + #Eavesdrop on traders + option = { + name = gdp_visit_holding_decision_event.1300.a + trigger = { + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1300.a.cooldown.tt + NOT = { has_variable = 1310_has_created_contract_recently } + } + } + show_as_unavailable = { always = yes } + reason = traders + custom_tooltip = gdp_visit_holding_decision_event.1300.a.tt + trigger_event = gdp_visit_holding_decision_event.1310 + } + #Look for recruits + option = { + name = gdp_visit_holding_decision_event.1400.b + trigger = { + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1300.b.cooldown.tt + NOT = { has_variable = 1320_has_recruited_recently } + } + } + show_as_unavailable = { always = yes } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1400.b.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { exists = scope:been_to_sea_captain } + desc = gdp_visit_holding_decision_event.1400.d_second + } + desc = gdp_visit_holding_decision_event.1400.d + } + } + } + trigger = { + exists = scope:sea_captain + NOR = { + exists = scope:recruited_interesting_character + has_character_flag = captain_shoved_off + } + is_ai = no + } + reason = market_recruitment + custom_tooltip = gdp_visit_holding_decision_event.1400.d.tt + trigger_event = gdp_visit_holding_decision_event.1334 + } + # Just relax + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + visit_holding_relax_tea_trigger = yes + NOR = { + AND = { + has_trait = drunkard + location = { + NOR = { + geographical_region = world_europe + geographical_region = world_asia + } + } + } + has_trait = comfort_eater + } + } + desc = gdp_visit_holding_decision_event.1300.j_tea + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = hashishiyah + } + trigger_if = { + limit = { + NOT = { has_trait = hashishiyah } + } + NOT = { has_trait = comfort_eater } + } + can_be_hashishiyah = yes + location = { + NOR = { + geographical_region = world_europe + geographical_region = world_asia + } + } + } + desc = gdp_visit_holding_decision_event.1300.j_hashish + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = drunkard + } + trigger_if = { + limit = { + NOT = { has_trait = drunkard } + } + NOT = { has_trait = comfort_eater } + } + location = { # Not offering booze + NOR = { + religion = religion:islam_religion + religion = religion:jainism_religion + faith = faith:mandaean_faith + } + } + } + desc = gdp_visit_holding_decision_event.1300.j_drink + } + triggered_desc = { + trigger = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = comfort_eater + } + NOR = { + has_trait = inappetetic + has_trait = temperate + } + } + desc = gdp_visit_holding_decision_event.1300.j_food + } + desc = gdp_visit_holding_decision_event.1300.j_bath + } + } + } + trigger = { + trigger_if = { # stop too many simultaneous options + limit = { + exists = scope:sea_captain + } + exists = scope:recruited_interesting_character + } + stress > 0 + #You're on cooldown + custom_tooltip = { + text = gdp_visit_holding_decision_event.1300.j.cooldown.tt + NOT = { has_variable = 1320_has_relaxed_recently } + } + } + show_as_unavailable = { has_variable = 1320_has_relaxed_recently } + reason = stress_loss + custom_tooltip = gdp_visit_holding_decision_event.1300.j.tt + if = { + limit = { exists = scope:visiting_associate } + custom_tooltip = gdp_visit_holding_decision_event.1300.j.associate.tt + } + trigger_event = gdp_visit_holding_decision_event.1340 + } + #Go Back To Main Hub + option = { + name = gdp_visit_holding_decision_event.1300.c + custom_tooltip = gdp_visit_holding_decision_event.1400.c.tt + trigger_event = gdp_visit_holding_decision_event.1000 + } +} + +#Visit Foreign Traders +gdp_visit_holding_decision_event.1310 = { + type = character_event + title = gdp_visit_holding_decision_event.1310.t + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1310.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + left_portrait = { + character = scope:foreigner + animation = debating + camera = camera_event_center_pointing_forward + } + center_portrait = { + character = scope:local_trader + animation = eyeroll + hide_info = yes + camera = camera_event_standing_with_horse_left + } + right_portrait = { + character = root + animation = eavesdrop + camera = camera_event_left_forward + } + immediate = { + random_empire = { + limit = { + any_de_jure_county = { + culture != root.culture + "squared_distance(root.location)" <= squared_distance_medium + } + } + random_de_jure_county = { + limit = { + culture != root.culture + "squared_distance(root.location)" <= squared_distance_medium + } + save_scope_as = foreign_trader_home + } + } + if = { + limit = { + NOT = { exists = scope:foreigner } + } + create_character = { + template = generic_peasant_character + location = root.location + dynasty = none + culture = scope:foreign_trader_home.culture + faith = scope:foreign_trader_home.faith + save_scope_as = foreigner + after_creation = { + remove_character_flag = peasant_outfit + set_location = root.location + } + } + } + if = { + limit = { + NOT = { exists = scope:local_trader } + } + create_character = { + template = generic_peasant_character + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + save_scope_as = local_trader + after_creation = { + remove_character_flag = peasant_outfit + } + } + } + } + #Menagerie Acquisition Contract + option = { + name = gdp_visit_holding_decision_event.1310.a + custom_tooltip = gdp_visit_holding_decision_event.1310.a.tt + trigger = { + can_create_task_contract = { type_name = menagerie_acquisition } + custom_tooltip = { + text = spawn_merchant_contract_interaction_duplicate_tt + NOT = { any_character_task_contract = { has_task_contract_type = menagerie_acquisition } } + } + short_term_gold >= root.medium_gold_value + } + show_as_unavailable = { always = yes } + trigger_event = { on_action = gdp_menagerie_acquisition } + pay_short_term_gold = { + target = scope:foreigner + gold = root.medium_gold_value + } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1310_has_created_contract_recently } + } + #Procuring Curio Contract + option = { + name = gdp_visit_holding_decision_event.1310.b + custom_tooltip = gdp_visit_holding_decision_event.1310.b.tt + trigger = { + can_create_task_contract = { type_name = find_curio } + custom_tooltip = { + text = spawn_merchant_contract_interaction_duplicate_tt + NOT = { + any_character_task_contract = { has_task_contract_type = find_curio } + } + } + short_term_gold >= root.medium_gold_value + } + show_as_unavailable = { always = yes } + + trigger_event = { on_action = gdp_find_curio } + pay_short_term_gold = { + target = scope:foreigner + gold = root.medium_gold_value + } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1310_has_created_contract_recently } + } + #Company Purpose Contracts + #Artisan Purpose + option = { + name = gdp_visit_holding_decision_event.1310.c + custom_tooltip = gdp_visit_holding_decision_event.1310.c.tt + trigger = { + can_create_task_contract = { type_name = support_guilds } + custom_tooltip = { + text = spawn_merchant_contract_interaction_duplicate_tt + NOT = { + any_character_task_contract = { has_task_contract_type = support_guilds } + } + } + custom_tooltip = { + text = spawn_merchant_contract_interaction_cooldown_tt + NOT = { has_character_flag = trade_opportunity_cooldown_support_guilds } + } + custom_tooltip = { + text = spawn_merchant_contract_interaction_route_tt + any_trade_route = { + has_trader = yes + any_trade_market_on_route = {} + } + } + short_term_gold >= root.medium_gold_value + } + show_as_unavailable = { + has_realm_law = company_purpose_artisan + can_create_task_contract = { type_name = support_guilds } + } + trigger_event = { on_action = gdp_support_guilds } + pay_short_term_gold = { + target = scope:foreigner + gold = root.medium_gold_value + } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1310_has_created_contract_recently } + } + #Creditor Purpose + option = { + name = gdp_visit_holding_decision_event.1310.c + custom_tooltip = gdp_visit_holding_decision_event.1310.c.tt + trigger = { + can_create_task_contract = { type_name = seek_debtors } + custom_tooltip = { + text = spawn_merchant_contract_interaction_duplicate_tt + NOT = { + any_character_task_contract = { has_task_contract_type = seek_debtors } + } + } + custom_tooltip = { + text = spawn_merchant_contract_interaction_cooldown_tt + NOT = { has_character_flag = trade_opportunity_cooldown_seek_debtors } + } + custom_tooltip = { + text = spawn_merchant_contract_interaction_route_tt + any_trade_route = { + has_trader = yes + any_trade_market_on_route = {} + } + } + } + show_as_unavailable = { + has_realm_law = company_purpose_creditor + can_create_task_contract = { type_name = seek_debtors } + } + trigger_event = { on_action = gdp_seek_debtors } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1310_has_created_contract_recently } + } + #Dock Or Market-Hub Leave + option = { + name = gdp_visit_holding_decision_event.1310.d + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + trigger = { + location = { is_coastal = no } + } + trigger_event = gdp_visit_holding_decision_event.1300 + } + option = { + name = gdp_visit_holding_decision_event.1310.d + custom_tooltip = gdp_visit_holding_decision_event.1320.e.tt + trigger = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } +} + +#Used to generate random recruits from templates +scripted_trigger 1320_generate_character_trigger = { + NOR = { + AND = { + exists = scope:market_first_recruit + scope:market_first_recruit = { has_character_flag = is_$ARCHETYPE$_recruit } + } + AND = { + exists = scope:market_second_recruit + scope:market_second_recruit = { has_character_flag = is_$ARCHETYPE$_recruit } + } + AND = { + exists = scope:market_third_recruit + scope:market_third_recruit = { has_character_flag = is_$ARCHETYPE$_recruit } + } + } +} +#Scripted effect to create a new character based on archetype +scripted_effect 1320_character_creation_type_effect = { + create_character = { + template = $ARCHETYPE$_recruit_template + gender_female_chance = 50 + location = root.location + dynasty = none + culture = $CULTURE$ + faith = $FAITH$ + save_scope_as = 1320_new_character + after_creation = { add_character_flag = is_$ARCHETYPE$_recruit } + } + scope:1320_new_character ?= { + if = { + limit = { location != root.location } + set_location = root.location + } + } +} +scripted_effect 1320_generate_character_effect = { + random_list = { + #Charlatan + 10 = { + trigger = { + 1320_generate_character_trigger = { ARCHETYPE = charlatan } + } + 1320_character_creation_type_effect = { + ARCHETYPE = charlatan + CULTURE = root.location.culture + FAITH = root.location.faith + } + } + #Hired Muscle + 10 = { + trigger = { + 1320_generate_character_trigger = { ARCHETYPE = hired_muscle } + } + 1320_character_creation_type_effect = { + ARCHETYPE = hired_muscle + CULTURE = root.location.culture + FAITH = root.location.faith + } + } + #Numerate + 10 = { + trigger = { + 1320_generate_character_trigger = { ARCHETYPE = numerate } + } + 1320_character_creation_type_effect = { + ARCHETYPE = numerate + CULTURE = root.location.culture + FAITH = root.location.faith + } + } + #Traveler + 10 = { + trigger = { + 1320_generate_character_trigger = { ARCHETYPE = traveler } + exists = scope:foreign_traveler_origin + } + 1320_character_creation_type_effect = { + ARCHETYPE = traveler + CULTURE = scope:foreign_traveler_origin.culture + FAITH = scope:foreign_traveler_origin.faith + } + } + #Urchin + 10 = { + trigger = { + 1320_generate_character_trigger = { ARCHETYPE = urchin } + } + 1320_character_creation_type_effect = { + ARCHETYPE = urchin + CULTURE = root.location.culture + FAITH = root.location.faith + } + } + #Herbalist + 10 = { + trigger = { + 1320_generate_character_trigger = { ARCHETYPE = herbalist } + } + 1320_character_creation_type_effect = { + ARCHETYPE = herbalist + CULTURE = root.location.culture + FAITH = root.location.faith + } + } + } + if = { + limit = { NOT = { exists = scope:market_first_recruit } } + scope:1320_new_character = { save_scope_as = market_first_recruit } + } + else_if = { + limit = { NOT = { exists = scope:market_second_recruit } } + scope:1320_new_character = { save_scope_as = market_second_recruit } + } + else_if = { + limit = { NOT = { exists = scope:market_third_recruit } } + scope:1320_new_character = { save_scope_as = market_third_recruit } + } +} +scripted_effect 1320_set_cost_effect = { + save_scope_value_as = { + name = $VALUE_NAME$_sum_skills + value = { + add = $CHARACTER$.diplomacy + add = $CHARACTER$.martial + add = $CHARACTER$.stewardship + add = $CHARACTER$.intrigue + add = $CHARACTER$.learning + add = $CHARACTER$.prowess + } + } + save_scope_value_as = { + name = $VALUE_NAME$ + value = { + integer_range = { + min = visit_holding_associate_recruit_gold_min + max = visit_holding_associate_recruit_gold_max + } + multiply = { + value = scope:$VALUE_NAME$_sum_skills + divide = 15 + } + } + } +} +scripted_effect 1320_archetype_save_effect = { + switch = { + trigger = has_character_flag + is_charlatan_recruit = { save_scope_as = charlatan_recruit } + is_hired_muscle_recruit = { save_scope_as = hired_muscle_recruit } + is_numerate_recruit = { save_scope_as = numerate_recruit } + is_traveler_recruit = { save_scope_as = traveler_recruit } + is_urchin_recruit = { save_scope_as = urchin_recruit } + is_herbalist_recruit = { save_scope_as = herbalist_recruit } + } +} +scripted_effect 1320_archetype_option_effect = { + $SCOPE$ = { + switch = { + trigger = has_character_flag + is_charlatan_recruit = { + custom_tooltip = gdp_visit_holding_decision_event.1320.charlatan.tt + root = { + trigger_event = gdp_visit_holding_decision_event.1321 + } + } + is_hired_muscle_recruit = { + custom_tooltip = gdp_visit_holding_decision_event.1320.hired_muscle.tt + root = { + trigger_event = gdp_visit_holding_decision_event.1322 + } + } + is_numerate_recruit = { + custom_tooltip = gdp_visit_holding_decision_event.1320.numerate.tt + root = { + trigger_event = gdp_visit_holding_decision_event.1323 + } + } + is_traveler_recruit = { + custom_tooltip = gdp_visit_holding_decision_event.1320.traveler.tt + root = { + trigger_event = gdp_visit_holding_decision_event.1324 + } + } + is_urchin_recruit = { + custom_tooltip = gdp_visit_holding_decision_event.1320.urchin.tt + root = { + trigger_event = gdp_visit_holding_decision_event.1325 + } + } + is_herbalist_recruit = { + custom_tooltip = gdp_visit_holding_decision_event.1320.herbalist.tt + root = { + trigger_event = gdp_visit_holding_decision_event.1326 + } + } + } + } +} + +scripted_effect set_foreign_traveler_origin_effect = { + random_empire = { + limit = { + any_de_jure_county = { + culture != root.culture + "squared_distance(root.location)" <= squared_distance_medium + } + } + random_de_jure_county = { + limit = { + culture != root.culture + "squared_distance(root.location)" <= squared_distance_medium + } + save_scope_as = foreign_traveler_origin + } + } +} + +#Recruit Interesting People +gdp_visit_holding_decision_event.1320 = { + type = character_event + window = visit_settlement_window + title = { + first_valid = { + triggered_desc = { + trigger = { + location = { is_coastal = yes } + } + desc = gdp_visit_holding_decision_event.1320.t_docks + } + desc = gdp_visit_holding_decision_event.1320.t_market + } + } + desc = { + desc = gdp_visit_holding_decision_event.1320.desc + #Check first recruit type + desc = gdp_visit_holding_decision_event.1320.first_character_desc + desc = gdp_visit_holding_decision_event.1320.mid.desc + #Check Second Recruit type + desc = gdp_visit_holding_decision_event.1320.second_character_desc + desc = gdp_visit_holding_decision_event.1320.mid.desc + #Check Third Recruit type + desc = gdp_visit_holding_decision_event.1320.third_character_desc + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + left_portrait = { + character = scope:market_first_recruit + outfit_tags = { no_cloak } + scripted_animation = gdp_visit_holding_animation_1320 + camera = camera_event_left + } + + center_portrait = { + character = scope:market_second_recruit + outfit_tags = { no_cloak } + scripted_animation = gdp_visit_holding_animation_1320 + camera = camera_event_scheme_center + } + + right_portrait = { + character = scope:market_third_recruit + outfit_tags = { no_cloak } + scripted_animation = gdp_visit_holding_animation_1320 + camera = camera_event_right_pointing_right + } + + immediate = { + hidden_effect = { + set_foreign_traveler_origin_effect = yes + while = { + count = 3 + 1320_generate_character_effect = yes + } + } + + #What recruit are they + scope:market_first_recruit ?= { + 1320_archetype_save_effect = yes + } + scope:market_second_recruit ?= { + 1320_archetype_save_effect = yes + } + scope:market_third_recruit ?= { + 1320_archetype_save_effect = yes + } + } + #What type of recruit are they? Set event based on type + option = { + name = gdp_visit_holding_decision_event.1320.a + 1320_archetype_option_effect = { SCOPE = scope:market_first_recruit } + } + option = { + name = gdp_visit_holding_decision_event.1320.b + 1320_archetype_option_effect = { SCOPE = scope:market_second_recruit } + } + option = { + name = gdp_visit_holding_decision_event.1320.c + 1320_archetype_option_effect = { SCOPE = scope:market_third_recruit } + } + #Dock Or Market-Hub + option = { + name = gdp_visit_holding_decision_event.1320.d + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + trigger = { + location = { is_coastal = no } + } + trigger_event = gdp_visit_holding_decision_event.1300 + } + option = { + name = gdp_visit_holding_decision_event.1320.e + custom_tooltip = gdp_visit_holding_decision_event.1320.e.tt + trigger = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } +} + +# Standard Recruitment Options +#The Charlatan +gdp_visit_holding_decision_event.1321 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { + location = { is_coastal = yes } + } + desc = gdp_visit_holding_decision_event.1321.t_docks + } + desc = gdp_visit_holding_decision_event.1321.t_market + } + desc = gdp_visit_holding_decision_event.1321.t + } + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1321.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + left_portrait = { + character = root + animation = interested + } + + right_portrait = { + character = scope:charlatan_recruit + animation = betting + camera = camera_event_right_crowner_crowning + } + + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:charlatan_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:charlatan_recruit VALUE_NAME = charlatan_recruit_cost } + } + } + + #Beat Them at their own game (Skill Duel) + option = { + name = gdp_visit_holding_decision_event.1321.a + + duel = { + skill = intrigue + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1321.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1321.a.success + left_icon = root + right_icon = scope:charlatan_recruit + add_courtier = scope:charlatan_recruit + hidden_effect = { + scope:charlatan_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { has_lifestyle = intrigue_lifestyle } + add_intrigue_lifestyle_xp = medium_lifestyle_xp + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1321.a.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1321.a.failure + desc = gdp_visit_holding_decision_event.1321.a.failure + left_icon = root + right_icon = scope:charlatan_recruit + } + } + } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + humble = minor_stress_impact_gain + shy = medium_stress_impact_gain + gregarious = minor_stress_impact_loss + stubborn = minor_stress_impact_loss + arrogant = medium_stress_impact_loss + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Pay Them + option = { + name = gdp_visit_holding_decision_event.1321.b + trigger = { + #You're broke + custom_tooltip = { + text = gdp_visit_holding_decision_event.1321.b.tt + short_term_gold >= scope:charlatan_recruit_cost + } + } + show_as_unavailable = { always = yes } + + pay_short_term_gold = { + target = scope:charlatan_recruit + gold = scope:charlatan_recruit_cost + } + + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:charlatan_recruit + add_courtier = scope:charlatan_recruit + hidden_effect = { + scope:charlatan_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Go Back + option = { + name = gdp_visit_holding_decision_event.1321.c + custom_tooltip = gdp_visit_holding_decision_event.1320.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } +} +#The Hired Muscle +gdp_visit_holding_decision_event.1322 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { + location = { is_coastal = yes } + } + desc = gdp_visit_holding_decision_event.1322.t_docks + } + desc = gdp_visit_holding_decision_event.1322.t_market + } + desc = gdp_visit_holding_decision_event.1322.t + } + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1322.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + left_portrait = { + character = root + animation = dismissal + } + + right_portrait = { + character = scope:hired_muscle_recruit + animation = rage + camera = camera_event_scheme_vs_center_look_left + } + + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:hired_muscle_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:hired_muscle_recruit VALUE_NAME = hired_muscle_recruit_cost } + } + } + + #Beat Them at their own game (Skill Duel) + option = { + name = gdp_visit_holding_decision_event.1322.a + duel = { + skills = { martial prowess } + value = high_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1322.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1322.a.success + left_icon = root + right_icon = scope:hired_muscle_recruit + add_courtier = scope:hired_muscle_recruit + scope:hired_muscle_recruit = { increase_wounds_effect = { REASON = fight } + } + hidden_effect = { + scope:hired_muscle_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { has_lifestyle = martial_lifestyle } + add_martial_lifestyle_xp = medium_lifestyle_xp + } + } + #Fail: chance of injury + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1322.a.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1322.a.failure + desc = gdp_visit_holding_decision_event.1322.a.failure + left_icon = root + right_icon = scope:hired_muscle_recruit + add_stress = minor_stress_gain + root = { increase_wounds_effect = { REASON = fight } + } + } + } + } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_gain + craven = medium_stress_impact_gain + just = minor_stress_impact_gain + content = minor_stress_impact_gain + brave = medium_stress_impact_loss + arrogant = medium_stress_impact_loss + stubborn = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + } + #Cooldown modifier + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Pay Them + option = { + name = gdp_visit_holding_decision_event.1322.b + trigger = { + #You're broke + custom_tooltip = { + text = gdp_visit_holding_decision_event.1322.b.tt + short_term_gold >= scope:hired_muscle_recruit_cost + } + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:hired_muscle_recruit + gold = scope:hired_muscle_recruit_cost + } + + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:hired_muscle_recruit + add_courtier = scope:hired_muscle_recruit + hidden_effect = { + scope:hired_muscle_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + #Stress modifiers + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + #Set cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Dock Or Market-Hub + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Go Back + option = { + name = gdp_visit_holding_decision_event.1322.c + custom_tooltip = gdp_visit_holding_decision_event.1320.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } +} +#The Numerate +gdp_visit_holding_decision_event.1323 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { location = { is_coastal = yes } } + desc = gdp_visit_holding_decision_event.1323.t_docks + } + desc = gdp_visit_holding_decision_event.1323.t_market + } + desc = gdp_visit_holding_decision_event.1323.t + } + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1323.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + left_portrait = { + character = root + animation = thinking_all + } + + right_portrait = { + character = scope:numerate_recruit + animation = writing + camera = camera_event_scheme_vs_center_look_left + } + + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:numerate_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:numerate_recruit VALUE_NAME = numerate_recruit_cost } + } + } + + #Beat Them at their own game (Skill Duel) + option = { + name = gdp_visit_holding_decision_event.1323.a + duel = { + skill = stewardship + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1323.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1323.a.success + left_icon = root + right_icon = scope:numerate_recruit + add_courtier = scope:numerate_recruit + hidden_effect = { + scope:numerate_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { has_lifestyle = stewardship_lifestyle } + add_stewardship_lifestyle_xp = medium_lifestyle_xp + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1323.a.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1323.a.failure + desc = gdp_visit_holding_decision_event.1323.a.failure + left_icon = root + right_icon = scope:numerate_recruit + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + deceitful = medium_stress_impact_gain + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + eccentric = medium_stress_impact_loss + patient = minor_stress_impact_loss + honest = minor_stress_impact_loss + diligent = minor_stress_impact_loss + } + #Set Cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Pay Them + option = { + name = gdp_visit_holding_decision_event.1323.b + trigger = { + #You're broke + custom_tooltip = { + text = gdp_visit_holding_decision_event.1323.b.tt + short_term_gold >= scope:numerate_recruit_cost + } + } + show_as_unavailable = { always = yes } + + pay_short_term_gold = { + target = scope:numerate_recruit + gold = scope:numerate_recruit_cost + } + + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:numerate_recruit + add_courtier = scope:numerate_recruit + hidden_effect = { + scope:numerate_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + #Set cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Go Back + option = { + name = gdp_visit_holding_decision_event.1323.c + custom_tooltip = gdp_visit_holding_decision_event.1320.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } +} +#The Traveler +gdp_visit_holding_decision_event.1324 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { location = { is_coastal = yes } } + desc = gdp_visit_holding_decision_event.1324.t_docks + } + desc = gdp_visit_holding_decision_event.1324.t_market + } + desc = gdp_visit_holding_decision_event.1324.t + } + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1324.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + left_portrait = { + character = root + animation = flirtation + } + + center_portrait = { + character = scope:traveler_recruit + animation = admiration + camera = camera_event_scheme_vs_center_look_left + } + + right_portrait = { + character = scope:local + animation = holding_scales + camera = camera_event_center_away_pointing_left_fov25 + } + + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:traveler_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:traveler_recruit VALUE_NAME = traveler_recruit_cost } + } + + if = { + limit = { + NOT = { exists = scope:local } + } + create_character = { + template = generic_peasant_character + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + save_scope_as = local + after_creation = { remove_character_flag = peasant_outfit } + } + } + } + + #Beat Them at their own game (Skill Duel) + option = { + name = gdp_visit_holding_decision_event.1324.a + duel = { + skill = diplomacy + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1324.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1324.a.success + left_icon = root + right_icon = scope:traveler_recruit + add_courtier = scope:traveler_recruit + hidden_effect = { + scope:traveler_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { has_lifestyle = diplomacy_lifestyle } + add_diplomacy_lifestyle_xp = medium_lifestyle_xp + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1324.a.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1324.a.failure + desc = gdp_visit_holding_decision_event.1324.a.failure + left_icon = root + right_icon = scope:traveler_recruit + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + impatient = medium_stress_impact_gain + lazy = minor_stress_impact_gain + shy = medium_stress_impact_gain + patient = minor_stress_impact_loss + honest = minor_stress_impact_loss + diligent = minor_stress_impact_loss + gregarious = medium_stress_impact_loss + } + #Set Cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Pay Them + option = { + name = gdp_visit_holding_decision_event.1324.b + trigger = { + #You're broke + custom_tooltip = { + text = gdp_visit_holding_decision_event.1324.b.tt + short_term_gold >= scope:traveler_recruit_cost + } + } + show_as_unavailable = { always = yes } + + pay_short_term_gold = { + target = scope:traveler_recruit + gold = scope:traveler_recruit_cost + } + + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:traveler_recruit + add_courtier = scope:traveler_recruit + hidden_effect = { + scope:traveler_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + #Set cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Go Back + option = { + name = gdp_visit_holding_decision_event.1324.c + custom_tooltip = gdp_visit_holding_decision_event.1320.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } +} +#The Urchin +gdp_visit_holding_decision_event.1325 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { location = { is_coastal = yes } } + desc = gdp_visit_holding_decision_event.1325.t_docks + } + desc = gdp_visit_holding_decision_event.1325.t_market + } + desc = gdp_visit_holding_decision_event.1325.t + } + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1325.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + center_portrait = { + character = root + animation = disbelief + camera = camera_body_right + } + + right_portrait = { + character = scope:urchin_recruit + animation = beg + camera = camera_event_center_pointing_left + } + + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:urchin_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:urchin_recruit VALUE_NAME = urchin_recruit_cost } + } + } + + #Beat Them at their own game (Skill Duel) + option = { + name = gdp_visit_holding_decision_event.1325.a + duel = { + skill = intrigue + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1325.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1325.a.success + left_icon = root + right_icon = scope:urchin_recruit + add_courtier = scope:urchin_recruit + hidden_effect = { + scope:urchin_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { has_lifestyle = intrigue_lifestyle } + add_intrigue_lifestyle_xp = medium_lifestyle_xp + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1325.a.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1325.a.failure + desc = gdp_visit_holding_decision_event.1325.a.failure + left_icon = root + right_icon = scope:urchin_recruit + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + callous = minor_stress_impact_loss + honest = minor_stress_impact_gain + trusting = medium_stress_impact_gain + just = medium_stress_impact_gain + } + #Set Cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Pay Them + option = { + name = gdp_visit_holding_decision_event.1325.b + trigger = { + #You're broke + custom_tooltip = { + text = gdp_visit_holding_decision_event.1325.b.tt + short_term_gold >= scope:urchin_recruit_cost + } + } + show_as_unavailable = { always = yes } + + pay_short_term_gold = { + target = scope:urchin_recruit + gold = scope:urchin_recruit_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:urchin_recruit + add_courtier = scope:urchin_recruit + hidden_effect = { + scope:urchin_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + #Set cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Go Back + option = { + name = gdp_visit_holding_decision_event.1325.c + custom_tooltip = gdp_visit_holding_decision_event.1320.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } +} +#The Herbalist +gdp_visit_holding_decision_event.1326 = { + type = character_event + title = { + first_valid = { + triggered_desc = { + trigger = { + location = { is_coastal = yes } + } + desc = gdp_visit_holding_decision_event.1326.t_docks + } + desc = gdp_visit_holding_decision_event.1326.t_market + } + desc = gdp_visit_holding_decision_event.1326.t + } + window = visit_settlement_window + desc = gdp_visit_holding_decision_event.1326.desc + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { is_coastal = yes } + } + reference = docks + } + override_background = { reference = market } + + center_portrait = { + character = root + animation = delirium + camera = camera_body_right + } + + right_portrait = { + character = scope:herbalist_recruit + animation = physician + camera = camera_body_left + } + + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:herbalist_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:herbalist_recruit VALUE_NAME = herbalist_recruit_cost } + } + } + + #Beat Them at their own game (Skill Duel) + option = { + name = gdp_visit_holding_decision_event.1326.a + duel = { + skill = learning + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1326.a.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1326.a.success + left_icon = root + right_icon = scope:herbalist_recruit + add_courtier = scope:herbalist_recruit + hidden_effect = { + scope:herbalist_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { has_lifestyle = learning_lifestyle } + add_learning_lifestyle_xp = medium_lifestyle_xp + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1326.a.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1326.a.failure + desc = gdp_visit_holding_decision_event.1326.a.failure + left_icon = root + right_icon = scope:herbalist_recruit + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { trigger_event = gdp_visit_holding_decision_event.1300 } + #Stress modifiers + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_gain + impatient = minor_stress_impact_gain + eccentric = minor_stress_impact_loss + patient = minor_stress_impact_loss + honest = medium_stress_impact_loss + stubborn = medium_stress_impact_loss + } + #Set Cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Pay Them + option = { + name = gdp_visit_holding_decision_event.1326.b + trigger = { + #You're broke + custom_tooltip = { + text = gdp_visit_holding_decision_event.1326.b.tt + short_term_gold >= scope:herbalist_recruit_cost + } + } + show_as_unavailable = { always = yes } + + pay_short_term_gold = { + target = scope:herbalist_recruit + gold = scope:herbalist_recruit_cost + } + + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:herbalist_recruit + add_courtier = scope:herbalist_recruit + hidden_effect = { + scope:herbalist_recruit = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + } + } + } + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { + trigger_event = gdp_visit_holding_decision_event.1300 + } + #Stress modifiers + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + #Set cooldown + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + #Clean up variables + visit_holding_clean_up_variables_effect = yes + scope:market_first_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_second_recruit = {visit_holding_clean_up_variables_effect = yes } + scope:market_third_recruit = {visit_holding_clean_up_variables_effect = yes } + } + #Go Back + option = { + name = gdp_visit_holding_decision_event.1326.c + custom_tooltip = gdp_visit_holding_decision_event.1320.tt + trigger_event = gdp_visit_holding_decision_event.1320 + } +} + +# Rare Spawn Characters +# The Monk +gdp_visit_holding_decision_event.1330 = { + type = character_event + title = gdp_visit_holding_decision_event.1330.t + window = visit_settlement_window + desc = { + first_valid = { + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_monk + scope:monk_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1330.desc_returned_01 + } + triggered_desc = { + trigger = { scope:monk_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1330.desc_returned_02 + } + } + desc = gdp_visit_holding_decision_event.1330.desc + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_social" } + override_background = tavern + + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:monk } + animation = interested + } + animation = pondering + } + right_portrait = { + character = scope:monk + trigger = { exists = scope:monk } + animation = prayer + } + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:monk_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:monk VALUE_NAME = monk_recruit_cost } + } + visit_holding_set_rare_recruit_loc_tracker_effect = { SCENE = monk } + visit_holding_pick_merchant_court_position_effect = { + CHARACTER = scope:monk + EMPLOYER = root + } + } + #Recruit them + option = { + name = gdp_visit_holding_decision_event.1330.a + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1330.a.tt + short_term_gold >= scope:monk_recruit_cost + } + } + scope:monk = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1330.recruit_benefits.tt + object = scope:monk + } + } + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:monk + gold = scope:monk_recruit_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:monk + add_courtier = scope:monk + hidden_effect = { + scope:monk = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:monk } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Duel them + option = { + name = gdp_visit_holding_decision_event.1330.c + scope:monk = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1330.recruit_benefits.tt + object = scope:monk + } + } + } + duel = { + skill = diplomacy + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1330.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1330.c.success + left_icon = root + right_icon = scope:monk + add_courtier = scope:monk + hidden_effect = { + scope:monk = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + remove_character_flag ?= created + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:monk } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1330.c.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1330.c.failure + desc = gdp_visit_holding_decision_event.1330.c.failure + left_icon = root + right_icon = scope:monk + } + visit_holding_rare_recruit_duel_loss_effect = { + CHARACTER = scope:monk + SCENE = monk + } + } + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Go Back + option = { + name = gdp_visit_holding_decision_event.1330.d + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + visit_holding_been_to_rare_recruit_effect = { SCENE = monk } + visit_holding_return_to_market_dock_hub_effect = yes + } +} +# The Seasoned Caravaneer +gdp_visit_holding_decision_event.1333 = { + type = character_event + title = { + desc = gdp_visit_holding_decision_event.1333.t_market + desc = gdp_visit_holding_decision_event.1333.t + } + window = visit_settlement_window + desc = { + first_valid = { + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_caravaneer + scope:caravaneer_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1333.desc_returned_01 + } + triggered_desc = { + trigger = { scope:caravaneer_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1333.desc_returned_02 + } + } + desc = gdp_visit_holding_decision_event.1333.desc + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_social" } + override_background = { reference = market } + + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:caravaneer } + animation = interested + } + animation = pondering + } + right_portrait = { + character = scope:caravaneer + trigger = { exists = scope:caravaneer } + animation = dromedary_holding + camera = camera_event_center_pointing_forward_fov35 + } + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:caravaneer_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:caravaneer VALUE_NAME = caravaneer_recruit_cost } + } + visit_holding_set_rare_recruit_loc_tracker_effect = { SCENE = caravaneer } + visit_holding_pick_merchant_court_position_effect = { + CHARACTER = scope:caravaneer + EMPLOYER = root + } + } + #Recruit them + option = { + name = gdp_visit_holding_decision_event.1333.a + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1333.a.tt + short_term_gold >= scope:caravaneer_recruit_cost + } + } + scope:caravaneer = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1333.recruit_benefits.tt + object = scope:caravaneer + } + } + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:caravaneer + gold = scope:caravaneer_recruit_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:caravaneer + add_courtier = scope:caravaneer + hidden_effect = { + scope:caravaneer = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:caravaneer } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Caravaneer: talk shop + option = { + name = gdp_visit_holding_decision_event.1333.b + trigger = { + has_realm_law = company_purpose_caravaneer + custom_tooltip = { + text = gdp_visit_holding_decision_event.1333.b.cooldown.tt + NOT = { has_variable = 1333_gained_caravaneer_xp_recently } + } + } + show_as_unavailable = { has_realm_law = company_purpose_caravaneer } + reason = purpose_caravaneer + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_minor_value + } + random = { + chance = 10 + if = { + limit = { + NOT = { has_trait = lifestyle_traveler } + } + add_trait = lifestyle_traveler + } + } + visit_holding_set_option_cooldown_effect = { VAR = 1333_gained_caravaneer_xp_recently } + visit_holding_return_to_market_dock_hub_effect = yes + } + + #Duel them + option = { + name = gdp_visit_holding_decision_event.1333.c + scope:caravaneer = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1333.recruit_benefits.tt + object = scope:caravaneer + } + } + } + duel = { + skill = stewardship + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1333.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1333.c.success + left_icon = root + right_icon = scope:caravaneer + add_courtier = scope:caravaneer + hidden_effect = { + scope:caravaneer = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + remove_character_flag ?= created + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:caravaneer } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1333.c.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1333.c.failure + desc = gdp_visit_holding_decision_event.1333.c.failure + left_icon = root + right_icon = scope:caravaneer + } + visit_holding_rare_recruit_duel_loss_effect = { + CHARACTER = scope:caravaneer + SCENE = caravaneer + } + } + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Go Back + option = { + name = gdp_visit_holding_decision_event.1333.d + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + visit_holding_been_to_rare_recruit_effect = { SCENE = caravaneer } + visit_holding_return_to_market_dock_hub_effect = yes + } +} +# The Sea Captain +gdp_visit_holding_decision_event.1334 = { + type = character_event + title = { + desc = gdp_visit_holding_decision_event.1334.t_docks + desc = gdp_visit_holding_decision_event.1334.t + } + window = visit_settlement_window + desc = { + first_valid = { + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_sea_captain + scope:sea_captain_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1334.desc_returned_01 + } + triggered_desc = { + trigger = { scope:sea_captain_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1334.desc_returned_02 + } + } + desc = gdp_visit_holding_decision_event.1334.desc + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_social" } + override_background = { reference = docks } + + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:sea_captain } + animation = interested + } + animation = pondering + } + center_portrait = { + character = scope:sea_captain + trigger = { exists = scope:sea_captain } + animation = biting_coin + } + right_portrait = { + character = scope:traveler + trigger = { + exists = scope:sea_captain + NOT = { exists = scope:been_to_sea_captain } + } + animation = beg + hide_info = yes + camera = camera_event_right + } + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:sea_captain_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:sea_captain VALUE_NAME = sea_captain_recruit_cost } + } + visit_holding_set_rare_recruit_loc_tracker_effect = { SCENE = sea_captain } + visit_holding_pick_merchant_court_position_effect = { + CHARACTER = scope:sea_captain + EMPLOYER = root + } + #Set up crowd + if = { + limit = { is_ai = no } + create_character = { + template = peasant_character + location = root.location + culture = root.culture + gender_female_chance = 50 + save_scope_as = traveler + } + } + } + + #Traveler: talk shop + option = { + name = gdp_visit_holding_decision_event.1334.b + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1334.b.cooldown.tt + NOT = { has_variable = 1334_gained_traveler_xp_recently } + } + } + show_as_unavailable = { always = yes } + if = { + limit = { + NOT = { has_trait = lifestyle_traveler } + } + add_trait = lifestyle_traveler + } + add_trait_xp = { + trait = lifestyle_traveler + track = travel + value = { 3 5 } + } + visit_holding_set_option_cooldown_effect = { VAR = 1334_gained_traveler_xp_recently } + visit_holding_return_to_market_dock_hub_effect = yes + } + + #Recruit them + option = { + name = gdp_visit_holding_decision_event.1334.a + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1334.a.tt + short_term_gold >= scope:sea_captain_recruit_cost + } + } + scope:sea_captain = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1334.recruit_benefits.tt + object = scope:sea_captain + } + } + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:sea_captain + gold = scope:sea_captain_recruit_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:sea_captain + add_courtier = scope:sea_captain + hidden_effect = { + scope:sea_captain = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:sea_captain } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Duel them + option = { + name = gdp_visit_holding_decision_event.1334.c + scope:sea_captain = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1334.recruit_benefits.tt + object = scope:sea_captain + } + } + } + duel = { + skill = stewardship + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1334.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1334.c.success + left_icon = root + right_icon = scope:sea_captain + add_courtier = scope:sea_captain + hidden_effect = { + scope:sea_captain = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + remove_character_flag ?= created + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:sea_captain } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1334.c.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1334.c.failure + desc = gdp_visit_holding_decision_event.1334.c.failure + left_icon = root + right_icon = scope:sea_captain + } + visit_holding_rare_recruit_duel_loss_effect = { + CHARACTER = scope:sea_captain + SCENE = sea_captain + } + add_character_flag = captain_shoved_off + } + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Go Back + option = { + name = gdp_visit_holding_decision_event.1334.d + custom_tooltip = gdp_visit_holding_decision_event.1320.e.tt + visit_holding_been_to_rare_recruit_effect = { SCENE = sea_captain } + visit_holding_return_to_market_dock_hub_effect = yes + } + after = { + scope:traveler ?= { silent_disappearance_effect = yes } + } +} +# The Carnival Jester +gdp_visit_holding_decision_event.1335 = { + type = character_event + title = { + desc = gdp_visit_holding_decision_event.1335.t_market + desc = gdp_visit_holding_decision_event.1335.t + } + window = visit_settlement_window + desc = { + first_valid = { + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_carnival_jester + scope:carnival_jester_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1335.desc_returned_01 + } + triggered_desc = { + trigger = { scope:carnival_jester_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1335.desc_returned_02 + } + } + desc = gdp_visit_holding_decision_event.1335.desc + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_social" } + override_background = { reference = market } + + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:carnival_jester } + animation = interested + } + animation = pondering + } + center_portrait = { + character = scope:carnival_jester + trigger = { exists = scope:carnival_jester } + animation = juggling + } + right_portrait = { + character = scope:carnival_spectator + animation = happiness + hide_info = yes + camera = camera_event_right + } + immediate = { + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:carnival_jester_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:carnival_jester VALUE_NAME = carnival_jester_recruit_cost } + } + visit_holding_set_rare_recruit_loc_tracker_effect = { SCENE = carnival_jester } + visit_holding_pick_merchant_court_position_effect = { + CHARACTER = scope:carnival_jester + EMPLOYER = root + } + #Set up crowd + if = { + limit = { is_ai = no } + create_character = { + template = peasant_character + location = root.location + culture = root.location.culture + faith = root.location.faith + gender_female_chance = 50 + save_scope_as = carnival_spectator + } + } + } + + #Creditor: talk shop + option = { + name = gdp_visit_holding_decision_event.1335.b + trigger = { + has_realm_law = company_purpose_creditor + custom_tooltip = { + text = gdp_visit_holding_decision_event.1335.b.cooldown.tt + NOT = { has_variable = 1335_gained_creditor_xp_recently } + } + } + show_as_unavailable = { has_realm_law = company_purpose_creditor } + reason = purpose_creditor + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_minor_value + } + visit_holding_set_option_cooldown_effect = { VAR = 1335_gained_creditor_xp_recently } + visit_holding_return_to_market_dock_hub_effect = yes + } + + #Recruit them + option = { + name = gdp_visit_holding_decision_event.1335.a + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1335.a.tt + short_term_gold >= scope:carnival_jester_recruit_cost + } + } + scope:carnival_jester = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1335.recruit_benefits.tt + object = scope:carnival_jester + } + } + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:carnival_jester + gold = scope:carnival_jester_recruit_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:carnival_jester + add_courtier = scope:carnival_jester + hidden_effect = { + scope:carnival_jester = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:carnival_jester } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Duel them + option = { + name = gdp_visit_holding_decision_event.1335.c + scope:carnival_jester = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1335.recruit_benefits.tt + object = scope:carnival_jester + } + } + } + duel = { + skill = diplomacy + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1335.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1335.c.success + left_icon = root + right_icon = scope:carnival_jester + add_courtier = scope:carnival_jester + hidden_effect = { + scope:carnival_jester = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + remove_character_flag ?= created + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:carnival_jester } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1335.c.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1335.c.failure + desc = gdp_visit_holding_decision_event.1335.c.failure + left_icon = root + right_icon = scope:carnival_jester + } + visit_holding_rare_recruit_duel_loss_effect = { + CHARACTER = scope:carnival_jester + SCENE = carnival_jester + } + } + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Go Back + option = { + name = gdp_visit_holding_decision_event.1335.d + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + visit_holding_been_to_rare_recruit_effect = { SCENE = carnival_jester } + visit_holding_return_to_market_dock_hub_effect = yes + } + after = { + scope:carnival_spectator ?= { silent_disappearance_effect = yes } + } +} +# The Cook +gdp_visit_holding_decision_event.1336 = { + type = character_event + title = { + desc = gdp_visit_holding_decision_event.1336.t_market + desc = gdp_visit_holding_decision_event.1336.t + } + window = visit_settlement_window + desc = { + first_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_cook + scope:cook_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1336.desc_returned_01 + } + triggered_desc = { + trigger = { scope:cook_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1336.desc_returned_02 + } + desc = { + desc = gdp_visit_holding_decision_event.1336.desc_intro + first_valid = { + triggered_desc = { + trigger = { exists = scope:local_noble } + desc = gdp_visit_holding_decision_event.1336.desc_named_noble + } + desc = gdp_visit_holding_decision_event.1336.desc_unknown_noble + } + } + } + } + + theme = merchant + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_social" } + override_background = { reference = market } + + left_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:cook } + animation = interested + } + animation = pondering + } + right_portrait = { + character = scope:cook + trigger = { exists = scope:cook } + animation = disappointed + } + immediate = { + if = { + limit = { + NOT = { exists = scope:visiting_location } + } + location = { save_scope_as = visiting_location } + } + if = { + limit = { NOT = { exists = scope:local_noble } } + scope:visiting_location.county.holder ?= { + if = { + limit = { this != root } + save_scope_as = local_noble + } + else = { + liege ?= { + if = { + limit = { + this != root + is_landed = yes + } + save_scope_as = local_noble + } + } + } + } + } + #Set recruitment cost + if = { + limit = { + NOT = { exists = scope:cook_recruit_cost } + } + 1320_set_cost_effect = { CHARACTER = scope:cook VALUE_NAME = cook_recruit_cost } + } + visit_holding_set_rare_recruit_loc_tracker_effect = { SCENE = cook } + visit_holding_pick_merchant_court_position_effect = { + CHARACTER = scope:cook + EMPLOYER = root + } + } + #Recruit them + option = { + name = gdp_visit_holding_decision_event.1336.a + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1336.a.tt + short_term_gold >= scope:cook_recruit_cost + } + } + scope:cook = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1336.recruit_benefits.tt + object = scope:cook + } + } + } + show_as_unavailable = { always = yes } + pay_short_term_gold = { + target = scope:cook + gold = scope:cook_recruit_cost + } + send_interface_toast = { + type = event_toast_effect_good + title = market_recruitment_success.t + left_icon = scope:cook + add_courtier = scope:cook + hidden_effect = { + scope:cook = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:cook } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Duel them + option = { + name = gdp_visit_holding_decision_event.1336.c + scope:cook = { + if = { + limit = { NOT = { exists = var:visit_holding_recruit_court_position } } + custom_description_no_bullet = { + text = gdp_visit_holding_decision_event.1336.recruit_benefits.tt + object = scope:cook + } + } + } + duel = { + skill = stewardship + value = average_skill_rating + #Success : recruit them + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1336.c.success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1336.c.success + left_icon = root + right_icon = scope:cook + add_courtier = scope:cook + hidden_effect = { + scope:cook = { + add_opinion = { + modifier = recruited_me_opinion + target = root + opinion = 50 + } + remove_character_flag ?= created + save_scope_as = recruited_interesting_character + } + } + } + visit_holding_appoint_rare_recruit_court_position_effect = { CHARACTER = scope:cook } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1336.c.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1336.c.failure + desc = gdp_visit_holding_decision_event.1336.c.failure + left_icon = root + right_icon = scope:cook + } + visit_holding_rare_recruit_duel_loss_effect = { + CHARACTER = scope:cook + SCENE = cook + } + } + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_recruited_recently } + visit_holding_rare_recruit_return_to_hub_after_recruit_effect = yes + } + + #Go Back + option = { + name = gdp_visit_holding_decision_event.1336.d + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + visit_holding_been_to_rare_recruit_effect = { SCENE = cook } + visit_holding_return_to_market_dock_hub_effect = yes + } +} + +# Relax +gdp_visit_holding_decision_event.1340 = { + type = character_event + title = gdp_visit_holding_decision_event.1340.t + window = visit_settlement_window + desc = { + desc = gdp_visit_holding_decision_event.1340.desc + triggered_desc = { # Tea + trigger = { scope:relax_type = flag:tea } + desc = gdp_visit_holding_decision_event.1340.tea + } + triggered_desc = { # Hashish + trigger = { scope:relax_type = flag:hashish } + desc = gdp_visit_holding_decision_event.1340.hashish + } + triggered_desc = { # Drink + trigger = { scope:relax_type = flag:drink } + desc = gdp_visit_holding_decision_event.1340.drink + } + triggered_desc = { # Food + trigger = { scope:relax_type = flag:food } + desc = gdp_visit_holding_decision_event.1340.food + } + triggered_desc = { # Bath + trigger = { scope:relax_type = flag:bath } + desc = gdp_visit_holding_decision_event.1340.bath + } + } + theme = merchant + left_portrait = { + character = root + triggered_animation = { + trigger = { scope:relax_type = flag:tea } + animation = interested + } + triggered_animation = { + trigger = { scope:relax_type = flag:hashish } + animation = delirium + } + triggered_animation = { + trigger = { + scope:relax_type = flag:food + is_vegetarian_trigger = no + faith = { + NOR = { + religion_tag = islam_religion + religion_tag = judaism_religion + } + } + } + animation = eating_salami + } + triggered_animation = { + trigger = { + scope:relax_type = flag:food + is_vegetarian_trigger = no + } + animation = eating + } + triggered_animation = { + trigger = { + scope:relax_type = flag:food + is_vegetarian_trigger = yes + } + animation = interested + } + triggered_animation = { + trigger = { scope:relax_type = flag:drink } + animation = drink + } + animation = happiness + } + right_portrait = { + trigger = { exists = scope:visiting_associate } + character = scope:visiting_associate + animation = happiness + } + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_social" } + override_background = { + trigger = { + OR = { + scope:relax_type = flag:tea + scope:relax_type = flag:drink + } + } + reference = tavern + } + override_background = { + trigger = { scope:relax_type = flag:hashish } + reference = relaxing_room + } + override_background = { + trigger = { scope:relax_type = flag:food } + reference = feast + } + override_background = { + trigger = { scope:relax_type = flag:bath } + reference = bath_house + } + override_effect_2d = { + trigger = { scope:relax_type = flag:bath } + reference = smoke + } + + immediate = { + location.county.holder = { save_scope_as = bg_scope } + visit_holding_ensure_visiting_associate_effect = yes + if = { # Tea + limit = { + visit_holding_relax_tea_trigger = yes + NOR = { + AND = { + has_trait = drunkard + location = { + NOR = { + geographical_region = world_europe + geographical_region = world_asia + } + } + } + has_trait = comfort_eater + } + } + save_scope_value_as = { + name = relax_type + value = flag:tea + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + scope:visiting_associate ?= { + if = { + limit = { is_alive = yes } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + } + } + } + else_if = { # Hashish + limit = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = hashishiyah + } + trigger_if = { + limit = { + NOT = { has_trait = hashishiyah } + } + NOT = { has_trait = comfort_eater } + } + can_be_hashishiyah = yes + location = { + NOR = { + geographical_region = world_europe + geographical_region = world_asia + } + } + } + save_scope_value_as = { + name = relax_type + value = flag:hashish + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + hashishiyah = minor_stress_impact_loss + } + scope:visiting_associate ?= { + if = { + limit = { is_alive = yes } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + hashishiyah = minor_stress_impact_loss + } + } + } + } + else_if = { # Drink + limit = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = drunkard + } + trigger_if = { + limit = { + NOT = { has_trait = drunkard } + } + NOT = { has_trait = comfort_eater } + } + location = { # Not offering booze + NOR = { + religion = religion:islam_religion + religion = religion:jainism_religion + faith = faith:mandaean_faith + } + } + } + save_scope_value_as = { + name = relax_type + value = flag:drink + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + lifestyle_reveler = minor_stress_impact_loss + drunkard = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + scope:visiting_associate ?= { + if = { + limit = { is_alive = yes } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + lifestyle_reveler = minor_stress_impact_loss + drunkard = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + } + } + } + else_if = { # Food + limit = { + trigger_if = { + limit = { has_trait = temperate } + has_trait = comfort_eater + } + NOR = { + has_trait = inappetetic + has_trait = temperate + } + } + save_scope_value_as = { + name = relax_type + value = flag:food + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + gluttonous = minor_stress_impact_loss + comfort_eater = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + scope:visiting_associate ?= { + if = { + limit = { is_alive = yes } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + gluttonous = minor_stress_impact_loss + comfort_eater = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + } + } + } + else = { # Bath + save_scope_value_as = { + name = relax_type + value = flag:bath + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + scope:visiting_associate ?= { + if = { + limit = { is_alive = yes } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + } + } + } + visit_holding_set_option_cooldown_market_dock_effect = { VAR = 1320_has_relaxed_recently } + } + + #Go Back + option = { + name = gdp_visit_holding_decision_event.1340.a + custom_tooltip = gdp_visit_holding_decision_event.1320.d.tt + if = { + limit = { + location = { is_coastal = yes } + } + trigger_event = gdp_visit_holding_decision_event.1400 + } + else = { + trigger_event = gdp_visit_holding_decision_event.1300 + } + } + + after = { + remove_character_flag = is_naked + } +} diff --git a/events/dlc/gdp/gdp_visit_holding_decision_event_2.txt b/events/dlc/gdp/gdp_visit_holding_decision_event_2.txt new file mode 100644 index 000000000..5f04c2812 --- /dev/null +++ b/events/dlc/gdp/gdp_visit_holding_decision_event_2.txt @@ -0,0 +1,4050 @@ +namespace = gdp_visit_holding_decision_event + +scripted_effect gdp_1200_create_fallback_negotiator_effect = { + if = { + limit = { + scope:patron ?= { + faith_dominant_gender_female_or_equal = yes + faith_dominant_gender_male_or_equal = no + } + } + create_character = { + template = pool_repopulate_stewardship + gender_female_chance = 100 + culture = scope:patron.culture + faith = scope:patron.faith + dynasty = none + location = scope:patron.location + save_scope_as = negotiator + after_creation = { add_character_flag = gdp_1200_temp_negotiator } + } + } + else_if = { + limit = { + scope:patron ?= { + faith_dominant_gender_male_or_equal = yes + faith_dominant_gender_female_or_equal = no + } + } + create_character = { + template = pool_repopulate_stewardship + gender_female_chance = 0 + culture = scope:patron.culture + faith = scope:patron.faith + dynasty = none + location = scope:patron.location + save_scope_as = negotiator + after_creation = { add_character_flag = gdp_1200_temp_negotiator } + } + } + else = { + create_character = { + template = pool_repopulate_stewardship + gender_female_chance = 50 + culture = scope:patron.culture + faith = scope:patron.faith + dynasty = none + location = scope:patron.location + save_scope_as = negotiator + after_creation = { add_character_flag = gdp_1200_temp_negotiator } + } + } +} + +#Supply duel for your highest skill stat +scripted_effect gdp_1200_highest_skill_duel_effect_a = { + if = { + limit = { highest_skill_including_prowess = diplomacy } + gdp_1200_duel_effect_a = { SKILL = diplomacy } + } + else_if = { + limit = { highest_skill_including_prowess = stewardship } + gdp_1200_duel_effect_a = { SKILL = stewardship } + } + else_if = { + limit = { highest_skill_including_prowess = intrigue } + gdp_1200_duel_effect_a = { SKILL = intrigue } + } + else_if = { + limit = { highest_skill_including_prowess = learning } + gdp_1200_duel_effect_a = { SKILL = learning } + } + else_if = { + limit = { highest_skill_including_prowess = martial } + gdp_1200_duel_effect_a = { SKILL = martial } + } + else = { + gdp_1200_duel_effect_a = { SKILL = prowess } + } +} + +scripted_effect gdp_1200_highest_skill_duel_effect_b = { + if = { + limit = { highest_skill_including_prowess = diplomacy } + gdp_1200_duel_effect_b = { SKILL = diplomacy } + } + else_if = { + limit = { highest_skill_including_prowess = stewardship } + gdp_1200_duel_effect_b = { SKILL = stewardship } + } + else_if = { + limit = { highest_skill_including_prowess = intrigue } + gdp_1200_duel_effect_b = { SKILL = intrigue } + } + else_if = { + limit = { highest_skill_including_prowess = learning } + gdp_1200_duel_effect_b = { SKILL = learning } + } + else_if = { + limit = { highest_skill_including_prowess = martial } + gdp_1200_duel_effect_b = { SKILL = martial } + } + else = { + gdp_1200_duel_effect_b = { SKILL = prowess } + } +} + +#Actual patron duel effect +scripted_effect gdp_1200_duel_effect_a = { + duel = { + skill = $SKILL$ + target = scope:negotiator + #Success: Get what you wanted + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1200.a_$SKILL$.success + send_interface_toast = { + title = gdp_visit_holding_decision_event.1200.a_$SKILL$.success + left_icon = root + right_icon = scope:negotiator + add_character_modifier = { + modifier = gdp_patron_competitiveness_modifier + years = 5 + } + #Cooldown + set_variable = { + name = 1200_patron_competitiveness + value = flag:success + days = visit_holding_cooldown_days + } + visit_holding_refresh_patron_area_tracker_effect = yes + trigger_event = gdp_visit_holding_decision_event.1200 + } + } + #Failure: you get nothing/get a worse deal, patron/steward gets mad + 45 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1200.a_$SKILL$.failure + send_interface_toast = { + title = gdp_visit_holding_decision_event.1200.a_$SKILL$.failure + left_icon = root + right_icon = scope:negotiator + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_competitiveness } + # they get mad + progress_towards_rival_effect = { + REASON = rival_merchant_asked_too_much + CHARACTER = scope:negotiator + OPINION = default_rival_opinion + } + #Go back to the main event + trigger_event = gdp_visit_holding_decision_event.1200 + } + } + #Critical Failure: The local guards are summoned + 5 = { + trigger = { + root = { + OR = { + highest_skill = martial + highest_skill_including_prowess = prowess + } + } + } + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + min = 5 + desc = gdp_visit_holding_decision_event.1200.a_$SKILL$.critical_failure + send_interface_toast = { + title = gdp_visit_holding_decision_event.1200.a_$SKILL$.critical_failure + left_icon = root + right_icon = scope:negotiator + #Set up the cooldown for the convince-ction + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_competitiveness } + #Quite the tussle + increase_wounds_effect = { REASON = fight } + #This patron doesn't want to see you again + progress_towards_rival_effect = { + REASON = rival_merchant_tried_to_intimidate + CHARACTER = scope:negotiator + OPINION = default_rival_opinion + } + #And you will not be going back to this patron for a while, but feel free to look at the greyed out option + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_guards_summoned } + #Go back to the main event + trigger_event = gdp_visit_holding_decision_event.1000 + } + } + } +} + +scripted_effect gdp_1200_duel_effect_b = { + duel = { + skill = $SKILL$ + target = scope:negotiator + #Success: Get what you wanted + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + desc = gdp_visit_holding_decision_event.1200.a_$SKILL$.success + send_interface_toast = { + title = gdp_visit_holding_decision_event.1200.a_$SKILL$.success + left_icon = root + right_icon = scope:negotiator + pay_short_term_gold = { + target = scope:negotiator + gold = medium_gold_value + } + add_prestige = medium_prestige_gain + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_prestige } + trigger_event = gdp_visit_holding_decision_event.1200 + } + + } + #Failure: you get nothing/get a worse deal, patron/steward gets mad + 45 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1200.a_$SKILL$.failure + send_interface_toast = { + title = gdp_visit_holding_decision_event.1200.a_$SKILL$.failure + left_icon = root + right_icon = scope:negotiator + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_prestige } + add_prestige = minor_prestige_loss + #Go back to the second event + trigger_event = gdp_visit_holding_decision_event.1200 + } + } + #Critical Failure: The local guards are summoned + 5 = { + trigger = { + root = { + OR = { + highest_skill = martial + highest_skill_including_prowess = prowess + } + } + } + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + min = 5 + desc = gdp_visit_holding_decision_event.1200.a_$SKILL$.critical_failure + send_interface_toast = { + title = gdp_visit_holding_decision_event.1200.a_$SKILL$.critical_failure + left_icon = root + right_icon = scope:negotiator + #Set up the cooldown for the convince-ction + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_prestige } + #Quite the tussle + increase_wounds_effect = { REASON = fight } + #This patron doesn't want to see you again + progress_towards_rival_effect = { + REASON = rival_merchant_tried_to_intimidate + CHARACTER = scope:negotiator + OPINION = default_rival_opinion + } + #And you will not be going back to this patron for a while, but feel free to look at the greyed out option + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_guards_summoned } + #Go back to the main event + trigger_event = gdp_visit_holding_decision_event.1000 + } + } + } +} + +#Visit Patron +gdp_visit_holding_decision_event.1200 = { + type = character_event + title = gdp_visit_holding_decision_event.1200.t + window = visit_settlement_window + desc = { + desc = gdp_visit_holding_decision_event.1200.intro_desc + first_valid = { + triggered_desc = { + trigger = { + AND = { + scope:patron = scope:negotiator + scope:steward ?= { is_available = yes } + } + } + desc = gdp_visit_holding_decision_event.1200.all_available_desc + } + triggered_desc = { + trigger = { + AND = { + scope:patron = scope:negotiator + OR = { + NOT = { exists = scope:steward } + scope:steward = { is_available = no } + } + } + } + desc = gdp_visit_holding_decision_event.1200.patron_available_desc + } + triggered_desc = { + trigger = { scope:steward ?= scope:negotiator } + desc = gdp_visit_holding_decision_event.1200.steward_available_desc + } + triggered_desc = { + trigger = { + exists = scope:negotiator + NOR = { + scope:negotiator = scope:patron + scope:steward ?= { this = scope:negotiator } + } + } + desc = gdp_visit_holding_decision_event.1200.representative_desc + } + desc = gdp_visit_holding_decision_event.1200.none_available_desc + } + } + + theme = stewardship + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = throne_room + + left_portrait = { + character = root + animation = holding_scrolls + camera = camera_event_scheme_center + } + + center_portrait = { + character = scope:steward + animation = chancellor + camera = camera_event_scheme_far_right + trigger = { + scope:steward ?= { + this != scope:negotiator + is_available = yes + } + } + } + + right_portrait = { + character = scope:negotiator + animation = pondering + } + + immediate = { + suzerain = { save_scope_as = patron } + scope:patron.cp:councillor_steward ?= { save_scope_as = steward } + if = { + limit = { NOT = { exists = scope:negotiator } } + if = { + limit = { + scope:patron = { is_available = yes } + } + scope:patron = { save_scope_as = negotiator } + } + else_if = { + limit = { + scope:steward ?= { is_available = yes } + } + scope:steward = { save_scope_as = negotiator } + } + else_if = { + limit = { + scope:patron.cp:councillor_chancellor ?= { is_available = yes } + } + scope:patron.cp:councillor_chancellor ?= { save_scope_as = negotiator } + } + else_if = { + limit = { + scope:patron = { + any_councillor = { is_available = yes } + } + } + scope:patron = { + random_councillor = { + limit = { is_available = yes } + save_scope_as = negotiator + } + } + } + else_if = { + limit = { + scope:patron = { + any_courtier = { + is_available = yes + is_adult = yes + } + } + } + scope:patron = { + random_courtier = { + limit = { + is_available = yes + is_adult = yes + } + save_scope_as = negotiator + } + } + } + else_if = { + limit = { + scope:patron = { + any_vassal = { + is_available = yes + is_adult = yes + } + } + } + scope:patron = { + random_vassal = { + limit = { + is_available = yes + is_adult = yes + } + save_scope_as = negotiator + } + } + } + else = { gdp_1200_create_fallback_negotiator_effect = yes } + } + } + + option = { # Ask for Trade Privileges + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1200.a.negotiator.tt + exists = scope:negotiator + } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1200.a.competitiveness_cooldown.tt + NOT = { has_variable = 1200_patron_competitiveness } + } + } + show_as_unavailable = { always = yes } + name = gdp_visit_holding_decision_event.1200.a + custom_tooltip = gdp_visit_holding_decision_event.1200.a.tt + trigger_event = gdp_visit_holding_decision_event.1201 + } + option = { # Look for Investment Opportunities + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1200.a.negotiator.tt + exists = scope:negotiator + } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1200.b.prestige_cooldown.tt + NOT = { has_variable = 1200_patron_prestige } + } + short_term_gold >= medium_gold_value + } + reason = add_prestige + show_as_unavailable = { always = yes } + name = gdp_visit_holding_decision_event.1200.b + custom_tooltip = gdp_visit_holding_decision_event.1200.b.tt + trigger_event = gdp_visit_holding_decision_event.1202 + } + + option = { # Back Out + name = gdp_visit_holding_decision_event.1200.c + custom_tooltip = gdp_visit_holding_decision_event.1200.c.tt + if = { + limit = { scope:negotiator ?= { has_character_flag = gdp_1200_temp_negotiator } } + scope:negotiator = { silent_disappearance_effect = yes } + } + trigger_event = gdp_visit_holding_decision_event.1000 + } +} + +#Visit Patron - Increase Competitiveness +gdp_visit_holding_decision_event.1201 = { + type = character_event + title = gdp_visit_holding_decision_event.1201.t + window = visit_settlement_window + desc = { + first_valid = { + triggered_desc = { + trigger = { + AND = { + scope:patron = scope:negotiator + scope:steward ?= { is_available = yes } + } + } + desc = gdp_visit_holding_decision_event.1201.all_available_desc + } + triggered_desc = { + trigger = { + AND = { + scope:patron = { is_available = yes } + OR = { + NOT = { exists = scope:steward } + scope:steward ?= { is_available = no } + } + } + } + desc = gdp_visit_holding_decision_event.1201.patron_available_desc + } + triggered_desc = { + trigger = { scope:steward ?= scope:negotiator } + desc = gdp_visit_holding_decision_event.1201.steward_available_desc + } + triggered_desc = { + trigger = { exists = scope:negotiator } + desc = gdp_visit_holding_decision_event.1201.representative_desc + } + } + } + + theme = stewardship + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = throne_room + + left_portrait = { + character = root + animation = personality_dishonorable + camera = camera_event_group_talking_left_left + } + + center_portrait = { + character = scope:steward + animation = wedding_groom_right + camera = camera_event_scheme_center_look_semi_right + trigger = { + scope:steward ?= { + this != scope:negotiator + is_available = yes + } + } + } + + right_portrait = { + character = scope:negotiator + animation = zealous_superior + } + + option = { # You owe me + trigger = { + exists = scope:negotiator + has_usable_hook = scope:negotiator + } + show_as_unavailable = { always = yes } + if = { + limit = { has_usable_hook = scope:patron } + use_hook = scope:patron + } + else_if = { + limit = { has_usable_hook = scope:negotiator } + use_hook = scope:negotiator + } + name = gdp_visit_holding_decision_event.1201.b + send_interface_toast = { + title = gdp_visit_holding_decision_event.1202.b.success + left_icon = root + right_icon = scope:negotiator + add_character_modifier = { + modifier = gdp_patron_competitiveness_modifier + years = 5 + } + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_competitiveness } + trigger_event = gdp_visit_holding_decision_event.1200 + } + stress_and_fulfillment_impact = { + deceitful = medium_stress_impact_loss + just = minor_stress_impact_loss + honest = medium_stress_impact_gain + } + } + + option = { # I want something... more. + trigger = { exists = scope:negotiator } + name = gdp_visit_holding_decision_event.1201.a + + gdp_1200_highest_skill_duel_effect_a = yes + + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + greedy = minor_stress_impact_loss + shy = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + } + + option = { # Let me rethink that. + name = gdp_visit_holding_decision_event.1201.c + trigger_event = gdp_visit_holding_decision_event.1200 + custom_tooltip = gdp_visit_holding_decision_event.1201.c.tt + } +} + +#Visit Patron - Gold for Prestige +gdp_visit_holding_decision_event.1202 = { + type = character_event + title = gdp_visit_holding_decision_event.1202.t + window = visit_settlement_window + desc = { + first_valid = { + triggered_desc = { + trigger = { + AND = { + scope:patron = scope:negotiator + scope:steward ?= { is_available = yes } + } + } + desc = gdp_visit_holding_decision_event.1202.all_available_desc + } + triggered_desc = { + trigger = { + AND = { + scope:patron = { is_available = yes } + OR = { + NOT = { exists = scope:steward } + scope:steward ?= { is_available = no } + } + } + } + desc = gdp_visit_holding_decision_event.1202.patron_available_desc + } + triggered_desc = { + trigger = { + scope:steward ?= { this = scope:negotiator } + } + desc = gdp_visit_holding_decision_event.1202.steward_available_desc + } + triggered_desc = { + trigger = { exists = scope:negotiator } + desc = gdp_visit_holding_decision_event.1202.representative_desc + } + } + } + + theme = stewardship + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = throne_room + + left_portrait = { + character = root + animation = steward + } + + center_portrait = { + character = scope:steward + animation = flirtation_left + camera = camera_event_right_crowner_crowning + trigger = { + scope:steward ?= { + this != scope:negotiator + is_available = yes + } + } + } + + right_portrait = { + character = scope:negotiator + animation = page_flipping + } + + option = { # Wait, hear me out. + trigger = { exists = scope:negotiator } + name = gdp_visit_holding_decision_event.1202.a + gdp_1200_highest_skill_duel_effect_b = yes + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + deceitful = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + greedy = minor_stress_impact_loss + humble = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + } + + option = { # Simple transaction + trigger = { exists = scope:negotiator } + name = gdp_visit_holding_decision_event.1202.b + send_interface_toast = { + title = gdp_visit_holding_decision_event.1202.b.success + left_icon = root + right_icon = scope:negotiator + pay_short_term_gold = { + target = scope:negotiator + gold = medium_gold_value + } + add_prestige = minor_prestige_gain + visit_holding_set_option_cooldown_patron_effect = { VAR = 1200_patron_prestige } + trigger_event = gdp_visit_holding_decision_event.1200 + } + + stress_and_fulfillment_impact = { + trusting = medium_stress_impact_loss + content = minor_stress_impact_loss + humble = minor_stress_impact_loss + greedy = medium_stress_impact_gain + arrogant = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + } + } + + option = { # Let me rethink that. + name = gdp_visit_holding_decision_event.1201.c + trigger_event = gdp_visit_holding_decision_event.1200 + custom_tooltip = gdp_visit_holding_decision_event.1201.c.tt + } +} + +#Events that use this must write loc for tracker 0 and 1 +scripted_effect 1505_set_and_check_scene_loc_tracker_scope_effect = { + if = { + limit = { + NOT = { exists = scope:$SCENE$_loc_tracker } #e.g. scope:weaponsmith_loc_tracker + } + save_scope_value_as = { + name = $SCENE$_loc_tracker + value = 0 + } + } + else_if = { + limit = { scope:$SCENE$_loc_tracker ?= 1 } + save_scope_value_as = { + name = $SCENE$_loc_tracker + value = 0 + } + } + else = { + save_scope_value_as = { + name = $SCENE$_loc_tracker + value = 1 + } + } +} + +#One of your sick kids who wouldn't fit the visiting_partner trigger +scripted_trigger 1500_sickly_minor_trigger = { + location = root.location + is_courtier_of = root + is_travelling = no + is_imprisoned = no + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + age < 10 +} +#No sickness or wounds for visiting partner +scripted_trigger 1500_has_illness_or_wound_to_treat_trigger = { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } +} + +#Nothing left for us to do +scripted_trigger 1500_done_with_holy_site_trigger = { + has_variable = 1500_used_healer_recently + has_variable = 1500_used_holy_site_recently + has_variable = 1500_used_garden_recently + trigger_if = { + limit = { exists = scope:merchant_physician_recruit } + exists = scope:merchant_decision_recruited_physician + } +} +#Find an appropriate visiting partner +scripted_trigger 1500_appropriate_visiting_partner_basic_trigger = { + is_available = yes + is_courtier_of = root + age >= 10 + OR = { + opinion = { + target = root + value >= 25 + } + has_any_good_relationship_with_character_trigger = { CHARACTER = root } + } + NOR = { + has_relation_potential_rival = root + has_relation_victim = root + has_relation_bully = root + } +} +#Pick Visiting Partner and save scope +scripted_effect 1500_pick_visiting_partner_effect = { + if = { + limit = { NOT = { exists = scope:visiting_partner } } + if = { + limit = { + any_courtier = { 1500_appropriate_visiting_partner_basic_trigger = yes } + } + random_courtier = { + limit = { 1500_appropriate_visiting_partner_basic_trigger = yes } + weight = { + base = 1 + modifier = { + add = 1000 + is_close_family_of = root + 1500_has_illness_or_wound_to_treat_trigger = yes + root.location = { + OR = { + has_holding_type = church_holding + has_holding_type = temple_citadel_holding + } + } + } + modifier = { + add = 500 + is_spouse_of = root + 1500_has_illness_or_wound_to_treat_trigger = yes + root.location = { + OR = { + has_holding_type = church_holding + has_holding_type = temple_citadel_holding + } + } + } + modifier = { + add = 100 + has_relation_lover = root + root.location = { + OR = { + has_holding_type = church_holding + has_holding_type = temple_citadel_holding + } + } + } + modifier = { add = 20 is_spouse_of = root } + modifier = { add = 15 is_primary_heir_of = root } + modifier = { + add = 10 + has_court_position = bodyguard_court_position + } + modifier = { add = 5 is_close_family_of = root } + modifier = { add = 2 has_trait = ambitious } + modifier = { add = -5 has_trait = lazy } + } + save_scope_as = visiting_partner + } + } + } +} +#Remember character for loc +scripted_effect 1500_remember_character_effect = { + #Do we already remember them? + if = { + limit = { + has_variable = merchant_remembered_$GUILD$s_list #Notice the 's' right after GUILD (= 'merchants' instead of 'merchant') + any_in_list = { + variable = merchant_remembered_$GUILD$s_list + this = $CHARACTER$ + } + } + #Replace old entry with a new one + remove_list_variable = { + name = merchant_remembered_$GUILD$s_list + target = $CHARACTER$ + } + add_to_variable_list = { + name = merchant_remembered_$GUILD$s_list + target = $CHARACTER$ + years = 10 + } + } + #Otherwise just add 'em to the list + else = { + add_to_variable_list = { + name = merchant_remembered_$GUILD$s_list + target = $CHARACTER$ + years = 10 + } + } +} + +#We return to the Holy Site event to peruse other options +scripted_effect 1501_return_to_holy_site_effect = { + custom_tooltip = return_to_holy_site + trigger_event = gdp_visit_holding_decision_event.1500 +} + +#Set up some reusable trait triggers +scripted_trigger 1510_has_friendly_traits = { + OR = { + has_trait = gregarious + has_trait = trusting + has_trait = compassionate + has_trait = forgiving + has_trait = generous + has_trait = fickle + has_trait = calm + } +} + +scripted_trigger 1510_has_uninterested_traits = { + OR = { + has_trait = callous + has_trait = cynical + has_trait = arrogant + has_trait = fickle + has_trait = arbitrary + has_trait = patient + has_trait = sadistic + } +} + +scripted_trigger 1510_has_commerce_traits = { + OR = { + has_trait = greedy + has_trait = deceitful + has_trait = ambitious + has_trait = diligent + has_trait = impatient + } +} + +scripted_trigger 1510_has_standoffish_traits = { + OR = { + has_trait = shy + has_trait = craven + has_trait = humble + has_trait = paranoid + } +} + +scripted_trigger 1510_has_irrational_traits = { + OR = { + has_trait = eccentric + has_trait = lunatic + has_trait = possessed + } +} + +scripted_trigger 1511_has_no_applicable_traits = { + 1510_has_friendly_traits = no + 1510_has_uninterested_traits = no + 1510_has_commerce_traits = no + 1510_has_standoffish_traits = no + 1510_has_irrational_traits = no +} + +#Holy Site: Visit the local Holy Site +gdp_visit_holding_decision_event.1500 = { + type = character_event + title = gdp_visit_holding_decision_event.1500.t + window = visit_settlement_window + desc = { + #Intro + first_valid = { + #We've returned to this scene, now what + #RETURN: We've returned from Main Square + random_valid = { + triggered_desc = { + trigger = { + var:return_from_location ?= flag:main_square + exists = scope:been_to_holy_site + OR = { + scope:holy_site_loc_tracker ?= 0 + scope:holy_site_loc_tracker ?= 2 + } + } + desc = gdp_visit_holding_decision_event.1500.desc_returned_01 + } + triggered_desc = { + trigger = { + var:return_from_location ?= flag:main_square + scope:holy_site_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1500.desc_returned_02 + } + } + #RETURN: We've returned from the Healer + triggered_desc = { + trigger = { var:return_from_location ?= flag:healer } + desc = gdp_visit_holding_decision_event.1500.desc_returned_from_healer + } + #RETURN: We've returned from the Church + triggered_desc = { + trigger = { var:return_from_location ?= flag:church } + desc = gdp_visit_holding_decision_event.1500.desc_returned_from_church + } + #RETURN: We've returned from the Garden + triggered_desc = { + trigger = { var:return_from_location ?= flag:garden } + desc = gdp_visit_holding_decision_event.1500.desc_returned_from_garden + } + #RETURN: We've returned from the Physician + triggered_desc = { + trigger = { var:return_from_location ?= flag:physician } + desc = gdp_visit_holding_decision_event.1500.desc_returned_from_physician + } + #FIRST TIME: First time here + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1500.desc + } + } + #Outro + first_valid = { + #FIRST TIME: For some reason, you have both Sickly Minor and Physician + triggered_desc = { + trigger = { + exists = scope:merchant_physician_recruit + exists = scope:1500_sickly_minor + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_physician_sickly_minor + } + #FIRST TIME: First time here, look at the physician + triggered_desc = { + trigger = { + exists = scope:merchant_physician_recruit + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_physician + } + #FIRST TIME: First time here, sickly minor + triggered_desc = { + trigger = { + exists = scope:1500_sickly_minor + NOT = { exists = scope:been_to_church_grounds } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_sickly_minor + } + #FIRST TIME: First time here, curious partner + triggered_desc = { + trigger = { + exists = scope:visiting_partner + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_partner + } + #FIRST TIME: First time here + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro + } + #RETURN: Partner - there is nothing left for us here + triggered_desc = { + trigger = { + exists = scope:visiting_partner + 1500_done_with_holy_site_trigger = yes + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_partner_finished + } + #RETURN: There is nothing left for us here + triggered_desc = { + trigger = { 1500_done_with_holy_site_trigger = yes } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_finished + } + #RETURN: Physician did not move to their study, yet + triggered_desc = { + trigger = { + exists = scope:merchant_physician_recruit + NOR = { + exists = scope:been_to_physician + exists = scope:merchant_decision_recruited_physician + } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_physician_return + } + #RETURN: We've been here before + first_valid = { + #RETURN: Sickly minor is still at the healer's + triggered_desc = { + trigger = { + exists = scope:1500_sickly_minor + var:return_from_location ?= flag:healer + scope:1500_sickly_minor = { has_any_illness = yes } + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_sickly_minor_return + } + random_valid = { + #RETURN: Partner flavor + triggered_desc = { + trigger = { + exists = scope:visiting_partner + exists = scope:been_to_holy_site + scope:holy_site_loc_tracker ?= 0 + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_partner_01 + } + triggered_desc = { + trigger = { + exists = scope:visiting_partner + scope:holy_site_loc_tracker ?= 1 + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_partner_02 + } + triggered_desc = { + trigger = { + exists = scope:visiting_partner + scope:church_grounds_loc_tracker ?= 2 + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_partner_03 + } + #RETURN: Generics + triggered_desc = { + trigger = { + exists = scope:been_to_holy_site + scope:church_grounds_loc_tracker ?= 0 + } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_01 + } + triggered_desc = { + trigger = { scope:church_grounds_loc_tracker ?= 1 } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_02 + } + triggered_desc = { + trigger = { scope:church_grounds_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1500.desc_outro_return_03 + } + } + } + } + } + theme = faith + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_generic" } + override_background = { + trigger = { + location = { + culture = { has_graphical_east_asia_culture_group_trigger = no } + geographical_region = world_asia_southeast + } + } + reference = holy_site_generic + } + override_background = { reference = courtyard_location } + left_portrait = { + trigger = { exists = scope:visiting_partner } + character = scope:visiting_partner + #Concerned about our kid + triggered_animation = { + trigger = { + exists = scope:1500_sickly_minor + is_close_family_of = scope:1500_sickly_minor + OR = { + AND = { + var:return_from_location ?= flag:healer + scope:1500_sickly_minor = { has_any_illness = yes } + } + NOT = { exists = scope:been_to_holy_site } + } + } + animation = stress + } + #Zealous dudette + triggered_animation = { + trigger = { + scope:visiting_partner = { has_trait = zealous } + } + animation = personality_zealous + } + #Cynical dude + triggered_animation = { + trigger = { + scope:visiting_partner = { has_trait = cynical } + } + animation = personality_cynical + } + #Friendly + triggered_animation = { + trigger = { + scope:visiting_partner = { + OR = { + has_trait = gregarious + has_trait = trusting + has_trait = compassionate + has_trait = forgiving + has_trait = generous + has_trait = fickle + has_trait = calm + } + } + } + animation = personality_forgiving + } + #Business-minded + triggered_animation = { + trigger = { + scope:visiting_partner = { + OR = { + has_trait = greedy + has_trait = deceitful + has_trait = ambitious + has_trait = diligent + has_trait = impatient + } + } + } + animation = personality_greedy + } + #Uninterested + triggered_animation = { + trigger = { + scope:visiting_partner = { + OR = { + has_trait = callous + has_trait = cynical + has_trait = arrogant + has_trait = fickle + has_trait = arbitrary + has_trait = patient + has_trait = sadistic + } + } + } + animation = personality_callous + } + #Irrational + triggered_animation = { + trigger = { + scope:visiting_partner = { + OR = { + has_trait = eccentric + has_trait = lunatic + has_trait = possessed + } + } + } + animation = personality_irrational + } + #A bit awkward + triggered_animation = { + trigger = { + scope:visiting_partner = { + OR = { + has_trait = shy + has_trait = craven + has_trait = humble + has_trait = paranoid + } + } + } + animation = personality_coward + } + animation = survey + } + center_portrait = { + character = root + #Concerned about our kid + triggered_animation = { + trigger = { + exists = scope:1500_sickly_minor + OR = { + AND = { + var:return_from_location ?= flag:healer + scope:1500_sickly_minor = { has_any_illness = yes } + } + NOT = { exists = scope:been_to_church_grounds } + } + } + animation = worry + } + #Bah, humbug + triggered_animation = { + trigger = { + OR = { + has_trait = cynical + any_secret = { type = secret_non_believer } + } + } + animation = boredom + } + animation = personality_content + } + #Do we have a Physician? + right_portrait = { + trigger = { + exists = scope:1500_third_character + #If this is root, then that means we have talked to the Physician, so let's disappear the portrait + scope:1500_third_character != root + } + camera = camera_event_scheme_center_forward + character = scope:1500_third_character + #Otherwise it's the Physician + animation = personality_zealous + } + #Shove the Physician as long as we've visited them but haven't actioned them + lower_left_portrait = { + trigger = { + exists = scope:1500_fourth_character + #Unless we've actioned them and overwritten them with ROOT + scope:1500_fourth_character != root + } + character = scope:1500_fourth_character + } + #Show the kid here if not actioned + lower_center_portrait = { + trigger = { + exists = scope:1500_fifth_character + scope:1500_sickly_minor = { has_any_illness = yes } + scope:1500_fifth_character != root + } + character = scope:1500_fifth_character + } + immediate = { + 1500_pick_visiting_partner_effect = yes + + #Set up the ancillary portraits to remind the player of the characters + if = { + #Physician exists + limit = { + #We've been to them at least once + exists = scope:been_to_physician + #We're not done with them yet + AND = { + exists = scope:merchant_physician_recruit + NOT = { exists = scope:merchant_decision_recruited_physician } + } + #This isn't already the state + NAND = { + exists = scope:1500_fourth_character + scope:1500_fourth_character ?= scope:merchant_physician_recruit + } + } + scope:merchant_physician_recruit = { save_scope_as = 1500_fourth_character } + } + #Clear out the ancillary portrait(s) + if = { + limit = { + exists = scope:1500_fourth_character + scope:merchant_physician_recruit ?= scope:1500_fourth_character + exists = scope:merchant_decision_recruited_physician + } + #Overwrite with ROOT to hide that portrait + save_scope_as = 1500_fourth_character + } + if = { + limit = { + exists = scope:1500_fifth_character + scope:1500_sickly_minor ?= scope:1500_fifth_character + has_variable = 1500_used_healer_recently + } + #Overwrite with ROOT to hide that portrait + save_scope_as = 1500_fifth_character + } + #Do we have a sick minor we snuck along? + if = { + limit = { + NOT = { exists = scope:1500_sickly_minor } + any_close_family_member = { 1500_sickly_minor_trigger = yes } + } + random_close_family_member = { + limit = { 1500_sickly_minor_trigger = yes } + save_scope_as = 1500_sickly_minor + save_scope_as = 1500_fifth_character + } + } + #Rare: Spawn a spectacular Physician + if = { + limit = { + NOT = { has_variable = merchant_decision_1500_checked_for_physician } + } + random_list = { + 80 = { + #No Physician + } + 20 = { + #Has this person been our physician in the past 10 years? + random_pool_character = { + province = root.location + limit = { + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + is_available_adult = yes + save_temporary_scope_as = saved_character_check + } + save_scope_as = merchant_physician_recruit + #Some more loc flavor shenanigans for these saved scopes + save_scope_as = merchant_recurring_physician + } + #Otherwise find a physician in the pool + if = { + limit = { + NOT = { exists = scope:merchant_physician_recruit } + } + random_pool_character = { + province = root.location + limit = { + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + is_available_adult = yes + has_trait = devoted + learning >= 15 + OR = { + has_trait = lifestyle_physician + has_trait = lifestyle_herbalist + has_trait = lifestyle_mystic + } + } + save_scope_as = merchant_physician_recruit + } + } + #Otherwise create a physician + if = { + limit = { + NOT = { exists = scope:merchant_physician_recruit } + } + #Create physician to stuff in pool + create_character = { + template = bp1_yearly_2021_learning_person_template + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + learning = { decent_skill_rating high_skill_rating } + save_scope_as = merchant_physician_recruit + } + scope:merchant_physician_recruit ?= { + #Chance to add a malus trait to this spectacular being + if = { + limit = { + NOR = { + has_trait = possessed_1 + has_trait = lunatic_1 + has_trait = depressed_1 + has_trait = drunkard + has_trait = hashishiyah + has_trait = irritable + any_secret = { type = secret_witch } + } + } + hidden_effect = { + random = { + chance = 20 + random_list = { + 10 = { add_trait = possessed_1 } + 10 = { add_trait = lunatic_1 } + 10 = { add_trait = depressed_1 } + 10 = { add_trait = drunkard } + 10 = { add_trait = hashishiyah } + 10 = { add_trait = irritable } + 10 = { + add_secret = { type = secret_witch } + } + } + } + } + } + if = { + limit = { + NOT = { has_trait = devoted } + } + add_trait = devoted + } + } + } + scope:merchant_physician_recruit = { save_scope_as = 1500_third_character } + #Remember the physician + 1500_remember_character_effect = { GUILD = physician CHARACTER = scope:merchant_physician_recruit } + #Cool down if the physician was spawned + set_variable = { + name = merchant_decision_1500_checked_for_physician + days = visit_holding_cooldown_days + } + } + } + } + } + #Attempt to improve your health // OR // Attempt to cure (curable) illness + option = { + name = { + text = { + first_valid = { + #Sickly child is still waiting at the healer's + triggered_desc = { + trigger = { + exists = scope:been_to_healer + exists = scope:1500_sickly_minor + NOT = { has_variable = 1500_used_healer_recently } + } + desc = gdp_visit_holding_decision_event.1500.a_second_sickly_minor + } + #Return to healer + triggered_desc = { + trigger = { exists = scope:been_to_healer } + desc = gdp_visit_holding_decision_event.1500.a_second + } + #We are meeting a sickly child at the healer's + triggered_desc = { + trigger = { exists = scope:1500_sickly_minor } + desc = gdp_visit_holding_decision_event.1500.a_sickly_minor + } + #First time going to healer + desc = gdp_visit_holding_decision_event.1500.a + } + } + } + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1500.a.cooldown.tt + NOT = { has_variable = 1500_used_healer_recently } + } + } + show_as_unavailable = { always = yes } + reason = visit_healer + custom_tooltip = gdp_visit_holding_decision_event.1500.a.tt + #Go to the Healer screen + trigger_event = gdp_visit_holding_decision_event.1501 + ai_chance = { base = 0 } + } + #Visit Holy Site + option = { + name = { + text = { + first_valid = { + #Return to Holy Site + triggered_desc = { + trigger = { exists = scope:been_to_holy_site } + desc = gdp_visit_holding_decision_event.1500.b_second + } + #First time at Holy Site + desc = gdp_visit_holding_decision_event.1500.b + } + } + } + trigger = { + #You were recently caught stealing from the Holy Site + trigger_if = { + limit = { has_variable = 1500_caught_stealing } + custom_tooltip = { + text = gdp_caught_stealing.tt + text = gdp_visit_holding_caught_stealing.tt + always = no + } + } + trigger_else = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1500.b.cooldown.tt + NOT = { has_variable = 1500_used_holy_site_recently } + } + } + } + show_as_unavailable = { always = yes } + reason = visit_church + custom_tooltip = gdp_visit_holding_decision_event.1500.b.tt + #Go to the Church screen + trigger_event = gdp_visit_holding_decision_event.1503 + ai_chance = { + base = 100 + modifier = { + has_trait = zealous + factor = 2 + } + modifier = { + has_trait = pilgrim + factor = 2 + } + } + } + #Convert to local faith // OR // Contemplate faith + option = { + name = { + text = { + first_valid = { + #Convert to faith + triggered_desc = { + trigger = { exists = scope:been_to_garden } + desc = gdp_visit_holding_decision_event.1500.c_second + } + #Contemplate faith + desc = gdp_visit_holding_decision_event.1500.c + } + } + } + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1500.c.cooldown.tt + NOT = { has_variable = 1500_used_garden_recently } + } + } + show_as_unavailable = { always = yes } + reason = visit_garden + custom_tooltip = gdp_visit_holding_decision_event.1500.c.tt + #Go to the Garden screen + trigger_event = gdp_visit_holding_decision_event.1505 + ai_chance = { + base = 100 + modifier = { + stress_level >= 2 + add = 400 + } + } + } + #Rare Option: Hire cheaper, skilled, Physician + option = { + name = { + text = { + first_valid = { + #Return to talk to physician + triggered_desc = { + trigger = { exists = scope:been_to_physician } + desc = gdp_visit_holding_decision_event.1500.d_second + } + #First time talking to physician + desc = gdp_visit_holding_decision_event.1500.d + } + } + } + trigger = { + exists = scope:merchant_physician_recruit + NOT = { exists = scope:merchant_decision_recruited_physician } + } + reason = recruit_physician + custom_tooltip = gdp_visit_holding_decision_event.1500.d.tt + #For the Physician screen + trigger_event = gdp_visit_holding_decision_event.1507 + ai_chance = { + base = 1000 #Just do it + } + } + #I want to do something else + option = { + name = gdp_visit_holding_decision_event.1500.e + custom_tooltip = gdp_visit_holding_decision_event.1200.c.tt + trigger_event = gdp_visit_holding_decision_event.1000 + ai_chance = { base = 100 } + } +} + +#Pretty straight forward +scripted_effect 1500_chance_to_buff_item_rarity_effect = { + random_list = { + 20 = { + trigger = { + exists = scope:merchant_healer_character + $VENDOR$ = scope:merchant_healer_character + } + set_artifact_rarity_famed = yes + } + 80 = { + set_artifact_rarity_common = yes + } + } +} + +#Determine the variable effect based on their aptitude, one for the healer and one for the physician-partner +scripted_effect 1500_calculate_aptitude_modifier_effect = { + if = { + limit = { + $CHARACTER$ = { + aptitude = { + court_position = court_physician_court_position + value >= 1 + } + } + } + change_variable = { + name = $VARIABLE$ + add = 1 + } + } + if = { + limit = { + $CHARACTER$ = { + aptitude = { + court_position = court_physician_court_position + value >= 2 + } + } + } + change_variable = { + name = $VARIABLE$ + add = 1 + } + } + if = { + limit = { + $CHARACTER$ = { + aptitude = { + court_position = court_physician_court_position + value >= 3 + } + } + } + change_variable = { + name = $VARIABLE$ + add = 1 + } + } + if = { + limit = { + $CHARACTER$ = { + aptitude = { + court_position = court_physician_court_position + value >= 4 + } + } + } + change_variable = { + name = $VARIABLE$ + add = 1 + } + } + if = { + limit = { + $CHARACTER$ = { + aptitude = { + court_position = court_physician_court_position + value >= 5 + } + } + } + change_variable = { + name = $VARIABLE$ + add = 1 + } + } +} + +#Do you feel lucky? +scripted_effect 1500_treatment_roll_effect = { + random_list = { + #Failure + 60 = { + #Some weighting based on the aptitude of the performing party (healer/physician-partner) + modifier = { + exists = $VARIABLE$ + $VARIABLE$ >= 5 + add = -15 + } + modifier = { + exists = $VARIABLE$ + $VARIABLE$ >= 4 + add = -15 + } + modifier = { + exists = $VARIABLE$ + $VARIABLE$ >= 3 + add = -15 + } + #Notify us about the outcome + if = { + limit = { + NOT = { $TARGET_CHARACTER$ = root } #If our partner gets treated + } + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1501.treatment_failure.t + desc = gdp_visit_holding_decision_event.1501.treatment_failure.desc + left_icon = root + right_icon = $TARGET_CHARACTER$ + } + } + else = { + send_interface_toast = { + type = event_toast_text_bad #If we get treated + title = gdp_visit_holding_decision_event.1501.treatment_failure.t + desc = gdp_visit_holding_decision_event.1501.treatment_failure.desc + left_icon = root + } + } + #Nothing happens + } + #Success + 40 = { + modifier = { + NOT = { $TARGET_CHARACTER$ = root } #The scoped character is either visiting_partner or sickly_minor + $TARGET_CHARACTER$ = { + age < 20 + is_child_of = root + } + add = 30 + } + modifier = { + NOT = { $TARGET_CHARACTER$ = root } + $TARGET_CHARACTER$ = { + age < 10 + is_child_of = root + } + add = 30 + } + #If our partner gets treated + if = { + limit = { + NOT = { $TARGET_CHARACTER$ = root } #The scoped character is either visiting_partner or sickly_minor + } + send_interface_toast = { + type = event_toast_effect_good + title = gdp_visit_holding_decision_event.1501.treatment_success.t + left_icon = root + right_icon = $TARGET_CHARACTER$ + $TARGET_CHARACTER$ = { 1500_remove_illness_or_wound_effect = yes } + } + } + #If we get treated, automatic toast + else = { 1500_remove_illness_or_wound_effect = yes } + } + } +} + +#The actual removal-of-illness +scripted_effect 1500_remove_illness_or_wound_effect = { + random_list = { + 100 = { + trigger = { has_character_modifier = infected_wound_modifier } + remove_character_modifier = infected_wound_modifier + } + 100 = { + trigger = { has_character_modifier = gangrene_modifier } + remove_character_modifier = gangrene_modifier + } + 100 = { + trigger = { has_trait = wounded_1 } + remove_trait = wounded_1 + } + 100 = { + trigger = { has_trait = wounded_2 } + remove_trait = wounded_2 + } + 100 = { + trigger = { has_trait = wounded_3 } + remove_trait = wounded_3 + } + 100 = { + trigger = { has_trait = ill } + remove_trait = ill + } + 100 = { + trigger = { has_trait = pneumonic } + remove_trait = pneumonic + } + 50 = { + trigger = { has_trait = typhus } + remove_trait = typhus + } + 50 = { + trigger = { has_trait = gout_ridden } + remove_trait = gout_ridden + } + 50 = { + trigger = { has_trait = consumption } + remove_trait = consumption + } + 50 = { + trigger = { has_trait = smallpox } + remove_trait = smallpox + } + 50 = { + trigger = { has_trait = great_pox } + remove_trait = great_pox + } + 25 = { + trigger = { has_trait = cancer } + remove_trait = cancer + } + 25 = { + trigger = { has_trait = bubonic_plague } + remove_trait = bubonic_plague + } + 25 = { + trigger = { has_trait = leper } + remove_trait = leper + } + } +} + +#What was our last location? +scripted_effect 1500_update_last_location_effect = { + if = { + limit = { has_variable = return_from_location } + remove_variable = return_from_location + set_variable = { + name = return_from_location + value = $LOCATION_FLAG$ + } + } + else = { + set_variable = { + name = return_from_location + value = $LOCATION_FLAG$ + } + } +} + +#Return to the holy site from a subsequent event +scripted_effect 1501_been_to_effect = { + #For desc flavor + if = { + limit = { + NOT = { exists = scope:been_to_$GUILD$ } + } + save_scope_as = been_to_$GUILD$ + } + #Go back to holy site + if = { + limit = { var:return_from_location ?= flag:church_grounds } + 1501_return_to_holy_site_effect = yes + } +} + +#Someone learn-y or mystic +scripted_trigger 1501_physician_partner_trigger = { + OR = { + learning >= 15 + has_trait = lifestyle_physician + has_trait = lifestyle_mystic + has_trait = witch + } +} + +#Visit Healer +gdp_visit_holding_decision_event.1501 = { + type = character_event + title = gdp_visit_holding_decision_event.1501.t + window = visit_settlement_window + desc = { + #What are they up to? + first_valid = { + #We've returned to this scene, now what + #RETURN: A sick minor... is still here + triggered_desc = { + trigger = { + exists = scope:1500_sickly_minor + exists = scope:been_to_healer + } + desc = gdp_visit_holding_decision_event.1501.desc_returned_sickly_minor + } + #RETURN: Physician partner wants a stab at it + triggered_desc = { + trigger = { + scope:visiting_partner ?= { + OR = { + learning >= 15 + has_trait = lifestyle_physician + has_trait = lifestyle_mystic + has_trait = witch + } + NOR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + exists = scope:been_to_healer + } + desc = gdp_visit_holding_decision_event.1501.desc_returned_physician_partner + } + #RETURN: Generics + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_healer + scope:healer_loc_tracker ?= 0 + } + desc = gdp_visit_holding_decision_event.1501.desc_returned_01 + } + triggered_desc = { + trigger = { scope:healer_loc_tracker ?= 1 } + desc = gdp_visit_holding_decision_event.1501.desc_returned_02 + } + } + #FIRST TIME: A sick minor was snuck along + triggered_desc = { + trigger = { + exists = scope:1500_sickly_minor + NOT = { exists = scope:been_to_healer } + } + desc = gdp_visit_holding_decision_event.1501.desc_sickly_minor + } + #FIRST TIME: Our partner is actually pretty physician-y + triggered_desc = { + trigger = { + scope:visiting_partner ?= { + OR = { + learning >= 15 + has_trait = lifestyle_physician + has_trait = lifestyle_mystic + has_trait = witch + } + NOR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + NOT = { exists = scope:been_to_healer } + } + desc = gdp_visit_holding_decision_event.1501.desc_physician_partner + } + #FIRST TIME: We've seen this healer before + triggered_desc = { + trigger = { + exists = scope:merchant_recurring_healer_character + NOT = { exists = scope:been_to_healer } + } + desc = gdp_visit_holding_decision_event.1501.desc_reused_healer + } + #FIRST TIME: + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_healer } + } + desc = gdp_visit_holding_decision_event.1501.desc + } + } + #Describe the artifact + first_valid = { + #RETURN: Horn artifact + triggered_desc = { + trigger = { + exists = scope:been_to_healer + scope:1500_health_artifact = { has_variable = health_horn } + } + desc = gdp_visit_holding_decision_event.1501.desc_outro_return_horn + } + #FIRST TIME: Horn artifact + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_healer } + scope:1500_health_artifact = { has_variable = health_horn } + } + desc = gdp_visit_holding_decision_event.1501.desc_outro_horn + } + #RETURN: Other artifacts + triggered_desc = { + trigger = { + exists = scope:been_to_healer + scope:1500_health_artifact = { + NOT = { has_variable = health_horn } + } + } + desc = gdp_visit_holding_decision_event.1501.desc_outro_return_artifact + } + #FIRST TIME: Other artifacts + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_healer } + scope:1500_health_artifact = { + NOT = { has_variable = health_horn } + } + } + desc = gdp_visit_holding_decision_event.1501.desc_outro_artifact + } + } + } + theme = medicine + #Someone close to you is sick + override_sound = { + trigger = { + OR = { + scope:visiting_partner ?= { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + exists = scope:1500_sickly_minor + } + } + reference = "event:/MUSIC/Cues/Events/Illness/mx_cue_illness" + } + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_medicine" } + override_background = { reference = physicians_study } + left_portrait = { + trigger = { exists = scope:visiting_partner } + character = scope:visiting_partner + #Concerned about our kid + triggered_animation = { + trigger = { + exists = scope:1500_sickly_minor + is_close_family_of = scope:1500_sickly_minor + } + animation = stress + } + #Sick dudette + triggered_animation = { + trigger = { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + animation = pain + } + #Doctor dude + triggered_animation = { + trigger = { + OR = { + learning >= 15 + has_trait = lifestyle_physician + has_trait = lifestyle_mystic + has_trait = witch + } + } + animation = ecstasy + } + animation = thinking + } + center_portrait = { + character = root + triggered_animation = { + trigger = { exists = scope:1500_sickly_minor } + animation = worry + } + animation = personality_content + } + right_portrait = { + character = scope:merchant_healer_character + camera = camera_event_scheme_far_right + animation = physician + } + #Do we have a sick minor? + lower_left_portrait = { + trigger = { exists = scope:1500_sickly_minor } + character = scope:1500_sickly_minor + } + artifact = { + target = scope:1500_health_artifact + position = lower_right_portrait + } + immediate = { + #Can we _not_ repeat the loc? + 1505_set_and_check_scene_loc_tracker_scope_effect = { SCENE = healer } + #Find our healer + if = { + #Do we already have a healer? + limit = { + NOT = { exists = scope:merchant_healer_character } + } + #Has this person been our healer in the past 10 years? + random_pool_character = { + province = root.location + limit = { + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + is_available_adult = yes + } + save_scope_as = merchant_healer_character + #Some more loc flavor shenanigans for these saved scopes + save_scope_as = merchant_recurring_healer_character + } + #Otherwise find a healer in the pool + if = { + limit = { + NOT = { exists = scope:merchant_healer_character } + } + random_pool_character = { + province = root.location + limit = { + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + is_available_adult = yes + has_trait = lifestyle_physician + } + save_scope_as = merchant_healer_character + } + } + #Otherwise create a healer + if = { + limit = { + NOT = { exists = scope:merchant_healer_character } + } + #Create healer to stuff in pool + create_character = { + template = physician_high_character_template + location = root.location + dynasty = none + culture = root.location.culture + faith = root.location.faith + save_scope_as = merchant_healer_character + } + } + #Remember the healer + 1500_remember_character_effect = { GUILD = healer CHARACTER = scope:merchant_healer_character } + #Find our healing artifact + if = { + limit = { + NOT = { exists = scope:1500_health_artifact } + } + scope:merchant_healer_character ?= { + #Have we created healing artifacts recently, which we can pull? + if = { + limit = { + any_character_artifact ?= { has_variable = 1500_merchant_decision_health_artifact } + } + random_character_artifact = { + limit = { has_variable = 1500_merchant_decision_health_artifact } + save_scope_as = 1500_health_artifact + } + } + #If we don't have any old healing artifacts; generate a new one! + hidden_effect_new_object = { #HAZMAT SUIT OF ERROR SUPRESSION + if = { + limit = { + NOT = { exists = scope:1500_health_artifact } + } + #Set rarity, maybe + 1500_chance_to_buff_item_rarity_effect = { VENDOR = scope:merchant_healer_character } + #Generate healing artifact + generate_health_trinket_effect = yes + #Finalization + scope:newly_created_health_artifact ?= { + set_variable = { + name = 1500_merchant_decision_health_artifact + days = visit_holding_cooldown_days + } + #Belt & suspenders + set_variable = 1500_merchant_decision_health_artifact + #Don't need no notification about this + set_variable = { + name = suppress_artifact_notifications + value = yes + days = 2 + } + save_scope_as = 1500_health_artifact + } + } + #Set the value of the health artifact + scope:1500_health_artifact = { + if = { + limit = { rarity = famed } + set_variable = { + name = 1065_accessory_value + value = { + value = root.massive_gold_value + multiply = { 1 1.5 } + } + } + } + else_if = { + limit = { rarity = masterwork } + set_variable = { + name = 1065_accessory_value + value = { + value = root.major_gold_value + multiply = { 1.25 1.75 } + } + } + } + else = { + set_variable = { + name = 1065_accessory_value + value = { + value = root.medium_gold_value + multiply = { 1 1.5 } + } + } + } + } + } + } + } + if = { + limit = { + exists = scope:merchant_healer_character + NOT = { has_variable = 1500_healer_aptitude } + } + #Calculate the healer's aptitude + set_variable = { + name = 1500_healer_aptitude + value = 0 + } + 1500_calculate_aptitude_modifier_effect = { CHARACTER = scope:merchant_healer_character VARIABLE = 1500_healer_aptitude } + #Calculate our physician friend's aptitude + if = { + limit = { + scope:visiting_partner ?= { + OR = { + learning >= 15 + has_trait = lifestyle_physician + has_trait = lifestyle_mystic + has_trait = witch + } + } + } + set_variable = { + name = 1500_partner_healer_aptitude + value = 0 + } + 1500_calculate_aptitude_modifier_effect = { CHARACTER = scope:visiting_partner VARIABLE = 1500_partner_healer_aptitude } + } + } + } + #For the background + scope:merchant_healer_character = { + if = { + limit = { + is_ruler = no + exists = court_owner + } + court_owner = { save_scope_as = bg_override_char } + } + else = { + save_scope_as = bg_override_char + } + } + } + #Attempt to improve your health // OR // Attempt to cure (curable) illness + option = { + name = { + text = { + first_valid = { + #We're ill + triggered_desc = { + trigger = { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + desc = gdp_visit_holding_decision_event.1501.a_ill + } + #Just a standard procedure + desc = gdp_visit_holding_decision_event.1501.a + } + } + } + trigger = { + short_term_gold >= minor_gold_value + } + show_as_unavailable = { short_term_gold < minor_gold_value } + #We're ill, roll for some treatment + if = { + limit = { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + 1500_treatment_roll_effect = { TARGET_CHARACTER = root VARIABLE = var:1500_healer_aptitude } + } + #Standard procedure health modifier + else = { + if = { + limit = { has_character_modifier = gdp_visit_holding_healer_health_modifier } + hidden_effect = { remove_character_modifier = gdp_visit_holding_healer_health_modifier } + } + add_character_modifier = { + modifier = gdp_visit_holding_healer_health_modifier + days = visit_holding_cooldown_days + } + } + pay_short_term_gold = { + target = scope:merchant_healer_character + gold = minor_gold_value + } + #Set the variables and redirect us back to the Holy Site + scope:1500_health_artifact = { remove_variable ?= 1065_accessory_value } + remove_variable ?= 1500_healer_aptitude + remove_variable ?= 1500_partner_healer_aptitude + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_used_healer_recently } + #Go back to Holy Site + trigger_event = gdp_visit_holding_decision_event.1500 + ai_chance = { + base = 100 + modifier = { + short_term_gold < minor_gold_value + factor = 0 + } + modifier = { + NOR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + has_character_modifier = gdp_visit_holding_healer_health_modifier + factor = 0 + } + } + } + #Buy the health artifact + option = { + name = gdp_visit_holding_decision_event.1501.b + trigger = { + short_term_gold >= scope:1500_health_artifact.var:1065_accessory_value + } + show_as_unavailable = { short_term_gold < scope:1500_health_artifact.var:1065_accessory_value } + scope:1500_health_artifact = { + root = { + pay_short_term_gold = { + target = scope:merchant_healer_character + gold = prev.var:1065_accessory_value + } + } + set_owner = root + } + #Set the variables and redirect us back to the Holy Site + scope:1500_health_artifact = { remove_variable ?= 1065_accessory_value } + remove_variable ?= 1500_healer_aptitude + remove_variable ?= 1500_partner_healer_aptitude + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_used_healer_recently } + #Go back to Holy Site + trigger_event = gdp_visit_holding_decision_event.1500 + ai_chance = { + base = 50 + modifier = { + short_term_gold < scope:1500_health_artifact.var:1065_accessory_value + factor = 0 + } + } + } + #Triggered Option: Your partner wants to try their hand at the procedure + option = { + name = gdp_visit_holding_decision_event.1501.c + trigger = { + scope:visiting_partner ?= { + OR = { + learning >= 15 + has_trait = lifestyle_physician + has_trait = lifestyle_mystic + has_trait = witch + } + NOR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + NOT = { exists = scope:1500_sickly_minor } + } + flavor = gdp_visit_holding_decision_event.1501.c.flavor + #We're ill, roll for some treatment + if = { + limit = { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + 1500_treatment_roll_effect = { TARGET_CHARACTER = root VARIABLE = var:1500_partner_healer_aptitude } + } + #Standard procedure health modifier + else = { + if = { + limit = { has_character_modifier = gdp_visit_holding_healer_health_partner_modifier } + hidden_effect = { remove_character_modifier = gdp_visit_holding_healer_health_partner_modifier } + } + add_character_modifier = { + modifier = gdp_visit_holding_healer_health_partner_modifier + days = visit_holding_cooldown_days + } + } + progress_towards_friend_effect = { + REASON = friend_allowed_to_treat + CHARACTER = scope:visiting_partner + OPINION = default_friend_opinion + } + scope:visiting_partner = { + if = { + limit = { + NOT = { has_trait = lifestyle_physician } + } + add_trait = lifestyle_physician + } + else_if = { + limit = { + has_trait = lifestyle_physician + has_trait_xp = { + trait = lifestyle_physician + value < 100 + } + } + add_trait_xp = { + trait = lifestyle_physician + value = 40 + } + } + else = { + add_learning_skill = 1 + } + } + #Set the variables and redirect us back to the Holy Site + scope:1500_health_artifact = { remove_variable ?= 1065_accessory_value } + remove_variable ?= 1500_healer_aptitude + remove_variable ?= 1500_partner_healer_aptitude + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_used_healer_recently } + #Go back to Holy Site + trigger_event = gdp_visit_holding_decision_event.1500 + ai_chance = { base = 200 } + } + #Triggered Option: Your partner or sickly minor is ill + option = { + name = { + text = gdp_visit_holding_decision_event.1501.d + trigger = { exists = scope:1500_sickly_minor } + } + name = { + text = gdp_visit_holding_decision_event.1501.d.partner + trigger = { exists = scope:visiting_partner } + } + trigger = { + OR = { + scope:visiting_partner ?= { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + exists = scope:1500_sickly_minor + } + short_term_gold >= minor_gold_value + } + show_as_unavailable = { + OR = { + scope:visiting_partner ?= { + OR = { + has_treatable_disease_trigger = yes + has_trait = wounded_1 + has_wounds_trigger = yes + } + } + exists = scope:1500_sickly_minor + } + } + if = { + limit = { exists = scope:1500_sickly_minor } + 1500_treatment_roll_effect = { TARGET_CHARACTER = scope:1500_sickly_minor VARIABLE = var:1500_healer_aptitude } + progress_towards_friend_effect = { + REASON = friend_got_treatment + CHARACTER = scope:1500_sickly_minor + OPINION = default_friend_opinion + } + } + else = { + 1500_treatment_roll_effect = { TARGET_CHARACTER = scope:visiting_partner VARIABLE = var:1500_healer_aptitude } + progress_towards_friend_effect = { + REASON = friend_got_treatment + CHARACTER = scope:visiting_partner + OPINION = default_friend_opinion + } + } + pay_short_term_gold = { + target = scope:merchant_healer_character + gold = minor_gold_value + } + #Set the variables and redirect us back to the Holy Site + scope:1500_health_artifact = { remove_variable ?= 1065_accessory_value } + remove_variable ?= 1500_healer_aptitude + remove_variable ?= 1500_partner_healer_aptitude + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_used_healer_recently } + #Go back to Holy Site + trigger_event = gdp_visit_holding_decision_event.1500 + ai_chance = { + base = 300 + modifier = { + short_term_gold < minor_gold_value + factor = 0 + } + } + } + #I want to go back + option = { + name = gdp_visit_holding_decision_event.1501.e + custom_tooltip = return_to_holy_site + #Sets variables and takes us back to the church grounds screen + #For desc flavor + if = { + limit = { + NOT = { exists = scope:been_to_holy_site } + } + save_scope_as = been_to_holy_site + } + #Go back to Holy Site + trigger_event = gdp_visit_holding_decision_event.1500 + ai_chance = { base = 100 } + } + after = { + #What was our last location + 1500_update_last_location_effect = { LOCATION_FLAG = flag:healer } + } +} + +scripted_effect 1503_return_to_church_grounds_effect = { + #Go back to church grounds + hidden_effect = { 1501_return_to_holy_site_effect = yes } +} + +scripted_effect 1500_set_holy_site_cooldown_effect = { + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_used_holy_site_recently } + hidden_effect = { 1501_return_to_holy_site_effect = yes } +} + +#Not really into religion +scripted_trigger 1503_is_unzealous_trigger = { + OR = { + has_trait = cynical + any_secret = { type = secret_non_believer } + } +} + +#No prisoners. No rivals. No service. +scripted_trigger 1510_basic_checks_trigger = { + NOT = { + has_any_bad_relationship_with_character_trigger = { CHARACTER = root } + } + is_available_adult = yes + #No double-dipping + #Church + trigger_if = { + limit = { exists = scope:merchant_healer_character } + this != scope:merchant_healer_character + } + trigger_if = { + limit = { exists = scope:merchant_clergy_character } + this != scope:merchant_clergy_character + } + trigger_if = { + limit = { exists = scope:merchant_physician_recruit } + this != scope:merchant_physician_recruit + } +} + +#Events that use this must write loc for tracker 0, 1, and 2 +scripted_effect 1505_set_and_check_hub_loc_tracker_scope_effect = { + if = { + limit = { + NOT = { exists = scope:$HUB$_loc_tracker } #e.g. scope:church_grounds_loc_tracker + } + save_scope_value_as = { + name = $HUB$_loc_tracker + value = 0 + } + } + else_if = { + limit = { scope:$HUB$_loc_tracker ?= 2 } + save_scope_value_as = { + name = $HUB$_loc_tracker + value = 0 + } + } + else_if = { + limit = { scope:$HUB$_loc_tracker ?= 0 } + save_scope_value_as = { + name = $HUB$_loc_tracker + value = 1 + } + } + else = { + save_scope_value_as = { + name = $HUB$_loc_tracker + value = 2 + } + } +} + +#Visit Holy Site +gdp_visit_holding_decision_event.1503 = { + type = character_event + title = gdp_visit_holding_decision_event.1503.t + window = visit_settlement_window + desc = { + #What are they up to? + first_valid = { + #We've returned to this scene, now what + #RETURN: Generics + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_holy_site + scope:holy_site_loc_tracker ?= 0 + } + desc = gdp_visit_holding_decision_event.1503.desc_returned_01 + } + triggered_desc = { + trigger = { scope:holy_site_loc_tracker ?= 1 } + desc = gdp_visit_holding_decision_event.1503.desc_returned_02 + } + } + #FIRST TIME: We've seen this NunMonk before + triggered_desc = { + trigger = { + exists = scope:merchant_recurring_clergy_character + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1503.desc_reused_clergy + } + #FIRST TIME: + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1503.desc + } + } + #How about some theft + first_valid = { + #RETURN: Longing master thief + triggered_desc = { + trigger = { + scope:visiting_partner ?= { has_court_position = fixer_court_position } + exists = scope:been_to_holy_site + } + desc = gdp_visit_holding_decision_event.1503.desc_return_outro_thief + } + #RETURN: Outro + triggered_desc = { + trigger = { exists = scope:been_to_holy_site } + desc = gdp_visit_holding_decision_event.1503.desc_return_outro + } + #FIRST TIME: Longing master thief + triggered_desc = { + trigger = { + scope:visiting_partner ?= { has_court_position = fixer_court_position } + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1503.desc_outro_thief + } + #FIRST TIME: Outro + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_holy_site } + } + desc = gdp_visit_holding_decision_event.1503.desc_outro + } + } + } + theme = faith + override_sound = { reference = "event:/MUSIC/Cues/Events/Sacral Happening/mx_cue_epic_sacral_moment" } + override_background = { reference = temple } + left_portrait = { + trigger = { exists = scope:visiting_partner } + character = scope:visiting_partner + #Master thief + triggered_animation = { + trigger = { has_court_position = fixer_court_position } + animation = scheme + } + #Unzealous + triggered_animation = { + trigger = { 1503_is_unzealous_trigger = yes } + animation = personality_cynical + } + #Zealous + triggered_animation = { + trigger = { + scope:visiting_partner = { has_trait = zealous } + } + animation = ecstasy + } + #Friendly + triggered_animation = { + trigger = { + scope:visiting_partner = { 1510_has_friendly_traits = yes } + } + animation = interested + } + #Business-minded + triggered_animation = { + trigger = { + scope:visiting_partner = { 1510_has_commerce_traits = yes } + } + animation = personality_greedy + } + #Uninterested + triggered_animation = { + trigger = { + scope:visiting_partner = { 1510_has_uninterested_traits = yes } + } + animation = boredom + } + #Irrational + triggered_animation = { + trigger = { + scope:visiting_partner = { 1510_has_irrational_traits = yes } + } + animation = personality_irrational + } + #A bit awkward + triggered_animation = { + trigger = { + scope:visiting_partner = { 1510_has_standoffish_traits = yes } + } + animation = disapproval + } + animation = personality_honorable + } + center_portrait = { + character = root + triggered_animation = { + trigger = { 1503_is_unzealous_trigger = yes } + animation = disapproval + } + animation = personality_content + } + right_portrait = { + character = scope:merchant_clergy_character + animation = personality_forgiving + } + immediate = { + #Can we _not_ repeat the loc? + 1505_set_and_check_scene_loc_tracker_scope_effect = { SCENE = holy_site } + #For the background + root.location.county.holder = { save_scope_as = bg_override_char } + #Find our clergy + if = { + #Do we already have a clergy? + limit = { + NOT = { exists = scope:merchant_clergy_character } + } + #Has this person been our clergy in the past 10 years? + random_pool_character = { + province = root.location + limit = { + 1510_basic_checks_trigger = yes + faith = root.location.faith + save_temporary_scope_as = saved_character_check + } + save_scope_as = merchant_clergy_character + #Some more loc flavor shenanigans for these saved scopes + save_scope_as = merchant_recurring_clergy_character + } + #Otherwise find a clergy in the pool + if = { + limit = { + NOT = { exists = scope:merchant_clergy_character } + } + random_pool_character = { + province = root.location + limit = { + 1510_basic_checks_trigger = yes + has_trait = devoted + faith = root.location.faith + } + save_scope_as = merchant_clergy_character + } + } + #Otherwise create a clergy + if = { + limit = { + NOT = { exists = scope:merchant_clergy_character } + } + #Create clergy to stuff in pool + create_character = { + template = generic_peasant_character + location = root.location + dynasty = none + trait = devoted + culture = root.location.culture + faith = root.location.faith + save_scope_as = merchant_clergy_character + } + } + #Remember the clerger + 1500_remember_character_effect = { GUILD = clergy CHARACTER = scope:merchant_clergy_character } + } + #How much gold is in the collect; and how difficult is it? + if = { + limit = { + NOT = { exists = scope:1503_collect_gold_value } + } + #Randomize the initial value + set_variable = { + name = 1503_collect_gold_difficulty + value = { + integer_range = { + min = 0 + max = 2 + } + } + } + #Then add difficulty based on how much gold is in the collect + random_list = { + 10 = { + save_scope_value_as = { + name = 1503_collect_gold_value + value = minor_gold_value + } + change_variable = { + name = 1503_collect_gold_difficulty + add = 1 + } + } + 10 = { + save_scope_value_as = { + name = 1503_collect_gold_value + value = medium_gold_value + } + change_variable = { + name = 1503_collect_gold_difficulty + add = 2 + } + } + 10 = { + save_scope_value_as = { + name = 1503_collect_gold_value + value = major_gold_value + } + change_variable = { + name = 1503_collect_gold_difficulty + add = 3 + } + } + } + #Did we go robbing a bunch of churches previously? + if = { + limit = { + has_variable = 1503_heightened_security + exists = var:1503_collect_gold_difficulty + } + change_variable = { + name = 1503_collect_gold_difficulty + add = var:1503_heightened_security + } + + } + #Set the difficulty + if = { + limit = { exists = var:1503_collect_gold_difficulty } + if = { + limit = { var:1503_collect_gold_difficulty >= 5 } + save_scope_value_as = { + name = 1503_collect_gold_difficulty_rating + value = monumentally_high_skill_rating + } + } + else_if = { + limit = { var:1503_collect_gold_difficulty = 4 } + save_scope_value_as = { + name = 1503_collect_gold_difficulty_rating + value = extremely_high_skill_rating + } + } + else_if = { + limit = { var:1503_collect_gold_difficulty = 3 } + save_scope_value_as = { + name = 1503_collect_gold_difficulty_rating + value = high_skill_rating + } + } + else_if = { + limit = { var:1503_collect_gold_difficulty = 2 } + save_scope_value_as = { + name = 1503_collect_gold_difficulty_rating + value = medium_skill_rating + } + } + else = { + save_scope_value_as = { + name = 1503_collect_gold_difficulty_rating + value = low_skill_rating + } + } + } + } + } + #Donate some gold for piety + option = { + name = gdp_visit_holding_decision_event.1503.a + trigger = { + short_term_gold >= minor_gold_value + } + show_as_unavailable = { always = yes } + flavor = { + first_valid = { + triggered_desc = { + trigger = { 1503_is_unzealous_trigger = yes } + desc = gdp_visit_holding_decision_event.1503.a.flavor_unzealous + } + } + } + if = { + limit = { NOT = { exists = var:visit_settlement_holy_site_donation } } + set_variable = { + name = visit_settlement_holy_site_donation + value = 1 + days = visit_holding_cooldown_days + } + } + else = { + set_local_variable = { + name = visit_settlement_holy_site_donation_temp + value = var:visit_settlement_church_donation + } + set_variable = { + name = visit_settlement_holy_site_donation + days = visit_holding_cooldown_days + value = { + value = local_var:visit_settlement_holy_site_donation_temp + add = 1 + } + } + } + #Pay gold, feel more pious + pay_short_term_gold = { + target = scope:merchant_clergy_character + gold = minor_gold_value + } + add_piety = visit_settlement_piety_gain_value + #Roll for epiphanous clergy + hidden_effect = { + scope:merchant_clergy_character = { + random_list = { + 95 = { + modifier = { + has_trait = possessed_1 + factor = 0.5 + } + #Nothing happens + } + 5 = { + modifier = { + piety_level = high_piety_level + add = 5 + } + modifier = { + piety_level = very_high_piety_level + add = 5 + } + modifier = { + piety_level = max_piety_level + add = 5 + } + set_variable = 1503_is_epiphanous + } + } + } + } + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + zealous = minor_stress_impact_loss + generous = minor_stress_impact_loss + improvident = medium_stress_impact_loss #Throw 'em a bone + } + trigger_event = gdp_visit_holding_decision_event.1504 + ai_chance = { + base = 100 + modifier = { + has_trait = greedy + factor = 0 + } + modifier = { + short_term_gold < minor_gold_value + factor = 0 + } + } + } + #Ask for blessing + option = { + name = gdp_visit_holding_decision_event.1503.b + trigger = { + NOR = { + has_character_modifier = laamp_decision_church_blessing_stress_loss_modifier + has_character_modifier = laamp_decision_church_blessing_stress_gain_modifier + piety_level < low_piety_level + } + } + show_as_unavailable = { always = yes } + reason = piety + #Pokémon blue? + add_character_modifier = { + modifier = laamp_decision_church_blessing_stress_loss_modifier + years = 5 + } + #Set the variables and redirect us back to the Church Grounds + 1500_set_holy_site_cooldown_effect = yes + ai_chance = { + base = 200 + modifier = { + piety_level > medium_piety_level + add = 300 + } + } + } + #'Borrow' gold from the collect + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + scope:visiting_partner ?= { has_court_position = fixer_court_position } + } + desc = gdp_visit_holding_decision_event.1503.c_master_thief + } + triggered_desc = { + trigger = { has_variable = 1503_heightened_security } + desc = gdp_visit_holding_decision_event.1503.c_guarded + } + desc = gdp_visit_holding_decision_event.1503.c + } + } + } + trigger = { is_ai = no } + flavor = { + first_valid = { + triggered_desc = { + trigger = { + has_variable = 1503_heightened_security + var:1503_heightened_security != 0 + } + desc = gdp_visit_holding_decision_event.1503.c.flavor_guarded + } + desc = gdp_visit_holding_decision_event.1503.c.flavor + } + } + duel = { + skill = intrigue + value = scope:1503_collect_gold_difficulty_rating + #Success: Coin! + 50 = { + modifier = { + scope:visiting_partner ?= { has_court_position = fixer_court_position } + factor = 2 + } + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 10 + desc = gdp_visit_holding_decision_event.1503.c.thievery_success.desc + send_interface_toast = { + title = gdp_visit_holding_decision_event.1503.c.thievery_success.t + left_icon = root + add_gold = scope:1503_collect_gold_value + } + hidden_effect = { + #... fool me twice; shame on you. + if = { + limit = { has_variable = 1503_heightened_security } + random_list = { + 50 = { + #Nothing + } + 50 = { + #Save old value as temp + set_variable = { + name = 1503_heightened_security_temp + value = var:1503_heightened_security + } + #Remove the variable we'll refresh + remove_variable ?= 1503_heightened_security + #Set the new proper variable and add the old value as well + set_variable = { + name = 1503_heightened_security + value = { + value = var:1503_heightened_security_temp + add = 1 + } + days = visit_holding_cooldown_days + } + #Then remove the temp + remove_variable ?= 1503_heightened_security_temp + } + } + } + #Fool me once, shame on me... + else = { + set_variable = { + name = 1503_heightened_security + value = 0 + days = visit_holding_cooldown_days + } + } + } + } + #Failure: Banished! + 50 = { + modifier = { + scope:visiting_partner ?= { has_court_position = fixer_court_position } + factor = 0.5 + } + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + desc = gdp_visit_holding_decision_event.1503.c.thievery_failure.desc + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1503.c.thievery_failure.t + desc = gdp_visit_holding_decision_event.1503.c.thievery_failure.desc + left_icon = root + custom_tooltip = gdp_visit_holding_decision_event.1501.return.tt + #Shame on you + add_piety = medium_piety_loss + } + #You will not be going back to the church any time soon + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_caught_stealing } + } + #Critical Failure: The local guards are summoned + 10 = { + trigger = { + trigger_if = { + limit = { exists = scope:visiting_partner } + NOT = { + scope:visiting_partner = { has_court_position = fixer_court_position } + } + } + trigger_else = { always = yes } + } + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + min = 5 + desc = gdp_visit_holding_decision_event.1503.c.thievery_critical_failure.desc + send_interface_toast = { + title = gdp_visit_holding_decision_event.1503.c.thievery_critical_failure.t + left_icon = root + #Quite the tussle + increase_wounds_effect = { REASON = fight } + #Shame on you + add_piety = minor_piety_loss + } + #You will not be going back to the church any time soon + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_caught_stealing } + } + } + #Super-stressful for honest characters and zealous characters, IF you share faith + if = { + limit = { root.location.county.faith = root.faith } + stress_and_fulfillment_impact = { + honest = major_stress_impact_gain + zealous = major_stress_impact_gain + deceitful = minor_stress_impact_loss + greedy = minor_stress_impact_loss + } + } + else = { + stress_and_fulfillment_impact = { + honest = major_stress_impact_gain + deceitful = minor_stress_impact_loss + } + } + #Set the variables and redirect us back to the Holy Site + 1503_return_to_church_grounds_effect = yes + } + #I want to go back + option = { + name = gdp_visit_holding_decision_event.1503.d + #Sets variables and takes us back to the holy site screen + #For desc flavor + if = { + limit = { + NOT = { exists = scope:been_to_holy_site } + } + save_scope_as = been_to_holy_site + } + 1501_return_to_holy_site_effect = yes + ai_chance = { base = 200 } + } + after = { + #What was our last location + 1500_update_last_location_effect = { LOCATION_FLAG = flag:church } + } +} + +#Post-Donation +gdp_visit_holding_decision_event.1504 = { + type = character_event + title = gdp_visit_holding_decision_event.1504.t + window = visit_settlement_window + desc = { + first_valid = { + #Strange person thinks you're a reincarnation or something? Why not. + triggered_desc = { + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + desc = gdp_visit_holding_decision_event.1504.desc_epiphany + } + desc = gdp_visit_holding_decision_event.1504.desc + } + } + theme = faith + override_sound = { + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + reference = "event:/DLC/FP4/MUSIC/Stingers/mx_stinger_legends_lvl_03" + } + override_sound = { reference = "event:/MUSIC/Cues/Events/Low Key Positive/mx_cue_low_key_postive" } + override_background = { reference = temple } + override_effect_2d = { + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + reference = legend_glow + } + left_portrait = { + character = root + triggered_animation = { + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + animation = disbelief + } + triggered_animation = { + trigger = { 1503_is_unzealous_trigger = yes } + animation = shock + } + animation = admiration + } + right_portrait = { + character = scope:merchant_clergy_character + triggered_animation = { + trigger = { has_variable = 1503_is_epiphanous } + animation = shock + } + animation = happiness + } + #Do we have someone to display? + lower_left_portrait = { + trigger = { exists = scope:visiting_partner } + character = scope:visiting_partner + } + immediate = { + hidden_effect = { + scope:merchant_clergy_character = { + if = { + limit = { has_variable = 1503_is_epiphanous } + add_trait = loyal + add_trait = holy_warrior + } + } + } + } + #Ask for blessing + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + desc = gdp_visit_holding_decision_event.1504.a_epiphany + } + desc = gdp_visit_holding_decision_event.1504.a + } + } + } + trigger = { + NOR = { + has_character_modifier = laamp_decision_church_blessing_stress_loss_modifier + has_character_modifier = laamp_decision_church_blessing_stress_gain_modifier + piety_level < low_piety_level + } + } + show_as_unavailable = { always = yes } + reason = piety + #Or Pokémon red? + add_character_modifier = { + modifier = laamp_decision_church_blessing_stress_gain_modifier + years = 5 + } + ai_chance = { + base = 100 + modifier = { + piety_level > medium_piety_level + add = 300 + } + } + } + #Triggered Option: Clergy Person wants to join your company + option = { + name = gdp_visit_holding_decision_event.1504.b + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + add_courtier = scope:merchant_clergy_character + hidden_effect = { + reverse_add_opinion = { + target = scope:merchant_clergy_character + modifier = recruited_me_opinion + opinion = 50 + } + } + ai_chance = { + base = 100 + modifier = { + has_trait = paranoid + factor = 0 + } + } + } + #Nah + option = { + name = { + text = { + first_valid = { + triggered_desc = { + trigger = { + scope:merchant_clergy_character = { has_variable = 1503_is_epiphanous } + } + desc = gdp_visit_holding_decision_event.1504.c_epiphany + } + desc = gdp_visit_holding_decision_event.1504.c + } + } + } + #Tooltip so we know where we're going + custom_tooltip = gdp_visit_holding_decision_event.1501.return.tt + ai_chance = { + base = 100 + } + } + after = { + #Set the variables and redirect us back to the Holy Site + 1500_set_holy_site_cooldown_effect = yes + } +} + +#Set the correct variable to block off the Garden option and remove the desc flavor variable +scripted_effect 1505_gardened_effect = { + visit_holding_set_option_cooldown_worship_effect = { VAR = 1500_used_garden_recently } + #Go back to church grounds + hidden_effect = { 1501_return_to_holy_site_effect = yes } +} + +#Right? +scripted_trigger 1505_probably_knows_gardening_trigger = { + OR = { + has_trait = lifestyle_gardener + has_trait = lifestyle_herbalist + learning > high_skill_rating + } +} + +scripted_trigger 1505_could_harvest_garden_trigger = { + OR = { + trigger_if = { + limit = { exists = scope:visiting_partner } + scope:visiting_partner = { 1505_probably_knows_gardening_trigger = yes } + } + 1505_probably_knows_gardening_trigger = yes + } +} + +#Ditto +scripted_trigger 1505_could_unwind_in_garden_trigger = { + scope:visiting_partner ?= { + OR = { + AND = { + has_relation_potential_lover = root + root = { might_cheat_on_every_partner_trigger = yes } + } + has_relation_lover = root + } + } +} + + +#Visit Garden +gdp_visit_holding_decision_event.1505 = { + type = character_event + title = gdp_visit_holding_decision_event.1505.t + window = visit_settlement_window + desc = { + #What's going down in the garden + first_valid = { + #We've returned to this scene, now what + #RETURN: Generics + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_garden + scope:garden_loc_tracker ?= 0 + } + desc = gdp_visit_holding_decision_event.1505.desc_returned_01 + } + triggered_desc = { + trigger = { scope:garden_loc_tracker ?= 1 } + desc = gdp_visit_holding_decision_event.1505.desc_returned_02 + } + } + #FIRST TIME: + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_garden } + } + desc = gdp_visit_holding_decision_event.1505.desc + } + } + #Hey look, some plants + first_valid = { + #RETURN: Still partner plants + triggered_desc = { + trigger = { + scope:visiting_partner ?= { 1505_probably_knows_gardening_trigger = yes } + exists = scope:been_to_garden + } + desc = gdp_visit_holding_decision_event.1505.desc_outro_return_partner + } + #RETURN: Still plants + triggered_desc = { + trigger = { + 1505_probably_knows_gardening_trigger = yes + exists = scope:been_to_garden + } + desc = gdp_visit_holding_decision_event.1505.desc_outro_return_gardener + } + #FIRST TIME: Partner PLAAANTSSS + triggered_desc = { + trigger = { + scope:visiting_partner ?= { 1505_probably_knows_gardening_trigger = yes } + NOT = { exists = scope:been_to_garden } + } + desc = gdp_visit_holding_decision_event.1505.desc_outro_partner + } + #FIRST TIME: PLAAANTSSS + triggered_desc = { + trigger = { + 1505_probably_knows_gardening_trigger = yes + NOT = { exists = scope:been_to_garden } + } + desc = gdp_visit_holding_decision_event.1505.desc_outro_gardener + } + } + } + theme = faith + override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_health_good" } + override_background = { reference = garden } + left_portrait = { + trigger = { exists = scope:visiting_partner } + character = scope:visiting_partner + triggered_animation = { + trigger = { + NOT = { has_variable = 1505_has_harvested_recently } + 1505_probably_knows_gardening_trigger = yes + } + animation = survey + } + animation = happiness + } + center_portrait = { + character = root + triggered_animation = { + trigger = { + NOT = { has_variable = 1505_has_harvested_recently } + scope:visiting_partner ?= { 1505_probably_knows_gardening_trigger = yes } + } + animation = interested + } + triggered_animation = { + trigger = { 1505_probably_knows_gardening_trigger = yes } + animation = survey + } + triggered_animation = { + trigger = { faith != root.location.faith } + animation = stress + } + animation = thinking + } + immediate = { + #Can we _not_ repeat the loc? + 1505_set_and_check_scene_loc_tracker_scope_effect = { SCENE = garden } + #For the background + root.location.county.holder = { save_scope_as = bg_override_char } + } + #Convert / contemplate faith + option = { + name = { + text = { + first_valid = { + #Convert to faith + triggered_desc = { + trigger = { + faith != root.location.faith + } + desc = gdp_visit_holding_decision_event.1505.a_convert + } + #Contemplate faith + desc = gdp_visit_holding_decision_event.1505.a + } + } + } + trigger = { + custom_tooltip = { + text = gdp_visit_holding_decision_event.1505.a.cooldown.tt + NOT = { has_variable = 1505_contemplated_garden_recently } + } + } + #Convert + if = { + limit = { faith != root.location.faith } + set_character_faith = root.location.faith + if = { + limit = { + root.location.faith = { has_doctrine = doctrine_monotheist } + } + custom_description_no_bullet = { text = mandala_monotheist_warning_tt } + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + zealous = major_stress_impact_gain + } + } + #Contemplate faith + else = { + stress_and_fulfillment_impact = { + base = medium_stress_impact_loss + content = minor_stress_impact_loss + zealous = medium_stress_impact_loss + } + } + #Cooldown for the action + set_variable = { + name = 1505_contemplated_garden_recently + days = visit_holding_cooldown_days + } + #Set the variables and redirect us back to the Church Grounds + 1505_gardened_effect = yes + ai_chance = { + base = 100 + modifier = { + faith != root.location.faith + has_trait = zealous + factor = 0 + } + modifier = { + faith != root.location.faith + any_secret ?= { secret_type = secret_non_believer } + add = 300 + } + } + } + #Triggered Option: Those plants look edible + option = { + name = { + text = { + first_valid = { + #Gardener friend + triggered_desc = { + trigger = { + scope:visiting_partner ?= { 1505_probably_knows_gardening_trigger = yes } + } + desc = gdp_visit_holding_decision_event.1505.b_partner + } + #Gardener self + desc = gdp_visit_holding_decision_event.1505.b + } + } + } + trigger = { + trigger_if = { + limit = { has_variable = 1505_has_harvested_recently } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1505.b.cooldown.tt + always = no + } + } + trigger_else = { 1505_could_harvest_garden_trigger = yes } + } + show_as_unavailable = { + #Only show it if you could've actually done it + trigger_if = { + limit = { 1505_could_harvest_garden_trigger = yes } + always = yes + } + trigger_else = { always = no } + } + add_gold = minor_gold_value + #Probably holy somewhere + if = { + limit = { + faith = { + OR = { + has_tenet = tenet_sanctity_of_nature + trait_is_virtue = lifestyle_gardener + trait_is_virtue = lifestyle_herbalist + } + } + } + add_piety = medium_piety_gain + } + #Cooldown for the action + set_variable = { + name = 1505_has_harvested_recently + days = visit_holding_cooldown_days + } + #Set the variables and redirect us back to the Church Grounds + 1505_gardened_effect = yes + ai_chance = { + base = 1000 #Just do it + } + } + #Triggered Option: Stress relief? Stress relief. + option = { + name = gdp_visit_holding_decision_event.1505.c + trigger = { + trigger_if = { + limit = { has_variable = 1505_garden_unwinded_recently } + custom_tooltip = { + text = gdp_visit_holding_decision_event.1505.c.cooldown.tt + always = no + } + } + trigger_else = { 1505_could_unwind_in_garden_trigger = yes } + } + show_as_unavailable = { + #Only show it if you could've actually done it + trigger_if = { + limit = { 1505_could_unwind_in_garden_trigger = yes } + always = yes + } + trigger_else = { always = no } + } + #Stress relief + had_sex_with_effect = { CHARACTER = scope:visiting_partner PREGNANCY_CHANCE = pregnancy_chance } + progress_towards_lover_effect = { + CHARACTER = scope:visiting_partner + REASON = lover_contemplative_sex + OPINION = default_lover_opinion + } + #Probably holy to some? + if = { + limit = { + faith = { has_tenet = tenet_carnal_exaltation } + } + add_piety = medium_piety_gain + } + #Or not + else_if = { + limit = { + faith = { + OR = { + trait_is_sin = lustful + trait_is_sin = rakish + trait_is_sin = seducer + } + } + } + add_piety = minor_piety_loss + } + #Cooldown for the action + set_variable = { + name = 1505_garden_unwinded_recently + days = visit_holding_cooldown_days + } + #Stress loss with some factors + stress_and_fulfillment_impact = { + base = medium_stress_impact_loss + rakish = medium_stress_impact_loss + seducer = minor_stress_impact_loss + lustful = minor_stress_impact_loss + paranoid = minor_stress_impact_gain + chaste = minor_stress_impact_gain + } + #Set the variables and redirect us back to the Church Grounds + 1505_gardened_effect = yes + ai_chance = { + base = 100 + modifier = { + has_trait = lustful + add = 500 + } + modifier = { + has_trait = rakish + add = 500 + } + modifier = { + has_trait = chaste + factor = 0 + } + } + } + #I want to go back + option = { + name = gdp_visit_holding_decision_event.1505.d + #Everything is on cooldown, I guess + if = { + limit = { + has_variable = 1505_contemplated_garden_recently + trigger_if = { + limit = { 1505_could_harvest_garden_trigger = yes } + has_variable = 1505_has_harvested_recently + } + trigger_if = { + limit = { 1505_could_unwind_in_garden_trigger = yes } + has_variable = 1505_garden_unwinded_recently + } + } + 1505_gardened_effect = yes + } + else = { + #Sets variables and returns us to church grounds screen + 1501_been_to_effect = { GUILD = garden } + #For desc flavor + if = { + limit = { + NOT = { exists = scope:been_to_garden } + } + save_scope_as = been_to_garden + } + 1501_return_to_holy_site_effect = yes + } + ai_chance = { base = 100 } + } + after = { + #What was our last location + 1500_update_last_location_effect = { LOCATION_FLAG = flag:garden } + } +} + +#Hire the Physician, show/set the effects and variables +scripted_effect 1507_hire_physician_effect = { + hidden_effect = { + reverse_add_opinion = { + target = scope:merchant_physician_recruit + modifier = recruited_me_opinion + opinion = 50 + } + } + add_courtier = scope:merchant_physician_recruit + #The actual effect happens in after + show_as_tooltip = { + court_position_grant_effect = { + EMPLOYER = root + POS = court_physician + CANDIDATE = scope:merchant_physician_recruit + } + } + #This 'finished' is different since it changes between flag:yes and flag:no + save_scope_value_as = { + name = merchant_decision_recruited_physician + value = flag:yes + } + #Go back to church grounds + hidden_effect = { 1501_return_to_holy_site_effect = yes } +} + + +#Visit Physician +gdp_visit_holding_decision_event.1507 = { + type = character_event + title = gdp_visit_holding_decision_event.1507.t + window = visit_settlement_window + desc = { + #What're they doing? + first_valid = { + #We've returned to this scene, now what + #RETURN: + random_valid = { + triggered_desc = { + trigger = { + exists = scope:been_to_physician + scope:physician_loc_tracker ?= 0 + } + desc = gdp_visit_holding_decision_event.1507.desc_returned_01 + } + triggered_desc = { + trigger = { scope:physician_loc_tracker ?= 1 } + desc = gdp_visit_holding_decision_event.1507.desc_returned_02 + } + triggered_desc = { + trigger = { scope:physician_loc_tracker ?= 2 } + desc = gdp_visit_holding_decision_event.1507.desc_returned_03 + } + } + #FIRST TIME: We've seen this physician before + triggered_desc = { + trigger = { + exists = scope:merchant_recurring_physician + NOT = { exists = scope:been_to_physician } + } + desc = gdp_visit_holding_decision_event.1507.desc_reused_physician + } + #FIRST TIME: + triggered_desc = { + trigger = { + NOT = { exists = scope:been_to_physician } + } + desc = gdp_visit_holding_decision_event.1507.desc + } + } + } + theme = learning + override_sound = { reference = "event:/MUSIC/Cues/Events/Positive/mx_cue_postive_effect" } + override_background = { reference = location_study } + left_portrait = { + trigger = { exists = scope:visiting_partner } + character = scope:visiting_partner + triggered_animation = { + trigger = { 1501_physician_partner_trigger = yes } + animation = interested + } + animation = personality_compassionate + } + center_portrait = { + character = root + animation = personality_rational + } + right_portrait = { + character = scope:merchant_physician_recruit + camera = camera_event_scheme_far_right + animation = reading + } + immediate = { + #Can we _not_ repeat the loc? + 1505_set_and_check_hub_loc_tracker_scope_effect = { HUB = physician } + #Hide the physician from the third portrait, since they have moved to their study + if = { + limit = { scope:1500_third_character = scope:merchant_physician_recruit } + #Overwrite with ROOT to block off the portrait + save_scope_as = 1500_third_character + #Remember the bodyguard + 1500_remember_character_effect = { GUILD = physician CHARACTER = scope:merchant_physician_recruit } + } + } + #Pay gold + option = { + name = gdp_visit_holding_decision_event.1507.a + trigger = { + short_term_gold >= visit_holding_associate_physician_gold_value + } + show_as_unavailable = { short_term_gold < visit_holding_associate_physician_gold_value } + pay_short_term_gold = { + target = scope:merchant_physician_recruit + gold = visit_holding_associate_physician_gold_value + } + #Wrap effect to hire 'em, set scope & return to church + 1507_hire_physician_effect = yes + ai_chance = { + base = 100 + modifier = { + short_term_gold < visit_holding_associate_physician_gold_value + factor = 0 + } + } + } + #Have x piety + option = { + name = gdp_visit_holding_decision_event.1507.b + trigger = { piety >= 1000 } + show_as_unavailable = { piety < 1000 } + reason = piety + #Wrap effect to hire 'em, set scope & return to church + 1507_hire_physician_effect = yes + ai_chance = { + base = 1000 #Just do it + } + } + #Learning duel + option = { + name = gdp_visit_holding_decision_event.1507.c + duel = { + skill = learning + value = average_skill_rating + #Success: Hire 'em up + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + modifier = { + OR = { + has_trait = erudite + has_trait = whole_of_body + has_trait = crusader_king + } + factor = 2 + } + desc = gdp_visit_holding_decision_event.1507.c.success + send_interface_toast = { + title = gdp_visit_holding_decision_event.1507.c.success + left_icon = root + right_icon = scope:merchant_physician_recruit + #Yippee! + 1507_hire_physician_effect = yes + } + } + #Failure: Bye, now + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -20 + } + modifier = { + has_trait = zealous + factor = 0.5 + } + desc = gdp_visit_holding_decision_event.1507.c.failure + send_interface_toast = { + type = event_toast_text_bad + title = gdp_visit_holding_decision_event.1507.c.failure + desc = gdp_visit_holding_decision_event.1507.c.failure.tt + left_icon = root + right_icon = scope:merchant_physician_recruit + #Oh well + custom_tooltip = gdp_visit_holding_decision_event.1507.c.failure.tt + #This 'finished' is different since it changes between flag:yes and flag:no + save_scope_value_as = { + name = merchant_decision_recruited_physician + value = flag:no + } + 1501_return_to_holy_site_effect = yes + } + } + } + ai_chance = { + base = 100 + modifier = { + piety >= 1000 + factor = 0 + } + } + } + #I want to go back + option = { + name = gdp_visit_holding_decision_event.1507.d + #Sets variables and returns us to church grounds screen + 1501_been_to_effect = { GUILD = physician } + 1501_return_to_holy_site_effect = yes + ai_chance = { + base = 100 + modifier = { + employs_court_position = court_physician_court_position + factor = 2 + } + } + } + after = { + if = { + limit = { scope:merchant_decision_recruited_physician ?= flag:yes } + #Appoint them + if = { + limit = { + can_appoint_char_to_court_position = { + CHAR = scope:merchant_physician_recruit + COURT_POS = court_physician_court_position + } + } + court_position_grant_effect = { + EMPLOYER = root + POS = court_physician + CANDIDATE = scope:merchant_physician_recruit + } + } + } + #What was our last location + 1500_update_last_location_effect = { LOCATION_FLAG = flag:physician } + } +} diff --git a/events/dlc/gdp/republic_promote_candidate_scheme_outcome_events.txt b/events/dlc/gdp/republic_promote_candidate_scheme_outcome_events.txt new file mode 100644 index 000000000..a0e12d905 --- /dev/null +++ b/events/dlc/gdp/republic_promote_candidate_scheme_outcome_events.txt @@ -0,0 +1,102 @@ +################################################## +# Events for the Republic Promote Candidate scheme +################################################## +namespace = republic_promote_candidate_scheme_event + +### Outcome events +# Standard success +republic_promote_candidate_scheme_event.0001 = { + hidden = yes + + immediate = { + if = { + limit = { + scope:target = { is_alive = yes } + scope:owner = { is_alive = yes } + } + # We save and change the actual score before sending a message to make sure tooltip evaluates correctly + save_scope_value_as = { + name = promoted_candidate_score_value + value = { + value = 10 # Base increase + add = { # Additional increase based on rating + value = scope:owner.house.house_power_score + multiply = 0.2 + } + if = { # If the relevant bonus is unlocked, increase the total + limit = { + scope:owner.house ?= { + has_house_aspiration_parameter = ambition_promote_candidate_scheme_bonus + } + } + multiply = 1.25 + } + round = yes + } + } + scope:scheme.var:target_candidate_title = { + change_appointment_investment = { + target = scope:target + investor = scope:owner + value = scope:promoted_candidate_score_value + } + } + send_interface_message = { + type = republic_promote_candidate_scheme_good_message + title = republic_promote_candidate_scheme_success_t + left_icon = scope:target + right_icon = scope:scheme.var:target_candidate_title + + show_as_tooltip = { + scope:scheme.var:target_candidate_title = { + change_appointment_investment = { + target = scope:target + investor = scope:owner + value = scope:promoted_candidate_score_value + } + } + } + republic_promote_candidate_scheme_end_effect = yes + } + scope:target = { + if = { + limit = { + this != scope:owner + } + send_interface_message = { + type = republic_promote_candidate_scheme_good_message + title = republic_promote_candidate_scheme_success_t + left_icon = scope:target + right_icon = scope:scheme.var:target_candidate_title + + show_as_tooltip = { + scope:scheme.var:target_candidate_title = { + change_appointment_investment = { + target = scope:target + investor = scope:owner + value = scope:promoted_candidate_score_value + } + } + } + } + } + } + } + } +} + +#Standard failure +republic_promote_candidate_scheme_event.0002 = { + hidden = yes + + immediate = { + send_interface_message = { + type = republic_promote_candidate_scheme_bad_message + title = republic_promote_candidate_scheme_failure_t + left_icon = scope:target + right_icon = scope:scheme.var:target_candidate_title + + republic_promote_candidate_scheme_end_effect = yes + } + } +} diff --git a/events/dlc/mpo/mpo_migration_travel_events.txt b/events/dlc/mpo/mpo_migration_travel_events.txt index 07f1aea78..9914191d3 100644 --- a/events/dlc/mpo/mpo_migration_travel_events.txt +++ b/events/dlc/mpo/mpo_migration_travel_events.txt @@ -82,11 +82,11 @@ mpo_migration_travel_events.0001 = { base = 100 modifier = { factor = 2 - domicile = { herd <= domicile.ten_percent_herd_value } + domicile ?= { herd <= ten_percent_herd_value } } modifier = { factor = 1.5 - domicile = { herd <= domicile.twenty_percent_herd_value } + domicile ?= { herd <= twenty_percent_herd_value } } modifier = { factor = 0 diff --git a/events/dlc/mpo/mpo_nomad_events_1.txt b/events/dlc/mpo/mpo_nomad_events_1.txt index a851250e6..23a192ba0 100644 --- a/events/dlc/mpo/mpo_nomad_events_1.txt +++ b/events/dlc/mpo/mpo_nomad_events_1.txt @@ -563,9 +563,9 @@ scripted_effect mpo_nomad_events_1011_heir_resents_effect = { has_relation_rival = scope:executioner } } - set_relation_rival = { - target = scope:executioner - reason = rival_sent_predecessors_head + set_relation_rival_effect = { + TARGET = scope:executioner + REASON = rival_sent_predecessors_head } } else = { @@ -2675,6 +2675,7 @@ mpo_nomad_events.1020 = { every_house_member = { limit = { is_alive = yes # die during processing will keep in list + root = { is_alive = yes } NOT = { this = root } @@ -5288,6 +5289,7 @@ mpo_nomad_events.1060 = { is_available = yes has_mpo_dlc_trigger = yes government_has_flag = government_is_nomadic + highest_held_title_tier < tier_kingdom any_sub_realm_county = { holder = root any_neighboring_county = { @@ -5315,7 +5317,6 @@ mpo_nomad_events.1060 = { } } } - highest_held_title_tier < tier_kingdom } cooldown = { @@ -5496,7 +5497,7 @@ mpo_nomad_events.1060 = { left_icon = scope:neighbor add_gold = major_gold_value scope:neighbor_county = { - change_development_progress_with_overflow = medium_development_progress_loss + change_prosperity_progress_with_overflow = medium_prosperity_progress_loss } } } @@ -5516,10 +5517,13 @@ mpo_nomad_events.1060 = { } } scope:neighbor.top_liege = { - add_opinion = { - target = root - modifier = angry_opinion - opinion = -30 + if = { + limit = { this != root } # root can be the neighbour's top liege + add_opinion = { + target = root + modifier = angry_opinion + opinion = -30 + } } } stress_and_fulfillment_impact = { @@ -6877,7 +6881,6 @@ mpo_nomad_events.1091 = { has_trait = seducer is_deviant_trigger = yes has_relation_lover = scope:widow - has_relation_soulmate = scope:widow has_relation_crush = scope:widow any_scheme = { scheme_type = courting @@ -6908,7 +6911,6 @@ mpo_nomad_events.1091 = { if = { limit = { OR = { - has_relation_soulmate = scope:widow has_relation_lover = scope:widow has_relation_best_friend = scope:widow } diff --git a/events/dlc/mpo/mpo_nomads_flavour_events.txt b/events/dlc/mpo/mpo_nomads_flavour_events.txt index 8a12ef9ed..c387a289c 100644 --- a/events/dlc/mpo/mpo_nomads_flavour_events.txt +++ b/events/dlc/mpo/mpo_nomads_flavour_events.txt @@ -310,9 +310,9 @@ nomad_events.0001 = { } hidden_effect = { scope:jealous_courtier = { - set_relation_grudge = { - target = scope:achmach_scope - reason = grudge_too_good + set_relation_grudge_effect = { + TARGET = scope:achmach_scope + REASON = grudge_too_good } } } @@ -735,9 +735,9 @@ nomad_events.0003 = { } } scope:jealous_courtier_2 = { - set_relation_grudge = { - target = scope:achmach_scope - reason = grudge_too_good + set_relation_grudge_effect = { + TARGET = scope:achmach_scope + REASON = grudge_too_good } } } @@ -2528,12 +2528,12 @@ nomad_events.0120 = { left_portrait = { character = root - animation = jockey_walk + animation = jockey_walk # always horse camera = camera_event_horse_left } right_portrait = { character = scope:companion - animation = horse_surveying + animation = horse_surveying # always horse camera = camera_event_horse_left } diff --git a/events/dlc/pam/heresy/pam_heresy_historical_events.txt b/events/dlc/pam/heresy/pam_heresy_historical_events.txt index d8b59d3fc..4f7c5dda9 100644 --- a/events/dlc/pam/heresy/pam_heresy_historical_events.txt +++ b/events/dlc/pam/heresy/pam_heresy_historical_events.txt @@ -772,8 +772,6 @@ heresy_historical.0011 = { } immediate = { - clear_saved_scope = convert_ruler - scope:origin_faith = { random_faith_ruler = { limit = { @@ -873,7 +871,7 @@ heresy_historical.0011 = { } if = { - limit = { exists = scope:convert_ruler } + limit = { scope:convert_ruler ?= { rite != scope:new_rite } } if = { limit = { diff --git a/events/dlc/pam/pam_antipope_events.txt b/events/dlc/pam/pam_antipope_events.txt index 166d474f7..8c3630bec 100644 --- a/events/dlc/pam/pam_antipope_events.txt +++ b/events/dlc/pam/pam_antipope_events.txt @@ -49,9 +49,9 @@ pam_antipope_events.0001 = { scope:pope = { if = { limit = { can_set_relation_rival_trigger = { CHARACTER = root } } - set_relation_rival = { - target = root - reason = rival_declared_antipope + set_relation_rival_effect = { + TARGET = root + REASON = rival_declared_antipope } } } @@ -64,9 +64,9 @@ pam_antipope_events.0001 = { scope:pope = { if = { limit = { can_set_relation_rival_trigger = { CHARACTER = scope:antipope } } - set_relation_rival = { - target = scope:antipope - reason = rival_declared_antipope + set_relation_rival_effect = { + TARGET = scope:antipope + REASON = rival_declared_antipope } } add_opinion = { diff --git a/events/dlc/pam/pam_christian_situation_events.txt b/events/dlc/pam/pam_christian_situation_events.txt index 41380e9dd..817a23f93 100644 --- a/events/dlc/pam/pam_christian_situation_events.txt +++ b/events/dlc/pam/pam_christian_situation_events.txt @@ -1 +1,61 @@ -# please replace and fix up vanilla in the future \ No newline at end of file +# please replace and fix up vanilla in the future + +# NEOW: Retain disabled historical situation chain. Only the new 1.21 catalyst event is available. +namespace = pam_the_christian_church + +pam_the_christian_church.0064 = { + type = character_event + queue_icon = "gfx/interface/icons/situation_types/christian_church.dds" + queue_name = the_christian_church + override_sound = { reference = "event:/DLC/CE3/SFX/Stingers/ce3_mx_sting_ChristianSituation_Crisis" } + title = pam_the_christian_church.0064.t + desc = { + first_valid = { + triggered_desc = { + trigger = { + scope:schism_mainline_head ?= this + } + desc = pam_the_christian_church.0064.desc.opening.self_mainline + } + triggered_desc = { + trigger = { + scope:schism_competitor_head ?= this + } + desc = pam_the_christian_church.0064.desc.opening.self_competitor + } + desc = pam_the_christian_church.0064.desc.opening + } + desc = pam_the_christian_church.0064.desc + } + theme = christian + + left_portrait = { + trigger = { exists = scope:schism_mainline_head } + character = scope:schism_mainline_head + animation = personality_zealous + } + right_portrait = { + trigger = { exists = scope:schism_competitor_head } + character = scope:schism_competitor_head + animation = disapproval + } + + immediate = { + play_music_cue = mx_cue_the_shepherds_flock + save_christian_church_scopes_effect = yes + situation:the_christian_church = { + save_scope_as = situation + if = { + limit = { situation_top_has_catalyst = catalyst_the_christian_church_great_schism } + trigger_situation_catalyst = catalyst_the_christian_church_great_schism + } + } + } + + option = { + name = pam_the_christian_church.0064.a + custom_tooltip = pam_the_christian_church.0064.a.tt + custom_tooltip = GREAT_SCHISM_PROGRESS_EFFECT_TT + clicksound = "event:/DLC/FP2/SFX/UI/fp2_struggle_start_select" + } +} diff --git a/events/dlc/pam/pam_clergy_events.txt b/events/dlc/pam/pam_clergy_events.txt index 5c7b79902..92035372d 100644 --- a/events/dlc/pam/pam_clergy_events.txt +++ b/events/dlc/pam/pam_clergy_events.txt @@ -17,7 +17,7 @@ pam_clergy_events.0001 = { trigger = { is_ai = no - primary_title = title:k_papal_state + has_title = title:k_papal_state exists = cp:councillor_court_chaplain } @@ -121,7 +121,7 @@ pam_clergy_events.0010 = { first_valid = { triggered_desc = { trigger = { - scope:cardinal_improve_development = yes + scope:cardinal_improve_prosperity = yes } desc = pam_clergy_events.0010.desc.develop } @@ -508,6 +508,37 @@ pam_clergy_events.0043 = { } } +scripted_effect pam_clear_clerical_region_treasury_effect = { + if = { + limit = { + primary_title = scope:title + has_treasury = yes + } + empty_treasury_effect = yes + } +} + +# Clerical region destroy events +# HoF cannot convert and they stay alive even if landless +pam_clergy_events.0050 = { + theme = christian + type = character_event + title = pam_clergy_events.0052.t + desc = pam_clergy_events.0052.desc + trigger = { + government_has_flag = government_is_theocracy + OR = { + faith.religious_head ?= this + is_proto_hof_trigger = yes + } + } + option = { + name = pam_clergy_events.0052.a + pam_clear_clerical_region_treasury_effect = yes + destroy_title = scope:title + } +} + ################################################################### ## 0051 - Clerical region capital converts (player holder) ## ## ################################################################### @@ -523,6 +554,7 @@ scripted_effect pam_strip_personal_landed_titles_effect = { scope:reason != flag:character_converted } has_clerical_region = no + pam_title_is_clerical_elector_trigger = no } } } @@ -533,8 +565,8 @@ scripted_effect pam_strip_personal_landed_titles_effect = { } if = { - limit = { exists = root.var:old_rite } - root.var:old_rite = { save_scope_as = pam_strip_see_rite } + limit = { exists = scope:old_rite } + scope:old_rite = { save_scope_as = pam_strip_see_rite } } else_if = { limit = { exists = scope:county.rite } @@ -620,6 +652,7 @@ scripted_effect pam_strip_personal_landed_titles_effect = { scope:reason != flag:character_converted } has_clerical_region = no + pam_title_is_clerical_elector_trigger = no } } change_title_holder_include_vassals = { @@ -781,6 +814,11 @@ pam_clergy_events.0051 = { } resolve_title_and_vassal_change = scope:pam_translation_change + if = { + limit = { primary_title = scope:title } + set_primary_title_to = scope:translation_see + } + hidden_effect = { pam_clear_clerical_region_treasury_effect = yes } destroy_title = scope:title pam_strip_personal_landed_titles_effect = yes } @@ -792,10 +830,11 @@ pam_clergy_events.0051 = { custom_tooltip = pam_clergy_events.0051.c.tt pam_strip_personal_landed_titles_effect = yes + pam_clear_clerical_region_treasury_effect = yes destroy_title = scope:title hidden_effect = { if = { - limit = { has_dlc_feature = roads_to_power } + limit = { has_playable_adventurer_dlc_trigger = yes } create_landless_adventurer_title_effect = { REASON = flag:wanderer FLAVOR_CHAR = root @@ -835,11 +874,12 @@ pam_clergy_events.0052 = { pam_strip_personal_landed_titles_effect = yes if = { limit = { scope:reason != flag:character_converted } + pam_clear_clerical_region_treasury_effect = yes destroy_title = scope:title } hidden_effect = { if = { - limit = { has_dlc_feature = roads_to_power } + limit = { has_playable_adventurer_dlc_trigger = yes } create_landless_adventurer_title_effect = { REASON = flag:wanderer FLAVOR_CHAR = root diff --git a/events/dlc/pam/pam_decision_events.txt b/events/dlc/pam/pam_decision_events.txt index a37883881..1e5118d51 100644 --- a/events/dlc/pam/pam_decision_events.txt +++ b/events/dlc/pam/pam_decision_events.txt @@ -555,6 +555,10 @@ pam_decision_events.0001 = { } set_variable = { # To check what they asked you to do name = pam_confession_penalty_var + value = flag:conversion + } + set_variable = { + name = pam_confession_penalty_target value = scope:target } } @@ -779,9 +783,9 @@ pam_decision_events.0003 = { NOT = { has_relation_grudge = scope:target_child } } scope:target_child = { - set_relation_grudge = { - target = root - reason = grudge_pressured_me_sp + set_relation_grudge_effect = { + TARGET = root + REASON = grudge_pressured_me_sp } } } @@ -1084,7 +1088,7 @@ pam_decision_events.0005 = { cp:councillor_court_chaplain ?= { save_scope_as = confessor } } #Find a different clergy member in the area - else_if = { + if = { limit = { NOT = { exists = scope:confessor @@ -1100,8 +1104,13 @@ pam_decision_events.0005 = { save_scope_as = confessor } } - else = { - #make a priest + #make a priest + if = { + limit = { + NOT = { + exists = scope:confessor + } + } create_character = { template = virtuous_priest_character_template dynasty = none @@ -1111,9 +1120,11 @@ pam_decision_events.0005 = { rite = root.rite save_scope_as = confessor } - add_character_flag = { - flag = fake_confessor - days = 10 + scope:confessor = { + add_character_flag = { + flag = fake_confessor + days = 10 + } } } #Find Player Heir @@ -1483,7 +1494,7 @@ pam_decision_events.0007 = { #Find holding to give to Monastic order ordered_held_title = { order_by = { - value = county.development_level + value = county.prosperity_level if = { limit = { title_province = { @@ -1502,7 +1513,7 @@ pam_decision_events.0007 = { } ordered_held_title = { order_by = { - value = county.development_level + value = county.prosperity_level if = { limit = { title_province = { @@ -1871,7 +1882,7 @@ pam_decision_events.0009 = { } } order_by = { - value = county.development_level + value = county.prosperity_level if = { limit = { title_province = { diff --git a/events/dlc/pam/pam_interactions_events.txt b/events/dlc/pam/pam_interactions_events.txt index 6ed88a400..cef66d9e5 100644 --- a/events/dlc/pam/pam_interactions_events.txt +++ b/events/dlc/pam/pam_interactions_events.txt @@ -1221,9 +1221,9 @@ pam_interactions_events.0032 = { this = scope:recipient.primary_title } } - set_relation_rival = { - target = scope:recipient - reason = rival_quarreled_over_land + set_relation_rival_effect = { + TARGET = scope:recipient + REASON = rival_quarreled_over_land } } else = { @@ -1604,13 +1604,11 @@ pam_interactions_events.0033 = { show_as_tooltip = { if = { limit = { - scope:target = { - this = scope:recipient.primary_title - } + scope:target = { this = scope:recipient.primary_title } } - set_relation_rival = { - target = scope:recipient - reason = rival_quarreled_over_land + set_relation_rival_effect = { + TARGET = scope:recipient + REASON = rival_quarreled_over_land } } else = { @@ -3000,7 +2998,7 @@ pam_interactions_events.0036 = { else = { scope:target = { ordered_de_jure_county = { - order_by = development_level + order_by = prosperity_level limit = { OR = { holder = scope:recipient @@ -3347,6 +3345,11 @@ pam_interactions_events.0050 = { sender = scope:puppet_or_actor desc = pam_interactions_events.0050.desc + trigger = { + scope:puppet_or_actor = { is_alive = yes } + scope:secondary_recipient = { is_alive = yes } + } + #Become celibate, obviously option = { trigger = { @@ -3433,7 +3436,7 @@ pam_interactions_events.0050 = { } if = { limit = { - NOT = { has_relation_lover = scope:secondary_recipient } + can_set_relation_lover_trigger = { CHARACTER = scope:secondary_recipient } scope:secondary_recipient = { is_ai = yes } @@ -5205,7 +5208,7 @@ pam_interactions_events.0095 = { immediate = { custom_tooltip = de_jure_clergy_past_tense_effect_tt ordered_sub_realm_county = { - order_by = development_level + order_by = prosperity_level limit = { any_this_title_or_de_jure_above = { this = scope:target diff --git a/events/dlc/pam/pam_secular_faith_events.txt b/events/dlc/pam/pam_secular_faith_events.txt index b80e9bd8a..fbabefa8d 100644 --- a/events/dlc/pam/pam_secular_faith_events.txt +++ b/events/dlc/pam/pam_secular_faith_events.txt @@ -2696,7 +2696,7 @@ pam_secular_faith_events.0020 = { option = { # Endow it richly - the parish quickens the county name = pam_secular_faith_events.0020.b scope:consecrated_county = { - change_development_progress = major_development_progress_gain + change_prosperity_progress = major_prosperity_progress_gain add_county_modifier = { modifier = pam_sf_consecrated_county_modifier years = 10 @@ -5053,7 +5053,6 @@ pam_secular_faith_events.0035 = { increase_wounds_effect = { REASON = whipping } scope:sufferer = { add_piety = major_piety_gain - change_spiritual_fulfillment = major_spiritual_fulfillment_value increase_wounds_effect = { REASON = whipping } } stress_and_fulfillment_impact = { @@ -5080,7 +5079,6 @@ pam_secular_faith_events.0035 = { add_piety = minor_piety_gain scope:sufferer = { add_piety = major_piety_gain - change_spiritual_fulfillment = major_spiritual_fulfillment_value increase_wounds_effect = { REASON = whipping } } stress_and_fulfillment_impact = { @@ -7785,8 +7783,7 @@ pam_secular_faith_events.0057 = { any_held_title = { tier = tier_county any_county_province = { - has_holding_type = church_holding - has_building_or_higher = breweries_01 + pam_sf_monastic_brewery_province_trigger = yes } } } @@ -7797,16 +7794,14 @@ pam_secular_faith_events.0057 = { limit = { tier = tier_county any_county_province = { - has_holding_type = church_holding - has_building_or_higher = breweries_01 + pam_sf_monastic_brewery_province_trigger = yes } } save_scope_as = ale_county save_scope_as = holy_site_scope random_county_province = { limit = { - has_holding_type = church_holding - has_building_or_higher = breweries_01 + pam_sf_monastic_brewery_province_trigger = yes } barony = { save_scope_as = ale_church } } @@ -8057,6 +8052,7 @@ pam_secular_faith_events.0059 = { # The sighted game must have somewhere in the domain to be. any_held_title = { tier = tier_county + is_landless_type_title = no hunt_activity_recent_hunt_sighting_trigger = no } } @@ -8067,6 +8063,7 @@ pam_secular_faith_events.0059 = { every_held_title = { limit = { tier = tier_county + is_landless_type_title = no hunt_activity_recent_hunt_sighting_trigger = no } add_to_list = sighting_counties @@ -8087,6 +8084,10 @@ pam_secular_faith_events.0059 = { } save_scope_as = sighting_province } + if = { + limit = { NOT = { exists = scope:sighting_province } } + title_province = { save_scope_as = sighting_province } + } } scope:sighting_county = { hunt_activity_standard_game_effect = { PROVINCE = scope:sighting_province HUNTER = root } @@ -8241,6 +8242,9 @@ pam_secular_faith_events.0060 = { rite = root.location.county.rite culture = root.location.county.culture save_scope_as = hermit + after_creation = { + add_character_flag = created + } } random_tenet = { limit = { diff --git a/events/dlc/pam/pam_theocratic_ruler_events.txt b/events/dlc/pam/pam_theocratic_ruler_events.txt index 36e53bcb6..078266dab 100644 --- a/events/dlc/pam/pam_theocratic_ruler_events.txt +++ b/events/dlc/pam/pam_theocratic_ruler_events.txt @@ -13,9 +13,13 @@ ## pam_theocratic_ruler_events.0010 - The Sword or the Crozier ## pam_theocratic_ruler_events.0011 - Sword of the Fallen Knight ## pam_theocratic_ruler_events.0012 - A Sacred Grove (travel) -## pam_theocratic_ruler_events.0013 - An Angelic Anthem +## pam_theocratic_ruler_events.0013 - An Angelic Inspiration ## pam_theocratic_ruler_events.0014 - A Convert's Plea -## pam_theocratic_ruler_events.0015 - Prayer Hearing +## pam_theocratic_ruler_events.0015 - Readiness to Rule +## pam_theocratic_ruler_events.0016 - Bishops Breaking Bread +## pam_theocratic_ruler_events.0017 - Honest Intentions +## pam_theocratic_ruler_events.0018 - Bishop or Merchant +## pam_theocratic_ruler_events.0019 - In the Midst of Animosity ############################ @@ -1456,7 +1460,7 @@ pam_theocratic_ruler_events.0007 = { is_in_debt = no NOT = { any_sub_realm_county = { - county_control <= 90 + county_control < county_control_baseline } } exists = liege @@ -1626,7 +1630,7 @@ pam_theocratic_ruler_events.0008 = { title_held_years <= 15 any_county_province = { has_holding_type = castle_holding - has_building_or_higher = curtain_walls_01 + has_building_or_higher = outer_walls_1 } } } @@ -1638,24 +1642,24 @@ pam_theocratic_ruler_events.0008 = { title_held_years <= 15 any_county_province = { has_holding_type = castle_holding - has_building_or_higher = curtain_walls_01 + has_building_or_higher = outer_walls_1 } } save_scope_as = inherited_stone_county random_county_province = { limit = { has_holding_type = castle_holding - has_building_or_higher = curtain_walls_01 + has_building_or_higher = outer_walls_1 } weight = { base = 1 modifier = { add = 5 - has_building_or_higher = curtain_walls_05 + has_building_or_higher = outer_walls_5 } modifier = { add = 3 - has_building_or_higher = curtain_walls_03 + has_building_or_higher = outer_walls_3 } } save_scope_as = stone_province @@ -1686,7 +1690,7 @@ pam_theocratic_ruler_events.0008 = { option = { name = pam_theocratic_ruler_events.0008.b scope:stone_province = { - destroy_or_downgrade_building_effect = { BUILDING = curtain_walls } + destroy_or_downgrade_district_building_effect = { BUILDING = outer_walls } } domicile ?= { switch = { @@ -2454,7 +2458,7 @@ pam_theocratic_ruler_events.0012 = { } ########################### -## pam_theocratic_ruler_events.0013 — An Angelic Anthem +## pam_theocratic_ruler_events.0013 — An Angelic Inspiration ############################ pam_theocratic_ruler_events.0013 = { @@ -2649,9 +2653,25 @@ pam_theocratic_ruler_events.0013 = { ## pam_theocratic_ruler_events.0014 — A Convert's Plea ############################ +scripted_trigger pam_theocratic_ruler_0014_offerable_tenet_trigger = { + save_temporary_scope_as = candidate_tenet + root = { + NOR = { + has_personal_tenet = scope:candidate_tenet + rite = { rite_has_tenet = scope:candidate_tenet } + } + } +} + scripted_trigger pam_theocratic_ruler_0014_neighbour_county_trigger = { culture != root.culture faith != root.faith + faith.main_rite = { + any_rite_tenet = { + status = core + pam_theocratic_ruler_0014_offerable_tenet_trigger = yes + } + } } scripted_effect pam_theocratic_ruler_events_0014_grant_mass_conversion_discount_effect = { @@ -2741,17 +2761,7 @@ pam_theocratic_ruler_events.0014 = { random_rite_tenet = { status = core limit = { - NOT = { root = { has_personal_tenet = this } } - NOT = { - root = { - rite = { - has_tenet_status = { - tenet = this - status = core - } - } - } - } + pam_theocratic_ruler_0014_offerable_tenet_trigger = yes } save_scope_as = offered_tenet_a } @@ -2763,17 +2773,7 @@ pam_theocratic_ruler_events.0014 = { status = core limit = { this != scope:offered_tenet_a - NOT = { root = { has_personal_tenet = this } } - NOT = { - root = { - rite = { - has_tenet_status = { - tenet = this - status = core - } - } - } - } + pam_theocratic_ruler_0014_offerable_tenet_trigger = yes } save_scope_as = offered_tenet_b } @@ -2949,7 +2949,7 @@ pam_theocratic_ruler_events.0014 = { } ########################### -## pam_theocratic_ruler_events.0015 — Prayer Hearing +## pam_theocratic_ruler_events.0015 — Readiness to Rule ############################ scripted_effect pam_theocratic_ruler_events_0015_highest_clerical_skill_point_effect = { @@ -3147,3 +3147,764 @@ pam_theocratic_ruler_events.0015 = { } } } + +########################### +## pam_theocratic_ruler_events.0016 — Bishops Breaking Bread +############################ + +scripted_trigger pam_theocratic_ruler_events_0016_subordinate_clergy_trigger = { + this != root + is_available_adult = yes + faith = root.faith +} + +pam_theocratic_ruler_events.0016 = { + type = character_event + title = pam_theocratic_ruler_events.0016.t + desc = pam_theocratic_ruler_events.0016.desc + theme = faith + window = big_event_window + override_background = { reference = feast } + + left_portrait = { + character = root + animation = toast + camera = camera_event_center_close_to_right + } + center_portrait = { + character = scope:subordinate_bishop_1 + animation = debating + camera = camera_event_center_pointing_forward_fov35 + } + right_portrait = { + character = scope:subordinate_bishop_2 + animation = chaplain + camera = camera_event_center_pointing_forward_fov35 + } + + cooldown = { years = 10 } + + trigger = { + pam_government_is_religious_playable_trigger = yes + is_landed = yes + is_available_adult = yes + any_subordinate = { + count >= 2 + pam_theocratic_ruler_events_0016_subordinate_clergy_trigger = yes + } + } + + immediate = { + every_subordinate = { + limit = { + pam_theocratic_ruler_events_0016_subordinate_clergy_trigger = yes + } + add_to_list = pam_theocratic_ruler_events_0016_bishop_candidates + } + if = { + limit = { + list_size = { + name = pam_theocratic_ruler_events_0016_bishop_candidates + value >= 2 + } + } + random_in_list = { + list = pam_theocratic_ruler_events_0016_bishop_candidates + save_scope_as = subordinate_bishop_1 + } + random_in_list = { + list = pam_theocratic_ruler_events_0016_bishop_candidates + limit = { + this != scope:subordinate_bishop_1 + } + save_scope_as = subordinate_bishop_2 + } + } + if = { + limit = { + scope:subordinate_bishop_1 = { + has_relation_friend = root + } + } + scope:subordinate_bishop_1 = { + save_scope_as = friend_subordinate_bishop + } + } + else_if = { + limit = { + scope:subordinate_bishop_2 = { + has_relation_friend = root + } + } + scope:subordinate_bishop_2 = { + save_scope_as = friend_subordinate_bishop + } + } + if = { + limit = { + scope:subordinate_bishop_1 = { + ecumenical_shareable_unknown_tenet_for_root_trigger = yes + } + scope:subordinate_bishop_2 = { + ecumenical_shareable_unknown_tenet_for_root_trigger = yes + } + } + random_list = { + 50 = { + scope:subordinate_bishop_1 = { + save_scope_as = tenet_teacher_bishop + } + } + 50 = { + scope:subordinate_bishop_2 = { + save_scope_as = tenet_teacher_bishop + } + } + } + } + else_if = { + limit = { + scope:subordinate_bishop_1 = { + ecumenical_shareable_unknown_tenet_for_root_trigger = yes + } + } + scope:subordinate_bishop_1 = { + save_scope_as = tenet_teacher_bishop + } + } + else_if = { + limit = { + scope:subordinate_bishop_2 = { + ecumenical_shareable_unknown_tenet_for_root_trigger = yes + } + } + scope:subordinate_bishop_2 = { + save_scope_as = tenet_teacher_bishop + } + } + if = { + limit = { + exists = scope:tenet_teacher_bishop + } + scope:tenet_teacher_bishop = { + random_character_tenet = { + knowledge_filter = known + limit = { + save_temporary_scope_as = pam_theocratic_ruler_events_0016_tenet_candidate + NOT = { root = { knows_tenet = scope:pam_theocratic_ruler_events_0016_tenet_candidate } } + root.faith.main_rite = { + has_tenet_status = { + tenet = scope:pam_theocratic_ruler_events_0016_tenet_candidate + status = unknown + } + } + } + save_scope_as = shared_tenet + } + } + } + } + + # Accept a friend's pledge of support. + option = { + name = pam_theocratic_ruler_events.0016.a + reason = friend + trigger = { + exists = scope:friend_subordinate_bishop + } + add_piety = medium_piety_value + stress_and_fulfillment_impact = { + zealous = minor_stress_impact_loss + generous = minor_stress_impact_loss + } + ai_chance = { + base = 35 + ai_value_modifier = { + ai_zeal = 0.35 + ai_compassion = 0.2 + } + } + } + + # Let us speak of wise stewardship. + option = { + name = pam_theocratic_ruler_events.0016.b + skill = stewardship + duel = { + skill = stewardship + value = medium_skill_rating + 60 = { + desc = pam_theocratic_ruler_events.0016.b.success + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + } + send_interface_toast = { + type = event_toast_effect_good + title = pam_theocratic_ruler_events.0016.b.toast.success + left_icon = scope:subordinate_bishop_1 + right_icon = scope:subordinate_bishop_2 + add_stewardship_lifestyle_xp = minor_lifestyle_xp + scope:subordinate_bishop_1 = { + add_stewardship_skill = 1 + } + scope:subordinate_bishop_2 = { + add_stewardship_skill = 1 + } + } + } + 40 = { + desc = pam_theocratic_ruler_events.0016.b.failure + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + } + send_interface_toast = { + type = event_toast_effect_neutral + title = pam_theocratic_ruler_events.0016.b.toast.failure + left_icon = root + add_stress = minor_stress_gain + } + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_rationality = 0.3 + } + } + } + + # Learn a tenet one bishop knows. + option = { + name = pam_theocratic_ruler_events.0016.c + trigger = { + exists = scope:shared_tenet + } + add_known_tenet = scope:shared_tenet + add_learning_lifestyle_xp = minor_lifestyle_xp + stress_and_fulfillment_impact = { + zealous = minor_stress_impact_loss + cynical = minor_stress_impact_gain + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_zeal = 0.3 + ai_rationality = 0.25 + } + } + } + + # Break bread and deepen bonds. + option = { + name = pam_theocratic_ruler_events.0016.d + trigger = { + NOT = { exists = scope:friend_subordinate_bishop } + } + progress_towards_friend_effect = { + REASON = friend_broke_bread_over_faith_reason + CHARACTER = scope:subordinate_bishop_1 + OPINION = 0 + } + progress_towards_friend_effect = { + REASON = friend_broke_bread_over_faith_reason + CHARACTER = scope:subordinate_bishop_2 + OPINION = 0 + } + stress_and_fulfillment_impact = { + compassionate = minor_stress_impact_loss + shy = minor_stress_impact_gain + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_compassion = 0.35 + ai_sociability = 0.25 + } + } + } +} + +########################### +## pam_theocratic_ruler_events.0017 — Honest Intentions +############################ + +pam_theocratic_ruler_events.0017 = { + type = character_event + title = pam_theocratic_ruler_events.0017.t + desc = pam_theocratic_ruler_events.0017.desc + theme = faith + override_background = { reference = council_chamber } + + left_portrait = { + character = root + animation = priest_good + } + lower_center_portrait = { + character = scope:church_authority + animation = zealous_superior + } + + right_portrait = { + character = cp:councillor_chancellor + animation = chancellor + } + + cooldown = { years = 10 } + + trigger = { + pam_government_is_religious_playable_trigger = yes + is_landed = yes + is_available_adult = yes + exists = top_participant_group:the_christian_church + is_decision_on_cooldown = pam_shape_the_christian_church_decision + OR = { + exists = superior + NOT = { + faith.main_rite = { + head_of_rite ?= root + } + } + } + cp:councillor_chancellor ?= { + is_available_adult = yes + } + faith = { + OR = { + religious_head ?= { + NOT = { this = root } + is_available_adult = yes + } + main_rite = { + head_of_rite ?= { + NOT = { this = root } + is_available_adult = yes + } + } + } + } + } + + immediate = { + cp:councillor_chancellor = { save_scope_as = chancellor } + if = { + limit = { + faith.religious_head ?= { + NOT = { this = root } + is_available_adult = yes + } + } + faith.religious_head = { save_scope_as = church_authority } + } + else = { + faith.main_rite.head_of_rite = { save_scope_as = church_authority } + } + } + + # I could do so much more. + option = { + name = pam_theocratic_ruler_events.0017.a + trigger = { + has_trait = ambitious + } + custom_tooltip = { + text = pam_theocratic_ruler_events.0017.a.cooldown_tt + remove_decision_cooldown = pam_shape_the_christian_church_decision + } + scope:church_authority = { + add_opinion = { + modifier = grateful_opinion + target = root + opinion = 10 + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + zealous = minor_stress_impact_loss + } + ai_chance = { + base = 40 + ai_value_modifier = { + ai_zeal = 0.35 + ai_boldness = 0.25 + } + } + } + + # I am but a servant + option = { + name = pam_theocratic_ruler_events.0017.b + add_piety = medium_piety_value + scope:church_authority = { + add_opinion = { + modifier = grateful_opinion + target = root + opinion = 5 + } + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_gain + humble = minor_stress_impact_loss + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_zeal = 0.3 + } + } + } + + # No one questions my convictions. + option = { + name = pam_theocratic_ruler_events.0017.c + add_prestige = medium_prestige_gain + scope:church_authority = { + add_opinion = { + modifier = disappointed_opinion + target = root + opinion = -15 + } + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + deceitful = minor_stress_impact_loss + humble = minor_stress_impact_gain + } + ai_chance = { + base = 20 + ai_value_modifier = { + ai_honor = -0.2 + ai_boldness = 0.15 + } + } + } +} + +########################### +## pam_theocratic_ruler_events.0018 — Bishop or Merchant +############################ + +scripted_trigger pam_theocratic_ruler_events_0018_political_bishop_trigger = { + this != root + is_available_adult = yes + faith = root.faith + NOT = { has_trait = zealous } + OR = { + has_trait = greedy + has_trait = cynical + stewardship > learning + } +} + +pam_theocratic_ruler_events.0018 = { + type = character_event + title = pam_theocratic_ruler_events.0018.t + desc = pam_theocratic_ruler_events.0018.desc + theme = faith + override_background = { reference = council_chamber } + + left_portrait = { + character = root + animation = villain + camera = camera_event_center_pointing_right + } + right_portrait = { + character = scope:political_bishop + animation = debating + } + + cooldown = { years = 8 } + + trigger = { + pam_government_is_religious_playable_trigger = yes + is_landed = yes + is_available_adult = yes + any_subordinate = { + pam_theocratic_ruler_events_0018_political_bishop_trigger = yes + } + } + + immediate = { + every_subordinate = { + limit = { + pam_theocratic_ruler_events_0018_political_bishop_trigger = yes + } + add_to_list = pam_theocratic_ruler_events_0018_bishop_candidates + } + if = { + limit = { + list_size = { + name = pam_theocratic_ruler_events_0018_bishop_candidates + value >= 1 + } + } + ordered_in_list = { + list = pam_theocratic_ruler_events_0018_bishop_candidates + order_by = stewardship + save_scope_as = political_bishop + } + } + } + + # Praise the bishop's stewardship. + option = { + name = pam_theocratic_ruler_events.0018.a + add_character_modifier = { + modifier = pam_bishop_or_merchant_modifier + years = 5 + } + scope:political_bishop = { + add_opinion = { + modifier = pleased_opinion + target = root + opinion = 10 + } + } + stress_and_fulfillment_impact = { + gregarious = minor_stress_impact_loss + cynical = minor_stress_impact_loss + zealous = minor_stress_impact_gain + } + ai_chance = { + base = 35 + ai_value_modifier = { + ai_rationality = 0.3 + ai_sociability = 0.25 + } + } + } + + # Demand a return to spiritual duty. + option = { + name = pam_theocratic_ruler_events.0018.b + add_piety = medium_piety_gain + scope:political_bishop = { + add_opinion = { + modifier = disappointed_opinion + target = root + opinion = -10 + } + add_stress = minor_stress_gain + } + stress_and_fulfillment_impact = { + zealous = minor_stress_impact_loss + diligent = minor_stress_impact_loss + cynical = minor_stress_impact_gain + } + ai_chance = { + base = 40 + ai_value_modifier = { + ai_zeal = 0.4 + ai_honor = 0.2 + } + } + } +} + +########################### +## pam_theocratic_ruler_events.0019 — In the Midst of Animosity +############################ + +pam_theocratic_ruler_events.0019 = { + type = character_event + title = pam_theocratic_ruler_events.0019.t + desc = pam_theocratic_ruler_events.0019.desc + theme = faith + override_background = { reference = council_chamber } + + left_portrait = { + character = root + animation = chess_certain_win + } + lower_center_portrait = { + character = scope:animosity_liege + animation = disapproval + } + lower_right_portrait = { + character = scope:animosity_superior + animation = zealous_superior + } + + cooldown = { years = 25 } + + trigger = { + pam_government_is_religious_playable_trigger = yes + is_landed = yes + is_available_adult = yes + exists = liege + exists = superior + liege != superior + liege = { + is_available_adult = yes + this != root + } + superior = { + is_available_adult = yes + this != root + } + liege = { + opinion = { + target = root.superior + value <= -25 + } + } + superior = { + opinion = { + target = root.liege + value <= -25 + } + } + } + + immediate = { + liege = { save_scope_as = animosity_liege } + superior = { save_scope_as = animosity_superior } + } + # Play them against each other. + option = { + name = pam_theocratic_ruler_events.0019.c + flavor = pam_theocratic_ruler_events.0019.c.flavor + skill = intrigue + trigger = { + intrigue >= high_skill_rating + } + show_as_unavailable = { + always = yes + } + add_intrigue_lifestyle_xp = major_lifestyle_xp + scope:animosity_liege = { + add_opinion = { + modifier = disappointed_opinion + target = scope:animosity_superior + opinion = -15 + } + } + scope:animosity_superior = { + add_opinion = { + modifier = disappointed_opinion + target = scope:animosity_liege + opinion = -15 + } + } + stress_and_fulfillment_impact = { + deceitful = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + honest = minor_stress_impact_gain + just = minor_stress_impact_gain + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_honor = -0.4 + ai_rationality = 0.2 + } + } + } + + # Help them find common ground. + option = { + name = pam_theocratic_ruler_events.0019.d + flavor = pam_theocratic_ruler_events.0019.d.flavor + skill = diplomacy + trigger = { + diplomacy >= high_skill_rating + } + show_as_unavailable = { + always = yes + } + add_diplomacy_lifestyle_xp = major_lifestyle_xp + scope:animosity_liege = { + add_opinion = { + modifier = grateful_opinion + target = scope:animosity_superior + opinion = 15 + } + } + scope:animosity_superior = { + add_opinion = { + modifier = grateful_opinion + target = scope:animosity_liege + opinion = 15 + } + } + stress_and_fulfillment_impact = { + diplomat = minor_stress_impact_loss + compassionate = minor_stress_impact_loss + wrathful = minor_stress_impact_gain + } + ai_chance = { + base = 25 + ai_value_modifier = { + ai_compassion = 0.3 + ai_rationality = 0.25 + } + } + } + + # Openly support my liege. + option = { + name = pam_theocratic_ruler_events.0019.a + add_prestige = medium_prestige_gain + scope:animosity_liege = { + add_opinion = { + modifier = pleased_opinion + target = root + opinion = 10 + } + } + scope:animosity_superior = { + add_opinion = { + modifier = disappointed_opinion + target = root + opinion = -10 + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + craven = minor_stress_impact_gain + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_boldness = 0.25 + ai_zeal = -0.15 + } + } + } + + # Openly support my superior. + option = { + name = pam_theocratic_ruler_events.0019.b + add_piety = medium_piety_gain + scope:animosity_superior = { + add_opinion = { + modifier = pleased_opinion + target = root + opinion = 10 + } + } + scope:animosity_liege = { + add_opinion = { + modifier = disappointed_opinion + target = root + opinion = -10 + } + } + stress_and_fulfillment_impact = { + zealous = minor_stress_impact_loss + craven = minor_stress_impact_gain + } + ai_chance = { + base = 30 + ai_value_modifier = { + ai_zeal = 0.3 + ai_boldness = 0.15 + } + } + } +} diff --git a/events/dlc/tgp/tgp_ceremonial_liege_events.txt b/events/dlc/tgp/tgp_ceremonial_liege_events.txt index ed55931da..4fc4cb8cf 100644 --- a/events/dlc/tgp/tgp_ceremonial_liege_events.txt +++ b/events/dlc/tgp/tgp_ceremonial_liege_events.txt @@ -612,7 +612,7 @@ tgp_ceremonial_liege_events.0020 = { } AND = { tgp_is_ceremonial_regent_trigger = yes - primary_title.var:administrative_ui_special_title.holder = { is_in_valid_activity_0020 = yes } + ceremonial_liege = { is_in_valid_activity_0020 = yes } } } } diff --git a/events/dlc/tgp/tgp_child_personality_events.txt b/events/dlc/tgp/tgp_child_personality_events.txt index 93996b8dd..e67f68905 100644 --- a/events/dlc/tgp/tgp_child_personality_events.txt +++ b/events/dlc/tgp/tgp_child_personality_events.txt @@ -30,7 +30,9 @@ tgp_child_personality.0002 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_0002 } NAND = { OR = { has_trait = arrogant @@ -42,7 +44,6 @@ tgp_child_personality.0002 = { has_trait = sadistic } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -69,6 +70,10 @@ tgp_child_personality.0002 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_0002 + years = 16 + } save_scope_as = child if = { limit = { @@ -95,11 +100,14 @@ tgp_child_personality.0002 = { save_scope_as = guardian } } - create_character = { - template = generic_peasant_character - gender_female_chance = 0 - location = root.location - save_scope_as = poor_fellow + if = { + limit = { is_ai = no } + create_character = { + template = generic_peasant_character + gender_female_chance = 0 + location = root.location + save_scope_as = poor_fellow + } } } @@ -201,7 +209,7 @@ tgp_child_personality.0002 = { } } after = { - scope:poor_fellow = { + scope:poor_fellow ?= { silent_disappearance_effect = yes } } @@ -224,7 +232,9 @@ tgp_child_personality.0003 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_0003 } OR = { any_relation = { type = guardian @@ -255,7 +265,6 @@ tgp_child_personality.0003 = { has_trait = arrogant } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -281,7 +290,10 @@ tgp_child_personality.0003 = { modifier = { add = 5 culture = { - has_cultural_parameter = honest_trait_more_common + OR = { + has_cultural_parameter = honest_trait_more_common + has_cultural_parameter = good_faith_traits_more_common + } } NOR = { has_trait = honest @@ -291,6 +303,10 @@ tgp_child_personality.0003 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_0003 + years = 16 + } save_scope_as = child get_guardian_scope_effect = yes } @@ -344,7 +360,10 @@ tgp_child_personality.0003 = { modifier = { add = 100 culture = { - has_cultural_parameter = honest_trait_more_common + OR = { + has_cultural_parameter = honest_trait_more_common + has_cultural_parameter = good_faith_traits_more_common + } } } } @@ -405,7 +424,9 @@ tgp_child_personality.0004 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_0004 } OR = { any_relation = { type = guardian @@ -440,7 +461,6 @@ tgp_child_personality.0004 = { has_trait = impatient } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -486,6 +506,10 @@ tgp_child_personality.0004 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_0004 + years = 16 + } save_scope_as = child get_guardian_scope_effect = yes } @@ -613,7 +637,9 @@ tgp_child_personality.0007 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_0007 } NAND = { OR = { has_trait = just @@ -628,7 +654,6 @@ tgp_child_personality.0007 = { has_trait = gluttonous } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -664,16 +689,23 @@ tgp_child_personality.0007 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_0007 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 40 60 } - location = root.location - save_scope_as = gluttonous_servant - trait = gluttonous - trait = drunkard - after_creation = { - change_current_weight = 150 + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + location = root.location + save_scope_as = gluttonous_servant + trait = gluttonous + trait = drunkard + after_creation = { + change_current_weight = 150 + } } } } @@ -774,7 +806,7 @@ tgp_child_personality.0007 = { } } after = { - scope:gluttonous_servant = { + scope:gluttonous_servant ?= { silent_disappearance_effect = yes } } @@ -793,7 +825,9 @@ tgp_child_personality.0009 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_0009 } NAND = { OR = { has_trait = brave @@ -808,7 +842,6 @@ tgp_child_personality.0009 = { has_trait = cynical } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -844,6 +877,10 @@ tgp_child_personality.0009 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_0009 + years = 16 + } save_scope_as = child } @@ -964,7 +1001,9 @@ tgp_child_personality.0010 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_0010 } OR = { any_relation = { type = guardian @@ -1000,7 +1039,6 @@ tgp_child_personality.0010 = { has_trait = trusting } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -1026,6 +1064,10 @@ tgp_child_personality.0010 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_0010 + years = 16 + } save_scope_as = child get_guardian_scope_effect = yes } @@ -1139,7 +1181,9 @@ tgp_child_personality.7000 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7000 } OR = { any_relation = { type = guardian @@ -1174,7 +1218,6 @@ tgp_child_personality.7000 = { has_trait = temperate } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -1210,6 +1253,10 @@ tgp_child_personality.7000 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7000 + years = 16 + } save_scope_as = child get_guardian_scope_effect = yes } @@ -1327,7 +1374,9 @@ tgp_child_personality.7300 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7300 } NAND = { OR = { has_trait = eccentric @@ -1340,7 +1389,6 @@ tgp_child_personality.7300 = { has_trait = sadistic } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -1367,6 +1415,10 @@ tgp_child_personality.7300 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7300 + years = 16 + } save_scope_as = child } @@ -1489,7 +1541,9 @@ tgp_child_personality.7010 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7010 } NAND = { OR = { has_trait = zealous @@ -1505,7 +1559,6 @@ tgp_child_personality.7010 = { has_trait = callous } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -1541,6 +1594,10 @@ tgp_child_personality.7010 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7010 + years = 16 + } save_scope_as = child } @@ -1660,7 +1717,9 @@ tgp_child_personality.7020 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7020 } NAND = { OR = { has_trait = shy @@ -1675,7 +1734,6 @@ tgp_child_personality.7020 = { has_trait = brave } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -1691,12 +1749,19 @@ tgp_child_personality.7020 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7020 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 40 60 } - location = root.location - save_scope_as = eyes + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + location = root.location + save_scope_as = eyes + } } } @@ -1787,7 +1852,7 @@ tgp_child_personality.7020 = { } } after = { - scope:eyes = { + scope:eyes ?= { silent_disappearance_effect = yes } } @@ -1806,7 +1871,9 @@ tgp_child_personality.7050 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7050 } NAND = { OR = { has_trait = just @@ -1822,7 +1889,6 @@ tgp_child_personality.7050 = { has_trait = sadistic } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -1848,6 +1914,10 @@ tgp_child_personality.7050 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7050 + years = 16 + } save_scope_as = child } @@ -1971,7 +2041,9 @@ tgp_child_personality.7200 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7200 } NAND = { OR = { has_trait = brave @@ -1987,7 +2059,6 @@ tgp_child_personality.7200 = { has_trait = calm } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -2014,12 +2085,19 @@ tgp_child_personality.7200 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7200 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 40 60 } - location = root.location - save_scope_as = alarmed_servant + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + location = root.location + save_scope_as = alarmed_servant + } } } @@ -2123,7 +2201,7 @@ tgp_child_personality.7200 = { } } after = { - scope:alarmed_servant = { + scope:alarmed_servant ?= { silent_disappearance_effect = yes } } @@ -2147,7 +2225,9 @@ tgp_child_personality.7070 = { hide_info = yes } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7070 } OR = { any_relation = { type = guardian @@ -2182,7 +2262,6 @@ tgp_child_personality.7070 = { has_trait = wrathful } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -2218,13 +2297,20 @@ tgp_child_personality.7070 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7070 + years = 16 + } save_scope_as = child get_guardian_scope_effect = yes - create_character = { - template = merchant_template - age = { 40 60 } - location = root.location - save_scope_as = servant + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + location = root.location + save_scope_as = servant + } } } @@ -2330,7 +2416,7 @@ tgp_child_personality.7070 = { } } after = { - scope:servant = { + scope:servant ?= { silent_disappearance_effect = yes } } @@ -2349,13 +2435,14 @@ tgp_child_personality.7040 = { } trigger = { - is_available_child_allow_travel = yes age >= 13 #Because chaste/lustful are only given at age 13 + is_valid_for_east_asian_events_trigger = yes + is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7040 } NOR = { has_trait = chaste has_trait = lustful } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -2376,6 +2463,10 @@ tgp_child_personality.7040 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7040 + years = 16 + } save_scope_as = child } @@ -2452,7 +2543,9 @@ tgp_child_personality.7080 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7080 } NAND = { OR = { has_trait = generous @@ -2468,7 +2561,6 @@ tgp_child_personality.7080 = { has_trait = humble } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -2494,12 +2586,19 @@ tgp_child_personality.7080 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7080 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 8 12 } - location = root.location - save_scope_as = greedy_child + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 8 12 } + location = root.location + save_scope_as = greedy_child + } } } @@ -2603,7 +2702,7 @@ tgp_child_personality.7080 = { } } after = { - scope:greedy_child = { + scope:greedy_child ?= { silent_disappearance_effect = yes } } @@ -2628,7 +2727,9 @@ tgp_child_personality.7030 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7030 } NAND = { OR = { has_trait = lazy @@ -2644,7 +2745,6 @@ tgp_child_personality.7030 = { has_trait = sadistic } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -2671,25 +2771,32 @@ tgp_child_personality.7030 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7030 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 40 60 } - gender_female_chance = { - if = { - limit = { - root = { - is_female = yes + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + gender_female_chance = { + if = { + limit = { + root = { + is_female = yes + } } + add = 100 + } + else = { + add = 0 } - add = 100 - } - else = { - add = 0 } + location = root.location + save_scope_as = clumsy_servant } - location = root.location - save_scope_as = clumsy_servant } } @@ -2794,7 +2901,7 @@ tgp_child_personality.7030 = { } } after = { - scope:clumsy_servant = { + scope:clumsy_servant ?= { silent_disappearance_effect = yes } } @@ -2816,7 +2923,9 @@ tgp_child_personality.7090 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7090 } NAND = { OR = { has_trait = forgiving @@ -2831,7 +2940,6 @@ tgp_child_personality.7090 = { has_trait = impatient } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -2854,28 +2962,45 @@ tgp_child_personality.7090 = { has_trait = impatient } } + modifier = { + add = 5 + culture = { + has_cultural_parameter = good_faith_traits_more_common + } + NOR = { + has_trait = trusting + has_trait = paranoid + } + } } immediate = { + add_character_flag = { + flag = had_event_child_personality_7090 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 40 60 } - gender_female_chance = { - if = { - limit = { - root = { - is_female = yes + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + gender_female_chance = { + if = { + limit = { + root = { + is_female = yes + } } + add = 100 + } + else = { + add = 0 } - add = 100 - } - else = { - add = 0 } + location = root.location + save_scope_as = sorry_servant } - location = root.location - save_scope_as = sorry_servant } } @@ -2936,6 +3061,12 @@ tgp_child_personality.7090 = { add = -0.5 guardian_or_court_tutor_trait_trigger = { TRAIT = paranoid } } + modifier = { + add = 100 + culture = { + has_cultural_parameter = good_faith_traits_more_common + } + } } } @@ -2975,7 +3106,7 @@ tgp_child_personality.7090 = { } } after = { - scope:sorry_servant = { + scope:sorry_servant ?= { silent_disappearance_effect = yes } } @@ -2998,7 +3129,9 @@ tgp_child_personality.7060 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7060 } NAND = { OR = { has_trait = humble @@ -3013,7 +3146,6 @@ tgp_child_personality.7060 = { has_trait = ambitious } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -3049,12 +3181,19 @@ tgp_child_personality.7060 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7060 + years = 16 + } save_scope_as = child - create_character = { - template = merchant_template - age = { 40 60 } - location = root.location - save_scope_as = sycophantic_servant + if = { + limit = { is_ai = no } + create_character = { + template = merchant_template + age = { 40 60 } + location = root.location + save_scope_as = sycophantic_servant + } } } @@ -3160,7 +3299,7 @@ tgp_child_personality.7060 = { } } after = { - scope:sycophantic_servant = { + scope:sycophantic_servant ?= { silent_disappearance_effect = yes } } @@ -3182,7 +3321,9 @@ tgp_child_personality.7100 = { } trigger = { + is_valid_for_east_asian_events_trigger = yes is_available_child_allow_travel = yes + NOT = { has_character_flag = had_event_child_personality_7100 } OR = { any_relation = { type = guardian @@ -3217,7 +3358,6 @@ tgp_child_personality.7100 = { has_trait = patient } } - is_valid_for_east_asian_events_trigger = yes } weight_multiplier = { @@ -3233,7 +3373,10 @@ tgp_child_personality.7100 = { modifier = { add = 5 culture = { - has_cultural_parameter = honest_trait_more_common + OR = { + has_cultural_parameter = honest_trait_more_common + has_cultural_parameter = good_faith_traits_more_common + } } NOR = { has_trait = honest @@ -3243,6 +3386,10 @@ tgp_child_personality.7100 = { } immediate = { + add_character_flag = { + flag = had_event_child_personality_7100 + years = 16 + } save_scope_as = child get_guardian_scope_effect = yes } @@ -3277,7 +3424,10 @@ tgp_child_personality.7100 = { modifier = { add = 100 culture = { - has_cultural_parameter = honest_trait_more_common + OR = { + has_cultural_parameter = honest_trait_more_common + has_cultural_parameter = good_faith_traits_more_common + } } } } diff --git a/events/dlc/tgp/tgp_china_yearly_events.txt b/events/dlc/tgp/tgp_china_yearly_events.txt index 9572cb1c4..1af9d4ed1 100644 --- a/events/dlc/tgp/tgp_china_yearly_events.txt +++ b/events/dlc/tgp/tgp_china_yearly_events.txt @@ -43,7 +43,7 @@ tgp_china_yearly.0001 = { is_independent_ruler = no short_term_gold >= medium_gold_value any_held_county = { - county_control <= 60 + county_control < county_control_baseline root.location.county = this } } @@ -51,7 +51,7 @@ tgp_china_yearly.0001 = { immediate = { random_held_county = { limit = { - county_control <= 60 + county_control < county_control_baseline root.location.county = this } save_scope_as = poor_county @@ -261,7 +261,7 @@ tgp_china_yearly.0005 = { government_has_flag = government_is_celestial highest_held_title_tier <= tier_kingdom is_independent_ruler = no - any_held_county = { development_level <= terrible_development_level } + any_held_county = { prosperity_level <= terrible_prosperity_level } OR = { any_courtier_or_guest = { is_available_ai_adult = yes @@ -271,12 +271,13 @@ tgp_china_yearly.0005 = { } immediate = { - every_pool_character = { + random_pool_character = { province = root.location limit = { age = { 6 12 } num_of_good_genetic_traits >= 1 num_of_bad_genetic_traits >= 1 + any_parent = {} any_parent = { count = all is_alive = no @@ -404,7 +405,6 @@ tgp_china_yearly.0005 = { option = { #I will find a suitable custodian. name = tgp_china_yearly.0005.a - trigger = { exists = scope:guardian } scope:grieving_child = { @@ -434,8 +434,6 @@ tgp_china_yearly.0005 = { option = { #The child cannot honor their father if we take them in. name = tgp_china_yearly.0005.b - change_merit = minor_merit_gain - stress_and_fulfillment_impact = { compassionate = medium_stress_impact_gain callous = medium_stress_impact_loss @@ -458,17 +456,48 @@ tgp_china_yearly.0005 = { } } + option = { #Take this and bury your parent, poor child + name = tgp_china_yearly.0005.e + + trigger = { gold >= tiny_gold_value } + + remove_short_term_gold = tiny_gold_value + add_prestige = medium_prestige_gain + change_merit = medium_merit_gain + add_courtier = scope:grieving_child + scope:grieving_child = { + add_opinion = { + target = ROOT + modifier = thankful_opinion + opinion = 50 + } + } + + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_loss + greedy = medium_stress_impact_gain + generous = medium_stress_impact_loss + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_compassion = tiny_chance_impact_positive_ai_value + ai_greed = tiny_chance_impact_negative_ai_value + } + } + } + option = { #I am not ready to decide on this. name = tgp_china_yearly.0005.c flavor = tgp_china_yearly.0005.c.flavor trigger = { OR = { + NOT = { has_trait = confucian_education } has_trait_xp = { trait = confucian_education value < 100 } - NOT = { has_trait = confucian_education } } } @@ -561,10 +590,18 @@ tgp_china_yearly.0010 = { trigger = { is_available_adult = yes - has_tgp_dlc_trigger = yes - government_has_flag = government_is_celestial - highest_held_title_tier <= tier_kingdom - is_independent_ruler = no + OR = { + AND = { + has_tgp_dlc_trigger = yes + government_has_flag = government_is_celestial + highest_held_title_tier <= tier_kingdom + is_independent_ruler = no + } + AND = { + government_has_flag = government_is_merchant + has_trait = confucian_education + } + } is_ai = no } @@ -603,6 +640,7 @@ tgp_china_yearly.0010 = { option = { #Banish him. name = tgp_china_yearly.0010.a + trigger = { government_has_flag = government_is_celestial } custom_tooltip = tgp_china_yearly.0010.a.tt add_dread = minor_dread_gain change_merit = minor_merit_gain @@ -628,6 +666,41 @@ tgp_china_yearly.0010 = { stress_and_fulfillment_impact = { ambitious = medium_stress_impact_loss } } + option = { + name = tgp_china_yearly.0010.e + trigger = { + government_has_flag = government_is_merchant + NOT = { has_trait = lifestyle_poet } + } + pay_short_term_gold = { + target = scope:starving_lowborn + gold = scope:starving_lowborn.tiny_gold_value + } + add_trait = lifestyle_poet + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + humble = minor_stress_impact_gain + content = minor_stress_impact_gain + ambitious = medium_stress_impact_loss + eccentric = medium_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = impatient + has_trait = content + has_trait = humble + } + } + modifier = { + factor = 0 + diplomacy <= high_skill_rating + } + } + } + option = { #I wonder what the books say about this. name = tgp_china_yearly.0010.c diff --git a/events/dlc/tgp/tgp_silk_road_events.txt b/events/dlc/tgp/tgp_silk_road_events.txt index dc49e40a9..a76808c7a 100644 --- a/events/dlc/tgp/tgp_silk_road_events.txt +++ b/events/dlc/tgp/tgp_silk_road_events.txt @@ -1,4 +1,4 @@ -namespace = tgp_silk_road_events +namespace = tgp_silk_road_events # visit_silk_road_market_decision @@ -287,3 +287,14 @@ namespace = tgp_silk_road_events # } # } #} + +# CK3 1.21: non-historical Silk Road market reward. +tgp_silk_road_events.0011 = { + hidden = yes + type = character_event + + immediate = { + add_short_term_gold = major_gold_value + remove_decision_cooldown = visit_silk_road_market_decision + } +} diff --git a/events/factions/faction_demands.txt b/events/factions/faction_demands.txt index d3baca31f..708d47c73 100644 --- a/events/factions/faction_demands.txt +++ b/events/factions/faction_demands.txt @@ -1,4 +1,4 @@ -namespace = faction_demand +namespace = faction_demand ################################################## # GENERAL SCRIPTED TRIGGERS & EFFECTS @@ -107,7 +107,7 @@ scripted_effect faction_demand_independence_rejected_effect = { scope:faction = { every_faction_member = { save_scope_as = char_temp - add_clan_unity_interaction_effect = { + add_house_unity_interaction_effect = { CHARACTER = scope:char_temp TARGET = root VALUE = medium_unity_loss @@ -3143,7 +3143,7 @@ faction_demand.0227 = { title_tier = county limit = { is_landless_type_title = no - county_control < 75 + county_control < county_control_baseline } add = 10 } diff --git a/events/game_rule_events.txt b/events/game_rule_events.txt index fb475b64b..a26c58bef 100644 --- a/events/game_rule_events.txt +++ b/events/game_rule_events.txt @@ -108,18 +108,22 @@ game_rule.1001 = { #by Mathilda Bjarnehed trigger = { is_from_ruler_designer = no # Do not modify the family of someone from the ruler designer #Is in need of family - NOT = { + NOR = { exists = player_heir - } - #Allowed to get family - NOT = { # Otherwise historical characters sometimes generate inappropriate children + #Allowed to get family, otherwise historical characters sometimes generate inappropriate children any_child = { always = yes } + has_trait = celibate + has_trait_with_flag = can_not_marry + AND = { + government_has_flag = government_is_republic + NOT = { + has_dlc_feature = silk_and_silver + } + } } is_eunuch_trigger = no - NOT = { has_trait = celibate } - NOT = { has_trait_with_flag = can_not_marry } age >= 17 #Because you need ~1 year of pregnancy is_playable_character = yes primary_title = { @@ -127,7 +131,6 @@ game_rule.1001 = { #by Mathilda Bjarnehed is_holy_order = no } NOR = { - government_has_flag = government_is_republic government_has_flag = government_is_theocracy has_character_flag = do_not_generate_starting_family government_has_flag = government_is_herder @@ -7240,9 +7243,9 @@ game_rule.1142 = { limit = { can_set_relation_rival_trigger = { CHARACTER = scope:elect } } - set_relation_rival = { - target = scope:elect - reason = rival_usurper + set_relation_rival_effect = { + TARGET = scope:elect + REASON = rival_usurper } } reverse_add_opinion = { diff --git a/events/global_religion_events.txt b/events/global_religion_events.txt index 1c243df2b..69e486826 100644 --- a/events/global_religion_events.txt +++ b/events/global_religion_events.txt @@ -296,7 +296,7 @@ # } #} -# Events for expelled faith development to relocate +# Events for expelled faith prosperity to relocate global_religion.1000 = { type = character_event title = global_religion.1000.t @@ -366,13 +366,13 @@ global_religion.1000 = { } } save_scope_value_as = { - name = initial_available_development - value = scope:target_rite.var:converted_development + name = initial_available_prosperity + value = scope:target_rite.var:converted_prosperity } # Defaulted so the loops below still evaluate when no starting County is found. save_scope_value_as = { - name = remaining_converted_development - value = 0 + name = remaining_converted_prosperity + value = scope:initial_available_prosperity } # Save same-rite Counties if that's what we're looking for, they can be all over the place @@ -387,21 +387,21 @@ global_religion.1000 = { save_scope_as = initial_county_target add_to_list = counties_to_move_in_to set_variable = { - name = county_development_to_get + name = county_prosperity_to_get value = { - value = development_level + value = prosperity_level divide = 10 floor = yes add = 1 - max = scope:initial_available_development + max = scope:initial_available_prosperity min = 1 } } save_scope_value_as = { - name = remaining_converted_development + name = remaining_converted_prosperity value = { value = scope:initial_available_development - subtract = var:county_development_to_get + subtract = var:county_prosperity_to_get } } } @@ -417,7 +417,7 @@ global_religion.1000 = { } } limit = { - scope:remaining_converted_development > 0 + scope:remaining_converted_prosperity > 0 } random_sub_realm_county = { limit = { @@ -428,21 +428,21 @@ global_religion.1000 = { } add_to_list = counties_to_move_in_to set_variable = { - name = county_development_to_get + name = county_prosperity_to_get value = { - value = development_level + value = prosperity_level divide = 10 floor = yes add = 1 - max = scope:remaining_converted_development + max = scope:remaining_converted_prosperity min = 1 } } save_scope_value_as = { - name = remaining_converted_development + name = remaining_converted_prosperity value = { value = scope:remaining_converted_development - subtract = var:county_development_to_get + subtract = var:county_prosperity_to_get } } } @@ -459,21 +459,21 @@ global_religion.1000 = { save_scope_as = initial_county_target add_to_list = counties_to_move_in_to set_variable = { - name = county_development_to_get + name = county_prosperity_to_get value = { - value = development_level + value = prosperity_level divide = 10 floor = yes add = 1 - max = scope:initial_available_development + max = scope:initial_available_prosperity min = 1 } } save_scope_value_as = { - name = remaining_converted_development + name = remaining_converted_prosperity value = { value = scope:initial_available_development - subtract = var:county_development_to_get + subtract = var:county_prosperity_to_get } } } @@ -489,7 +489,7 @@ global_religion.1000 = { } } limit = { - scope:remaining_converted_development > 0 + scope:remaining_converted_prosperity > 0 } random_sub_realm_county = { limit = { @@ -500,21 +500,21 @@ global_religion.1000 = { } add_to_list = counties_to_move_in_to set_variable = { - name = county_development_to_get + name = county_prosperity_to_get value = { - value = development_level + value = prosperity_level divide = 10 floor = yes add = 1 - max = scope:remaining_converted_development + max = scope:remaining_converted_prosperity min = 1 } } save_scope_value_as = { - name = remaining_converted_development + name = remaining_converted_prosperity value = { value = scope:remaining_converted_development - subtract = var:county_development_to_get + subtract = var:county_prosperity_to_get } } } @@ -562,28 +562,28 @@ global_religion.1000 = { save_scope_as = initial_county_target add_to_list = counties_to_move_in_to set_variable = { - name = county_development_to_get + name = county_prosperity_to_get value = { - value = development_level + value = prosperity_level divide = 10 floor = yes add = 1 - max = scope:initial_available_development + max = scope:initial_available_prosperity min = 1 } } save_scope_value_as = { - name = remaining_converted_development + name = remaining_converted_prosperity value = { value = scope:initial_available_development - subtract = var:county_development_to_get + subtract = var:county_prosperity_to_get } } } while = { count = root.primary_title.tier limit = { - scope:remaining_converted_development > 0 + scope:remaining_converted_prosperity > 0 } random_sub_realm_county = { limit = { @@ -640,21 +640,21 @@ global_religion.1000 = { } add_to_list = counties_to_move_in_to set_variable = { - name = county_development_to_get + name = county_prosperity_to_get value = { - value = development_level + value = prosperity_level divide = 10 floor = yes add = 1 - max = scope:remaining_converted_development + max = scope:remaining_converted_prosperity min = 1 } } save_scope_value_as = { - name = remaining_converted_development + name = remaining_converted_prosperity value = { value = scope:remaining_converted_development - subtract = var:county_development_to_get + subtract = var:county_prosperity_to_get } } } @@ -690,7 +690,7 @@ global_religion.1000 = { add = { every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get } } multiply = 1000 @@ -727,8 +727,8 @@ global_religion.1000 = { OR = { NOT = { has_variable = associated_county } AND = { - has_variable = converted_development - var:converted_development <= 0 + has_variable = converted_prosperity + var:converted_prosperity <= 0 } } } @@ -742,8 +742,8 @@ global_religion.1000 = { OR = { NOT = { has_variable = associated_culture } AND = { - has_variable = converted_development - var:converted_development <= 0 + has_variable = converted_prosperity + var:converted_prosperity <= 0 } } } @@ -754,15 +754,15 @@ global_religion.1000 = { } if = { limit = { - NOT = { has_variable = converted_development } + NOT = { has_variable = converted_prosperity } } set_variable = { - name = converted_development + name = converted_prosperity value = { every_in_list = { list = counties_to_move_in_to add = { - add = var:county_development_to_get + add = var:county_prosperity_to_get divide = 2 min = 1 } @@ -772,12 +772,12 @@ global_religion.1000 = { } else = { change_variable = { - name = converted_development + name = converted_prosperity add = { every_in_list = { list = counties_to_move_in_to add = { - add = var:county_development_to_get + add = var:county_prosperity_to_get divide = 2 min = 1 } @@ -797,12 +797,12 @@ global_religion.1000 = { set_county_faith = scope:target_rite.faith set_county_rite = scope:target_rite } - change_development_level = { + change_prosperity_level = { value = { every_in_list = { list = counties_to_move_in_to add = { - add = var:county_development_to_get + add = var:county_prosperity_to_get divide = 2 min = 1 } @@ -814,7 +814,7 @@ global_religion.1000 = { every_in_list = { list = counties_to_move_in_to add = { - add = var:county_development_to_get + add = var:county_prosperity_to_get divide = 2 min = 1 } @@ -832,8 +832,8 @@ global_religion.1000 = { change_cultural_acceptance = { target = scope:target_rite_associated_culture value = { - value = scope:initial_available_development - subtract = scope:remaining_converted_development + value = scope:initial_available_prosperity + subtract = scope:remaining_converted_prosperity } desc = cultural_acceptance_gain_event } @@ -842,11 +842,11 @@ global_religion.1000 = { scope:target_rite = { change_variable = { - name = converted_development + name = converted_prosperity subtract = { every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get divide = 3 min = 1 } @@ -889,8 +889,10 @@ global_religion.1000 = { add_gold = { value = { - value = scope:initial_available_development + value = scope:initial_available_prosperity multiply = 15 + min = minor_gold_value + max = medium_gold_value } } @@ -902,9 +904,12 @@ global_religion.1000 = { change_cultural_acceptance = { target = scope:target_rite_associated_culture value = { - value = scope:initial_available_development - subtract = scope:remaining_converted_development - multiply = -0.5 + value = scope:initial_available_prosperity + subtract = scope:remaining_converted_prosperity + multiply = 0.3 + add = 3 + ceiling = yes + multiply = -1 } desc = cultural_acceptance_gain_event } @@ -913,7 +918,7 @@ global_religion.1000 = { scope:target_rite = { change_variable = { - name = converted_development + name = converted_prosperity subtract = 1 } } @@ -957,7 +962,7 @@ global_religion.1000 = { set_character_rite_with_conversion = scope:target_rite if = { limit = { - scope:target_rite = { has_doctrine = doctrine_monotheist } + scope:target_rite = { rite_has_doctrine = doctrine_monotheist } } custom_description_no_bullet = { text = mandala_monotheist_warning_tt } } @@ -994,7 +999,7 @@ global_religion.1000 = { value = 0 every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get } multiply = 250 } @@ -1018,11 +1023,11 @@ global_religion.1000 = { else = { every_in_list = { list = counties_to_move_in_to - change_development_level = var:county_development_to_get + change_prosperity_level = var:county_prosperity_to_get set_county_faith = scope:target_rite.faith set_county_rite = scope:target_rite change_county_control = { - value = var:county_development_to_get + value = var:county_prosperity_to_get multiply = -5 } } @@ -1036,8 +1041,8 @@ global_religion.1000 = { change_cultural_acceptance = { target = scope:target_rite_associated_culture value = { - value = scope:initial_available_development - subtract = scope:remaining_converted_development + value = scope:initial_available_prosperity + subtract = scope:remaining_converted_prosperity } desc = cultural_acceptance_gain_event } @@ -1046,11 +1051,11 @@ global_religion.1000 = { scope:target_rite = { change_variable = { - name = converted_development + name = converted_prosperity subtract = { every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get } } } @@ -1170,7 +1175,7 @@ global_religion.1000 = { value = 0 every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get } multiply = 250 } @@ -1179,9 +1184,9 @@ global_religion.1000 = { else = { every_in_list = { list = counties_to_move_in_to - change_development_level = var:county_development_to_get + change_prosperity_level = var:county_prosperity_to_get change_county_control = { - value = var:county_development_to_get + value = var:county_prosperity_to_get multiply = -5 } } @@ -1197,7 +1202,7 @@ global_religion.1000 = { value = 0 every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get } multiply = 250 } @@ -1221,12 +1226,12 @@ global_religion.1000 = { else = { every_in_list = { list = counties_to_move_in_to - change_development_level = { - value = var:county_development_to_get + change_prosperity_level = { + value = var:county_prosperity_to_get if = { limit = { culture = { - has_cultural_parameter = development_gain_from_religious_exiles_is_doubled + has_cultural_parameter = prosperity_gain_from_religious_exiles_is_doubled } } multiply = 2 @@ -1235,7 +1240,7 @@ global_religion.1000 = { set_county_faith = scope:target_rite.faith set_county_rite = scope:target_rite change_county_control = { - value = var:county_development_to_get + value = var:county_prosperity_to_get multiply = -5 } } @@ -1250,8 +1255,8 @@ global_religion.1000 = { change_cultural_acceptance = { target = scope:target_rite_associated_culture value = { - value = scope:initial_available_development - subtract = scope:remaining_converted_development + value = scope:initial_available_prosperity + subtract = scope:remaining_converted_prosperity } desc = cultural_acceptance_gain_event } @@ -1260,11 +1265,11 @@ global_religion.1000 = { scope:target_rite = { change_variable = { - name = converted_development + name = converted_prosperity subtract = { every_in_list = { list = counties_to_move_in_to - add = var:county_development_to_get + add = var:county_prosperity_to_get } } } @@ -1402,30 +1407,26 @@ global_religion.1000 = { name = global_religion.1000.b if = { limit = { - exists = scope:from_decision + NOT = { exists = scope:from_decision } } - } - else = { if = { limit = { faith != scope:target_rite.faith } - add_piety = { - value = { - value = scope:initial_available_development - subtract = scope:remaining_converted_development - multiply = 100 - divide = 2 - } - } + add_piety = minor_piety_gain } else = { - add_prestige = { - value = { - value = scope:initial_available_development - subtract = scope:remaining_converted_development - multiply = 100 - divide = 2 + add_prestige = minor_prestige_gain + } + } + + scope:target_rite = { + change_variable = { + name = converted_prosperity + subtract = { + every_in_list = { + list = counties_to_move_in_to + add = var:county_prosperity_to_get } } } @@ -1443,7 +1444,7 @@ global_religion.1000 = { after = { every_in_list = { list = counties_to_move_in_to - remove_variable = county_development_to_get + remove_variable = county_prosperity_to_get } scope:local_character = { silent_disappearance_ai_effect = yes diff --git a/events/historical_character_events.txt b/events/historical_character_events.txt index 8b78e5065..a9babe807 100644 --- a/events/historical_character_events.txt +++ b/events/historical_character_events.txt @@ -281,7 +281,7 @@ historical_char_creation_events.1 = { add_internal_flag = dangerous trigger = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes } flavor = danger_dynasty_abandon_tt if = { @@ -359,7 +359,7 @@ historical_char_creation_events.1 = { if = { limit = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes exists = scope:explorer } scope:historical_character = { @@ -371,7 +371,7 @@ historical_char_creation_events.1 = { } else_if = { limit = { - has_ep3_dlc_trigger = yes + has_playable_adventurer_dlc_trigger = yes is_ai = yes } random = { diff --git a/events/lifestyles/scholarship_lifestyle/learning_medicine_events.txt b/events/lifestyles/scholarship_lifestyle/learning_medicine_events.txt index 0c06527bb..695b384e5 100644 --- a/events/lifestyles/scholarship_lifestyle/learning_medicine_events.txt +++ b/events/lifestyles/scholarship_lifestyle/learning_medicine_events.txt @@ -1037,7 +1037,6 @@ learning_medicine.2021 = { #by Mathilda Bjarnehed EMPLOYER = root PHYSICIAN = scope:physician } - custom_tooltip = health.3001.a.tt custom_tooltip = court_physician_aptitude_tooltip trigger_event = { id = learning_medicine.2022 @@ -1067,7 +1066,6 @@ learning_medicine.2021 = { #by Mathilda Bjarnehed EMPLOYER = root PHYSICIAN = scope:physician } - custom_tooltip = health.3001.a.tt custom_tooltip = court_physician_aptitude_tooltip ai_chance = { base = 25 @@ -2533,7 +2531,7 @@ learning_medicine.2040 = { #by Mathilda Bjarnehed title = learning_medicine.2030.d.modifier add_character_modifier = { modifier = wide_vocabulary_modifier - years = 15 + years = 10 } } } @@ -4181,7 +4179,7 @@ learning_medicine_special.2100 = { option = { #Eat the hallucinogenic fish. name = learning_medicine_special.2100.a random_list = { - 40 = { #You seem some radical angels and such. + 40 = { #You see some radical angels and such. desc = learning_medicine_special.2100.a.tt_success send_interface_toast = { title = learning_medicine_special.2100.a.tt_success @@ -4284,10 +4282,10 @@ learning_medicine_special.2100 = { title = learning_medicine_special.2100.b.tt_success left_icon = scope:fish_alchemist if = { - limit = { number_of_lifestyle_traits = 0 } + limit = { NOT = { has_trait = lifestyle_herbalist } } add_trait = lifestyle_herbalist } - add_learning_skill = 5 + add_learning_skill = 2 if = { limit = { NOT = { diff --git a/events/lifestyles/scholarship_lifestyle/learning_theology_events.txt b/events/lifestyles/scholarship_lifestyle/learning_theology_events.txt index ce8d55eae..20360e2bd 100644 --- a/events/lifestyles/scholarship_lifestyle/learning_theology_events.txt +++ b/events/lifestyles/scholarship_lifestyle/learning_theology_events.txt @@ -52,10 +52,9 @@ learning_theology.1301 = { animation = beg } + cooldown = { years = 5 } + trigger = { - NOT = { - has_character_flag = had_event_learning_theology_1301 - } exists = cp:councillor_court_chaplain can_add_hook = { type = favor_hook @@ -69,10 +68,6 @@ learning_theology.1301 = { } immediate = { - add_character_flag = { - flag = had_event_learning_theology_1301 - years = 5 - } cp:councillor_court_chaplain = { save_scope_as = bishop } @@ -95,7 +90,6 @@ learning_theology.1301 = { name = learning_theology.1301.b remove_short_term_gold = medium_gold_value add_learning_lifestyle_xp = minor_lifestyle_xp - add_learning_skill = 1 scope:bishop = { add_opinion = { target = root @@ -1972,7 +1966,6 @@ learning_theology.3044 = { option = { # This is what I have been looking for name = learning_theology.3044.a - add_learning_skill = 1 add_learning_lifestyle_perk_points = 1 ai_chance = { base = 80 @@ -3901,9 +3894,9 @@ learning_theology_special.1102 = { } name = learning_theology_special.1102.b - set_relation_rival = { - target = scope:scholar - reason = rival_academic_dispute + set_relation_rival_effect = { + TARGET = scope:scholar + REASON = rival_academic_dispute } scope:scholar = { select_and_move_to_pool_effect = yes } diff --git a/events/religion_events/false_conversion_events.txt b/events/religion_events/false_conversion_events.txt index 2bf74dac1..b12eb8449 100644 --- a/events/religion_events/false_conversion_events.txt +++ b/events/religion_events/false_conversion_events.txt @@ -1213,6 +1213,79 @@ false_conversion.2000 = { save_scope_as = vulnerable_relation } } + # The trigger checks sources that get_characters_of_interest_effect can miss + if = { + limit = { NOT = { exists = scope:vulnerable_relation } } + every_close_or_extended_family_member = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_powerful_vassal = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_consort = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_concubine = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_normal_councillor = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_ally = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_knight = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + betrothed ?= { + if = { + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + } + if = { + limit = { + exists = liege + is_powerful_vassal = yes + liege = { false_conversion_2000_is_vulnerable_trigger = yes } + } + liege = { add_to_list = vulnerable_relations_fallback } + } + every_relation = { + type = lover + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_relation = { + type = ward + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + every_relation = { + type = friend + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + if = { + limit = { age >= 12 } + every_relation = { + type = guardian + limit = { false_conversion_2000_is_vulnerable_trigger = yes } + add_to_list = vulnerable_relations_fallback + } + } + random_in_list = { + list = vulnerable_relations_fallback + save_scope_as = vulnerable_relation + } + } # Also for the effect scope:vulnerable_relation = { save_scope_as = target } # Determine which weakness we will capitalize on diff --git a/events/religion_events/great_holy_war_events.txt b/events/religion_events/great_holy_war_events.txt index b22dc509a..3afbea071 100644 --- a/events/religion_events/great_holy_war_events.txt +++ b/events/religion_events/great_holy_war_events.txt @@ -262,6 +262,7 @@ great_holy_war.0001 = { faith = scope:the_faith highest_held_title_tier >= tier_county this != scope:ghw_sponsor + NOT = { government_has_flag = government_is_merchant } } trigger_event = great_holy_war.0003 #Send event immediately for player, then delay it for all the AIs. } @@ -732,6 +733,7 @@ great_holy_war.0003 = { has_character_flag = ghw_unpledging_cooldown #Safety event. #Do not pledge against your own liege: any_liege_or_above = { this = scope:the_faith.great_holy_war.ghw_target_character } + government_has_flag = government_is_merchant } OR = { #Either be independent, or all lieges above you MUST be of the same Faith declaring the war to avoid messy situations of vassals and lieges fighting against each other. top_liege = this @@ -918,6 +920,22 @@ great_holy_war.0005 = { prestige = no gold = no } + #Guelphs & Ghibellines + every_pledged_attacker = { + limit = { + has_title = title:e_hre + faith = { + religious_head_title ?= title:k_papal_state + exists = religious_head + } + } + gg_reconciliation_catalyst_effect = { + ACTOR = this + RECIPIENT = faith.religious_head + CATALYST = catalyst_gg_emperor_took_the_cross + ONCE_A_YEAR = no + } + } } } @@ -2821,6 +2839,7 @@ great_holy_war.0023 = { ghw_pope_annoyed_at_lack_of_participation_trigger = yes ghw_pope_annoyed_at_lack_of_participation_tier_trigger = yes is_landless_adventurer = no + NOT = { government_has_flag = government_is_merchant } } immediate = { @@ -3502,7 +3521,10 @@ great_holy_war.0030 = { has_trait_with_flag = debilitating_illness AND = { is_ruler = yes - NOT = { government_has_flag = government_is_landless_adventurer } + NOR = { + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_merchant + } } any_heir_title = { } #Shouldn't be heir to anything } @@ -3912,6 +3934,7 @@ great_holy_war.0071 = { is_ai = no is_at_war = no faith = scope:attacker.faith + NOT = { government_has_flag = government_is_merchant } NOR = { this = scope:attacker scope:attacker.faith.great_holy_war = { has_pledged_attacker = root } @@ -3929,6 +3952,7 @@ great_holy_war.0071 = { is_ai = no is_at_war = no faith = scope:defender.faith + NOT = { government_has_flag = government_is_merchant } NOR = { this = scope:defender scope:attacker.faith.great_holy_war = { has_pledged_defender = root } @@ -4307,7 +4331,7 @@ great_holy_war.0060 = { } } } - scope:army = { + scope:army ?= { exists = army_commander location = { save_temporary_scope_as = current_location } army_commander = { diff --git a/events/scheme_events/court_scheme/court_scheme_ongoing_events.txt b/events/scheme_events/court_scheme/court_scheme_ongoing_events.txt index e44530627..9b1b670f3 100644 --- a/events/scheme_events/court_scheme/court_scheme_ongoing_events.txt +++ b/events/scheme_events/court_scheme/court_scheme_ongoing_events.txt @@ -3421,6 +3421,11 @@ scripted_effect court_ongoing_1110_remove_competitor_effect = { scripted_effect court_ongoing_1110_duel_success_effect = { court_ongoing_1110_remove_competitor_effect = yes add_prestige = medium_prestige_gain + progress_towards_rival_effect = { + REASON = rival_duel_vengeance + CHARACTER = scope:competitor + OPINION = -10 + } } scripted_effect court_ongoing_1110_duel_failure_effect = { @@ -3635,6 +3640,7 @@ court_ongoing.1110 = { multiply = 20 } } + min = 10 show_as_tooltip = { court_ongoing_1110_duel_success_effect = yes } save_scope_value_as = { name = competitor_outcome @@ -3654,6 +3660,7 @@ court_ongoing.1110 = { multiply = 20 } } + min = 10 show_as_tooltip = { court_ongoing_1110_duel_failure_effect = yes } save_scope_value_as = { name = competitor_outcome @@ -3678,8 +3685,7 @@ court_ongoing.1110 = { } } - - #Poision + #Poison option = { name = court_ongoing.1110.b @@ -3770,6 +3776,7 @@ court_ongoing.1110 = { multiply = 20 } } + min = 10 send_interface_toast = { title = court_ongoing.1110.c.success left_icon = scope:competitor @@ -3778,7 +3785,6 @@ court_ongoing.1110 = { } } 10 = { #Failure - min = 5 desc = court_ongoing.1110.c.failure modifier = { scope:competitor.ai_honor > 0 @@ -3796,6 +3802,7 @@ court_ongoing.1110 = { multiply = 5 } } + min = 10 send_interface_toast = { title = court_ongoing.1110.c.failure left_icon = scope:competitor @@ -4055,22 +4062,35 @@ court_ongoing.1112 = { #by Mathilda Bjarnehed theme = romance_scheme left_portrait = { character = root - animation = schadenfreude + animation = marshal + camera = camera_event_very_left_further_back } right_portrait = { character = scope:competitor - animation = pain + animation = sword_yield_start + camera = camera_event_center_pointing_forward_fov35 } - lower_right_portrait = scope:target + lower_center_portrait = scope:target + override_background = { reference = courtyard } trigger = { exists = scope:scheme } + immediate = { + add_character_flag = wear_armor + scope:competitor = { add_character_flag = wear_armor } + } + option = { name = court_ongoing.1112.a court_ongoing_1110_duel_success_effect = yes } + + after = { + remove_character_flag = wear_armor + scope:competitor = { remove_character_flag = wear_armor } + } } #Duel failure for owner @@ -4112,11 +4132,10 @@ court_ongoing.1113 = { #by Mathilda Bjarnehed NOT = { has_relation_rival = scope:competitor } } name = court_ongoing.1113.b - set_relation_rival = { - target = scope:competitor - reason = rival_duel_vengeance + set_relation_rival_effect = { + TARGET = scope:competitor + REASON = rival_duel_vengeance } - ai_chance = { base = 50 ai_value_modifier = { @@ -4195,14 +4214,11 @@ court_ongoing.1115 = { #by Mathilda Bjarnehed trigger = { NOT = { has_relation_rival = scope:competitor } } - name = court_ongoing.1113.b - - set_relation_rival = { - target = scope:competitor - reason = rival_poison_vengeance + name = court_ongoing.1113.b + set_relation_rival_effect = { + TARGET = scope:competitor + REASON = rival_poison_vengeance } - - ai_chance = { base = 50 ai_value_modifier = { diff --git a/events/scheme_events/governor_contract_events.txt b/events/scheme_events/governor_contract_events.txt index 79248aa37..0e539fa1d 100644 --- a/events/scheme_events/governor_contract_events.txt +++ b/events/scheme_events/governor_contract_events.txt @@ -2663,7 +2663,7 @@ governor_contract_event.2041 = { desc = governor_contract_event.2041.d.success modifier = { scope:ongoing_destination.county = { - development_level >= medium_development_level + prosperity_level >= medium_prosperity_level } add = 10 } @@ -2686,7 +2686,7 @@ governor_contract_event.2041 = { desc = governor_contract_event.2041.d.fail modifier = { scope:ongoing_destination.county = { - development_level <= bad_development_level + prosperity_level <= bad_prosperity_level } add = 10 } diff --git a/events/scheme_events/mandala_schemes/disbelieve_mandala_scheme_events.txt b/events/scheme_events/mandala_schemes/disbelieve_mandala_scheme_events.txt index 8fd114bb2..83695b354 100644 --- a/events/scheme_events/mandala_schemes/disbelieve_mandala_scheme_events.txt +++ b/events/scheme_events/mandala_schemes/disbelieve_mandala_scheme_events.txt @@ -286,8 +286,8 @@ disbelieve_mandala_ongoing.0010 = { factor = 2 OR = { has_trait = deceitful - scope:agent.diplomacy >= high_skill_rating - scope:agent.intrigue >= high_skill_rating + scope:spymaster.diplomacy >= high_skill_rating + scope:spymaster.intrigue >= high_skill_rating } } modifier = { diff --git a/events/single_combat_events.txt b/events/single_combat_events.txt index 8d1a14fd1..7a42dfe70 100644 --- a/events/single_combat_events.txt +++ b/events/single_combat_events.txt @@ -262,6 +262,7 @@ scripted_effect select_special_tier_move_effect = { NOR = { has_trait = peasant_leader government_has_flag = government_is_republic + government_has_flag = government_is_merchant } } } @@ -272,6 +273,7 @@ scripted_effect select_special_tier_move_effect = { NOR = { has_trait = peasant_leader government_has_flag = government_is_republic + government_has_flag = government_is_merchant } } } @@ -2420,10 +2422,7 @@ scripted_effect finalise_combat_results_effect = { #Beating your rival means additional glory gain if = { limit = { - OR = { - has_relation_rival = scope:sc_loser - has_relation_nemesis = scope:sc_loser - } + has_relation_rival = scope:sc_loser } accolade = { add_glory = minor_glory_gain } } @@ -8159,7 +8158,7 @@ single_combat.0021 = { calculate_injury_risks_effect = yes if = { limit = { - NOT = { exists = scope:sc_finished } + NOT = { scope:sc_finished ?= yes } scope:sc_defender.var:current_round > 1 } # Check scope:sc_attacker to see if they can injure themselves due to having more risk than success. @@ -8215,7 +8214,7 @@ single_combat.0021 = { } # If we now have a victor, work out the cleanup. if = { - limit = { exists = scope:sc_finished } + limit = { scope:sc_finished ?= yes } finalise_combat_results_effect = yes } # If we don't, and this round is at or over the round_cap_limit, enter into sudden death. diff --git a/events/test_events/debug.txt b/events/test_events/debug.txt index 3d786a7c6..5187e9342 100644 --- a/events/test_events/debug.txt +++ b/events/test_events/debug.txt @@ -178,9 +178,7 @@ debug.0002 = { } } -## globally upgrade some holdings for marketing videos and screenshots - -debug.0008 = { +debug.0008 = { # globally upgrade some holdings for marketing videos and screenshots type = character_event hidden = yes theme = default @@ -188,112 +186,106 @@ debug.0008 = { immediate = { every_duchy = { - if = { - limit = { is_titular = no } - title_capital_county = { - every_county_province = { - if = { - limit = { - is_county_capital = yes - NOT = { has_building = curtain_walls_02 } - } - add_building = curtain_walls_02 + limit = { is_titular = no } + title_capital_county = { + every_county_province = { + if = { + limit = { + is_county_capital = yes + can_start_building_construction_for_owner = pb_walls_01 } - if = { - limit = { - has_holding_type = castle_holding - NOT = { has_building = castle_02 } - } - add_building = castle_02 + start_building_construction_for_holder = pb_walls_01 + } + if = { + limit = { + has_holding_type = castle_holding + NOT = { has_building_or_higher = castle_02 } } - else_if = { - limit = { - has_holding_type = church_holding - NOT = { has_building = temple_02 } - } - add_building = temple_03 + holding_district = { add_building = castle_02 } + } + else_if = { + limit = { + has_holding_type = church_holding + NOT = { has_building_or_higher = temple_02 } } - else_if = { - limit = { - has_holding_type = city_holding - NOT = { has_building = city_02 } - } - add_building = city_03 + holding_district = { add_building = temple_02 } + } + else_if = { + limit = { + has_holding_type = city_holding + NOT = { has_building_or_higher = city_02 } } + holding_district = { add_building = city_02 } } } } } every_kingdom = { - if = { - limit = { is_titular = no } - title_capital_county = { - every_county_province = { - if = { - limit = { - is_county_capital = yes - NOT = { has_building = curtain_walls_03 } - } - add_building = curtain_walls_03 + limit = { is_titular = no } + title_capital_county = { + every_county_province = { + if = { + limit = { + is_county_capital = yes + can_start_building_construction_for_owner = pb_walls_01 } - if = { - limit = { - has_holding_type = castle_holding - NOT = { has_building = castle_03 } - } - add_building = castle_03 + start_building_construction_for_holder = pb_walls_01 + } + if = { + limit = { + has_holding_type = castle_holding + NOT = { has_building_or_higher = castle_03 } } - else_if = { - limit = { - has_holding_type = church_holding - NOT = { has_building = temple_03 } - } - add_building = temple_03 + holding_district = { add_building = castle_03 } + } + else_if = { + limit = { + has_holding_type = church_holding + NOT = { has_building_or_higher = temple_03 } } - else_if = { - limit = { - has_holding_type = city_holding - NOT = { has_building = city_03 } - } - add_building = city_03 + holding_district = { add_building = temple_03 } + } + else_if = { + limit = { + has_holding_type = city_holding + NOT = { has_building_or_higher = city_03 } } + holding_district = { add_building = city_03 } } } } } every_empire = { - if = { - limit = { is_titular = no } - title_capital_county = { - every_county_province = { - if = { - limit = { - is_county_capital = yes - NOT = { has_building = curtain_walls_08 } - } - add_building = curtain_walls_08 + limit = { is_titular = no } + title_capital_county = { + every_county_province = { + if = { + limit = { + is_county_capital = yes + can_start_building_construction_for_owner = pb_walls_01 } - if = { - limit = { - has_holding_type = castle_holding - NOT = { has_building = castle_04 } - } - add_building = castle_04 + start_building_construction_for_holder = pb_walls_01 + } + if = { + limit = { + has_holding_type = castle_holding + NOT = { has_building_or_higher = castle_04 } } - else_if = { - limit = { - has_holding_type = church_holding - NOT = { has_building = temple_04 } - } - add_building = temple_04 + holding_district = { add_building = castle_04 } + } + else_if = { + limit = { + has_holding_type = church_holding + NOT = { has_building_or_higher = temple_04 } } - else_if = { - limit = { - has_holding_type = city_holding - NOT = { has_building = city_04 } - } - add_building = city_04 + holding_district = { add_building = temple_04 } + } + else_if = { + limit = { + has_holding_type = city_holding + NOT = { has_building_or_higher = city_04 } } + holding_district = { add_building = city_04 } } } } @@ -2011,9 +2003,9 @@ debug.350 = { } scope:actor = { - set_relation_rival = { - target = scope:recipient - reason = rival_debug + set_relation_rival_effect = { + TARGET = scope:recipient + REASON = rival_debug } } } @@ -2052,9 +2044,9 @@ debug.350 = { } scope:actor = { - set_relation_nemesis = { - target = scope:recipient - reason = nemesis_debug + set_relation_nemesis_effect = { + TARGET = scope:recipient + REASON = nemesis_debug } } } diff --git a/events/title_events.txt b/events/title_events.txt index 5eaaf1b7e..55e9f47dc 100644 --- a/events/title_events.txt +++ b/events/title_events.txt @@ -106,80 +106,6 @@ title_event.9900 = { root = { remove_variable = ascended_throne_extra } } } - #Clean up LAAMPS who get the wrong governments in claimant wars - if = { - limit = { - OR = { - AND = { - has_variable = city_construction_is_temple_citadel - any_in_list = { - variable = new_titles - this = root.var:city_construction_is_temple_citadel - } - } - AND = { - has_variable = city_construction_is_castle - any_in_list = { - variable = new_titles - this = root.var:city_construction_is_castle - } - } - } - } - #Can the LAAMP become Mandala? - if = { - limit = { has_variable = city_construction_is_temple_citadel } - if = { - limit = { - #... we're lenient - faith = { has_doctrine = doctrine_polytheist } - } - #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 - } - } - } - else = { - house ?= { - set_house_aspiration = { type = no_aspect } - } - } - } - #Otherwise go feudals - else = { - assign_feudal_governments_effect = yes - } - } - #Otherwise we have city_construction_is_castle - else = { - #... Feudals shouldn't have temple capitals - if = { - limit = { - has_variable = holding_barony - capital_barony = { this != root.var:holding_barony } - capital_province = { has_holding_type = church_holding } - } - capital_province = { set_holding_type = castle_holding } - } - #Otherwise go feudals - else = { - assign_feudal_governments_effect = yes - } - } - remove_variable = city_construction_is_temple_citadel - remove_variable = city_construction_is_castle - remove_variable = holding_barony - } clear_variable_list = new_titles remove_variable = title_count } @@ -266,12 +192,7 @@ title_event.9911 = { trigger = { government_has_flag = government_is_landless_adventurer - NOR = { - is_commanding_army = yes - exists = involved_activity - is_travelling = yes - is_imprisoned = yes - } + should_in_default_location_trigger = yes } immediate = { set_location_to_default = yes } diff --git a/events/travel_events/gdp_travel_events.txt b/events/travel_events/gdp_travel_events.txt new file mode 100644 index 000000000..5a7fce8cc --- /dev/null +++ b/events/travel_events/gdp_travel_events.txt @@ -0,0 +1,2128 @@ +namespace = gdp_travel_events + +#Event adding relevant characters to your travel entourage +gdp_travel_events.0001 = { + hidden = yes + trigger = { + government_has_flag = government_is_merchant + } + immediate = { + every_courtier = { + limit = { + is_adult = yes + is_available_ai = yes + NOT = { has_court_position = partner_court_position } + save_temporary_scope_as = gdp_entourage_candidate + NOT = { + root = { + any_scheme = { + scheme_is_character_agent = scope:gdp_entourage_candidate + } + } + } + } + add_to_list = gdp_entourage_members + } + + every_child = { + limit = { + is_available_ai_child = yes + is_courtier_of = root + } + add_to_list = gdp_entourage_members + } + + ordered_in_list = { + list = gdp_entourage_members + order_by = { + value = 0 + if = { + limit = { + OR = { + has_court_position = fixer_court_position + has_court_position = translator_court_position + has_court_position = market_agent_court_position + has_court_position = bailiff_court_position + } + } + add = 200 + } + if = { + limit = { has_trait = merchant_associate } + add = 100 + } + if = { + limit = { + OR = { + is_spouse_of = root + is_close_family_of = root + } + } + add = 50 + } + } + max = 10 + check_range_bounds = no + root.current_travel_plan ?= { add_companion = prev } + } + } +} + +#Desert Oasis Dilema, Travel Danger +gdp_travel_events.1000 = { + type = character_event + title = gdp_travel_events.1000.t + desc = gdp_travel_events.1000.desc + theme = travel_danger + + widget = { gui = event_window_widget_vfx_heat_wave container = background_shader_vfx_container } + + override_effect_2d = { reference = legend_glow } + + cooldown = { years = 10 } + + left_portrait = { + character = scope:entourage_member_one + animation = divine_ecstasy + camera = camera_event_center_pointing_right + } + right_portrait = { + character = root + animation = dromedary_holding + camera = camera_event_dromedary_holding_right + } + + trigger = { + is_available_travelling_adult = yes + is_location_valid_for_travel_event_on_land = yes + government_has_flag = government_is_merchant + location = { + terrain = desert + travel_danger_type = { + travel_plan = root.current_travel_plan + terrain = desert + } + } + current_travel_plan = { num_entourage_characters > 1 } + } + + immediate = { + current_travel_plan = { + random_entourage_character = { + save_scope_as = entourage_member_one + } + } + save_scope_value_as = { #For a bit of randomness in the random_list + name = oasis_value + value = { + integer_range = { + min = 0 + max = 1.5 + } + } + } + } + #You have enough experience to know where the oasis is + option = { + name = gdp_travel_events.1000.a + trigger = { + custom_tooltip = { + text = low_caravaneer_experience_reason_tooltip + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value >= 100 + } + } + } + show_as_unavailable = { always = yes } + current_travel_plan = { + add_travel_plan_modifier = { + modifier = gdp_oasis_of_hope_modifier + months = 10 + } + } + stress_and_fulfillment_impact = { + brave = minor_stress_impact_loss + impatient = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 50 + OR = { + has_trait = brave + has_trait = impatient + } + } + } + } + #Take a chance on the oasis being real + option = { + name = gdp_travel_events.1000.b + + random_list = { + # Success it was real + 25 = { + modifier = { + factor = 0.5 + has_trait = zealous + } + modifier = { + factor = scope:oasis_value + } + desc = gdp_travel_events.1000.b.success + send_interface_toast = { + title = gdp_travel_events.1000.b.success + left_icon = scope:entourage_member_one + current_travel_plan = { + add_travel_plan_modifier = { + modifier = gdp_oasis_of_hope_modifier + months = 2 + } + } + scope:entourage_member_one = { + add_trait = desert_warrior + } + } + } + # Failure it was a mirage + 75 = { + desc = gdp_travel_events.1000.b.failure + send_interface_toast = { + title = gdp_travel_events.1000.b.failure + left_icon = scope:entourage_member_one + add_prestige = minor_prestige_loss + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_minor_value + } + } + } + } + stress_and_fulfillment_impact = { + brave = minor_stress_impact_loss + zealous = medium_stress_impact_loss + craven = minor_stress_impact_gain + lazy = minor_stress_impact_gain + impatient = medium_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = impatient + has_trait = craven + } + } + } + } + #Push on despite the heat + option = { + name = gdp_travel_events.1000.c + add_prestige = minor_prestige_gain + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_minor_value + } + + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + wrathful = minor_stress_impact_loss + sadistic = medium_stress_impact_loss + callous = medium_stress_impact_loss + calm = minor_stress_impact_gain + zealous = medium_stress_impact_gain + } + + current_travel_plan = { + add_travel_plan_modifier = { + modifier = gdp_low_morale_entourage_modifier + months = 2 + } + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = calm + has_trait = zealous + } + } + } + } +} +#Travelers seeking refuge +gdp_travel_events.1010 = { + type = character_event + title = gdp_travel_events.1010.t + desc = gdp_travel_events.1010.desc + theme = travel + override_effect_2d = { reference = flies } + + cooldown = { years = 10 } + + left_portrait = { + character = scope:traveler_child + animation = clutching_doll + camera = camera_event_near_angle_345_close + } + right_portrait = { + character = scope:traveler_father + animation = donkey_standing_baggage + camera = camera_event_donkey_holding_right + } + + trigger = { + is_available_travelling_adult = yes + is_location_valid_for_travel_event_on_land = yes + government_has_flag = government_is_merchant + } + + immediate = { + #Create Traveler family + #Father + create_character = { + template = generic_peasant_character + location = root.location + culture = root.location.culture + faith = root.location.faith + gender = male + age = { 29 33 } + save_scope_as = traveler_father + after_creation = { + remove_character_flag = peasant_outfit + add_character_flag = created + } + } + #Child + create_character = { + template = generic_peasant_character + location = root.location + culture = root.location.culture + faith = root.location.faith + age = { 8 10 } + father = scope:traveler_father + save_scope_as = traveler_child + after_creation = { + remove_character_flag = peasant_outfit + add_character_flag = created + } + } + } + #Let them shelter with you + option = { + name = gdp_travel_events.1010.a + scope:traveler_child = { add_to_court_and_entourage_effect = yes } + scope:traveler_father = { add_to_court_and_entourage_effect = yes } + stress_and_fulfillment_impact = { + compassionate = medium_stress_impact_loss + generous = minor_stress_impact_loss + callous = medium_stress_impact_gain + greedy = minor_stress_impact_gain + } + + ai_chance = { + base = 50 + modifier = { + factor = 0 + OR = { + has_trait = callous + has_trait = greedy + } + } + modifier = { + OR = { + has_trait = compassionate + has_trait = generous + } + add = 50 + } + } + } + #Let them stay, but they have to pay + option = { + name = gdp_travel_events.1010.b + current_travel_plan = { + delay_travel_plan = { + days = 5 + } + } + scope:traveler_father = { + pay_short_term_gold = { + target = root + gold = minor_gold_value + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + greedy = minor_stress_impact_loss + generous = medium_stress_impact_gain + content = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = generous + has_trait = content + } + } + } + } + #Let them stay... if they give you all they have + option = { + trigger = { + has_trait = greedy + } + name = gdp_travel_events.1010.c + current_travel_plan = { + delay_travel_plan = { + days = 5 + } + } + scope:traveler_father = { + pay_short_term_gold = { + target = root + gold = major_gold_value + } + } + current_travel_plan = { + every_entourage_character = { + custom = custom.every_compassionate_entourage_character + limit = { has_trait = compassionate } + add_opinion = { + target = root + modifier = cruelty_opinion + opinion = -15 + } + } + } + + stress_and_fulfillment_impact = { + ambitious = medium_stress_impact_loss + greedy = medium_stress_impact_loss + generous = medium_stress_impact_gain + content = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = content + } + } + modifier = { + has_trait = greedy + add = 100 + } + } + } + #Send them away + option = { + name = gdp_travel_events.1010.d + + stress_and_fulfillment_impact = { + callous = minor_stress_impact_loss + compassionate = medium_stress_impact_gain + generous = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = generous + has_trait = compassionate + has_trait = greedy + } + } + } + current_travel_plan = { + every_entourage_character = { + custom = custom.every_compassionate_entourage_character + limit = { has_trait = compassionate } + add_opinion = { + target = root + modifier = cruelty_opinion + opinion = -15 + } + } + } + } + after = { + scope:traveler_father = { silent_disappear_ai_if_not_hired_with_flag = yes } + scope:traveler_child = { silent_disappear_ai_if_not_hired_with_flag = yes } + } +} +#What xp you gain for listening to your associate +scripted_effect gdp_associate_lifestyle_xp_gain_effect = { + if = { + limit = { + scope:associate = { has_trait = education_stewardship } + } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_medium_value + } + } + else_if = { + limit = { + scope:associate = { has_trait = education_learning } + } + add_trait_xp = { + trait = lifestyle_merchant + track = artisan + value = lifestyle_merchant_xp_gain_medium_value + } + } + else_if = { + limit = { + scope:associate = { has_trait = education_diplomacy } + } + add_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value = lifestyle_merchant_xp_gain_medium_value + } + } + else_if = { + limit = { + scope:associate = { has_trait = education_intrigue } + } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_medium_value + } + } + else_if = { + limit = { + scope:associate = { has_trait = education_martial } + } + add_trait_xp = { + trait = lifestyle_merchant + track = creditor + value = lifestyle_merchant_xp_gain_medium_value + } + } +} +# Associate has something interesting to share +gdp_travel_events.1020 = { + type = character_event + title = gdp_travel_events.1020.t + desc = { + desc = gdp_travel_events.1020.desc.intro + first_valid = { + triggered_desc = { + trigger = { + scope:associate = { + OR = { + has_trait = education_stewardship + has_trait = education_diplomacy + } + } + } + desc = gdp_travel_events.1020.desc.caravaneer + } + triggered_desc = { + trigger = { + scope:associate = { has_trait = education_learning } + } + desc = gdp_travel_events.1020.desc.artisan + } + triggered_desc = { + trigger = { + scope:associate = { + OR = { + has_trait = education_intrigue + has_trait = education_martial + } + } + } + desc = gdp_travel_events.1020.desc.creditor + } + } + } + theme = travel + + cooldown = { years = 10 } + + left_portrait = { + character = root + triggered_animation = { + trigger = { char_uses_camel_trigger = yes } + animation = dromedary_riding + camera = camera_event_dromedary_left_facing_right + } + triggered_animation = { + trigger = { char_uses_camel_trigger = no } + animation = donkey_riding + camera = camera_event_donkey_left_facing_right + } + animation = donkey_riding + camera = camera_event_donkey_left_facing_right + } + right_portrait = { + character = scope:associate + triggered_animation = { + trigger = { char_uses_camel_trigger = yes } + animation = dromedary_riding + camera = camera_event_dromedary_right_facing_right + } + triggered_animation = { + trigger = { char_uses_camel_trigger = no } + animation = donkey_riding + camera = camera_event_donkey_right_facing_right + } + animation = donkey_riding + camera = camera_event_donkey_right_facing_right + } + + trigger = { + is_available_travelling_adult = yes + is_location_valid_for_travel_event_on_land = yes + government_has_flag = government_is_merchant + current_travel_plan = { + any_entourage_character = { + is_adult = yes + NOT = { this = root } + is_courtier_of = root + } + } + } + + immediate = { + current_travel_plan = { + random_entourage_character = { + limit = { + is_adult = yes + NOT = { this = root } + is_courtier_of = root + } + weight = { + base = 1 + modifier = { + add = 25 + has_trait = lifestyle_merchant + } + } + save_scope_as = associate + } + departure_location = { save_scope_as = journey_start } + } + } + #Eagerly listen to them + option = { + name = gdp_travel_events.1020.a + scope:associate = { + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 30 + } + } + gdp_associate_lifestyle_xp_gain_effect = yes + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + lazy = minor_stress_impact_gain + content = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = content + } + } + } + } + #No no listen to ME instead + option = { + name = gdp_travel_events.1020.b + duel = { + skills = { diplomacy } + target = scope:associate + 50 = { + desc = gdp_travel_events.1020.b.success + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + send_interface_toast = { + title = gdp_travel_events.1020.b.success + left_icon = root + right_icon = scope:associate + add_prestige = medium_prestige_gain + scope:associate = { + add_opinion = { + modifier = impressed_opinion + target = root + opinion = 15 + } + } + } + } + 50 = { + desc = gdp_travel_events.1020.b.failure + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + send_interface_toast = { + title = gdp_travel_events.1020.b.failure + left_icon = root + right_icon = scope:associate + add_prestige = minor_prestige_loss + } + } + } + + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + arbitrary = minor_stress_impact_gain + content = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = arbitrary + has_trait = content + } + } + } + } + #No more talking + option = { + name = gdp_travel_events.1020.c + scope:associate = { + add_opinion = { + modifier = hurt_opinion + target = root + opinion = -15 + } + } + stress_and_fulfillment_impact = { + callous = minor_stress_impact_loss + lazy = minor_stress_impact_gain + content = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = content + } + } + } + } +} +#Another associate wants to replace your partner +gdp_travel_events.1030 = { + type = character_event + title = gdp_travel_events.1030.t + desc = gdp_travel_events.1030.desc + theme = travel + + cooldown = { years = 10 } + + left_portrait = { + character = scope:ambitious_associate + triggered_animation = { + trigger = { char_uses_camel_trigger = yes } + animation = dromedary_leading + camera = camera_event_dromedary_leading_left_facing_right + } + triggered_animation = { + trigger = { char_uses_camel_trigger = no } + animation = donkey_leading + camera = camera_event_donkey_leading_left_facing_right + } + animation = donkey_riding + camera = camera_event_donkey_leading_left_facing_right + } + right_portrait = { + character = root + triggered_animation = { + trigger = { char_uses_camel_trigger = yes } + animation = dromedary_leading + camera = camera_event_dromedary_leading_right_facing_right + } + triggered_animation = { + trigger = { char_uses_camel_trigger = no } + animation = donkey_leading + camera = camera_event_donkey_leading_right_facing_right + } + animation = donkey_riding + camera = camera_event_donkey_leading_right_facing_right + } + lower_left_portrait = { + character = scope:current_partner + } + + trigger = { + employs_court_position = partner_court_position + is_available_travelling_adult = yes + is_location_valid_for_travel_event_on_land = yes + government_has_flag = government_is_merchant + court_position:partner_court_position = { + house = root.house + any_secret = { + NOT = { is_known_by = root } + } + } + current_travel_plan = { + any_entourage_character = { + is_ai = yes + is_adult = yes + NOT = { this = root } + NOT = { has_court_position = partner_court_position } + can_be_employed_as = partner_court_position + } + } + } + + immediate = { + court_position:partner_court_position ?= { + save_scope_as = current_partner + } + scope:current_partner = { + random_secret = { + limit = { + NOT = { is_known_by = root } + } + save_scope_as = secret_to_reveal + } + } + current_travel_plan = { + random_entourage_character = { + limit = { + is_ai = yes + is_adult = yes + NOT = { this = root } + NOT = { this = scope:current_partner } + can_be_employed_as = partner_court_position + } + save_scope_as = ambitious_associate + } + } + } + #Hear them out + option = { + name = gdp_travel_events.1030.a + + show_as_tooltip = { + scope:secret_to_reveal = { reveal_to = root } + } + hidden_effect = { + scope:secret_to_reveal = { + reveal_to = scope:ambitious_associate + reveal_to = root + } + } + house = { + add_unity_value = { + value = major_unity_loss + character = root + desc = gdp_travel_events.1030.a.unity_loss.desc + } + } + add_hook = { + target = scope:ambitious_associate + type = obligation_hook + } + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 30 + } + + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + content = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = content + } + } + } + } + #Dimiss them + option = { + name = gdp_travel_events.1030.b + add_opinion = { + target = root + modifier = insult_opinion + opinion = -10 + } + house = { + add_unity_value = { + value = major_unity_gain + character = root + desc = gdp_travel_events.1030.b.unity_gain.desc + } + } + stress_and_fulfillment_impact = { + ambitious = minor_stress_impact_loss + lazy = minor_stress_impact_gain + content = minor_stress_impact_gain + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = content + } + } + } + } +} + +# DANGER: Unmaintained Well - Party stops at an icky well +gdp_travel_events.1040 = { + type = character_event + title = gdp_travel_events.1040.t + desc = gdp_travel_events.1040.desc + theme = travel_danger + + cooldown = { months = 1 } + + right_portrait = { + character = scope:thirsty_traveler + animation = sick_stomach + camera = camera_event_very_right + } + left_portrait = { + character = root + animation = eyeroll + camera = camera_event_donkey_left_facing_right + } + + override_effect_2d = { reference = flies } + + trigger = { + is_available_travelling_adult = yes + is_location_valid_for_travel_event_on_land = yes + location = { + has_holding = no + county = { prosperity_level <= bad_prosperity_level } + } + current_travel_plan = { num_entourage_characters > 1 } + } + + immediate = { + current_travel_plan = { + random_entourage_character = { + save_scope_as = thirsty_traveler + } + } + } + + option = { # Drink Anyway (Success) + name = gdp_travel_events.1040.a + trigger = { + OR = { + has_trait = strong + has_trait = physique_good_1 + has_trait = physique_good_2 + has_trait = physique_good_3 + has_trait = whole_of_body + } + } + stress_and_fulfillment_impact = { + base = medium_stress_impact_loss + brave = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + impatient = minor_stress_impact_loss + } + scope:thirsty_traveler = { + add_opinion = { + target = root + modifier = impressed_opinion + opinion = 15 + } + } + ai_chance = { + base = 1000 + } + } + + option = { # Purify Water + name = gdp_travel_events.1040.b + trigger = { + trigger_if = { + limit = { + has_trait = lifestyle_herbalist + } + has_trait = lifestyle_herbalist + } + trigger_else = { + learning >= high_skill_rating + } + } + show_as_unavailable = { + NOR = { + learning >= high_skill_rating + has_trait = lifestyle_herbalist + } + } + if = { + limit = { + has_government = landless_adventurer_government + } + domicile = { + change_provisions = minor_provisions_gain + } + } + current_travel_plan = { + add_travel_plan_modifier = { + modifier = gdp_pure_waters_modifier + months = 5 + } + } + ai_chance = { + base = 500 + } + } + + option = { # Ration Water + name = gdp_travel_events.1040.c + trigger = { + OR = { + has_trait = logistician + has_trait = overseer + has_trait = administrator + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value >= 50 + } + } + } + show_as_unavailable = { + NOR = { + has_trait = logistician + has_trait = overseer + has_trait = administrator + has_trait_xp = { + trait = lifestyle_merchant + track = caravaneer + value >= 50 + } + } + } + current_travel_plan = { + add_travel_plan_modifier = { + modifier = gdp_rationing_water_modifier + months = 3 + } + every_entourage_character = { + custom = custom.every_entourage_character + add_opinion = { + target = root + modifier = unimpressed_opinion + opinion = -10 + } + } + } + ai_chance = { + base = 60 + } + } + + option = { # Press On + name = gdp_travel_events.1040.d + stress_and_fulfillment_impact = { + base = medium_stress_impact_gain + } + if = { + limit = { + has_government = landless_adventurer_government + } + domicile = { + change_provisions = medium_provisions_loss + } + } + add_character_modifier = { + modifier = gdp_thirsty_traveler_modifier + months = 6 + } + ai_chance = { + base = 10 + } + } + + option = { # Drink anyway + name = gdp_travel_events.1040.e + trigger = { + NOR = { + has_trait = strong + has_trait = physique_good_1 + has_trait = physique_good_2 + has_trait = physique_good_3 + has_trait = whole_of_body + has_trait = dysentery + } + } + if = { + limit = { + NOT = { has_trait = ill } + } + random_list = { + 20 = { # Success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_travel_events.1040.e.success + left_icon = root + custom_tooltip = gdp_travel_events.1040.e.success.desc + } + } + 60 = { # Failure + contract_disease_effect = { DISEASE = ill TREATMENT_EVENT = yes } + stress_and_fulfillment_impact = { + paranoid = minor_stress_impact_gain + } + } + 20 = { # Critical Failure + contract_disease_effect = { DISEASE = dysentery TREATMENT_EVENT = yes } + stress_and_fulfillment_impact = { + paranoid = minor_stress_impact_gain + } + } + } + } + else = { + random_list = { + 50 = { # Success + send_interface_toast = { + type = event_toast_effect_good + title = gdp_travel_events.1040.e.success + left_icon = root + custom_tooltip = gdp_travel_events.1040.e.success.desc + } + } + 50 = { # Critical Failure + if = { + limit = { + has_trait = ill + } + hidden_effect = { + recover_from_disease_effect = { DISEASE = ill } + remove_disease_treatment_effect = yes + } + custom_tooltip = gdp_travel_events.1040.e.critical_failure.tt + } + add_trait_force_tooltip = dysentery + contract_disease_effect = { DISEASE = dysentery TREATMENT_EVENT = yes } + stress_and_fulfillment_impact = { + paranoid = minor_stress_impact_gain + } + } + } + } + ai_chance = { + base = 1 + modifier = { + has_trait = ill + has_trait = paranoid + add = -100 + } + } + } +} + +# DANGER: Toppled Timber - The road is blocked by fallen trees +gdp_travel_events.1050 = { + type = character_event + title = gdp_travel_events.1050.t + desc = gdp_travel_events.1050.desc + theme = travel_danger + + cooldown = { months = 1 } + + + right_portrait = { + character = scope:local_worker + animation = marshal_axe + camera = camera_event_right_pointing_right + hide_info = yes + } + + left_portrait = { + character = root + animation = throne_room_conversation_3 + camera = camera_event_very_left + } + + override_effect_2d = { reference = rain } + + trigger = { + is_available_travelling = yes + location = { + OR = { + terrain = forest + terrain = jungle + } + OR = { + travel_danger_type = { + travel_plan = root.current_travel_plan + terrain = forest + } + travel_danger_type = { + travel_plan = root.current_travel_plan + terrain = jungle + } + } + } + NOT = { + current_season_trigger = { SEASON = dry_season } + } + } + + weight_multiplier = { + base = 1 + modifier = { + current_season_trigger = { SEASON = rainy_season } + add = 2 + } + } + + immediate = { + create_character = { + template = generic_peasant_character + location = root.location + culture = root.location.culture + faith = root.location.faith + gender = male + age = { 19 35 } + save_scope_as = local_worker + after_creation = { + remove_character_flag = peasant_outfit + add_character_flag = created + } + } + } + + option = { # Warhorse Aid + name = gdp_travel_events.1050.x + trigger = { + any_owned_story = { story_type = story_cycle_martial_lifestyle_warhorse } + } + add_prestige = medium_prestige_gain + add_martial_lifestyle_xp = medium_lifestyle_xp + ai_chance = { + base = 1000 + } + } + + option = { # Get to Chopping + name = gdp_travel_events.1050.a + trigger = { + OR = { + has_trait = whole_of_body + has_trait = athletic + has_trait = giant + has_trait = strong + has_trait = physique_good_1 + has_trait = physique_good_2 + has_trait = physique_good_3 + } + } + show_as_unavailable = { + NOR = { + has_trait = whole_of_body + has_trait = athletic + has_trait = giant + has_trait = strong + has_trait = physique_good_1 + has_trait = physique_good_2 + has_trait = physique_good_3 + } + } + add_prowess_skill = 1 + add_character_modifier = { + modifier = gdp_workout_modifier + months = 6 + } + current_travel_plan = { + every_entourage_character = { + custom = custom.every_entourage_character + add_opinion = { + target = root + modifier = impressed_opinion + opinion = 10 + } + } + } + stress_and_fulfillment_impact = { + diligent = minor_stress_impact_loss + athletic = minor_stress_impact_loss + arrogant = minor_stress_impact_gain + impatient = minor_stress_impact_loss + stubborn = minor_stress_impact_loss + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 500 + modifier = { + add = 500 + OR = { + has_trait = diligent + has_trait = athletic + has_trait = impatient + has_trait = stubborn + } + } + modifier = { + OR = { + has_trait = arrogant + has_trait = lazy + } + add = -1000 + } + } + } + + option = { # Study the Workers + name = gdp_travel_events.1050.b + trigger = { + has_trait = lifestyle_merchant + learning >= 10 + } + show_as_unavailable = { + OR = { + has_government = landless_adventurer_government + has_trait = lifestyle_merchant + } + } + # Add Carpentries Experience + primary_title = { + add_trade_good_category_xp = { + target = trade_good_category:trade_category_carpentry_supplies + value = trade_expertise_xp_monumental_value + } + } + current_travel_plan = { delay_travel_plan = { days = 50 } } + stress_and_fulfillment_impact = { + impatient = minor_stress_impact_gain + lazy = minor_stress_impact_gain + } + + ai_chance = { + base = 80 + modifier = { + factor = 0 + OR = { + has_trait = impatient + has_trait = lazy + exists = involved_activity + } + } + } + } + + option = { # Find Alternative Route + name = gdp_travel_events.1050.c + trigger = { + trigger_if = { + limit = { + has_trait = lifestyle_traveler + has_trait_xp = { + trait = lifestyle_traveler + track = danger + value >= 50 + } + } + has_trait = lifestyle_traveler + } + } + random_list = { + 50 = { # Success + modifier = { + has_trait_xp = { + trait = lifestyle_traveler + track = danger + value >= 50 + } + add = 150 + } + send_interface_toast = { + type = event_toast_effect_good + title = gdp_travel_events.1050.c.success + left_icon = root + if = { + limit = { + NOT = { + has_trait = lifestyle_traveler + } + } + add_trait = lifestyle_traveler + } + else_if = { + limit = { + has_trait_xp = { + trait = lifestyle_traveler + track = danger + value >= 100 + } + } + add_stress = minor_stress_loss + } + else = { + add_trait_xp = { + trait = lifestyle_traveler + track = danger + value = 15 + } + } + } + } + 50 = { # Failure + increase_wounds_effect = { REASON = accident } + send_interface_toast = { + type = event_toast_effect_bad + title = gdp_travel_events.1050.c.failure + left_icon = root + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + } + } + } + ai_chance = { + base = 10 + modifier = { + ai_boldness >= high_positive_ai_value + add = 100 + } + modifier = { + has_trait_xp = { + trait = lifestyle_traveler + track = danger + value >= 50 + } + add = 1000 + } + } + } + + option = { # Wait it Out + name = gdp_travel_events.1050.d + current_travel_plan = { delay_travel_plan = { days = 20 } } + stress_and_fulfillment_impact = { + base = minor_stress_impact_gain + } + if = { + limit = { + has_government = landless_adventurer_government + } + domicile = { + change_provisions = minor_provisions_loss + } + } + ai_chance = { + base = 30 + modifier = { + factor = 0 + exists = involved_activity + } + } + } + + after = { + scope:local_worker = { silent_disappearance_ai_if_created_effect = yes } + } +} + +# DANGER: Rats in the Hold - Rats are gnawing on the ship's supplies +gdp_travel_events.1060 = { + type = character_event + title = gdp_travel_events.1060.t + desc = gdp_travel_events.1060.desc + theme = travel_danger + + cooldown = { months = 1 } + + right_portrait = { + character = scope:entourage_member_one + animation = fear + camera = camera_event_right_forward + } + + left_portrait = { + character = root + animation = worry + camera = camera_event_center + } + + trigger = { + is_available_travelling = yes + location = { + OR = { + terrain = sea + terrain = coastal_sea + } + OR = { + travel_danger_type = { + travel_plan = root.current_travel_plan + terrain = sea + } + travel_danger_type = { + travel_plan = root.current_travel_plan + terrain = coastal_sea + } + } + } + current_travel_plan = { num_entourage_characters > 1 } + } + + immediate = { + if = { + random_courtier_or_guest = { + limit = { + is_of_major_interest_trigger = { CHARACTER = root } + } + save_scope_as = entourage_member_one + } + } + else_if = { + limit = { exists = current_travel_plan.travel_leader } + current_travel_plan.travel_leader = { save_scope_as = entourage_member_one } + } + else = { + current_travel_plan = { + random_entourage_character = { + save_scope_as = entourage_member_one + } + } + } + } + + option = { # Release the Cat + name = gdp_travel_events.1060.x + trigger = { + any_owned_story = { story_type = story_cycle_pet_cat } + } + current_travel_plan = { + every_entourage_character = { + custom = custom.every_entourage_character + add_opinion = { + target = root + modifier = impressed_opinion + opinion = 10 + } + add_character_modifier = { + modifier = gdp_cat_rats_modifier + years = 5 + } + } + } + ai_chance = { + base = 1000 + } + + } + + option = { # Hunter: Go Fishing + name = gdp_travel_events.1060.a + trigger = { + has_trait = lifestyle_hunter + } + show_as_unavailable = { + NOT = { + has_trait = lifestyle_hunter + } + } + add_trait_xp = { + trait = lifestyle_hunter + track = hunter + value = 5 + } + if = { + limit = { + has_government = landless_adventurer_government + } + domicile = { + change_provisions = minor_provisions_gain + } + } + stress_and_fulfillment_impact = { + base = minor_stress_impact_loss + calm = minor_stress_impact_loss + eccentric = minor_stress_impact_loss + } + if = { + limit = { + has_trait = lifestyle_merchant + } + add_character_modifier = { + modifier = gdp_fishing_modifier + years = 5 + } + } + ai_chance = { + base = 1000 + modifier = { + OR = { + has_trait = calm + has_trait = eccentric + } + add = 1000 + } + } + } + + option = { # Cereals Expertise: Arrange Proper Storage + name = gdp_travel_events.1060.b + trigger = { + has_trait = lifestyle_merchant + custom_tooltip = { + text = gdp_travel_events.1060.b.tt + primary_title = { + trade_good_category_xp = { + target = trade_good_category:trade_category_cereals + value >= 25 + } + } + } + } + show_as_unavailable = { + OR = { + has_government = landless_adventurer_government + has_trait = lifestyle_merchant + } + } + primary_title = { + add_trade_good_category_xp = { + target = trade_good_category:trade_category_cereals + value = 300 # 2 levels + } + } + stress_and_fulfillment_impact = { + lazy = minor_stress_impact_gain + paranoid = minor_stress_impact_gain + diligent = minor_stress_impact_loss + } + ai_chance = { + base = 1000 + modifier = { + OR = { + has_trait = lazy + has_trait = paranoid + } + add = -1000 + } + modifier = { + has_trait = diligent + add = 1000 + } + } + } + + option = { # Restock at Shore + name = gdp_travel_events.1060.c + remove_short_term_gold = minor_gold_value + stress_and_fulfillment_impact = { + greedy = medium_stress_impact_gain + arrogant = minor_stress_impact_gain + impatient = minor_stress_impact_gain + generous = minor_stress_impact_loss + forgiving = minor_stress_impact_loss + profligate = minor_stress_impact_loss + } + ai_chance = { + base = 1 + modifier = { + OR = { + has_trait = greedy + has_trait = arrogant + has_trait = impatient + } + add = -100 + } + modifier = { + has_trait = generous + has_trait = forgiving + has_trait = profligate + add = 100 + } + modifier = { + exists = involved_activity + add = -1000 + } + } + } + + option = { # Catch Rats + name = gdp_travel_events.1060.d + current_travel_plan = { + every_entourage_character = { + custom = custom.every_entourage_character + add_character_modifier = { + modifier = gdp_catch_rats_modifier + years = 5 + } + add_opinion = { + target = root + modifier = angry_opinion + opinion = -10 + } + } + } + stress_and_fulfillment_impact = { + arrogant = minor_stress_impact_loss + lazy = minor_stress_impact_loss + wrathful = minor_stress_impact_loss + callous = minor_stress_impact_loss + sadistic = medium_stress_impact_loss + compassionate = medium_stress_impact_gain + just = minor_stress_impact_gain + } + ai_chance = { + base = 50 + modifier = { + OR = { + has_trait = arrogant + has_trait = lazy + has_trait = wrathful + has_trait = callous + has_trait = sadistic + } + add = 300 + } + modifier = { + has_trait = compassionate + has_trait = just + add = -1000 + } + } + } +} + +# High-Stakes Bartering: Bandits smell gold +gdp_travel_events.1070 = { + type = character_event + title = gdp_travel_events.1070.t + desc = gdp_travel_events.1070.desc + theme = widgetless_travel_danger + right_portrait = { + character = scope:bandit_leader + animation = horse_archer_aggressive + camera = camera_event_right_to_the_right_more_right + } + override_background = { reference = wilderness } + + trigger = { + is_available_travelling_adult = yes + is_playable_character = yes + is_location_valid_for_travel_event_on_land = yes + exists = var:local_deals_last_haggle_gold + current_travel_plan ?= { has_travel_option = adventurers_make_local_deals_option } + location = { + travel_danger_type = { + travel_plan = root.current_travel_plan + type = county_control + } + } + } + + immediate = { + mp_delay_travel_plan = { DAYS = 90 } + add_character_flag = { + flag = local_deals_haggle_bandit_cooldown + days = 120 + } + traveler_danger_xp_effect = { + MIN = 2 + MAX = 5 + } + if = { + limit = { + any_pool_character = { + province = root.location + is_physically_able_ai_adult = yes + prowess >= medium_skill_rating + } + } + random_pool_character = { + province = root.location + limit = { + is_physically_able_ai_adult = yes + prowess >= medium_skill_rating + } + save_scope_as = bandit_leader + } + } + else = { + create_character = { + template = bandit_character + location = root.location + culture = root.location.culture + faith = root.location.faith + save_scope_as = bandit_leader + after_creation = { + add_character_flag = created + } + } + } + scope:bandit_leader = { add_character_flag = need_military_outfit } + } + + option = { # You wanna mess with my Charter holder? + name = gdp_travel_events.1070.a + trigger = { + merchant_has_usable_charter_trigger = { + ONLY_EQUIPPED = yes + INCLUDE_FORGERIES = no + } + } + reason = charter + send_interface_toast = { + title = gdp_travel_events.1070.a.success + left_icon = root + add_prestige = medium_prestige_gain + } + ai_chance = { + base = 1000 + } + } + + option = { #Intimidate + name = gdp_travel_events.1070.b + duel = { + skills = { martial prowess } + value = decent_skill_rating + 10 = { + desc = gdp_travel_events.1070.b.success + compare_modifier = { + value = scope:duel_value + multiplier = 1 + min = -49 + } + modifier = { add = current_travel_plan.num_entourage_characters } + modifier = { + add = { + value = current_travel_plan.travel_safety + divide = 20 + } + } + modifier = { + add = { + value = dread + divide = 4 + } + } + send_interface_toast = { + title = travel_danger_events.6010.c.success + left_icon = root + add_prestige = medium_prestige_gain + } + } + 10 = { + desc = gdp_travel_events.1070.b.failure + min = 3 + compare_modifier = { + value = scope:duel_value + multiplier = -1 + min = -49 + } + remove_short_term_gold = local_deals_bandit_demand_gold_value + random = { + chance = 50 + custom_tooltip = travel_danger_events.6010.c.wound + hidden_effect = { + current_travel_plan = { + random_entourage_character = { + limit = { is_adult = yes } + weight = { + base = 1 + modifier = { add = prowess } + modifier = { + add = 10 + has_court_position = bodyguard_court_position + } + modifier = { + add = 10 + has_court_position = akolouthos_court_position + } + modifier = { + add = 10 + is_knight_of = root + } + } + save_scope_as = woundee + } + } + if = { + limit = { exists = scope:woundee } + send_interface_toast = { + title = travel_danger_events.6010.c.wound + left_icon = scope:woundee + scope:woundee = { + increase_wounds_effect = { REASON = battle } + } + } + } + } + } + } + } + stress_and_fulfillment_impact = { + craven = medium_stress_impact_gain + lazy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = craven + } + } + } + + option = { # Just... take it. + name = gdp_travel_events.1070.c + remove_short_term_gold = local_deals_bandit_demand_gold_value + stress_and_fulfillment_impact = { + greedy = minor_stress_impact_gain + } + ai_chance = { + base = 100 + ai_value_modifier = { + ai_greed = -1 + ai_boldness = -0.5 + } + modifier = { + factor = 0 + gold < local_deals_bandit_demand_gold_value + } + } + } + + after = { + mp_resume_travel_plan = yes + remove_variable = local_deals_last_haggle_gold + scope:bandit_leader = { silent_disappearance_ai_if_created_effect = yes } + } +} + +gdp_travel_events.2000 = { + type = character_event + title = gdp_travel_events.2000.t + desc = gdp_travel_events.2000.desc + theme = travel + override_background = { reference = pam_romanesque_church_exterior } + + left_portrait = { + character = root + animation = shock + } + + right_portrait = { + character = scope:mason + animation = ecstasy + } + + trigger = { + location = { + has_variable = tower_of_pisa_to_inspect + has_building = tower_of_pisa + province_owner = root + } + } + + immediate = { + location = { save_scope_as = pisa_province } + hidden_effect = { + scope:pisa_province = { tower_of_pisa_lean_effect = yes } + } + pan_camera_to_province = scope:pisa_province + random_pool_character = { + province = scope:pisa_province + limit = { + is_available_ai_adult = yes + stewardship >= excellent_skill_level + } + save_scope_as = mason + } + if = { + limit = { + NOT = { exists = scope:mason } + } + create_character = { + template = foreign_architect_template + culture = scope:pisa_province.culture + faith = scope:pisa_province.faith + rite = scope:pisa_province.rite + gender_female_chance = location_faith_dominant_gender_female_chance + location = scope:pisa_province + save_scope_as = mason + } + scope:mason = { add_character_flag = created } + } + } + + option = { + name = gdp_travel_events.2000.a + custom_tooltip = tower_of_pisa_leans_tt + add_prestige = minor_prestige_gain + ai_chance = { + base = 100 + } + } + + option = { + name = gdp_travel_events.2000.b + custom_tooltip = tower_of_pisa_leans_tt + add_courtier = scope:mason + ai_chance = { + base = 100 + } + } + + after = { + scope:mason = { silent_disappear_ai_if_not_hired_with_flag = yes } + } +} + +gdp_travel_events.2001 = { + type = character_event + hidden = yes + + immediate = { + scope:tower_of_pisa_province ?= { tower_of_pisa_lean_effect = yes } + } +} + +scripted_effect tower_of_pisa_go_see_effect = { + if = { + limit = { location = scope:tower_of_pisa_province } + trigger_event = gdp_travel_events.2000 + } + else = { + start_travel_plan = { + destination = scope:tower_of_pisa_province + on_arrival_event = gdp_travel_events.2000 + on_travel_planner_cancel_event = gdp_travel_events.2004 + } + } +} + +gdp_travel_events.2002 = { + type = letter_event + opening = gdp_travel_events.2002.opening + desc = gdp_travel_events.2002.desc + sender = { + character = scope:tower_of_pisa_messenger + animation = worry + } + + # Go and see it + option = { + name = gdp_travel_events.2002.a + trigger = { + OR = { + location = scope:tower_of_pisa_province + is_travelling = no + } + } + show_as_unavailable = { always = yes } + tower_of_pisa_go_see_effect = yes + ai_chance = { + base = 100 + } + } + + # Leave it be + option = { + name = gdp_travel_events.2002.b + custom_tooltip = tower_of_pisa_leans_tt + hidden_effect = { + scope:tower_of_pisa_province = { tower_of_pisa_lean_effect = yes } + } + ai_chance = { + base = 100 + } + } +} + +gdp_travel_events.2003 = { + type = letter_event + window = anonymous_letter_event + opening = gdp_travel_events.2002.opening + desc = gdp_travel_events.2002.desc + sender = root + + option = { + name = gdp_travel_events.2002.a + trigger = { + OR = { + location = scope:tower_of_pisa_province + is_travelling = no + } + } + show_as_unavailable = { always = yes } + tower_of_pisa_go_see_effect = yes + ai_chance = { + base = 100 + } + } + + option = { + name = gdp_travel_events.2002.b + custom_tooltip = tower_of_pisa_leans_tt + hidden_effect = { + scope:tower_of_pisa_province = { tower_of_pisa_lean_effect = yes } + } + ai_chance = { + base = 100 + } + } +} + +gdp_travel_events.2004 = { + type = character_event + hidden = yes + + immediate = { + every_directly_owned_province = { + limit = { has_variable = tower_of_pisa_to_inspect } + tower_of_pisa_lean_effect = yes + } + } +} diff --git a/events/travel_events/travel_events_bp3.txt b/events/travel_events/travel_events_bp3.txt index 908d096d7..370dd61d0 100644 --- a/events/travel_events/travel_events_bp3.txt +++ b/events/travel_events/travel_events_bp3.txt @@ -1087,7 +1087,7 @@ travel_events_bp3.15 = { # The Stories of scripted_trigger bp3_home_city_trigger = { has_holding_type = city_holding - free_building_slots > 0 + local_guild_compare_trigger = yes } travel_events_bp3.20 = { # The Guild @@ -1126,7 +1126,6 @@ travel_events_bp3.20 = { # The Guild } bp3_travel_event_default_trigger = yes location = { - has_holding_type = city_holding local_guild_trigger = yes } any_sub_realm_barony = { @@ -1156,17 +1155,6 @@ travel_events_bp3.20 = { # The Guild local_guild_compare_trigger = yes } } - alternative_limit = { - title_province = { - bp3_home_city_trigger = yes - local_guild_compare_trigger = yes - } - } - alternative_limit = { - title_province = { - bp3_home_city_trigger = yes - } - } title_province = { save_scope_as = new_home_province } } @@ -1185,15 +1173,7 @@ travel_events_bp3.20 = { # The Guild name = travel_events_bp3.20.a add_gold = 1 scope:new_home_province = { - if = { - limit = { - local_guild_compare_trigger = yes - } - local_guild_reward_effect = yes - } - else = { - add_random_economic_building_effect = yes - } + local_guild_reward_effect = yes } stress_and_fulfillment_impact = { @@ -1214,7 +1194,7 @@ travel_events_bp3.20 = { # The Guild flavor = travel_events_bp3.20.b.tt add_gold = tiny_gold_value scope:new_home_province.county = { - change_development_progress_with_overflow = 25 + change_prosperity_progress_with_overflow = 25 change_county_control = -25 } @@ -2222,7 +2202,7 @@ travel_events_bp3.40 = { # The Local Champion left_icon = root add_prestige = medium_prestige_gain - add_gold = medium_gold_value + add_gold = minor_gold_value } } 50 = { diff --git a/events/travel_events/travel_events_james.txt b/events/travel_events/travel_events_james.txt index 7533037d8..8a34dbeaa 100644 --- a/events/travel_events/travel_events_james.txt +++ b/events/travel_events/travel_events_james.txt @@ -2305,7 +2305,7 @@ travel_events.4012 = { is_location_valid_for_travel_event_on_land = yes location = { has_holding = no - county = { development_level <= 5 } + county = { prosperity_level <= 5 } } trigger_if = { limit = { @@ -3649,6 +3649,7 @@ travel_events.4020 = { } cooldown = { years = 10 } trigger = { + NOT = { government_has_flag = government_is_merchant } is_available_travelling = yes is_playable_character = yes is_location_valid_for_travel_event_on_land = yes @@ -3686,6 +3687,7 @@ travel_events.4020 = { value = scope:duel_value multiplier = 3.5 } + min = 10 send_interface_toast = { title = travel.debate_won left_icon = root @@ -3697,6 +3699,7 @@ travel_events.4020 = { value = scope:duel_value multiplier = -3.5 } + min = 10 send_interface_toast = { title = travel.debate_lost left_icon = root @@ -7261,8 +7264,16 @@ travel_events.4039 = { is_available_travelling = yes is_playable_character = yes is_location_valid_for_travel_event_on_land = yes - rite = { NOT = { rite_has_parameter = host_honored_guests_active } } - location.rite = { rite_has_parameter = host_honored_guests_active } + OR = { + AND = { + rite = { NOT = { rite_has_parameter = host_honored_guests_active } } + location.rite = { rite_has_parameter = host_honored_guests_active } + } + AND = { + NOT = { culture = { has_cultural_parameter = caravanserai_hospitality } } + location.culture ?= { has_cultural_parameter = caravanserai_hospitality } + } + } } immediate = { diff --git a/events/war_events/combat_events.txt b/events/war_events/combat_events.txt index 4fbf0a42b..2d0731a12 100644 --- a/events/war_events/combat_events.txt +++ b/events/war_events/combat_events.txt @@ -417,9 +417,9 @@ combat_event.0005 = { scope:friendly_commander = { send_interface_toast = { title = combat_event.0005.message - set_relation_rival = { - target = root - reason = rival_undefeated_defeated + set_relation_rival_effect = { + TARGET = root + REASON = rival_undefeated_defeated } } } @@ -1095,8 +1095,16 @@ combat_event.1001 = { scope:combat_winner = { trigger_event = combat_event.1002 } - scope:combat_loser = { - trigger_event = combat_event.1003 + if = { + limit = { + any_in_list = { + list = prisoners_of_war + this != scope:combat_loser + } + } + scope:combat_loser = { + trigger_event = combat_event.1003 + } } # Send a message to all other players who may be concerned about the fate of the captured prisoners. every_player = { @@ -1122,8 +1130,8 @@ combat_event.1001 = { modifier = { factor = accolade_progress # scales with accolade progress } - modifier = { # must have an eligible knight - NOT = { + if = { + limit = { # must have an eligible knight root = { any_side_knight = { can_unlock_accolade_attribute_trigger = { @@ -1138,48 +1146,47 @@ combat_event.1001 = { } } } - factor = 0 - } - save_scope_as = accolade_liege - set_variable = { - name = accolade_progress - value = 0 - } - root = { - random_side_knight = { - limit = { - can_unlock_accolade_attribute_trigger = { - ATTRIBUTE = thug - } - any_killed_character = { - OR = { - is_in_list = slain_combatants - is_in_list = victorious_slain_combatants + save_scope_as = accolade_liege + set_variable = { + name = accolade_progress + value = 0 + } + root = { + random_side_knight = { + limit = { + can_unlock_accolade_attribute_trigger = { + ATTRIBUTE = thug + } + any_killed_character = { + OR = { + is_in_list = slain_combatants + is_in_list = victorious_slain_combatants + } } } - } - weight = { - base = 1 - modifier = { - add = 50 - is_acclaimed = yes + weight = { + base = 1 + modifier = { + add = 50 + is_acclaimed = yes + } } + save_scope_as = accolade_knight } - save_scope_as = accolade_knight } - } - send_interface_message = { - type = msg_accolade_eligibility - title = accolade_thug_unlock.t - left_icon = scope:accolade_knight - right_icon = scope:accolade_liege - custom_tooltip = accolade_thug_unlock.tt - scope:accolade_knight = { - set_variable = { - name = thug_attribute_unlock - value = yes - } - } + send_interface_message = { + type = msg_accolade_eligibility + title = accolade_thug_unlock.t + left_icon = scope:accolade_knight + right_icon = scope:accolade_liege + custom_tooltip = accolade_thug_unlock.tt + scope:accolade_knight = { + set_variable = { + name = thug_attribute_unlock + value = yes + } + } + } } } } diff --git a/events/war_events/raid_events.txt b/events/war_events/raid_events.txt index 15d434440..0af966cc6 100644 --- a/events/war_events/raid_events.txt +++ b/events/war_events/raid_events.txt @@ -103,9 +103,9 @@ raiding.0002 = { #Less hidden event: I do get a sacking! name = raiding.0002.a trigger = { NOT = { government_has_flag = government_is_nomadic } - root.capital_county = { development_level < 15 } #If you have a certain amount of development, you can't gain anything from this. + root.capital_county = { prosperity_level < 15 } #If you have a certain amount of prosperity, you can't gain anything from this. OR = { - scope:county = { development_level > 15 } #The county must actually have enough development to be worth sacking. + scope:county = { prosperity_level > 15 } #The county must actually have enough prosperity to be worth sacking. scope:county.holder = { #Or at least be a non-tribal place. NOR = { government_has_flag = government_is_tribal @@ -121,10 +121,10 @@ raiding.0002 = { #Less hidden event: I do get a sacking! years = 20 } change_county_control = -10 - change_development_progress = major_development_progress_loss #Always deduct progress. - if = { #If they don't have enough progress made, burn a level of development. - limit = { development_towards_level_increase < major_development_progress_gain } - change_development_level = -1 + change_prosperity_progress = major_prosperity_progress_loss #Always deduct progress. + if = { #If they don't have enough progress made, burn a level of prosperity. + limit = { prosperity_towards_level_increase < major_prosperity_progress_gain } + change_prosperity_level = -1 } save_scope_value_as = { name = sack_status @@ -139,7 +139,7 @@ raiding.0002 = { #Less hidden event: I do get a sacking! } } root.capital_county = { - change_development_progress = medium_development_progress_gain + change_prosperity_progress = medium_prosperity_progress_gain } stress_and_fulfillment_impact = { compassionate = minor_stress_impact_gain @@ -173,10 +173,10 @@ raiding.0002 = { #Less hidden event: I do get a sacking! years = 20 } change_county_control = -10 - change_development_progress = major_development_progress_loss #Always deduct progress. - if = { #If they don't have enough progress made, burn a level of development. - limit = { development_towards_level_increase < major_development_progress_gain } - change_development_level = -1 + change_prosperity_progress = major_prosperity_progress_loss #Always deduct progress. + if = { #If they don't have enough progress made, burn a level of prosperity. + limit = { prosperity_towards_level_increase < major_prosperity_progress_gain } + change_prosperity_level = -1 } save_scope_value_as = { name = sack_status @@ -227,13 +227,13 @@ raiding.0002 = { #Less hidden event: I do get a sacking! } if = { #If they have enough progress gain to take the hit, then they just lose some progress. limit = { - development_towards_level_increase > medium_development_progress_loss + prosperity_towards_level_increase > medium_prosperity_progress_loss } - change_development_progress = medium_development_progress_loss + change_prosperity_progress = medium_prosperity_progress_loss } - else = { #If they don't, then they lose the progress, and a level of development is burned away. - change_development_progress = medium_development_progress_loss - change_development_level = -1 + else = { #If they don't, then they lose the progress, and a level of prosperity is burned away. + change_prosperity_progress = medium_prosperity_progress_loss + change_prosperity_level = -1 } save_scope_value_as = { name = sack_status @@ -469,7 +469,7 @@ raiding.0003 = { trigger = { top_liege = this NOT = { scope:sack_status = flag:spared_plundered } - NOT = { government_has_flag = government_is_tribal } #Tribes don't care about development. + NOT = { government_has_flag = government_is_tribal } #Tribes don't care about prosperity. NOT = { government_has_flag = government_is_nomadic } OR = { is_ai = no @@ -622,7 +622,7 @@ raiding.0004 = { trigger = { NOR = { scope:sack_status = flag:spared_plundered - government_has_flag = government_is_tribal #Tribes don't care about development. + government_has_flag = government_is_tribal #Tribes don't care about prosperity. government_has_flag = government_is_nomadic } OR = { @@ -1409,7 +1409,7 @@ raiding.0040 = { } 5 = { trigger = { - county = { development_level > 0 } + county = { prosperity_level > 0 } } modifier = { scope:raider.culture ?= { has_innovation = innovation_motte } @@ -1423,7 +1423,7 @@ raiding.0040 = { left_icon = scope:barony.holder right_icon = root.army_commander show_as_tooltip = { - scope:county = { change_development_level = -1 } + scope:county = { change_prosperity_level = -1 } } } } @@ -1434,7 +1434,7 @@ raiding.0040 = { left_icon = scope:barony.holder right_icon = root.army_commander - scope:county = { change_development_level = -1 } + scope:county = { change_prosperity_level = -1 } } } } diff --git a/events/yearly_events/bp1_yearly_james.txt b/events/yearly_events/bp1_yearly_james.txt index c1fe0c8b0..b863ce67d 100644 --- a/events/yearly_events/bp1_yearly_james.txt +++ b/events/yearly_events/bp1_yearly_james.txt @@ -490,6 +490,10 @@ bp1_yearly.9005 = { } trigger = { + is_available_adult = yes + NOT = { + has_trait = forgiving + } any_memory = { memory_type = destroyed_my_toy memory_participant:destroyer = { @@ -505,10 +509,6 @@ bp1_yearly.9005 = { memory_type = avenged_my_toy } } - is_available_adult = yes - NOT = { - has_trait = forgiving - } } immediate = { @@ -535,28 +535,24 @@ bp1_yearly.9005 = { } } if = { - limit = { - NOT = { - has_relation_rival = scope:bp1_yearly_9001_toy_hater - } - } - set_relation_rival = { - target = scope:bp1_yearly_9001_toy_hater - reason = rival_toy_destruction + limit = { has_relation_rival = scope:bp1_yearly_9001_toy_hater } + set_relation_nemesis_effect = { + TARGET = scope:bp1_yearly_9001_toy_hater + REASON = rival_toy_destruction } } - else = { - set_relation_nemesis = { - target = scope:bp1_yearly_9001_toy_hater - reason = rival_toy_destruction - copy_reason = rival + else_if = { + limit = { + NOT = { has_relation_rival = scope:bp1_yearly_9001_toy_hater } + } + set_relation_rival_effect = { + TARGET = scope:bp1_yearly_9001_toy_hater + REASON = rival_toy_destruction } } create_character_memory = { type = avenged_my_toy - participants = { - destroyer = scope:bp1_yearly_9001_toy_hater - } + participants = { destroyer = scope:bp1_yearly_9001_toy_hater } } stress_and_fulfillment_impact = { compassionate = major_stress_impact_gain @@ -580,9 +576,7 @@ bp1_yearly.9005 = { name = bp1_yearly.9005.b trigger = { has_relation_rival = scope:bp1_yearly_9001_toy_hater - scope:bp1_yearly_9001_toy_hater = { - is_imprisoned_by = root - } + scope:bp1_yearly_9001_toy_hater = { is_imprisoned_by = root } } scope:bp1_yearly_9001_toy_hater = { death = { @@ -592,9 +586,7 @@ bp1_yearly.9005 = { } create_character_memory = { type = avenged_my_toy - participants = { - destroyer = scope:bp1_yearly_9001_toy_hater - } + participants = { destroyer = scope:bp1_yearly_9001_toy_hater } } stress_and_fulfillment_impact = { compassionate = major_stress_impact_gain @@ -1158,8 +1150,7 @@ bp1_yearly.9008 = { NOT = { has_character_flag = had_event_bp1_yearly_9008 } exists = var:my_doppelganger var:my_doppelganger = { is_available_ai_adult = yes } - NOR = { - has_relation_nemesis = var:my_doppelganger + NOT = { has_relation_rival = var:my_doppelganger } } @@ -1473,9 +1464,7 @@ bp1_yearly.9010 = { var:my_doppelganger = { is_available_ai_adult = yes } NOR = { has_relation_friend = var:my_doppelganger - has_relation_best_friend = var:my_doppelganger has_relation_lover = var:my_doppelganger - has_relation_soulmate = var:my_doppelganger } } @@ -1483,11 +1472,11 @@ bp1_yearly.9010 = { var:my_doppelganger = { save_scope_as = bp1_yearly_9007_doppelganger } if = { limit = { - NOT = { has_relation_nemesis = scope:bp1_yearly_9007_doppelganger } + can_set_relation_nemesis_trigger = { CHARACTER = scope:bp1_yearly_9007_doppelganger } } - set_relation_nemesis = { - target = scope:bp1_yearly_9007_doppelganger - reason = nemesis_doppelganger + set_relation_nemesis_effect = { + TARGET = scope:bp1_yearly_9007_doppelganger + REASON = nemesis_doppelganger } } } @@ -1837,7 +1826,6 @@ bp1_yearly.9015 = { OR = { is_consort_of = root has_relation_lover = root - has_relation_soulmate = root } } NOT = { rite = { rite_has_parameter = consanguinity_unrestricted_incest } } @@ -1862,7 +1850,6 @@ bp1_yearly.9015 = { OR = { is_consort_of = root has_relation_lover = root - has_relation_soulmate = root } } } @@ -1980,10 +1967,7 @@ bp1_yearly.9015 = { else_if = { # We're enemies, move closer to not being enemies limit = { NOT = { scope:bp1_yearly_9007_doppelganger = { is_consort_of = root } } - OR = { - has_relation_rival = scope:bp1_yearly_9007_doppelganger - has_relation_nemesis = scope:bp1_yearly_9007_doppelganger - } + has_relation_rival = scope:bp1_yearly_9007_doppelganger } scope:bp1_yearly_9007_doppelganger = { progress_towards_friend_effect = { @@ -1999,7 +1983,6 @@ bp1_yearly.9015 = { OR = { is_consort_of = root has_relation_lover = root - has_relation_soulmate = root } } } @@ -2032,7 +2015,6 @@ bp1_yearly.9015 = { OR = { is_consort_of = root has_relation_lover = root - has_relation_soulmate = root } } NOT = { rite = { rite_has_parameter = consanguinity_unrestricted_incest } } @@ -2055,7 +2037,6 @@ bp1_yearly.9015 = { OR = { is_consort_of = root has_relation_lover = root - has_relation_soulmate = root } } rite = { rite_has_parameter = divine_marriage_piety_gain_active } @@ -2072,7 +2053,6 @@ bp1_yearly.9015 = { OR = { is_consort_of = root has_relation_lover = root - has_relation_soulmate = root } } rite = { rite_has_parameter = consanguinity_unrestricted_incest } @@ -2833,12 +2813,12 @@ bp1_yearly.9018 = { } scope:bp1_yearly_9018_illegitimate_child = { - set_relation_nemesis = { - target = scope:bp1_yearly_9018_bully - involved_character = root - copy_reason = rival - reason = nemesis_fought_for_parents_compassion + root = { save_scope_as = relationship_reason_involved_character } + set_relation_nemesis_effect = { + TARGET = scope:bp1_yearly_9018_bully + REASON = nemesis_fought_for_parents_compassion } + clear_saved_scope = relationship_reason_involved_character duel = { skill = prowess @@ -3040,10 +3020,7 @@ bp1_yearly.9019 = { first_valid = { triggered_desc = { trigger = { - OR = { - has_relation_lover = scope:bp1_yearly_9019_lover - has_relation_soulmate = scope:bp1_yearly_9019_lover - } + has_relation_lover = scope:bp1_yearly_9019_lover } desc = bp1_yearly.9019.desc.lover } diff --git a/events/yearly_events/court_yearly_events.txt b/events/yearly_events/court_yearly_events.txt index 120dea5b7..aaaced2c8 100644 --- a/events/yearly_events/court_yearly_events.txt +++ b/events/yearly_events/court_yearly_events.txt @@ -1145,9 +1145,9 @@ court_yearly.6040 = { has_relation_potential_rival = scope:scrounger can_set_relation_rival_trigger = { CHARACTER = scope:scrounger } } - set_relation_rival = { - target = scope:scrounger - reason = rival_scrounger_kicked_out_of_court + set_relation_rival_effect = { + TARGET = scope:scrounger + REASON = rival_scrounger_kicked_out_of_court } } add_stress = medium_stress_loss @@ -2863,14 +2863,8 @@ court_yearly.7030 = { capital_county = { title_province = { OR = { - AND = { - building_common_tradeport_requirement_terrain = yes - NOT = { has_building = common_tradeport_08 } - } - AND = { - has_building_or_higher = city_01 - NOT = { has_building = guild_halls_08 } - } + province_has_district = market_district + province_has_district = guild_district } } } @@ -2878,32 +2872,9 @@ court_yearly.7030 = { remove_treasury_or_gold = medium_treasury_or_gold_value - if = { - limit = { - root.capital_county = { - title_province = { - building_common_tradeport_requirement_terrain = yes - } - } - } - root.capital_county = { - title_province = { - upgrade_tradeport = yes - } - } - } - else_if = { - limit = { - root.capital_county = { - title_province = { - has_building_or_higher = city_01 - } - } - } - root.capital_county = { - title_province = { - upgrade_guildhall = yes - } + root.capital_county = { + title_province = { + add_random_economic_building_effect = yes } } diff --git a/events/yearly_events/yearly_events_3.txt b/events/yearly_events/yearly_events_3.txt index 26ee85311..02b7546a8 100644 --- a/events/yearly_events/yearly_events_3.txt +++ b/events/yearly_events/yearly_events_3.txt @@ -3165,7 +3165,7 @@ yearly.3051 = { random_vassal = { limit = { yearly_3051_vassal_trigger = yes - NOT = { this = cp:councillor_steward } + NOT = { root.cp:councillor_steward ?= this } } random_held_title = { limit = { @@ -3234,9 +3234,9 @@ yearly.3051 = { } can_set_relation_rival_trigger = { CHARACTER = scope:vassal } } - set_relation_rival = { - target = scope:vassal - reason = rival_confiscated_title + set_relation_rival_effect = { + TARGET = scope:vassal + REASON = rival_confiscated_title } } else_if = { @@ -3409,7 +3409,7 @@ yearly.3061 = { trait = zealous add_treasury_or_gold = major_treasury_or_gold_value scope:county = { - change_development_level = -1 + change_prosperity_level = -1 change_county_control = 50 } } diff --git a/events/yearly_events/yearly_events_republic.txt b/events/yearly_events/yearly_events_republic.txt new file mode 100644 index 000000000..4744efeed --- /dev/null +++ b/events/yearly_events/yearly_events_republic.txt @@ -0,0 +1,6050 @@ +############################ +# Republican Yearly Events # +############################ + +namespace = yearly_republic + +######################################### +# Patrician family and relations events # +######################################### +# Bjorn Sundstrom (2026) # + +# Come to Bed yearly_republic.1001 +# Thorny Marriage yearly_republic.1002 +# Back Alley Honor yearly_republic.1003 +# Back Alley Honor: Return Letter yearly_republic.1004 +# Veto of the Masses yearly_republic.1005 +# Detente:Letter yearly_republic.1006 +# Detente yearly_republic.1007 +# Wolves in Merchant's clothing yearly_republic.1008 +# Salon of Secrets yearly_republic.1009 +# Patricians in the Rafters yearly_republic.1010 +# Summoned to Council yearly_republic.1011 +# The Doge's Procession yearly_republic.1012 +# Marriage to the sea yearly_republic.1013 +# Aligning the Faction yearly_republic.1014 +# Gold for Votes yearly_republic.1015 +# Beating the Vote Out of Them yearly_republic.1016 +# Philosopher-Kings yearly_republic.1017 + +################################################################################### + +############### +# COME TO BED # +############### + +yearly_republic.1001 = { + + type = character_event + title = yearly_republic.1001.t + desc = yearly_republic.1001.desc + + theme = family + override_background = study + + widgets = { + widget = { gui = event_window_widget_vfx_background_flickering_candlelight_dark container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_left_character_flickering_candlelight container = foreground_shader_vfx_container } + widget = { gui = event_window_widget_vfx_right_character_flickering_candlelight_dark container = foreground_shader_vfx_container } + } + + left_portrait = { + character = root + animation = writing + camera = camera_event_horse_right_facing_left_close + } + + right_portrait = { + character = root.primary_spouse + animation = beg + camera = camera_event_right_away_3_4 + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + exists = primary_spouse + NOT = { + has_trait = celibate + } + } + + immediate = { + if = { + limit = { + any_scheme = { + scheme_owner = root + } + } + random_scheme = { + limit = { scheme_owner = root } + save_scope_as = scheme + } + } + root.primary_spouse = { + save_scope_as = spouse_target + } + } + + ## "Better get us more candles, my love" + option = { + name = yearly_republic.1001.a + + trigger = { + NOT = { + house = { + has_house_aspiration_parameter = republic_no_ambition + } + } + } + + progress_towards_lover_effect = { + CHARACTER = root.primary_spouse + REASON = lovers_marriage_shared_labor + OPINION = default_lover_opinion + } + + if = { + limit = { + house = { has_house_aspiration_parameter = republic_commerce } + } + add_gold = minor_gold_value + } + else_if = { + limit = { + house = { has_house_aspiration_parameter = republic_aggrandizement } + } + add_prestige = medium_prestige_gain + } + else_if = { + limit = { + house = { has_house_aspiration_parameter = republic_communal } + } + custom_tooltip = { + text = yearly_republic.1001.communal + every_vassal = { + add_opinion = { + modifier = house_ambition_communal + opinion = 10 + target = root + } + } + } + } + else_if = { + limit = { + house = { has_house_aspiration_parameter = republic_signorial } + } + dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain } + } + else_if = { + limit = { + house = { has_house_aspiration_parameter = republic_agitation } + } + if = { + limit = { + any_scheme = { + scheme_owner = root + } + } + scope:scheme = { + add_scheme_progress = { + value = scheme_progress_gain + multiply = 5 + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + paranoid = medium_stress_impact_gain + # Loss + trusting = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + } + } + ## "I'm too behind on my duties. Leave me be" + option = { + name = yearly_republic.1001.b + + if = { + limit = { + any_scheme = { + scheme_owner = root + } + } + scope:scheme = { + add_scheme_progress = { + value = scheme_progress_gain + multiply = 5 + } + } + } + else = { + add_stewardship_lifestyle_xp = medium_lifestyle_experience + } + + reverse_add_opinion = { + modifier = rebuffed_opinion + opinion = -15 + target = root.primary_spouse + } + + stress_and_fulfillment_impact = { + # Gain + compassionate = medium_stress_impact_gain + humble = minor_stress_impact_gain + # Loss + callous = medium_stress_impact_loss + shy = minor_stress_impact_loss + impatient = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = humble + } + } + } + } + ## "Go to bed - I'll be there soon, honey" + option = { + name = yearly_republic.1001.c + + progress_towards_lover_effect = { + CHARACTER = root.primary_spouse + REASON = lovers_marriage_shared_labor + OPINION = default_lover_opinion + } + + had_sex_with_effect = { + CHARACTER = root.primary_spouse + PREGNANCY_CHANCE = pregnancy_chance + } + + stress_and_fulfillment_impact = { + # Gain + diligent = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + # Loss + fickle = minor_stress_impact_loss + content = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = diligent + has_trait = ambitious + } + } + modifier = { + add = 50 + has_trait = lustful + } + } + } +} + +################### +# THORNY MARRIAGE # +################### + +yearly_republic.1002 = { + + type = character_event + title = yearly_republic.1002.t + desc = yearly_republic.1002.desc + + theme = family + + left_portrait = { + character = root + animation = anger + } + + right_portrait = { + character = root.primary_spouse + animation = writing + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + exists = primary_spouse + primary_spouse.house ?= { + this != root.house + house_head = { + government_has_flag = government_is_republic + } + } + primary_spouse = { + opinion = { + target = root + value <= -20 + } + } + } + + immediate = { + root.primary_spouse = { + save_scope_as = spouse_target + } + root.primary_spouse.house = { + save_scope_as = spouse_house + house_head = { + save_scope_as = spouse_house_leader + } + } + hidden_effect = { + house = { + change_house_relation_effect = { + HOUSE = scope:spouse_target.house + VALUE = house_relation_damage_medium_value + REASON = thorny + CHAR = root + TARGET_CHAR = scope:spouse_house_leader + TITLE = scope:dummy_gender + } + } + } + } + + # "I will buy the gratitude of [spouse_target.GetFirstNameNoTooltip] and [spouse_target.GetHerHis] house." + option = { + name = yearly_republic.1002.a + + trigger = { + short_term_gold >= medium_gold_value + } + + show_as_unavailable = { always = yes } + remove_short_term_gold = medium_gold_value + + house = { + change_house_relation_effect = { + HOUSE = scope:spouse_target.house + VALUE = house_relation_improve_medium_value + REASON = bribery_good + CHAR = root + TARGET_CHAR = scope:spouse_house_leader + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + # Gain + greedy = medium_stress_impact_gain + # Loss + cynical = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + has_trait = greedy + factor = 0 + } + modifier = { + short_term_treasury_or_gold <= massive_gold_value + factor = 0 + } + } + } + + # "I will forge [spouse_target.GetHerHis] letters to sing my praises." + option = { + name = yearly_republic.1002.b + + duel = { + skill = intrigue + target = scope:spouse_target + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1002.tt.falsifying_success.desc + send_interface_toast = { + title = yearly_republic.1002.falsifying_success.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:spouse_target + house = { + change_house_relation_effect = { + HOUSE = scope:spouse_target.house + VALUE = house_relation_improve_medium_value + REASON = falsify_good + CHAR = root + TARGET_CHAR = scope:spouse_house_leader + TITLE = scope:dummy_gender + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1002.tt.falsifying_failure.desc + send_interface_toast = { + title = yearly_republic.1002.falsifying_failure.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:spouse_target + house = { + change_house_relation_effect = { + HOUSE = scope:spouse_target.house + VALUE = house_relation_damage_medium_value + REASON = falsify_bad + CHAR = root + TARGET_CHAR = scope:spouse_house_leader + TITLE = scope:dummy_gender + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + humble = minor_stress_impact_gain + # Loss + impatient = minor_stress_impact_loss + deceitful = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + intrigue <= good_skill_level + } + modifier = { + factor = 0 + OR = { + has_trait = honest + has_trait = humble + } + } + } + } + + # "I swear to [ROOT.Char.GetFaith.random_GoodGodNames] to better myself in your eyes." + option = { + name = yearly_republic.1002.c + + duel = { + skills = { prowess diplomacy stewardship learning } + value = high_skill_rating + 55 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1002.tt.impress_spouse_success.desc + send_interface_toast = { + title = yearly_republic.1002.impress_spouse_success.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:spouse_target + + progress_towards_lover_effect = { + CHARACTER = root.primary_spouse + REASON = lovers_marriage_shared_labor + OPINION = default_lover_opinion + } + + house = { + change_house_relation_effect = { + HOUSE = scope:spouse_target.house + VALUE = house_relation_improve_medium_value + REASON = falsify_good + CHAR = root + TARGET_CHAR = scope:spouse_house_leader + TITLE = scope:dummy_gender + } + } + } + } + 45 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1002.tt.impress_spouse_failure.desc + send_interface_toast = { + title = yearly_republic.1002.impress_spouse_failure.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:spouse_target + house = { + change_house_relation_effect = { + HOUSE = scope:spouse_target.house + VALUE = house_relation_damage_medium_value + REASON = falsify_bad + CHAR = root + TARGET_CHAR = scope:spouse_house_leader + TITLE = scope:dummy_gender + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + content = minor_stress_impact_gain + fickle = minor_stress_impact_gain + arrogant = medium_stress_impact_gain + # Loss + diligent = medium_stress_impact_loss + humble = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = content + has_trait = fickle + has_trait = arrogant + } + } + } + } + + # "They can think what they will." + option = { + name = yearly_republic.1002.d + + stress_and_fulfillment_impact = { + # Gain + diligent = medium_stress_impact_gain + humble = minor_stress_impact_gain + ambitious = minor_stress_impact_gain + # Loss + content = minor_stress_impact_loss + fickle = minor_stress_impact_loss + arrogant = medium_stress_impact_loss + } + + ai_chance = { + base = 25 + modifier = { + factor = 0 + OR = { + has_trait = diligent + has_trait = humble + has_trait = ambitious + } + } + } + } +} + +#################### +# BACK ALLEY HONOR # +#################### + +scripted_trigger gdp_potential_street_brawler_trigger = { + is_male = yes + is_married = no + is_clergy = no + age = { 16 $MAX_AGE$ } + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + top_liege = root.top_liege +} + +scripted_trigger gdp_house_is_hostile_to_root_house_trigger = { + house ?= { + this != root.house + any_house_relation = { + any_relation_house = { this = root.house } + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } +} + +scripted_trigger gdp_has_personal_animosity_trigger = { + has_relation_rival = $CHARACTER$ +} + +scripted_trigger gdp_can_supply_rival_house_brawler_trigger = { + any_close_or_extended_family_member = { + NOR = { + is_close_or_extended_family_of = root + house ?= root.house + } + gdp_potential_street_brawler_trigger = { MAX_AGE = 25 } + house.house_head.top_liege ?= root.top_liege + OR = { + gdp_house_is_hostile_to_root_house_trigger = yes + gdp_has_personal_animosity_trigger = { CHARACTER = $BRAWLER$ } + } + } +} + +yearly_republic.1003 = { + + type = character_event + title = yearly_republic.1003.t + desc = yearly_republic.1003.desc + + theme = family + override_background = gdp_western_merchant_domicile + + left_portrait = { + character = scope:spouse_target + animation = anger + camera = camera_event_center_coronation_kneeling + } + + right_portrait = { + character = scope:rook_01 + animation = severelywounded + + } + + lower_center_portrait = { + character = scope:rook_02 + animation = aggressive_axe + camera = camera_shoulders + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_ai = no + exists = primary_spouse + any_close_or_extended_family_member = { + gdp_potential_street_brawler_trigger = { MAX_AGE = 27 } + save_temporary_scope_as = potential_rook_01 + } + top_liege = { + OR = { + gdp_can_supply_rival_house_brawler_trigger = { BRAWLER = scope:potential_rook_01 } + any_vassal = { + gdp_can_supply_rival_house_brawler_trigger = { BRAWLER = scope:potential_rook_01 } + } + } + } + } + + immediate = { + primary_spouse = { + save_scope_as = spouse_target + } + #1# Let's get ourselves a suitable young ruffian from our family: + random_close_or_extended_family_member = { + limit = { + is_child_of = root + gdp_potential_street_brawler_trigger = { MAX_AGE = 27 } + } + alternative_limit = { + gdp_potential_street_brawler_trigger = { MAX_AGE = 27 } + } + save_scope_as = rook_01 + } + #2# And a ruffian from another family + top_liege = { + if = { + limit = { gdp_can_supply_rival_house_brawler_trigger = { BRAWLER = scope:rook_01 } } + add_to_temporary_list = rook_02_source_list + } + every_vassal = { + limit = { gdp_can_supply_rival_house_brawler_trigger = { BRAWLER = scope:rook_01 } } + add_to_temporary_list = rook_02_source_list + } + } + random_in_list = { + list = rook_02_source_list + random_close_or_extended_family_member = { + limit = { + NOR = { + is_close_or_extended_family_of = root + house ?= root.house + } + gdp_potential_street_brawler_trigger = { MAX_AGE = 25 } + house.house_head.top_liege ?= root.top_liege + gdp_has_personal_animosity_trigger = { CHARACTER = scope:rook_01 } + } + alternative_limit = { + NOR = { + is_close_or_extended_family_of = root + house ?= root.house + } + gdp_potential_street_brawler_trigger = { MAX_AGE = 25 } + house.house_head.top_liege ?= root.top_liege + gdp_house_is_hostile_to_root_house_trigger = yes + } + save_scope_as = rook_02 + } + } + scope:rook_02.house.house_head = { + save_scope_as = other_house_character_01 + } + scope:rook_01 = { + increase_wounds_no_death_effect = { REASON = fight } + } + scope:rook_02 = { + increase_wounds_no_death_effect = { REASON = fight } + } + hidden_effect = { + house = { + change_house_relation_effect = { + HOUSE = scope:rook_02.house + VALUE = house_relation_damage_minor_value + REASON = street_combat + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + } + } + + # "Ah, the follies of youth" + option = { + name = yearly_republic.1003.a + + stress_and_fulfillment_impact = { + # Gain + content = minor_stress_impact_gain + lazy = minor_stress_impact_gain + # Loss + wrathful = minor_stress_impact_loss + sadistic = minor_stress_impact_loss + cynical = minor_stress_impact_loss + } + + ai_chance = { + base = 25 + modifier = { + factor = 100 + OR = { + has_trait = lazy + has_trait = content + has_trait = temperate + } + } + } + } + + # "Clearly [rook_02.GetNameNoTooltip] was at fault. We demand reparations!" + option = { + name = yearly_republic.1003.b + + custom_tooltip = demand_reparation_for_fight_desc + + house = { + change_house_relation_effect = { + HOUSE = scope:rook_02.house + VALUE = house_relation_damage_medium_value + REASON = street_combat + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + + add_prestige = minor_prestige_gain + + trigger_event = { + id = yearly_republic.1004 + days= 3 + } + + stress_and_fulfillment_impact = { + # Gain + craven = minor_stress_impact_gain + content = minor_stress_impact_gain + generous = minor_stress_impact_gain + # Loss + vengeful = minor_stress_impact_loss + greedy = minor_stress_impact_loss + arrogant = minor_stress_impact_loss + } + ai_chance = { + base = 75 + modifier = { + factor = 0 + OR = { + has_trait = craven + has_trait = humble + } + } + modifier = { + add = 50 + has_trait = greedy + } + modifier = { + add = 100 + has_trait = vengeful + } + } + } + + # "We shall send a gift to [rook_02.GetDynastyHouseName] to smooth the waters" + option = { + name = yearly_republic.1003.c + + custom_tooltip = pay_reparation_for_fight_desc + + pay_short_term_gold = { + target = scope:other_house_character_01 + gold = minor_gold_value + } + + house = { + change_house_relation_effect = { + HOUSE = scope:rook_02.house + VALUE = house_relation_improve_medium_value + REASON = street_combat + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + # Gain + fickle = minor_stress_impact_gain + content = minor_stress_impact_gain + lustful = minor_stress_impact_gain + # Loss + diligent = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + wrathful = minor_stress_impact_loss + vengeful = minor_stress_impact_loss + + } + + ai_chance = { + base = 100 + modifier = { + factor = 100 + OR = { + has_trait = compassionate + has_trait = forgiving + has_trait = craven + } + } + modifier = { + add = 0 + OR = { + has_trait = wrathful + has_trait = vengeful + } + } + } + + } +} + +################################### +# BACK ALLEY HONOR: RETURN LETTER # +################################### + +scripted_trigger ai_accept_demand_or_not_trigger = { + OR = { + scope:other_house_character_01 = { + has_dread_level_towards = { + target = root + level >= 2 + } + } + holder.house.house_power_score > scope:other_house_character_01.house.house_power_score + } +} + +yearly_republic.1004 = { + + type = letter_event + opening = yearly_republic.1004.t + sender = scope:other_house_character_01 + desc = { + first_valid = { + triggered_desc = { + trigger = { + OR = { + ai_accept_demand_or_not_trigger = yes + scope:other_house_character_01 = { + NOR = { + has_trait = vengeful + has_trait = wrathful + } + OR = { + has_trait = gregarious + has_trait = trusting + has_trait = compassionate + } + } + } + } + desc = yearly_republic.1004.b.desc + } + desc = yearly_republic.1004.a.desc + } + } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + + immediate = { + + } + + # "They will regret this show of disrespect!" + option = { + name = yearly_republic.1004.a + + trigger = { + NOT = { + ai_accept_demand_or_not_trigger = yes + } + } + + progress_towards_rival_effect = { + REASON = rival_unjust_demands + CHARACTER = scope:other_house_character_01 + OPINION = -20 + } + + house = { + change_house_relation_effect = { + HOUSE = scope:rook_02.house + VALUE = house_relation_damage_medium_value + REASON = street_combat + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + # Gain + craven = medium_stress_impact_gain + # Loss + wrathful = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = craven + has_trait = humble + } + } + } + } + + # "Fine, we will get our restitution in due time." + option = { + name = yearly_republic.1004.b + + trigger = { + NOT = { + ai_accept_demand_or_not_trigger = yes + } + } + + house = { + change_house_relation_effect = { + HOUSE = scope:rook_02.house + VALUE = house_relation_damage_minor_value + REASON = street_combat + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + # Gain + impatient = medium_stress_impact_gain + # Loss + patient = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = wrathful + has_trait = vengeful + } + } + } + } + + # "We accept our due." + option = { + name = yearly_republic.1004.c + + trigger = { + ai_accept_demand_or_not_trigger = yes + } + + scope:other_house_character_01 = { + pay_short_term_gold = { + target = root + gold = medium_gold_value + } + } + + stress_and_fulfillment_impact = { + # Gain + # Loss + greedy = medium_stress_impact_loss + arrogant = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + OR = { + has_trait = greedy + has_trait = arrogant + } + } + } + } + + # "Let this be the end of discord between us." + option = { + name = yearly_republic.1004.d + + trigger = { + ai_accept_demand_or_not_trigger = yes + } + + house = { + change_house_relation_effect = { + HOUSE = scope:other_house_character_01.house + VALUE = house_relation_improve_major_value + REASON = street_combat + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + # Gain + callous = medium_stress_impact_gain + vengeful = minor_stress_impact_gain + # Loss + compassionate = medium_stress_impact_loss + humble = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + OR = { + has_trait = gregarious + has_trait = humble + } + } + } + } +} + +###################### +# VETO OF THE MASSES # +###################### + +yearly_republic.1005 = { + + type = character_event + title = yearly_republic.1005.t + desc = yearly_republic.1005.desc + override_background = gdp_western_merchant_domicile + theme = republic + + left_portrait = { + character = root + animation = thinking + camera = camera_body + } + + right_portrait = { + character = scope:house_member_01 + animation = aggressive_unarmed + camera = camera_body + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + top_liege = { + any_vassal = { + house ?= { + this != root.house + any_house_relation = { + any_relation_house = { + this = root.house + } + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + } + } + any_close_or_extended_family_member = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + top_liege = root.top_liege + } + } + + immediate = { + top_liege = { + capital_county = { + save_scope_as = capital_01 + } + random_vassal = { + limit = { + house ?= { + this != root.house + any_house_relation = { + any_relation_house = { + this = root.house + } + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = feud + } + } + } + } + save_scope_as = other_house_character_01 + } + } + random_close_or_extended_family_member = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + top_liege = root.top_liege + } + save_scope_as = house_member_01 + } + } + + # "No, [ROOT.Char.Custom2('RelationToMeShort', house_member_01)]. It's time to sit down with [other_house_character_01.GetDynastyHouseName]." + option = { + name = yearly_republic.1005.a + + custom_tooltip = offer_a_sitdown_desc + + add_piety = minor_piety_gain + + trigger_event = { + id = yearly_republic.1006 + days= 7 + } + + stress_and_fulfillment_impact = { + # Gain + paranoid = medium_stress_impact_gain + # Loss + trusting = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = paranoid + } + } + } + + # "My oratory skills will put the blame on house [other_house_character_01.GetDynastyHouseName]." + option = { + name = yearly_republic.1005.b + + duel = { + skills = { diplomacy intrigue } + value = high_skill_rating + 55 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1005.tt.oratory_blame.desc + send_interface_toast = { + title = yearly_republic.1005.tt.oratory_blame.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:other_house_character_01 + dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain } + + } + } + 45 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1005.tt.oratory_blame_failure.desc + send_interface_toast = { + title = yearly_republic.1005.tt.oratory_blame_failure.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:other_house_character_01 + add_prestige = minor_prestige_loss + } + } + } + + house = { + change_house_relation_effect = { + HOUSE = scope:other_house_character_01.house + VALUE = house_relation_damage_minor_value + REASON = house_blamed + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + + stress_and_fulfillment_impact = { + # Gain + compassionate = medium_stress_impact_gain + humble = minor_stress_impact_gain + # Loss + callous = medium_stress_impact_loss + shy = minor_stress_impact_loss + impatient = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = humble + } + } + } + } + + # "Guards! Drive these rabble from my door." + option = { + name = yearly_republic.1005.c + + add_dread = minor_dread_gain + + stress_and_fulfillment_impact = { + # Gain + compassionate = medium_stress_impact_gain + forgiving = minor_stress_impact_gain + # Loss + fickle = minor_stress_impact_loss + wrathful = medium_stress_impact_loss + sadistic = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = forgiving + } + } + modifier = { + add = 50 + OR = { + has_trait = wrathful + has_trait = sadistic + } + } + } + } +} + +################## +# DETENTE:Letter # +################## + +yearly_republic.1006 = { + + type = letter_event + opening = yearly_republic.1006.t + sender = scope:other_house_character_01 + desc = { + first_valid = { + triggered_desc = { + trigger = { + OR = { + ai_accept_demand_or_not_trigger = yes + scope:other_house_character_01 = { + NOT = { + has_trait = vengeful + has_trait = wrathful + } + OR = { + has_trait = gregarious + has_trait = trusting + has_trait = compassionate + } + } + } + } + desc = yearly_republic.1006.a.desc + } + desc = yearly_republic.1006.b.desc + } + } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + + immediate = { + + } + + # "Excellent!" + option = { + name = yearly_republic.1006.a + + trigger = { + OR = { + ai_accept_demand_or_not_trigger = yes + scope:other_house_character_01 = { + NOT = { + has_trait = vengeful + has_trait = wrathful + } + OR = { + has_trait = gregarious + has_trait = trusting + has_trait = compassionate + } + } + } + } + + trigger_event = { + id = yearly_republic.1007 + days= 3 + } + + stress_and_fulfillment_impact = { + # Gain + # Loss + } + + ai_chance = { + base = 100 + } + } + + # "Damnation!" + option = { + name = yearly_republic.1006.b + + trigger = { + NOR = { + ai_accept_demand_or_not_trigger = yes + scope:other_house_character_01 = { + NOT = { + has_trait = vengeful + has_trait = wrathful + } + OR = { + has_trait = gregarious + has_trait = trusting + has_trait = compassionate + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + # Loss + } + + ai_chance = { + base = 100 + } + } +} + +########### +# DETENTE # +########### + +yearly_republic.1007 = { + + type = character_event + title = yearly_republic.1007.t + desc = yearly_republic.1007.desc + window = big_event_window + override_background = western_tavern + + theme = republic + + left_portrait = { + character = root + animation = debating + } + + right_portrait = { + character = scope:other_house_character_01 + animation = chaplain + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + + immediate = { + + } + + # "This feud is bad for business" + option = { + name = yearly_republic.1007.a + + duel = { + skill = stewardship + value = high_skill_rating + 55 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1007.tt.detente_business.desc + send_interface_toast = { + title = yearly_republic.1007.tt.detente_business.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:other_house_character_01 + house ?= { + set_house_relation = { + target = scope:other_house_character_01.house + level = neutral + description = yearly_republic.1007.detente_business.change.desc + } + } + + } + } + 45 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1007.tt.detente_business_failure.desc + send_interface_toast = { + title = yearly_republic.1007.tt.detente_business_failure.toast + type = event_toast_effect_neutral + right_icon = scope:other_house_character_01 + house = { + change_house_relation_effect = { + HOUSE = scope:other_house_character_01.house + VALUE = house_relation_improve_medium_value + REASON = business_argument + CHAR = root + TARGET_CHAR = scope:other_house_character_01 + TITLE = scope:dummy_gender + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + vengeful = minor_stress_impact_gain + wrathful = minor_stress_impact_gain + stubborn = minor_stress_impact_gain + # Loss + greedy = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = vengeful + has_trait = wrathful + has_trait = stubborn + } + } + } + } + + # "We should make peace, as Christians." + option = { + name = yearly_republic.1007.b + + trigger = { + OR = { + piety_level >= medium_piety_level + has_trait = zealous + } + } + + trait = zealous + reason = piety_level + add_piety = medium_piety_loss + + house ?= { + set_house_relation = { + target = scope:other_house_character_01.house + level = neutral + description = yearly_republic.1007.piety.change.desc + } + } + + stress_and_fulfillment_impact = { + # Gain + cynical = medium_stress_impact_gain + wrathful = minor_stress_impact_gain + # Loss + zealous = medium_stress_impact_loss + just = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = cynical + } + modifier = { + add = 100 + has_trait = zealous + } + modifier = { + factor = 0 + piety <= medium_piety_value + } + } + } + + # "Blood has been spilled, let blood tie us together" + option = { + name = yearly_republic.1007.c + + trigger = { + custom_tooltip = { + text = yearly_republic.1007.c.tt.suitable_pair + house ?= { + any_house_member = { + is_adult = yes + is_married = no + is_betrothed = no + can_marry_trigger = yes + save_temporary_scope_as = temp_spouse_1 + scope:other_house_character_01.house ?= { + any_house_member = { + is_married = no + is_betrothed = no + can_marry_trigger = yes + can_marry_character_trigger = { CHARACTER = scope:temp_spouse_1 } + } + } + } + } + } + } + + house = { + random_house_member = { + limit = { + is_adult = yes + is_married = no + is_betrothed = no + can_marry_trigger = yes + save_temporary_scope_as = temp_spouse_1 + scope:other_house_character_01.house ?= { + any_house_member = { + is_married = no + is_betrothed = no + can_marry_trigger = yes + can_marry_character_trigger = { CHARACTER = scope:temp_spouse_1 } + } + } + } + save_scope_as = spouse_1 + } + } + + scope:other_house_character_01.house = { + random_house_member = { + limit = { + is_adult = yes + is_married = no + is_betrothed = no + can_marry_trigger = yes + can_marry_character_trigger = { CHARACTER = scope:spouse_1 } + } + save_scope_as = spouse_2 + } + } + + marry_on_realm_law = { + SPOUSE_1 = scope:spouse_1 + SPOUSE_2 = scope:spouse_2 + } + + # 4) End the feud + house ?= { + set_house_relation = { + target = scope:other_house_character_01.house + level = neutral + description = yearly_republic.1007.detente_marriage.change.desc + } + } + stress_and_fulfillment_impact = { + # Gain + vengeful = medium_stress_impact_gain + # Loss + gregarious = medium_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = vengeful + } + modifier = { + add = 50 + has_trait = gregarious + } + } + } + + # "Let's settle it with steel, here and now!" + option = { + name = yearly_republic.1007.d + add_internal_flag = dangerous + + trigger = { + NOT = { has_trait = craven } + } + + add_intrigue_lifestyle_xp = medium_lifestyle_xp + add_prestige = medium_prestige_loss + + duel = { + skill = prowess + target = scope:other_house_character_01 + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1007.duel_win.desc + custom_tooltip = { + text = yearly_republic.1007.duel_win.custom + random_list = { + 50 = { + root = { + send_interface_toast = { + title = yearly_republic.1007.duel_win.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:other_house_character_01 + scope:other_house_character_01 = { + increase_wounds_no_death_effect = { REASON = fight } + } + } + } + } + 50 = { + root = { + send_interface_toast = { + title = yearly_republic.1007.duel_win.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:other_house_character_01 + + scope:other_house_character_01 = { + death = { + death_reason = death_ambushed_during_detente + killer = root + } + every_child = { + limit = { + is_male = yes + is_adult = yes + } + set_relation_nemesis = root + } + } + } + } + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1007.duel_loss.desc + scope:other_house_character_01 = { + custom_tooltip = { + text = yearly_republic.1007.duel_loss.custom + random_list = { + 75 = { + root = { + send_interface_toast = { + title = yearly_republic.1007.duel_loss.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:other_house_character_01 + root = { + increase_wounds_no_death_effect = { REASON = fight } + } + } + } + } + 35 = { + root = { + send_interface_toast = { + title = yearly_republic.1007.duel_loss.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:other_house_character_01 + root = { + death = { + death_reason = death_ambushed_during_detente + killer = scope:other_house_character_01 + } + every_child = { + limit = { + is_male = yes + is_adult = yes + } + set_relation_nemesis = scope:other_house_character_01 + } + } + } + } + } + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + forgiving = medium_stress_impact_gain + just = medium_stress_impact_gain + # Loss + deceitful = major_stress_impact_loss + vengeful = major_stress_impact_loss + wrathful = major_stress_impact_loss + } + + ai_chance = { + base = 25 + modifier = { + factor = 0 + OR = { + has_trait = honest + has_trait = forgiving + has_trait = just + } + } + modifier = { + add = 75 + OR = { + has_trait = wrathful + has_trait = vengeful + has_trait = brave + } + } + } + } +} + +################################# +# Wolves in Merchant's clothing # +################################# + +yearly_republic.1008 = { + + type = character_event + title = yearly_republic.1008.t + desc = yearly_republic.1008.desc + + theme = republic + + left_portrait = { + character = root + animation = chancellor + } + + lower_center_portrait = { + character = scope:bandit_01 + } + + lower_right_portrait = { + character = scope:other_patrician_01 + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + domicile ?= { + domicile_location ?= { + OR = { + geographical_region = world_middle_east_jerusalem + geographical_region = world_africa_north + geographical_region = world_europe + } + } + } + is_ai = no + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + top_liege = { + any_vassal = { + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_powerful_vassal = yes + } + } + } + + immediate = { + top_liege = { + random_vassal = { + limit = { + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_powerful_vassal = yes + } + save_scope_as = other_patrician_01 + } + } + create_character = { + template = bandit_captain_character + location = root.location + save_scope_as = bandit_01 + } + hidden_effect = { + scope:bandit_01 = { add_short_term_gold = major_gold_value } + scope:other_patrician_01 = { add_courtier = scope:bandit_01 } + } + + } + + # "Hire the captain to work for you, forthwith." + option = { + name = yearly_republic.1008.a + add_courtier = scope:bandit_01 + scope:bandit_01 = { + add_opinion = { + modifier = grateful_opinion + opinion = 30 + target = root + } + } + + stress_and_fulfillment_impact = { + # Gain + just = medium_stress_impact_gain + # Loss + greedy = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = just + } + modifier = { + add = 50 + OR = { + has_trait = greedy + has_trait = ambitious + } + } + } + } + + # "Threaten the captain to share his loot." + option = { + name = yearly_republic.1008.b + + scope:bandit_01 = { + add_opinion = { + modifier = scared_opinion + opinion = -20 + target = root + } + set_relation_grudge = { + target = root + reason = grudge_took_loot_desc + } + pay_short_term_gold = { + target = root + gold = major_gold_value + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = minor_stress_impact_gain + compassionate = minor_stress_impact_gain + # Loss + greedy = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = honest + has_trait = compassionate + } + } + modifier = { + add = 50 + has_trait = greedy + } + } + } + + # "Threaten [other_patrician_01.GetShortUINameNoTooltip] to gain a hook." + option = { + name = yearly_republic.1008.c + + add_dread = minor_dread_gain + + if = { + limit = { + can_add_hook = { + target = scope:other_patrician_01 + type = threat_hook + } + } + add_hook = { + target = scope:other_patrician_01 + type = threat_hook + } + } + + scope:other_patrician_01 = { + add_opinion = { + modifier = scared_opinion + opinion = -20 + target = root + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + # Loss + deceitful = minor_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = honest + } + modifier = { + add = 50 + OR = { + has_trait = deceitful + has_trait = ambitious + } + } + } + } +} + +##################### +# Salon of Secrets # +##################### + +yearly_republic.1009 = { + + type = character_event + title = yearly_republic.1009.t + desc = yearly_republic.1009.desc + override_background = ep3_byzantine_feast + + theme = republic + + left_portrait = { + character = root + animation = eavesdrop + } + + right_portrait = { + character = scope:relation_01 + animation = holding_tally_stick + } + + lower_center_portrait = { + character = scope:patrician_spouse_01 + } + + lower_right_portrait = { + character = scope:patrician_husband_01 + } + + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_independent_ruler = no + top_liege = { + any_vassal = { + is_ai = yes + this != root + is_powerful_vassal = yes + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + any_spouse = { + this != root + is_ai = yes + has_trait = deceitful + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + save_temporary_scope_as = patrician_spouse_01_temp + } + save_temporary_scope_as = patrician_husband_01_temp + } + } + OR = { + any_relation = { + type = friend + type = best_friend + type = lover + type = soulmate + this != scope:patrician_spouse_01_temp + this != scope:patrician_husband_01_temp + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_close_or_extended_family_member = { + this != root + this != scope:patrician_spouse_01_temp + this != scope:patrician_husband_01_temp + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_spouse = { + this != scope:patrician_spouse_01_temp + this != scope:patrician_husband_01_temp + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + } + + immediate = { + top_liege = { + random_vassal = { + limit = { + is_ai = yes + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + is_powerful_vassal = yes + any_spouse = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root + has_trait = deceitful + } + } + save_scope_as = patrician_husband_01 + random_spouse = { + limit = { + is_ai = yes + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root + has_trait = deceitful + } + save_scope_as = patrician_spouse_01 + } + } + } + every_relation = { + type = friend + type = best_friend + type = lover + type = soulmate + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != scope:patrician_spouse_01 + this != scope:patrician_husband_01 + } + add_to_list = relation_candidates + } + every_close_or_extended_family_member = { + limit = { + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != scope:patrician_spouse_01 + this != scope:patrician_husband_01 + } + add_to_list = relation_candidates + } + every_spouse = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != scope:patrician_spouse_01 + this != scope:patrician_husband_01 + } + add_to_list = relation_candidates + } + random_in_list = { + list = relation_candidates + weight = { + base = 1 + modifier = { + add = 30 + has_relation_soulmate = root + } + modifier = { + add = 15 + OR = { + has_relation_best_friend = root + has_relation_friend = root + has_relation_lover = root + is_primary_heir_of = root + } + } + modifier = { + add = 5 + OR = { + is_child_of = root + is_grandchild_of = root + } + } + modifier = { + factor = 1.5 + opinion = { + target = root + value >= 50 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = relation_01 + } + hidden_effect = { + scope:patrician_spouse_01 = { + give_spy_secret_effect = { TARGET = root } + random_secret = { + type = secret_spy + limit = { + secret_target = root + } + save_scope_as = spouse_secret_01 + reveal_to_without_events_effect = { + CHARACTER = root + } + } + } + scope:patrician_husband_01 = { + give_spy_secret_effect = { TARGET = root } + random_secret = { + type = secret_spy + limit = { + secret_target = root + } + save_scope_as = husband_secret_01 + reveal_to_without_events_effect = { + CHARACTER = root + } + } + } + } + top_liege = { + random_vassal = { + limit = { + is_powerful_vassal = yes + any_secret = { NOT = { is_known_by = root } } + NOR = { + this = scope:relation_01 + this = root + this = scope:patrician_husband_01 + this = scope:patrician_spouse_01 + } + } + alternative_limit = { + has_any_secrets = yes + NOR = { + this = scope:relation_01 + this = root + this = scope:patrician_husband_01 + this = scope:patrician_spouse_01 + } + } + save_scope_as = potential_secret_holder_01 + random_secret = { + limit = { + NOT = { is_known_by = root } + } + save_scope_as = potential_secret_01 + } + } + } + } + + # "I must warn everyone of this wicked scheme!" + option = { + name = yearly_republic.1009.a + + scope:spouse_secret_01 = { + expose_secret = root + } + scope:husband_secret_01 = { + expose_secret = root + } + + top_liege = { + add_opinion = { + modifier = spy_opinion + target = scope:patrician_spouse_01 + } + add_opinion = { + modifier = spy_opinion + target = scope:patrician_husband_01 + } + every_vassal = { + limit = { + this != root + this != scope:patrician_husband_01 + this != scope:patrician_spouse_01 + government_has_flag = government_is_republic + domicile ?= { + is_domicile_type = merchant_company + } + any_held_title = { is_noble_family_title = yes } + } + custom = custom.every_other_patrician + custom_tooltip = { + text = yearly_republic.1009.a.tt + add_opinion = { + modifier = grateful_opinion + opinion = 20 + target = root + } + add_opinion = { + modifier = spy_opinion + target = scope:patrician_spouse_01 + } + add_opinion = { + modifier = spy_opinion + target = scope:patrician_husband_01 + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + shy = minor_stress_impact_gain + # Loss + compassionate = minor_stress_impact_loss + honest = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = shy + } + modifier = { + add = 50 + OR = { + has_trait = honest + has_trait = compassionate + } + } + } + } + + # "What a great Idea! I should to that myself." + option = { + name = yearly_republic.1009.b + trigger = { + exists = scope:potential_secret_01 + short_term_gold >= medium_gold_value + } + show_as_unavailable = { always = yes } + + remove_short_term_gold = medium_gold_value + + add_intrigue_lifestyle_xp = medium_lifestyle_xp + + flavor = yearly_republic.1009.flavor + + send_interface_toast = { + title = yearly_republic.1009.b.secret_learned + type = event_toast_effect_good + left_icon = scope:potential_secret_holder_01 + right_icon = root + scope:potential_secret_01 = { + reveal_to = root + } + } + + give_spy_secret_effect = { TARGET = scope:potential_secret_holder_01 } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + just = medium_stress_impact_gain + # Loss + deceitful = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + short_term_gold < medium_gold_value + } + modifier = { + factor = 0 + has_trait = honest + } + modifier = { + add = 50 + OR = { + has_trait = deceitful + has_trait = ambitious + } + } + } + } + + # "Blackmail [patrician_spouse_01.GetShortUINameNoTooltip] to keep her secret." + option = { + name = yearly_republic.1009.c + add_intrigue_lifestyle_xp = medium_lifestyle_xp + + duel = { + skill = intrigue + target = scope:patrician_spouse_01 + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1009.c.success.desc + send_interface_toast = { + title = yearly_republic.1009.c.success.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:patrician_husband_01 + add_hook = { + type = strong_blackmail_hook + target = scope:patrician_husband_01 + secret = scope:husband_secret_01 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1009.c.failure.desc + send_interface_toast = { + title = yearly_republic.1009.c.failure.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:patrician_husband_01 + progress_towards_rival_effect = { + REASON = rival_attempted_blackmail + CHARACTER = scope:patrician_husband_01 + OPINION = -20 + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + compassionate = medium_stress_impact_gain + # Loss + deceitful = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = honest + has_trait = compassionate + } + } + modifier = { + add = 50 + OR = { + has_trait = deceitful + has_trait = ambitious + } + } + modifier = { + add = 50 + intrigue >= scope:patrician_spouse_01.intrigue + } + } + } +} + +############################# +# Patricians in the Rafters # +############################# + +yearly_republic.1010 = { + + type = character_event + title = yearly_republic.1010.t + desc = yearly_republic.1010.desc + + theme = republic + + left_portrait = { + character = root + animation = contemplating + camera = camera_activity_horse + } + + right_portrait = { + character = scope:relation_01 + animation = debating + camera = camera_activity_horse + } + + lower_center_portrait = { + character = scope:ambassador_01 + } + + cooldown = { years = 10 } + + trigger = { + NOT = { + root.house ?= { + has_house_modifier = gdp_secret_information_house_modifier + } + } + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + any_independent_ruler = { + in_diplomatic_range = root + NOR = { + this = root + this = root.top_liege + } + primary_title = { + is_mercenary_company = no + is_holy_order = no + } + } + top_liege = { + this != root + any_vassal = { + this != root + government_has_flag = government_is_republic + NOT = { is_close_or_extended_family_of = root } + is_powerful_vassal = yes + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + OR = { + any_relation = { + type = friend + type = best_friend + type = lover + type = soulmate + this != root.top_liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_close_or_extended_family_member = { + this != root + this != root.top_liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + any_spouse = { + this != root.top_liege + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + } + + immediate = { + top_liege = { save_scope_as = republic_ruler } + + every_relation = { + type = friend + type = best_friend + type = lover + type = soulmate + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.top_liege + } + add_to_list = relation_candidates + } + every_close_or_extended_family_member = { + limit = { + this != root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.top_liege + } + add_to_list = relation_candidates + } + every_spouse = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + this != root.top_liege + } + add_to_list = relation_candidates + } + random_in_list = { + list = relation_candidates + weight = { + base = 1 + modifier = { + add = 30 + has_relation_soulmate = root + } + modifier = { + add = 15 + OR = { + has_relation_best_friend = root + has_relation_friend = root + has_relation_lover = root + is_primary_heir_of = root + } + } + modifier = { + add = 5 + OR = { + is_child_of = root + is_grandchild_of = root + } + } + modifier = { + factor = 1.5 + opinion = { + target = root + value >= 50 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = relation_01 + } + + random_independent_ruler = { + limit = { + in_diplomatic_range = root + NOR = { + this = root + this = root.top_liege + } + primary_title = { + is_mercenary_company = no + is_holy_order = no + } + } + primary_title = { save_scope_as = ambassador_mission_location_01 } + } + + top_liege = { + random_vassal = { + limit = { + this != root + this != scope:relation_01 + government_has_flag = government_is_republic + is_powerful_vassal = yes + NOT = { is_close_or_extended_family_of = root } + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + save_scope_as = ambassador_01 + } + } + } + + option = { + name = yearly_republic.1010.a + + add_internal_flag = dangerous + add_intrigue_lifestyle_xp = medium_lifestyle_xp + + duel = { + skill = intrigue + value = high_skill_rating + 25 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1010.a.success.desc + send_interface_toast = { + title = yearly_republic.1010.a.success.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:ambassador_01 + house ?= { + add_house_modifier = { + modifier = gdp_secret_information_house_modifier + years = 5 + } + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -0.5 + min = -49 + } + min = 5 + desc = yearly_republic.1010.a.mixed.desc + send_interface_toast = { + title = yearly_republic.1010.a.mixed.toast + type = event_toast_effect_neutral + left_icon = root + custom_tooltip = { + text = yearly_republic.1010.a.mixed.custom + increase_wounds_no_death_effect = { REASON = fell_off_roof } + scope:relation_01 = { + increase_wounds_no_death_effect = { REASON = fell_off_roof } + } + } + } + } + 25 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1010.a.failure.desc + send_interface_toast = { + title = yearly_republic.1010.a.failure.toast + type = event_toast_effect_bad + left_icon = root + custom_tooltip = { + text = yearly_republic.1010.a.failure.custom + top_liege = { + add_opinion = { + modifier = spy_opinion + target = root + } + add_opinion = { + modifier = spy_opinion + target = scope:relation_01 + } + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + just = medium_stress_impact_gain + craven = minor_stress_impact_gain + # Loss + deceitful = medium_stress_impact_loss + paranoid = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + intrigue < mediocre_skill_rating + } + modifier = { + factor = 0 + OR = { + has_trait = honest + has_trait = just + has_trait = craven + } + } + modifier = { + add = 50 + OR = { + has_trait = deceitful + has_trait = paranoid + has_trait = ambitious + } + } + } + } + + option = { + name = yearly_republic.1010.b + + trigger = { + short_term_gold >= scope:ambassador_01.medium_gold_value + } + + show_as_unavailable = { always = yes } + + random_list = { + 100 = { + desc = yearly_republic.1010.b.accept + modifier = { + scope:ambassador_01 = { has_trait = greedy } + add = 75 + } + modifier = { + scope:ambassador_01 = { has_trait = deceitful } + add = 50 + } + modifier = { + scope:ambassador_01 = { has_trait = ambitious } + add = 25 + } + modifier = { + scope:ambassador_01 = { has_trait = cynical } + add = 25 + } + modifier = { + scope:ambassador_01 = { has_trait = arbitrary } + add = 25 + } + modifier = { + scope:ambassador_01 = { has_trait = honest } + factor = 0.25 + } + modifier = { + scope:ambassador_01 = { has_trait = just } + factor = 0.35 + } + modifier = { + scope:ambassador_01 = { has_trait = generous } + factor = 0.5 + } + modifier = { + scope:ambassador_01 = { has_trait = stubborn } + factor = 0.5 + } + modifier = { + scope:ambassador_01 = { has_trait = zealous } + factor = 0.75 + } + send_interface_toast = { + title = yearly_republic.1010.b.success.toast + type = event_toast_effect_good + left_icon = root + pay_short_term_gold = { + target = scope:ambassador_01 + gold = scope:ambassador_01.medium_gold_value + } + house ?= { + add_house_modifier = { + modifier = gdp_secret_information_house_modifier + years = 5 + } + } + } + } + 100 = { + desc = yearly_republic.1010.b.refuse + modifier = { + scope:ambassador_01 = { has_trait = honest } + add = 75 + } + modifier = { + scope:ambassador_01 = { has_trait = just } + add = 50 + } + modifier = { + scope:ambassador_01 = { has_trait = generous } + add = 25 + } + modifier = { + scope:ambassador_01 = { has_trait = greedy } + factor = 0.25 + } + modifier = { + scope:ambassador_01 = { has_trait = deceitful } + factor = 0.5 + } + + send_interface_toast = { + title = yearly_republic.1010.b.failure.toast + type = event_toast_effect_bad + left_icon = root + scope:ambassador_01 = { + add_opinion = { + target = root + modifier = insulted_opinion + opinion = -20 + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + honest = medium_stress_impact_gain + just = medium_stress_impact_gain + # Loss + deceitful = medium_stress_impact_loss + ambitious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + short_term_gold < major_gold_value + } + modifier = { + factor = 0 + OR = { + has_trait = honest + has_trait = just + has_trait = generous + } + } + modifier = { + add = 50 + OR = { + has_trait = greedy + has_trait = deceitful + has_trait = ambitious + } + } + } + } + + option = { + name = yearly_republic.1010.c + + if = { + limit = { + NOT = { has_trait = patient } + } + random = { + chance = 5 + add_trait = patient + } + + } + + stress_and_fulfillment_impact = { + # Gain + paranoid = medium_stress_impact_gain + # Loss + patient = medium_stress_impact_loss + trusting = medium_stress_impact_loss + lazy = medium_stress_impact_loss + calm = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = paranoid + } + } + } +} + +######################## +# Summoned to Council # +######################## + +yearly_republic.1011 = { + + type = character_event + title = yearly_republic.1011.t + desc = yearly_republic.1011.desc + + theme = republic + override_background = bedchamber + + left_portrait = { + character = root + animation = boredom + camera = camera_event_center_close_to_right + } + + right_portrait = { + trigger = { exists = scope:right_portrait } + character = scope:right_portrait + triggered_animation = { + trigger = { exists = scope:sick_person_01 } + animation = sick + camera = camera_event_center_close_to_right + } + animation = personality_rational + camera = camera_body_right + } + + cooldown = { years = 10 } + + trigger = { + top_liege != root + government_has_flag = government_is_republic + is_healthy = yes + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + } + + immediate = { + random_courtier = { + limit = { + is_healthy = no + is_close_family_of = root + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + } + save_scope_as = sick_person_01 + } + court_position:court_physician_court_position ?= { + if = { + limit = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + } + save_scope_as = physician_01 + } + } + if = { + limit = { exists = scope:sick_person_01 } + scope:sick_person_01 = { save_scope_as = right_portrait } + } + else_if = { + limit = { exists = scope:physician_01 } + scope:physician_01 = { save_scope_as = right_portrait } + } + } + + option = { + name = yearly_republic.1011.a + reason = physician + trigger = { + court_position:court_physician_court_position ?= { + is_available_ai_adult = yes + } + NOT = { exists = scope:sick_person_01 } + } + + add_character_modifier = { + modifier = gdp_dodging_council_modifier + years = 5 + } + + add_intrigue_lifestyle_xp = minor_lifestyle_xp + + stress_and_fulfillment_impact = { + # Gain + diligent = minor_stress_impact_gain + # Loss + lazy = minor_stress_impact_loss + shy = minor_stress_impact_loss + deceitful = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = diligent + } + modifier = { + add = 50 + OR = { + has_trait = lazy + has_trait = shy + has_trait = deceitful + } + } + } + } + + option = { + name = yearly_republic.1011.b + + trigger = { + exists = scope:sick_person_01 + } + + add_character_modifier = { + modifier = gdp_dodging_council_modifier + years = 5 + } + + progress_towards_friend_effect = { + REASON = friend_stayed_home_when_sick + CHARACTER = scope:sick_person_01 + OPINION = 0 + } + + stress_and_fulfillment_impact = { + # Gain + diligent = minor_stress_impact_gain + # Loss + lazy = minor_stress_impact_loss + shy = minor_stress_impact_loss + compassionate = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = diligent + } + modifier = { + add = 50 + OR = { + has_trait = lazy + has_trait = shy + has_trait = compassionate + } + } + } + } + + option = { + name = yearly_republic.1011.c + + duel = { + skill = diplomacy + value = low_skill_rating + 65 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1011.c.success.desc + send_interface_toast = { + title = yearly_republic.1011.c.success.toast + type = event_toast_effect_good + left_icon = root + add_character_modifier = { + modifier = gdp_exemption_from_council_modifier + years = 5 + } + } + } + 35 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1011.c.failure.desc + send_interface_toast = { + title = yearly_republic.1011.c.failure.toast + type = event_toast_effect_bad + left_icon = root + add_prestige = minor_prestige_loss + } + } + } + + stress_and_fulfillment_impact = { + # Gain + shy = minor_stress_impact_gain + craven = minor_stress_impact_gain + # Loss + ambitious = minor_stress_impact_loss + greedy = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = shy + has_trait = craven + } + } + modifier = { + add = 50 + OR = { + has_trait = ambitious + has_trait = greedy + } + } + } + } + + option = { + name = yearly_republic.1011.d + + add_prestige = minor_prestige_gain + + stress_and_fulfillment_impact = { + # Gain + lazy = minor_stress_impact_gain + arbitrary = minor_stress_impact_gain + # Loss + diligent = minor_stress_impact_loss + humble = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = lazy + has_trait = arbitrary + } + } + modifier = { + add = 50 + OR = { + has_trait = diligent + has_trait = humble + } + } + } + } +} + +######################### +# The Doge's Procession # +######################### + +yearly_republic.1012 = { + + type = character_event + title = yearly_republic.1012.t + desc = yearly_republic.1012.desc + window = big_event_window + + override_background = market + theme = republic + + left_portrait = { + trigger = { + exists = scope:second_highest_patrician + } + character = scope:second_highest_patrician + camera = camera_event_group_talking_left_left + animation = frontend_center_idle + } + + center_portrait = { + trigger = { + exists = scope:highest_patrician + } + character = scope:highest_patrician + camera = camera_event_group_talking_left_left + animation = chaplain + } + + right_portrait = { + character = root + camera = camera_event_group_talking_left_left + animation = acknowledging + } + + trigger = { + NOT = { has_character_flag = doge_procession_flag } + top_liege = { this = root } + government_has_flag = government_is_republic + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + any_noble_family = { + exists = holder.house + holder != root + holder.domicile ?= { + is_domicile_type = merchant_company + } + holder = { + government_has_flag = government_is_republic + } + } + } + + immediate = { + add_character_flag = doge_procession_flag + save_scope_as = patrician_ambition_display_ruler + ordered_noble_family = { + limit = { + holder != root + exists = holder.house + holder.domicile ?= { + is_domicile_type = merchant_company + } + holder = { + government_has_flag = government_is_republic + } + } + order_by = { + value = 0 + add = holder.house.house_power_score + } + position = 0 + holder = { save_scope_as = highest_patrician } + } + ordered_noble_family = { + limit = { + holder != root + exists = holder.house + holder.domicile ?= { + is_domicile_type = merchant_company + } + holder = { + government_has_flag = government_is_republic + } + } + order_by = { + value = 0 + add = holder.house.house_power_score + } + position = 1 + check_range_bounds = no + holder = { save_scope_as = second_highest_patrician } + } + + } + + option = { + name = yearly_republic.1012.a + add_piety = medium_piety_gain + root.capital_county = { + add_popular_opinion = 20 + } + + every_vassal = { + limit = { + government_has_flag = government_is_republic + domicile ?= { + is_domicile_type = merchant_company + } + house ?= { + OR = { + has_house_aspiration_parameter = republic_communal + has_house_aspiration_parameter = republic_commerce + } + } + } + custom = custom.every_patrician_commerce_communal + add_opinion = { + target = root + modifier = pleased_opinion + opinion = 20 + } + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + house ?= { + OR = { + has_house_aspiration_parameter = republic_communal + has_house_aspiration_parameter = republic_commerce + } + } + } + } + } + + option = { + name = yearly_republic.1012.b + add_prestige = medium_prestige_gain + root.capital_county = { + change_county_control = 15 + } + + every_noble_family = { + limit = { + holder != root + holder.domicile ?= { + is_domicile_type = merchant_company + } + holder = { + government_has_flag = government_is_republic + } + holder.house ?= { + OR = { + has_house_aspiration_parameter = republic_aggrandizement + has_house_aspiration_parameter = republic_signorial + } + } + } + custom = custom.every_patrician_aggrandizement_signorial + holder = { + add_opinion = { + target = root + modifier = respect_opinion + opinion = 20 + } + } + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + house ?= { + OR = { + has_house_aspiration_parameter = republic_aggrandizement + has_house_aspiration_parameter = republic_signorial + } + } + } + } + } + + option = { + name = yearly_republic.1012.c + + add_prestige = medium_prestige_gain + dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain } + capital_county = { + change_county_control = 15 + } + add_character_flag = { + flag = GDP_despot_discount_flag + years = 10 + } + + every_noble_family = { + limit = { + holder != root + holder.domicile ?= { + is_domicile_type = merchant_company + } + holder = { + government_has_flag = government_is_republic + } + holder.house ?= { + OR = { + has_house_aspiration_parameter = republic_aggrandizement + has_house_aspiration_parameter = republic_signorial + has_house_aspiration_parameter = republic_communal + } + } + } + custom = custom.every_patrician_aggrandizement_signorial_communal + holder = { + add_opinion = { + target = root + modifier = disrespect_opinion + opinion = -40 + } + } + } + + custom_tooltip = yearly_republic.1012.c.tt + + stress_and_fulfillment_impact = { + # Gain + humble = major_stress_impact_gain + # Loss + arrogant = major_stress_impact_loss + ambitious = major_stress_impact_loss + + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = humble + } + modifier = { + add = 50 + OR = { + has_trait = arrogant + has_trait = ambitious + } + } + } + } +} + +####################### +# Marriage to the Sea # +####################### + +yearly_republic.1013 = { + + type = character_event + title = yearly_republic.1013.t + desc = yearly_republic.1013.desc + + theme = republic + override_background = fp1_ocean + + left_portrait = { + character = root + animation = acknowledging + camera = camera_body_left + } + + right_portrait = { + character = scope:bishop_01 + } + + trigger = { + NOT = { has_character_flag = marriage_to_the_sea_doge_flag } + top_liege = { this = root } + government_has_flag = government_is_republic + capital_county = title:c_venezia + culture = { has_cultural_pillar = heritage_latin } + OR = { religion = religion:catholic_religion religion = religion:protestant_religion religion = religion:eastern_orthodox_religion religion = religion:oriental_orthodox_religion } + cp:councillor_court_chaplain ?= { is_available_ai_adult = yes } + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + travel = no + } + + } + + immediate = { + add_character_flag = marriage_to_the_sea_doge_flag + cp:councillor_court_chaplain ?= { + save_scope_as = bishop_01 + } + + capital_county = { + add_popular_opinion = 15 + change_county_control = minor_county_control_gain + } + } + # "We rule the waves!" + option = { + name = yearly_republic.1013.a + + trigger = { + NOT = { has_trait = cynical } + } + + add_prestige = medium_prestige_gain + dynasty ?= { add_dynasty_prestige = miniscule_dynasty_prestige_gain } + add_stewardship_lifestyle_xp = medium_lifestyle_experience + + stress_and_fulfillment_impact = { + # Gain + humble = minor_stress_impact_gain + shy = minor_stress_impact_gain + # Loss + arrogant = medium_stress_impact_loss + gregarious = minor_stress_impact_loss + zealous = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + OR = { + has_trait = arrogant + has_trait = gregarious + has_trait = zealous + } + } + } + } + # "A foolish and empty ritual." + option = { + name = yearly_republic.1013.b + + trigger = { + has_trait = cynical + } + + add_prestige = medium_prestige_gain + dynasty ?= { add_dynasty_prestige = miniscule_dynasty_prestige_gain } + add_intrigue_lifestyle_xp = medium_lifestyle_experience + + stress_and_fulfillment_impact = { + # Gain + gregarious = minor_stress_impact_gain + # Loss + cynical = medium_stress_impact_loss + honest = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + has_trait = cynical + } + } + } + # "I am coming my love!" + option = { + name = yearly_republic.1013.c + add_internal_flag = dangerous + + trigger = { + OR = { + has_trait = lunatic_1 + } + } + + dynasty ?= { add_dynasty_prestige = major_dynasty_prestige_gain } + + death = { + death_reason = death_drowned + } + + # Lethal, so player-only. Options a and b are never zeroed, leaving the AI a weighted alternative + ai_chance = { + base = 0 + } + } + # "and to the sea I will remain true!" + option = { + name = yearly_republic.1013.d + + trigger = { + has_trait = eccentric + } + + add_character_modifier = { + modifier = gdp_wedded_to_the_sea_modifier + } + + set_nickname_effect = { NICKNAME = nick_amator_maris } + + stress_and_fulfillment_impact = { + # Gain + zealous = minor_stress_impact_gain + arrogant = minor_stress_impact_gain + # Loss + eccentric = medium_stress_impact_loss + } + + ai_chance = { + base = 50 + modifier = { + factor = 0 + OR = { + has_trait = zealous + has_trait = arrogant + } + } + modifier = { + add = 50 + has_trait = lunatic_1 + } + } + } +} + +######################## +# Aligning the Houses # +######################## + +# NEOW 2555: historical Guelph/Ghibelline faction recruitment is disabled. +#yearly_republic.1014 = { + +# type = character_event +# title = yearly_republic.1014.t +# desc = yearly_republic.1014.desc +# override_background = bp1_relaxing_room_western + +# theme = republic +# window = big_event_window + +# left_portrait = { +# character = scope:faction_head_01 +# animation = admiration +# } +# center_portrait = { +# character = root +# animation = contemplating +# } +# right_portrait = { +# character = scope:faction_head_02 +# animation = arguing +# } + +# cooldown = { years = 10 } + +# trigger = { +# is_ai = no +# government_has_flag = government_is_republic +# exists = house +# house = { NOT = { has_default_house_aspiration = yes } } +# trigger_if = { +# limit = { gdp_is_assembly_head_trigger = yes } +# any_vassal = { +# count >= 2 +# gdp_shares_house_ambition_trigger = { CHARACTER = root } +# } +# } +# trigger_else = { +# liege ?= { +# trigger_if = { +# limit = { gdp_shares_house_ambition_trigger = { CHARACTER = root } } +# any_vassal = { +# count >= 1 +# gdp_shares_house_ambition_trigger = { CHARACTER = root } +# } +# } +# trigger_else = { +# any_vassal = { +# count >= 2 +# gdp_shares_house_ambition_trigger = { CHARACTER = root } +# } +# } +# } +# } +# } + +# immediate = { +# if = { +# limit = { gdp_is_assembly_head_trigger = yes } +# save_scope_as = republic_ruler +# } +# else = { +# liege ?= { save_scope_as = republic_ruler } +# } + +# # Pool the head of the republic with the patrician families so they compete on house score together +# scope:republic_ruler = { +# if = { +# limit = { gdp_shares_house_ambition_trigger = { CHARACTER = root } } +# add_to_list = faction_candidates +# } +# every_vassal = { +# limit = { gdp_shares_house_ambition_trigger = { CHARACTER = root } } +# add_to_list = faction_candidates +# } +# } + +# # faction_candidates excludes root, so pool a second list for the options that act on the gathering as a whole +# add_to_list = aligning_houses +# every_in_list = { +# list = faction_candidates +# add_to_list = aligning_houses +# } + +# ordered_in_list = { +# list = faction_candidates +# order_by = house.house_power_score +# position = 0 +# save_scope_as = faction_head_01 +# } +# ordered_in_list = { +# list = faction_candidates +# order_by = house.house_power_score +# position = 1 +# save_scope_as = faction_head_02 +# } +# } +# # "We should all join the Guelphs." +# option = { +# name = yearly_republic.1014.a + +# trigger = { +# is_guelph_trigger = yes +# any_in_list = { +# list = faction_candidates +# is_guelph_trigger = no +# } +# } + +# duel = { +# skill = diplomacy +# value = high_skill_rating +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = 3.5 +# min = -49 +# } +# min = 5 +# desc = yearly_republic.1014.tt.align_guelphs_success.desc +# custom_tooltip = { +# text = yearly_republic.1014.a.tt +# send_interface_toast = { +# title = yearly_republic.1014.align_guelphs_success.toast +# type = event_toast_effect_good +# left_icon = root +# every_in_list = { +# list = faction_candidates +# limit = { +# exists = top_participant_group:guelph_ghibelline +# is_guelph_trigger = no +# NOT = { exists = var:gg_recently_recruited } +# } +# gg_change_side_to_guelph_effect = { REASON = flag:schemed } +# # Grace period so they can't be flip-flopped incessantly +# set_variable = { +# name = gg_recently_recruited +# years = 2 +# } +# } +# } +# } +# } +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = -3.5 +# min = -49 +# } +# min = 5 +# desc = yearly_republic.1014.tt.align_guelphs_failure.desc +# send_interface_toast = { +# title = yearly_republic.1014.align_guelphs_failure.toast +# type = event_toast_effect_bad +# left_icon = root +# add_prestige = minor_prestige_loss +# } +# } +# } + +# stress_and_fulfillment_impact = { +# # Gain +# shy = medium_stress_impact_gain +# craven = minor_stress_impact_gain +# content = minor_stress_impact_gain +# # Loss +# ambitious = medium_stress_impact_loss +# gregarious = minor_stress_impact_loss +# zealous = minor_stress_impact_loss +# } + +# ai_chance = { +# base = 100 +# modifier = { +# factor = 0 +# OR = { +# has_trait = shy +# has_trait = craven +# has_trait = content +# } +# } +# modifier = { +# add = 50 +# has_trait = ambitious +# } +# modifier = { +# add = 25 +# diplomacy >= high_skill_rating +# } +# } +# } +# # "We should all join the Ghibellines." +# option = { +# name = yearly_republic.1014.b + +# trigger = { +# is_ghibelline_trigger = yes +# any_in_list = { +# list = faction_candidates +# is_ghibelline_trigger = no +# } +# } + +# duel = { +# skill = diplomacy +# value = high_skill_rating +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = 3.5 +# min = -49 +# } +# min = 5 +# desc = yearly_republic.1014.tt.align_ghibellines_success.desc +# custom_tooltip = yearly_republic.1014.b.tt +# send_interface_toast = { +# title = yearly_republic.1014.align_ghibellines_success.toast +# type = event_toast_effect_good +# left_icon = root +# every_in_list = { +# list = faction_candidates +# limit = { +# exists = top_participant_group:guelph_ghibelline +# is_ghibelline_trigger = no +# NOT = { exists = var:gg_recently_recruited } +# } +# gg_change_side_to_ghibelline_effect = { REASON = flag:schemed } +# # Grace period so they can't be flip-flopped incessantly +# set_variable = { +# name = gg_recently_recruited +# years = 2 +# } +# } +# } +# } +# 50 = { +# compare_modifier = { +# value = scope:duel_value +# multiplier = -3.5 +# min = -49 +# } +# min = 5 +# desc = yearly_republic.1014.tt.align_ghibellines_failure.desc +# send_interface_toast = { +# title = yearly_republic.1014.align_ghibellines_failure.toast +# type = event_toast_effect_bad +# left_icon = root +# add_prestige = minor_prestige_loss +# } +# } +# } + +# stress_and_fulfillment_impact = { +# # Gain +# shy = medium_stress_impact_gain +# craven = minor_stress_impact_gain +# content = minor_stress_impact_gain +# # Loss +# ambitious = medium_stress_impact_loss +# gregarious = minor_stress_impact_loss +# stubborn = minor_stress_impact_loss +# } + +# ai_chance = { +# base = 100 +# modifier = { +# factor = 0 +# OR = { +# has_trait = shy +# has_trait = craven +# has_trait = content +# } +# } +# modifier = { +# add = 50 +# has_trait = ambitious +# } +# modifier = { +# add = 25 +# diplomacy >= high_skill_rating +# } +# } +# } +# # "Let's strengthen the bonds between our houses." +# option = { +# name = yearly_republic.1014.c + +# custom_tooltip = { +# text = yearly_republic.1014.c.tt +# every_in_list = { +# list = aligning_houses +# save_temporary_scope_as = aligning_house_head +# every_in_list = { +# list = aligning_houses +# limit = { +# this != scope:aligning_house_head +# # Handle each pair once, from the side not yet paired off +# NOT = { has_character_flag = aligning_houses_paired_flag } +# house ?= { NOT = { scope:aligning_house_head.house ?= this } } +# } +# save_temporary_scope_as = aligning_other_house_head +# scope:aligning_house_head.house ?= { +# # impact_house_relation silently fails to create a relation between two small AI houses, so we set a new one ourselves +# if = { +# limit = { NOT = { has_house_relation_with = scope:aligning_other_house_head.house } } +# set_house_relation = { +# target = scope:aligning_other_house_head.house +# level = cordial +# description = house_relation_reason_houses_aligned_desc +# } +# } +# else = { +# change_house_relation_effect = { +# HOUSE = scope:aligning_other_house_head.house +# VALUE = house_relation_improve_medium_value +# REASON = houses_aligned +# CHAR = scope:aligning_house_head +# TARGET_CHAR = scope:aligning_other_house_head +# TITLE = scope:dummy_gender +# } +# } +# } +# } +# add_character_flag = aligning_houses_paired_flag +# } +# every_in_list = { +# list = aligning_houses +# remove_character_flag = aligning_houses_paired_flag +# } +# } + +# stress_and_fulfillment_impact = { +# # Gain +# paranoid = medium_stress_impact_gain +# callous = minor_stress_impact_gain +# arrogant = minor_stress_impact_gain +# # Loss +# gregarious = medium_stress_impact_loss +# trusting = minor_stress_impact_loss +# compassionate = minor_stress_impact_loss +# } + +# ai_chance = { +# base = 100 +# modifier = { +# factor = 0 +# OR = { +# has_trait = paranoid +# has_trait = callous +# has_trait = arrogant +# } +# } +# modifier = { +# add = 50 +# has_trait = gregarious +# } +# modifier = { +# add = 25 +# has_trait = trusting +# } +# } +# } +# # "All rivalries among us has to end." +# option = { +# name = yearly_republic.1014.d + +# trigger = { +# any_in_list = { +# list = aligning_houses +# OR = { +# any_relation = { +# type = rival +# is_in_list = aligning_houses +# } +# any_relation = { +# type = nemesis +# is_in_list = aligning_houses +# } +# } +# } +# } + +# custom_tooltip = { +# text = yearly_republic.1014.d.tt +# send_interface_toast = { +# title = yearly_republic.1014.d.toast +# type = event_toast_effect_good +# left_icon = root +# every_in_list = { +# list = aligning_houses +# save_temporary_scope_as = feuding_house_head +# every_in_list = { +# list = aligning_houses +# limit = { this != scope:feuding_house_head } +# # Nemesis aliases as rival, so it has to be caught first +# if = { +# limit = { has_relation_nemesis = scope:feuding_house_head } +# remove_relation_nemesis = scope:feuding_house_head +# } +# else_if = { +# limit = { has_relation_rival = scope:feuding_house_head } +# remove_relation_rival = scope:feuding_house_head +# } +# } +# } +# } +# } + +# stress_and_fulfillment_impact = { +# # Gain +# vengeful = medium_stress_impact_gain +# wrathful = minor_stress_impact_gain +# stubborn = minor_stress_impact_gain +# # Loss +# forgiving = medium_stress_impact_loss +# compassionate = minor_stress_impact_loss +# calm = minor_stress_impact_loss +# } + +# ai_chance = { +# base = 100 +# modifier = { +# factor = 0 +# OR = { +# has_trait = vengeful +# has_trait = wrathful +# has_trait = stubborn +# } +# } +# modifier = { +# add = 50 +# has_trait = forgiving +# } +# modifier = { +# add = 25 +# has_trait = compassionate +# } +# } +# } +# # "We should align our business interests." +# option = { +# name = yearly_republic.1014.e + +# trigger = { +# NOT = { +# house ?= { +# has_house_modifier = gdp_ambitions_aligned_house_modifier +# } +# } +# } +# custom_tooltip = { +# text = yearly_republic.1014.e.tt +# send_interface_toast = { +# title = yearly_republic.1014.e.toast +# type = event_toast_effect_good +# left_icon = root +# every_in_list = { +# list = aligning_houses +# # Several attendees can share a house, so let the first of them claim the modifier for it +# limit = { +# house ?= { +# NOT = { has_house_modifier = gdp_ambitions_aligned_house_modifier } +# } +# } +# this.house ?= { +# add_house_modifier = { +# modifier = gdp_ambitions_aligned_house_modifier +# years = 2 +# } +# } +# } +# } +# } + +# stress_and_fulfillment_impact = { +# # Gain +# content = minor_stress_impact_gain +# lazy = minor_stress_impact_gain +# generous = minor_stress_impact_gain +# # Loss +# greedy = medium_stress_impact_loss +# diligent = minor_stress_impact_loss +# ambitious = minor_stress_impact_loss +# } + +# ai_chance = { +# base = 100 +# modifier = { +# factor = 0 +# OR = { +# has_trait = content +# has_trait = lazy +# has_trait = generous +# } +# } +# modifier = { +# add = 50 +# has_trait = greedy +# } +# modifier = { +# add = 25 +# has_trait = diligent +# } +# } +# } +#} + +################## +# Gold for Votes # +################## + +yearly_republic.1015 = { + + type = character_event + title = yearly_republic.1015.t + desc = yearly_republic.1015.desc + + theme = republic + + left_portrait = { + character = root + animation = thinking + } + right_portrait = { + character = scope:patrician + animation = debating + } + + cooldown = { years = 3 } + + trigger = { + is_ai = no + government_has_flag = government_is_republic + gdp_is_assembly_head_trigger = yes + # A pledge for the next vote only makes sense while none is under way + ongoing_voting_session = no + any_vassal = { + gdp_can_pledge_assembly_vote_trigger = yes + } + } + + immediate = { + random_vassal = { + limit = { + gdp_can_pledge_assembly_vote_trigger = yes + } + weight = { + base = 1 + modifier = { + add = 3 + has_trait = greedy + } + modifier = { + add = 2 + is_major_assembly_member = yes + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = patrician + } + } + + # "Name your price." + option = { + name = yearly_republic.1015.a + + trigger = { + short_term_gold >= scope:patrician.major_gold_value + } + + pay_short_term_gold = { + target = scope:patrician + gold = scope:patrician.major_gold_value + } + + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:patrician + } + + stress_and_fulfillment_impact = { + # Gain + greedy = medium_stress_impact_gain + just = minor_stress_impact_gain + # Loss + ambitious = minor_stress_impact_loss + gregarious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = greedy + has_trait = just + } + } + } + } + + # "My proposals will stand on their own merits." + option = { + name = yearly_republic.1015.c + + stress_and_fulfillment_impact = { + # Gain + ambitious = minor_stress_impact_gain + # Loss + just = medium_stress_impact_loss + content = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = ambitious + } + } + } + } +} + +################################ +# Beating the Vote Out of Them # +################################ + +scripted_effect vote_intimidation_response_effect = { + if = { + limit = { + has_trait = vengeful + } + set_relation_rival = { reason = rival_intimidation target = root } + } + else_if = { + limit = { + has_trait = brave + } + progress_towards_rival_effect = { + REASON = rival_intimidation + CHARACTER = root + OPINION = -15 + } + } + else_if = { + limit = { + has_trait = craven + } + add_opinion = { + modifier = threatened_opinion + target = root + opinion = -5 + } + } + else = { + add_opinion = { + modifier = threatened_opinion + target = root + opinion = -10 + } + } +} + +yearly_republic.1016 = { + + type = character_event + title = yearly_republic.1016.t + desc = yearly_republic.1016.desc + + theme = republic + override_background = alley_day + + left_portrait = { + character = root + animation = anger + } + lower_center_portrait = { + character = scope:house_member + animation = fear + } + lower_right_portrait = { + character = scope:house_client + animation = fear + } + right_portrait = { + character = scope:patrician + animation = fear + } + + cooldown = { years = 3 } + + trigger = { + is_ai = no + government_has_flag = government_is_republic + gdp_is_assembly_head_trigger = yes + # A pledge for the next vote only makes sense while none is under way + ongoing_voting_session = no + top_liege = { + any_vassal = { + gdp_can_pledge_assembly_vote_trigger = yes + any_courtier = { + this != root + is_available_quick = { + activity = no + adult = yes + ai = yes + } + save_temporary_scope_as = first_associate + } + any_close_or_extended_family_member = { + this != root + this != scope:first_associate + NOR = { + has_trait = reclusive + has_trait = irritable + has_trait = lunatic + } + is_available_quick = { + activity = no + adult = yes + ai = yes + } + } + } + } + } + + immediate = { + random_vassal = { + limit = { + gdp_can_pledge_assembly_vote_trigger = yes + any_courtier = { + this != root + is_available_quick = { + activity = no + adult = yes + ai = yes + } + save_temporary_scope_as = first_associate + } + any_close_or_extended_family_member = { + this != root + this != scope:first_associate + NOR = { + has_trait = reclusive + has_trait = irritable + has_trait = lunatic + } + is_available_quick = { + activity = no + adult = yes + ai = yes + } + } + } + weight = { + base = 1 + modifier = { + add = 3 + has_trait = craven + } + modifier = { + add = -10 + has_trait = brave + } + modifier = { + add = 2 + is_major_assembly_member = yes + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = patrician + random_courtier = { + limit = { + this != root + is_available_quick = { + activity = no + adult = yes + ai = yes + } + } + save_scope_as = house_client + } + random_close_or_extended_family_member = { + limit = { + this != scope:patrician + this != root + this != scope:house_client + NOR = { + has_trait = reclusive + has_trait = irritable + has_trait = lunatic + } + is_available_quick = { + activity = no + adult = yes + ai = yes + } + } + save_scope_as = house_member + } + } + } + + ## "Sabotage [target.GetHerHis] business interests." + option = { + name = yearly_republic.1016.a + scope:patrician = { + add_character_modifier = { + modifier = gdp_business_sabotage_modifier + years = 5 + } + } + + progress_towards_rival_effect = { + REASON = rival_sabotaged_business_interests + CHARACTER = scope:patrician + OPINION = -20 + } + + send_interface_toast = { + title = yearly_republic.1016.pledge.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:patrician + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:patrician + } + } + + stress_and_fulfillment_impact = { + # Stress Gain # + compassionate = miniscule_stress_impact_gain + just = miniscule_stress_impact_gain + craven = miniscule_stress_impact_gain + calm = miniscule_stress_impact_gain + + # Stress Loss # + callous = miniscule_stress_impact_loss + impatient = miniscule_stress_impact_loss + wrathful = miniscule_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = just + has_trait = craven + has_trait = calm + } + } + } + } + ## "Have thugs ambush and beat [target.GetHerHis] courtiers." + option = { + name = yearly_republic.1016.b + trigger = { + NOR = { + has_trait = sadistic + has_trait = wrathful + } + } + add_dread = minor_dread_gain + + send_interface_toast = { + title = yearly_republic.1016.pledge.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:patrician + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:patrician + } + } + + scope:house_client = { + increase_wounds_no_death_effect = { REASON = beaten } + } + scope:patrician = { + vote_intimidation_response_effect = yes + } + add_piety = minor_piety_loss + + stress_and_fulfillment_impact = { + # Stress Gain # + just = medium_stress_impact_gain + compassionate = minor_stress_impact_gain + craven = miniscule_stress_impact_gain + calm = minor_stress_impact_gain + + # Stress Loss # + callous = miniscule_stress_impact_loss + impatient = miniscule_stress_impact_loss + wrathful = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = just + has_trait = craven + has_trait = calm + } + } + } + } + ## "Set fire to [target.GetHerHis] home." + option = { + name = yearly_republic.1016.c + trigger = { + has_trait = wrathful + NOT = { + has_trait = sadistic + } + } + scope:patrician = { + add_character_modifier = { + modifier = gdp_arson_modifier + years = 5 + } + + vote_intimidation_response_effect = yes + } + add_dread = medium_dread_gain + + add_piety = medium_piety_loss + random = { + chance = 25 + scope:house_member = { + increase_wounds_no_death_effect = { REASON = wounded } + } + } + + send_interface_toast = { + title = yearly_republic.1016.pledge.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:patrician + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:patrician + } + } + + stress_and_fulfillment_impact = { + # Stress Gain # + just = medium_stress_impact_gain + compassionate = minor_stress_impact_gain + craven = miniscule_stress_impact_gain + calm = minor_stress_impact_gain + + # Stress Loss # + callous = minor_stress_impact_loss + wrathful = minor_stress_impact_loss + impatient = miniscule_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = just + has_trait = craven + has_trait = calm + } + } + } + } + ## "I will teach him TERROR!" + option = { + name = yearly_republic.1016.d + trigger = { + has_trait = sadistic + } + add_dread = major_dread_gain + add_piety = major_piety_loss + scope:patrician = { + vote_intimidation_response_effect = yes + } + + send_interface_toast = { + title = yearly_republic.1016.pledge.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:patrician + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:patrician + } + } + custom_tooltip = { + text = yearly_republic.1016.d.tt + scope:house_member = { + increase_wounds_no_death_effect = { REASON = wounded } + if = { + limit = { + is_male = yes + } + random_list = { + 1 = { add_trait = eunuch_1 } + 1 = { add_trait = blind } + 1 = { add_trait = disfigured } + } + } + else = { + random_list = { + 1 = { add_trait = blind } + 1 = { add_trait = disfigured } + } + } + } + } + + stress_and_fulfillment_impact = { + # Stress Gain # + just = medium_stress_impact_gain + compassionate = medium_stress_impact_gain + craven = miniscule_stress_impact_gain + calm = minor_stress_impact_gain + + # Stress Loss # + callous = medium_stress_impact_loss + wrathful = medium_stress_impact_loss + impatient = miniscule_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = compassionate + has_trait = just + has_trait = craven + has_trait = calm + } + } + } + } + ## "I will be patient a while longer." + option = { + name = yearly_republic.1016.e + stress_and_fulfillment_impact = { + # Stress Gain + wrathful = miniscule_stress_impact_gain + impatient = medium_stress_impact_gain + + # Stress Loss + compassionate = miniscule_stress_impact_loss + calm = medium_stress_impact_loss + stubborn = minor_stress_impact_loss + } + ai_chance = { + base = 100 + modifier = { + factor = 0 + OR = { + has_trait = wrathful + has_trait = impatient + } + } + } + } +} + +##################### +# Philosopher-Kings # +##################### + +#TODO_GDP_BS TIT-68244 Change order of the left_portrait so arm don't go behind the center_portrait. + +yearly_republic.1017 = { + + type = character_event + title = yearly_republic.1017.t + desc = yearly_republic.1017.desc + window = big_event_window + override_background = activity_feast + + theme = republic + + left_portrait = { + character = scope:debater_01 + animation = stunned + camera = camera_body_right + } + center_portrait = { + character = scope:debater_02 + animation = drink + camera = camera_event_center_pointing_left + } + right_portrait = { + character = scope:debater_03 + animation = admiration + camera = camera_body_left_gg + } + lower_center_portrait = { + character = root + } + + cooldown = { years = 10 } + + trigger = { + is_ai = no + government_has_flag = government_is_republic + gdp_is_assembly_head_trigger = yes + # A pledge for the next vote only makes sense while none is under way + ongoing_voting_session = no + any_vassal = { + count >= 3 + gdp_can_pledge_assembly_vote_trigger = yes + } + } + + immediate = { + random_vassal = { + limit = { + gdp_can_pledge_assembly_vote_trigger = yes + } + weight = { + base = 1 + modifier = { + add = 10 + has_trait = shrewd + } + modifier = { + add = 5 + has_trait = lifestyle_poet + } + modifier = { + add = 5 + has_trait = lifestyle_mystic + } + modifier = { + add = 5 + has_trait = administrator + } + modifier = { + add = 10 + has_trait = lifestyle_scholar + } + modifier = { + add = 2 + is_major_assembly_member = yes + } + modifier = { + add = 10 + has_trait_rank = { + trait = education_learning + rank >= 2 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = debater_01 + } + random_vassal = { + limit = { + gdp_can_pledge_assembly_vote_trigger = yes + this != scope:debater_01 + } + weight = { + base = 1 + modifier = { + add = 10 + has_trait = shrewd + } + modifier = { + add = 5 + has_trait = lifestyle_poet + } + modifier = { + add = 5 + has_trait = lifestyle_mystic + } + modifier = { + add = 5 + has_trait = administrator + } + modifier = { + add = 10 + has_trait = lifestyle_scholar + } + modifier = { + add = 2 + is_major_assembly_member = yes + } + modifier = { + add = 10 + has_trait_rank = { + trait = education_learning + rank >= 2 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = debater_02 + } + random_vassal = { + limit = { + gdp_can_pledge_assembly_vote_trigger = yes + this != scope:debater_01 + this != scope:debater_02 + } + weight = { + base = 1 + modifier = { + add = 10 + has_trait = shrewd + } + modifier = { + add = 5 + has_trait = lifestyle_poet + } + modifier = { + add = 5 + has_trait = lifestyle_mystic + } + modifier = { + add = 5 + has_trait = administrator + } + modifier = { + add = 10 + has_trait = lifestyle_scholar + } + modifier = { + add = 2 + is_major_assembly_member = yes + } + modifier = { + add = 10 + has_trait_rank = { + trait = education_learning + rank >= 2 + } + } + modifier = { + factor = 0.5 + opinion = { + target = root + value < 0 + } + } + } + save_scope_as = debater_03 + } + # The sharpest of the three sets the bar for each kind of argument + ordered_vassal = { + limit = { + OR = { + this = scope:debater_01 + this = scope:debater_02 + this = scope:debater_03 + } + } + order_by = diplomacy + save_scope_as = debater_orator + } + ordered_vassal = { + limit = { + OR = { + this = scope:debater_01 + this = scope:debater_02 + this = scope:debater_03 + } + } + order_by = learning + save_scope_as = debater_scholar + } + } + + ## "Brilliant Oratory will convince them." + option = { + name = yearly_republic.1017.a + + duel = { + skill = diplomacy + target = scope:debater_orator + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1017.a.success.desc + send_interface_toast = { + title = yearly_republic.1017.a.success.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:debater_orator + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:debater_01 + } + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:debater_02 + } + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:debater_03 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1017.a.failure.desc + send_interface_toast = { + title = yearly_republic.1017.a.failure.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:debater_orator + add_prestige = minor_prestige_loss + } + } + } + + stress_and_fulfillment_impact = { + # Gain + shy = minor_stress_impact_gain + # Loss + gregarious = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = shy + } + } + } + + ## "The soundness of my reasoning will dazzle them." + option = { + name = yearly_republic.1017.b + + duel = { + skill = learning + target = scope:debater_scholar + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = 3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1017.b.success.desc + send_interface_toast = { + title = yearly_republic.1017.b.success.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:debater_scholar + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:debater_01 + } + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:debater_02 + } + gdp_pledge_assembly_vote_effect = { + PLEDGER = scope:debater_03 + } + } + } + 50 = { + compare_modifier = { + value = scope:duel_value + multiplier = -3.5 + min = -49 + } + min = 5 + desc = yearly_republic.1017.b.failure.desc + send_interface_toast = { + title = yearly_republic.1017.b.failure.toast + type = event_toast_effect_bad + left_icon = root + right_icon = scope:debater_scholar + add_prestige = minor_prestige_loss + } + } + } + + stress_and_fulfillment_impact = { + # Gain + humble = minor_stress_impact_gain + # Loss + arrogant = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = humble + } + } + } + + ## "Maybe its better to listen and learn." + option = { + name = yearly_republic.1017.c + + send_interface_toast = { + title = yearly_republic.1017.c.toast + type = event_toast_effect_good + left_icon = root + right_icon = scope:debater_scholar + add_learning_lifestyle_xp = medium_lifestyle_xp + } + + custom_tooltip = yearly_republic.1017.c.tt + hidden_effect = { + random = { + chance = 15 + random_list = { + 25 = { + send_interface_toast = { + title = yearly_republic.1017.c.insight.toast + type = event_toast_effect_good + left_icon = root + add_learning_skill = 1 + } + } + 25 = { + trigger = { + NOT = { has_trait = lifestyle_mystic } + } + send_interface_toast = { + title = yearly_republic.1017.c.insight.toast + type = event_toast_effect_good + left_icon = root + add_trait = lifestyle_mystic + } + } + 25 = { + trigger = { + NOT = { has_trait = lifestyle_poet } + } + send_interface_toast = { + title = yearly_republic.1017.c.insight.toast + type = event_toast_effect_good + left_icon = root + add_trait = lifestyle_poet + } + } + 25 = { + trigger = { + NOR = { + has_trait = shrewd + has_trait = dull + } + } + send_interface_toast = { + title = yearly_republic.1017.c.insight.toast + type = event_toast_effect_good + left_icon = root + add_trait = shrewd + } + } + } + } + } + + stress_and_fulfillment_impact = { + # Gain + arrogant = minor_stress_impact_gain + # Loss + humble = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + factor = 0 + has_trait = arrogant + } + } + } +} + +############################ +# Friend Comes Bearing Gifts# +############################ +## Player get an domicile artifact from a friendly merchant/patrician/adventurer. + +yearly_republic.1018 = { + + type = character_event + title = yearly_republic.1018.t + desc = yearly_republic.1018.desc + override_background = bp2_courtyard + + theme = republic + + left_portrait = { + character = root + animation = happiness + camera = camera_event_crowd + } + right_portrait = { + character = scope:benefactor_01 + animation = admiration + camera = camera_event_far_right_very_right + } + artifact = { + target = scope:new_curio + position = lower_center_portrait + } + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + exists = house + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + any_relation = { + type = friend + type = soulmate + type = lover + NOR = { + is_spouse_of = root + is_close_family_of = root + } + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + + immediate = { + every_relation = { + type = friend + type = soulmate + type = lover + limit = { + NOR = { + is_spouse_of = root + is_close_family_of = root + } + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + add_to_list = potential_benefactor_list + } + random_in_list = { + list = potential_benefactor_list + weight = { + base = 1 + modifier = { + factor = 50 + OR = { + government_has_flag = government_is_merchant + is_landless_adventurer = yes + } + } + # Prefer best friends next + modifier = { + factor = 10 + has_relation_best_friend = root + } + } + save_scope_as = benefactor_01 + } + hidden_effect = { + random_dummy_gender_effect = yes + house = { + switch = { + trigger = has_house_aspiration_parameter + republic_commerce = { + scope:benefactor_01 = { + random_gift_artifact_commerce_effect = { + OWNER = scope:benefactor_01 + CREATOR = scope:dummy_gender + SUBJECT = flag:stewardship + TOPIC = flag:no + } + } + scope:new_trinket ?= { save_scope_as = new_curio } + scope:newly_created_artifact ?= { save_scope_as = new_curio } + } + republic_aggrandizement = { + scope:benefactor_01 = { + random_gift_artifact_aggrandizement_effect = { + OWNER = scope:benefactor_01 + CREATOR = scope:dummy_gender + } + } + scope:new_trinket ?= { save_scope_as = new_curio } + scope:newly_created_artifact ?= { save_scope_as = new_curio } + } + republic_communal = { + scope:benefactor_01 = { + random_gift_artifact_communal_effect = { + OWNER = scope:benefactor_01 + CREATOR = scope:dummy_gender + SUBJECT = flag:stewardship + TOPIC = flag:no + } + } + scope:new_trinket ?= { save_scope_as = new_curio } + scope:newly_created_artifact ?= { save_scope_as = new_curio } + } + republic_signorial = { + scope:benefactor_01 = { + random_gift_artifact_signorial_effect = { + OWNER = scope:benefactor_01 + CREATOR = scope:dummy_gender + } + } + scope:new_trinket ?= { save_scope_as = new_curio } + scope:newly_created_artifact ?= { save_scope_as = new_curio } + } + republic_agitation = { + scope:benefactor_01 = { + random_gift_artifact_agitation_effect = { + OWNER = scope:benefactor_01 + CREATOR = scope:dummy_gender + } + } + scope:new_trinket ?= { save_scope_as = new_curio } + scope:newly_created_artifact ?= { save_scope_as = new_curio } + } + fallback = { + scope:benefactor_01 = { + create_curio_artifact_effect = { + OWNER = scope:benefactor_01 + CREATOR = scope:dummy_gender + } + } + scope:new_trinket ?= { save_scope_as = new_curio } + scope:newly_created_artifact ?= { save_scope_as = new_curio } + scope:new_curio ?= { + add_artifact_modifier = artifact_diplomacy_1_modifier + } + } + } + } + } + } + + # ""Thank you, my friend!"" + option = { + name = yearly_republic.1018.a + + scope:new_curio = { + set_owner = { + target = root + history = { + type = given + actor = scope:benefactor_01 + recipient = root + location = root.location # optional + } + } + } + + stress_and_fulfillment_impact = { + # Loss + base = minor_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + OR = { + has_trait = gregarious + has_trait = humble + } + } + } + } + # "Perhaps this could fetch a good price?" + option = { + name = yearly_republic.1018.b + # Sale price scales with the curio's quality (falling back to wealth, then rarity) + add_gold = { + value = 0 + if = { + limit = { exists = scope:new_curio.var:quality } + add = scope:new_curio.var:quality + } + else_if = { + limit = { exists = scope:new_curio.var:wealth } + add = scope:new_curio.var:wealth + } + else_if = { + limit = { scope:new_curio = { rarity = illustrious } } + add = 80 + } + else_if = { + limit = { scope:new_curio = { rarity = famed } } + add = 50 + } + else_if = { + limit = { scope:new_curio = { rarity = masterwork } } + add = 30 + } + else = { + add = 15 + } + multiply = 2 + min = 20 + max = 150 + # Round to the nearest 5 to match gold formatting conventions + divide = 5 + ceiling = yes + multiply = 5 + } + custom_tooltip = yearly_republic.1018_domicile_curio_sold_tt + hidden_effect = { + scope:new_curio = { + set_owner = { + target = root + history = { + type = given + actor = scope:benefactor_01 + recipient = root + location = root.location # optional + } + } + } + } + + add_character_flag = yearly_republic_1018_selling_artifact + + stress_and_fulfillment_impact = { + # Loss + greedy = medium_stress_impact_loss + paranoid = medium_stress_impact_loss + } + + ai_chance = { + base = 100 + modifier = { + add = 50 + OR = { + has_trait = greedy + has_trait = paranoid + } + } + } + } + after = { + if = { + limit = { + has_character_flag = yearly_republic_1018_selling_artifact + } + destroy_owned_artifact = scope:new_curio + remove_character_flag = yearly_republic_1018_selling_artifact + } + } +} + +###################### +# An Eye for Details # +###################### +## Player get some trade expertise by discussions with a friend - more if the friend is a merchant. + +scripted_effect set_trade_category_for_experience_effect_01 = { + random_trade_good_category = { + limit = { + has_trade_good_category_xp_track = yes + } + save_scope_as = $CATEGORY_SCOPE$ + } +} + +scripted_effect set_trade_category_for_experience_effect_02 = { + random_trade_good_category = { + limit = { + has_trade_good_category_xp_track = yes + this != scope:experience_trade_category_01 + } + save_scope_as = $CATEGORY_SCOPE$ + } +} + +scripted_effect give_trade_category_experience_effect = { + add_trade_good_category_xp = { + target = $CATEGORY$ + value = $VALUE$ + } +} + +yearly_republic.1019 = { + type = character_event + title = yearly_republic.1019.t + desc = yearly_republic.1019.desc + override_background = gdp_artisan_street + + theme = republic + + left_portrait = { + character = root + animation = thinking + camera = camera_body + } + right_portrait = { + character = scope:benefactor_01 + animation = debating + camera = camera_body + } + cooldown = { years = 10 } + + + trigger = { + government_has_flag = government_is_republic + is_travelling = no + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + any_relation = { + type = friend + type = soulmate + type = lover + NOR = { + is_spouse_of = root + is_close_family_of = root + } + is_travelling = no + is_available_quick = { + adult = yes + travel = no + imprisoned = no + incapable = no + in_army = no + } + } + } + + immediate = { + location = { save_scope_as = event_location_01 } + random_barony = { + limit = { + exists = holder + holder = { in_diplomatic_range = root } + } + save_scope_as = target_city + } + every_relation = { + type = friend + type = soulmate + type = lover + limit = { + NOR = { + is_spouse_of = root + is_close_family_of = root + } + is_available_quick = { + travel = no + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + add_to_list = potential_benefactor_list + } + random_in_list = { + list = potential_benefactor_list + weight = { + base = 1 + modifier = { + factor = 50 + OR = { + government_has_flag = government_is_merchant + } + } + modifier = { + factor = 25 + OR = { + is_landless_adventurer = yes + } + } + # Prefer best friends next + modifier = { + factor = 10 + has_relation_best_friend = root + } + } + save_scope_as = benefactor_01 + } + set_trade_category_for_experience_effect_01 = { + CATEGORY_SCOPE = experience_trade_category_01 + } + set_trade_category_for_experience_effect_02 = { + CATEGORY_SCOPE = experience_trade_category_02 + } + } + + # ""Did you learn about [experience_trade_category_01.GetNameNoTooltip] during your travels?"" + option = { + name = yearly_republic.1019.a + + every_held_title = { + limit = { + is_noble_family_title = yes + } + if = { + limit = { + scope:benefactor_01 = { + government_has_flag = government_is_merchant + } + } + give_trade_category_experience_effect = { + CATEGORY = scope:experience_trade_category_01 + VALUE = trade_expertise_xp_major_value + } + } + else = { + give_trade_category_experience_effect = { + CATEGORY = scope:experience_trade_category_01 + VALUE = trade_expertise_xp_medium_value + } + } + } + ai_chance = { + base = 100 + modifier = { + add = 100 + any_held_title = { + is_noble_family_title = yes + save_temporary_scope_as = held_title_01 + trade_good_category_level = { + target = scope:experience_trade_category_01 + value >= 5 + } + NOT = { + any_trade_good_category = { + this != scope:experience_trade_category_01 + save_temporary_scope_as = rival_category + "scope:held_title_01.trade_good_category_level(scope:rival_category)" > "scope:held_title_01.trade_good_category_level(scope:experience_trade_category_01)" + } + } + } + } + } + } + + # ""Let's discuss the [experience_trade_category_02.GetNameNoTooltip] business at the market."" + option = { + name = yearly_republic.1019.b + every_held_title = { + limit = { + is_noble_family_title = yes + } + if = { + limit = { + scope:benefactor_01 = { + government_has_flag = government_is_merchant + } + } + give_trade_category_experience_effect = { + CATEGORY = scope:experience_trade_category_02 + VALUE = trade_expertise_xp_major_value + } + } + else = { + give_trade_category_experience_effect = { + CATEGORY = scope:experience_trade_category_02 + VALUE = trade_expertise_xp_medium_value + } + } + } + ai_chance = { + base = 100 + modifier = { + add = 100 + any_held_title = { + is_noble_family_title = yes + save_temporary_scope_as = held_title_01 + trade_good_category_level = { + target = scope:experience_trade_category_02 + value >= 5 + } + NOT = { + any_trade_good_category = { + this != scope:experience_trade_category_02 + save_temporary_scope_as = rival_category + "scope:held_title_01.trade_good_category_level(scope:rival_category)" > "scope:held_title_01.trade_good_category_level(scope:experience_trade_category_02)" + } + } + } + } + } + } + + # "I should make observation a daily habit." + option = { + name = yearly_republic.1019.c + add_character_modifier = { + modifier = gdp_learning_from_the_masses + years = 10 + } + + ai_chance = { + base = 100 + } + } +} + +###################### +# The Bathhouse Deal # +###################### +## Player get to choose between getting some competitive benefit or higher trade range modifier by cooperating with a friendly house. + +yearly_republic.1020 = { + + type = character_event + title = yearly_republic.1020.t + desc = yearly_republic.1020.desc + override_background = bath_house + widget = { gui = event_window_widget_vfx_fog container = foreground_shader_vfx_container } + + theme = republic + + left_portrait = { + character = root + animation = drink_goblet + } + right_portrait = { + character = scope:house_benefactor_01 + animation = chaplain + } + cooldown = { years = 10 } + + trigger = { + government_has_flag = government_is_republic + is_travelling = no + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + house = { + any_house_relation = { + OR = { + has_house_relation_level = cordial + has_house_relation_level = friendly + has_house_relation_level = amity + } + any_relation_house = { + NOT = { this = root.house } + } + } + } + } + + immediate = { + house = { + random_house_relation = { + limit = { + OR = { + has_house_relation_level = cordial + has_house_relation_level = friendly + has_house_relation_level = amity + } + any_relation_house = { + NOT = { this = root.house } + house_head = { + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + } + random_relation_house = { + limit = { + NOT = { this = root.house } + house_head = { + is_travelling = no + is_available_quick = { + adult = yes + imprisoned = no + incapable = no + in_army = no + } + } + } + house_head = { save_scope_as = house_benefactor_01 } + } + } + } + add_character_flag = is_naked + scope:house_benefactor_01 = { add_character_flag = is_naked } + } + + # ""We should share agents and contacts abroad, widening our reach."" + option = { + name = yearly_republic.1020.a + + house ?= { + add_house_modifier = { + modifier = gdp_cooperation_correspondenti_house_modifier + years = 20 + } + change_house_relation_effect = { + HOUSE = scope:house_benefactor_01.house + VALUE = house_relation_improve_medium_value + REASON = cooperation + CHAR = root + TARGET_CHAR = scope:house_benefactor_01 + TITLE = scope:dummy_gender + } + } + hidden_effect = { + scope:house_benefactor_01 = { + house ?= { + add_house_modifier = { + modifier = gdp_cooperation_correspondenti_house_modifier + years = 20 + } + } + } + } + + ai_chance = { + base = 100 + } + } + + # ""Let's share our expertise and grow stronger together."" + option = { + name = yearly_republic.1020.b + + house ?= { + add_house_modifier = { + modifier = gdp_cooperation_compagnia_house_modifier + years = 20 + } + change_house_relation_effect = { + HOUSE = scope:house_benefactor_01.house + VALUE = house_relation_improve_medium_value + REASON = cooperation + CHAR = root + TARGET_CHAR = scope:house_benefactor_01 + TITLE = scope:dummy_gender + } + } + hidden_effect = { + scope:house_benefactor_01 = { + house ?= { + add_house_modifier = { + modifier = gdp_cooperation_compagnia_house_modifier + years = 20 + } + } + } + } + + ai_chance = { + base = 100 + } + } + after = { + remove_character_flag = is_naked + scope:house_benefactor_01 = { remove_character_flag = is_naked } + } +} diff --git a/events/yearly_events/yearly_events_sahara.txt b/events/yearly_events/yearly_events_sahara.txt index 44e307362..9f6f1342f 100644 --- a/events/yearly_events/yearly_events_sahara.txt +++ b/events/yearly_events/yearly_events_sahara.txt @@ -649,7 +649,7 @@ yearly_saharan.0005 = { #Torch half the county to flip them back. scope:target_county = { change_county_control = massive_county_control_loss - change_development_progress = major_development_progress_loss + change_prosperity_progress = major_prosperity_progress_loss add_county_modifier = { modifier = persecuted_converts_saharan_modifier years = 25 @@ -710,13 +710,13 @@ scripted_effect pick_nomad-appropriate_county_effect = { multiply = 0.1 } } - #Weight down higher development counties proportionally: both not the focus of the event, and less likely to be accepted by the player. + #High prosperity is not the focus and players rarely take it, so we weight those counties down modifier = { add = { - value = development_level + value = prosperity_level multiply = -1 } - development_level >= bad_development_level + prosperity_level >= bad_prosperity_level } } }