################################### # TAI MIGRATION EVENTS ################################### namespace = tgp_tai_migration_event # Tai settlers are migrating to your province tgp_tai_migration_event.1000 = { type = character_event title = tgp_tai_migration_event.1000.t desc = tgp_tai_migration_event.1000.desc window = big_event_window theme = realm right_portrait = { character = root camera = camera_event_right_crowner_crowning animation = personality_rational } left_portrait = { character = scope:migration_leader camera = camera_event_group_talking_left_left animation = admiration } cooldown = { years = 10 } immediate = { random_county_in_region = { region = custom_tai_migration_origin limit = { culture = { has_cultural_pillar = heritage_tai } } save_scope_as = migration_origin holder = { save_scope_as = migration_origin_holder } culture = { save_scope_as = migration_origin_culture } faith = { save_scope_as = migration_origin_faith } } random_realm_county = { limit = { title_province = { geographical_region = custom_tai_migration_target } culture = { NOT = { has_cultural_pillar = heritage_tai } } } save_scope_as = migration_target } hidden_effect = { create_character = { template = settlement_elder_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = male after_creation = { set_to_lowborn = yes } save_scope_as = migration_leader } add_visiting_courtier = scope:migration_leader } } option = { # accept them name = tgp_tai_migration_event.1000.a scope:migration_target = { set_county_culture = culture:tai add_county_modifier = { modifier = tgp_tai_migration_migration_happened_county_modifier years = 20 } } culture = { change_cultural_acceptance = { target = culture:tai value = 10 desc = cultural_acceptance_gain_event } } add_character_modifier = { modifier = tgp_tai_migration_migration_happened_character_modifier years = 10 } } option = { # accept only the skilled, not enough to change culture, but development trigger = { is_ai = no } name = tgp_tai_migration_event.1000.b scope:migration_target = { add_county_modifier = { modifier = tgp_tai_migration_skilled_development_county_modifier years = 10 } } add_prestige = medium_prestige_gain } option = { # shoo them away trigger = { is_ai = no } name = tgp_tai_migration_event.1000.c add_character_modifier = { modifier = tgp_tai_migration_migration_rejected_character_modifier years = 10 } custom_tooltip = { text = tgp_tai_migration_event_1000.c_shooed_immigrants_tt random_list = { 80 = { random_ruler = { # send them to another eligible migration reciever; since this is a non-ai option, it won't happen again twice for the ai, and they'll settle there limit = { any_owned_story = { type = story_tai_migrations } is_ai = yes } trigger_event = { id = tgp_tai_migration_event.1000 months = 1 } } } 20 = {} } } } after = { hidden_effect = { if = { # make option a's elder disappear only if he's not recruited with character interaction limit = { scope:migration_leader = { NOT = { is_courtier_of = root } } } scope:migration_leader = { silent_disappearance_effect = yes } } } } } scripted_effect courtier_replacement_scripted_effect = { #Replace current character if any if = { limit = { employs_court_position = $POSITION$ } add_courtier = $CHARACTER$ every_court_position_holder = { type = $POSITION$ save_temporary_scope_as = current_court_position_holder employer = { replace_court_position = { recipient = $CHARACTER$ holder = scope:current_court_position_holder court_position = $POSITION$ } } } } #Or simply appoint new character else = { add_courtier = $CHARACTER$ appoint_court_position = { recipient = $CHARACTER$ court_position = $POSITION$ } } custom_tooltip = will_have_excellent_aptitude } # Skilled Tai character offers services tgp_tai_migration_event.2000 = { type = character_event title = tgp_tai_migration_event.2000.t desc = { desc = tgp_tai_migration_event.2000.desc first_valid = { triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_wet_nurse } } desc = tgp_tai_migration_event.2000.wet_nurse.desc } triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_champion } } desc = tgp_tai_migration_event.2000.champion.desc } triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_travel_leader } } desc = tgp_tai_migration_event.2000.travel_leader.desc } triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_master_of_hunt } } desc = tgp_tai_migration_event.2000.master_of_hunt.desc } triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_court_physician } } desc = tgp_tai_migration_event.2000.court_physician.desc } triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_antiquarian } } desc = tgp_tai_migration_event.2000.antiquarian.desc } triggered_desc = { trigger = { scope:migrant_skilled_character = { has_character_flag = migrant_court_tutor } } desc = tgp_tai_migration_event.2000.court_tutor.desc } } desc = tgp_tai_migration_event.2000.end.desc } theme = realm right_portrait = { character = root camera = camera_event_right_crowner_crowning animation = personality_rational } left_portrait = { character = scope:migrant_skilled_character camera = camera_event_group_talking_left_left animation = admiration } cooldown = { years = 20 } trigger = { OR = { # checks if any of the following court posiitons are present at the court OR = { can_employ_court_position_type = wet_nurse_court_position employs_court_position = wet_nurse_court_position } OR = { can_employ_court_position_type = champion_court_position employs_court_position = champion_court_position } OR = { can_employ_court_position_type = travel_leader_court_position employs_court_position = travel_leader_court_position } OR = { can_employ_court_position_type = master_of_hunt_court_position employs_court_position = master_of_hunt_court_position } OR = { can_employ_court_position_type = court_physician_court_position employs_court_position = court_physician_court_position } OR = { can_employ_court_position_type = antiquarian_court_position employs_court_position = antiquarian_court_position } OR = { can_employ_court_position_type = court_tutor_court_position employs_court_position = court_tutor_court_position } } } immediate = { random_county_in_region = { # locate a Tai county where the character supposedly migrated from region = custom_tai_migration_origin limit = { culture = { has_cultural_pillar = heritage_tai } } save_scope_as = migration_origin holder = { save_scope_as = migration_origin_holder } culture = { save_scope_as = migration_origin_culture } faith = { save_scope_as = migration_origin_faith } } hidden_effect = { # Pick one of six court positions and create a character randomly random_list = { 1 = { trigger = { OR = { can_employ_court_position_type = wet_nurse_court_position employs_court_position = wet_nurse_court_position } } create_character = { template = wet_nurse_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_wet_nurse } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } 1 = { trigger = { OR = { can_employ_court_position_type = champion_court_position employs_court_position = champion_court_position } } create_character = { template = champion_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_champion } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } 1 = { trigger = { OR = { can_employ_court_position_type = travel_leader_court_position employs_court_position = travel_leader_court_position } } create_character = { template = travel_leader_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_travel_leader } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } 1 = { trigger = { OR = { can_employ_court_position_type = master_of_hunt_court_position employs_court_position = master_of_hunt_court_position } } create_character = { template = master_of_hunt_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_master_of_hunt } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } 1 = { trigger = { OR = { can_employ_court_position_type = court_physician_court_position employs_court_position = court_physician_court_position } } create_character = { template = court_physician_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_court_physician } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } 1 = { trigger = { OR = { can_employ_court_position_type = antiquarian_court_position employs_court_position = antiquarian_court_position } } create_character = { template = antiquarian_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_antiquarian } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } 3 = { trigger = { OR = { can_employ_court_position_type = court_tutor_court_position employs_court_position = court_tutor_court_position } } create_character = { template = court_tutor_court_position_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes add_character_flag = migrant_court_tutor } save_scope_as = migrant_skilled_character } add_visiting_courtier = scope:migrant_skilled_character } } } } option = { name = tgp_tai_migration_event.2000.a # employ the character culture = { change_cultural_acceptance = { target = culture:tai value = 6 desc = cultural_acceptance_gain_event } } if = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_wet_nurse } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = wet_nurse_court_position } } else_if = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_champion } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = champion_court_position } } else_if = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_travel_leader } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = travel_leader_court_position } } else_if = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_master_of_hunt } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = master_of_hunt_court_position } } else_if = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_antiquarian } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = antiquarian_court_position } } else_if = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_court_tutor } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = court_tutor_court_position } } else = { limit = { scope:migrant_skilled_character = { has_character_flag = migrant_court_physician } } courtier_replacement_scripted_effect = { CHARACTER = scope:migrant_skilled_character POSITION = court_physician_court_position } } pay_treasury_or_gold = { target = scope:migrant_skilled_character value = medium_treasury_or_gold_value } ai_chance = { base = 100 } } option = { name = tgp_tai_migration_event.2000.b # invite to court, but not as an employer duel = { skill = diplomacy value = medium_skill_rating 300 = { compare_modifier = { value = scope:duel_value multiplier = 3.5 min = -49 } add_courtier = scope:migrant_skilled_character send_interface_toast = { title = tgp_tai_migration_event.2000.b.success left_icon = root right_icon = scope:migrant_skilled_character add_prestige = minor_prestige_gain } } 50 = { compare_modifier = { value = scope:duel_value multiplier = -3.5 min = -49 } show_as_tooltip = { remove_courtier_or_guest = scope:migrant_skilled_character } hidden_effect = { if = { # make option a's elder disappear only if he's not recruited with character interaction limit = { scope:migrant_skilled_character = { NOT = { is_courtier_of = root } } } scope:migrant_skilled_character = { silent_disappearance_effect = yes } } } send_interface_toast = { title = tgp_tai_migration_event.2000.b.failure left_icon = root right_icon = scope:migrant_skilled_character add_prestige = minor_prestige_loss } } } } option = { name = tgp_tai_migration_event.2000.c # do not employ the character show_as_tooltip = { remove_courtier_or_guest = scope:migrant_skilled_character } hidden_effect = { if = { # make option a's elder disappear only if he's not recruited with character interaction limit = { scope:migrant_skilled_character = { NOT = { is_courtier_of = root } } } scope:migrant_skilled_character = { silent_disappearance_effect = yes } } } } after = { } } # Noble Tai character and his family are asking for a county or a barony title tgp_tai_migration_event.3000 = { type = character_event title = tgp_tai_migration_event.3000.t desc = tgp_tai_migration_event.3000.desc theme = realm right_portrait = { character = root camera = camera_event_right_crowner_crowning animation = personality_rational } left_portrait = { character = scope:title_asking_noble_husband camera = camera_event_group_talking_left_left animation = admiration } cooldown = { years = 5 } trigger = { highest_held_title_tier >= tier_duchy any_held_title = { count > 2 tier = tier_county } } immediate = { random_county_in_region = { # locate a Tai county where the character supposedly migrated from region = custom_tai_migration_origin limit = { culture = { has_cultural_pillar = heritage_tai } } save_scope_as = migration_origin holder = { save_scope_as = migration_origin_holder } culture = { save_scope_as = migration_origin_culture } faith = { save_scope_as = migration_origin_faith } } random_held_title = { limit = { tier = tier_county NOT = { this.county = root.capital_county } } save_scope_as = target_asked_title } hidden_effect = { create_character = { template = local_noble_character location = root.capital_province gender = male culture = scope:migration_origin_culture faith = scope:migration_origin_faith save_scope_as = title_asking_noble_husband } add_visiting_courtier = scope:title_asking_noble_husband create_character = { template = local_noble_character location = root.capital_province gender = female culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { marry = scope:title_asking_noble_husband } save_scope_as = title_asking_noble_wife } create_character = { template = peasant_child_character location = root.capital_province culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = male after_creation = { set_mother = scope:title_asking_noble_wife set_father = scope:title_asking_noble_husband } save_scope_as = title_asking_noble_son } add_visiting_courtier = scope:title_asking_noble_husband add_visiting_courtier = scope:title_asking_noble_wife add_visiting_courtier = scope:title_asking_noble_son } } option = { name = tgp_tai_migration_event.3000.a # accept create_title_and_vassal_change = { type = granted save_scope_as = title_change add_claim_on_loss = no } scope:target_asked_title = { change_title_holder = { holder = scope:title_asking_noble_husband change = scope:title_change } } resolve_title_and_vassal_change = scope:title_change culture = { change_cultural_acceptance = { target = culture:tai value = 8 desc = cultural_acceptance_gain_event } } house = { change_house_relation_effect = { HOUSE = scope:title_asking_noble_husband.house VALUE = house_relation_improve_major_value REASON = title_grant CHAR = root TARGET_CHAR = scope:title_asking_noble_husband TITLE = scope:dummy_gender } } reverse_add_opinion = { modifier = received_title_county target = scope:title_asking_noble_husband } reverse_add_opinion = { modifier = loyalty_opinion target = scope:title_asking_noble_son } add_hook = { type = loyalty_hook target = scope:title_asking_noble_husband } add_hook = { type = loyalty_hook target = scope:title_asking_noble_son } add_prestige = major_prestige_gain stress_impact = { greedy = medium_stress_impact_gain generous = medium_stress_impact_loss } } option = { name = tgp_tai_migration_event.3000.b # reject remove_courtier_or_guest = scope:title_asking_noble_husband remove_courtier_or_guest = scope:title_asking_noble_wife remove_courtier_or_guest = scope:title_asking_noble_son stress_impact = { generous = medium_stress_impact_gain greedy = medium_stress_impact_loss } } after = { } } # A family of peasants are asking to move into your court tgp_tai_migration_event.4000 = { type = character_event title = tgp_tai_migration_event.4000.t desc = tgp_tai_migration_event.4000.desc window = big_event_window theme = realm right_portrait = { character = root camera = camera_event_center_pointing_very_left animation = personality_rational } center_portrait = { character = scope:lowborn_tai_family_husband camera = camera_event_horse_right_facing_left_close animation = admiration } left_portrait = { character = scope:lowborn_tai_family_wife camera = camera_event_group_talking_left_left animation = personality_coward } lower_right_portrait = { character = scope:lowborn_tai_family_son } lower_center_portrait = { character = scope:lowborn_tai_family_daughter } cooldown = { years = 5 } immediate = { random_county_in_region = { region = custom_tai_migration_origin limit = { culture = { has_cultural_pillar = heritage_tai } } save_scope_as = migration_origin holder = { save_scope_as = migration_origin_holder } culture = { save_scope_as = migration_origin_culture } faith = { save_scope_as = migration_origin_faith } } hidden_effect = { create_character = { template = generic_peasant_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = male after_creation = { set_to_lowborn = yes } save_scope_as = lowborn_tai_family_husband } create_character = { template = generic_peasant_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = female after_creation = { set_to_lowborn = yes marry = scope:lowborn_tai_family_husband } save_scope_as = lowborn_tai_family_wife } create_character = { template = peasant_child_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = male after_creation = { set_to_lowborn = yes set_mother = scope:lowborn_tai_family_wife set_father = scope:lowborn_tai_family_husband } save_scope_as = lowborn_tai_family_son } create_character = { template = peasant_child_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = female after_creation = { set_to_lowborn = yes set_mother = scope:lowborn_tai_family_wife set_father = scope:lowborn_tai_family_husband } save_scope_as = lowborn_tai_family_daughter } add_visiting_courtier = scope:lowborn_tai_family_husband add_visiting_courtier = scope:lowborn_tai_family_wife add_visiting_courtier = scope:lowborn_tai_family_son add_visiting_courtier = scope:lowborn_tai_family_daughter } } option = { name = tgp_tai_migration_event.4000.a # accept add_courtier = scope:lowborn_tai_family_husband add_courtier = scope:lowborn_tai_family_wife add_courtier = scope:lowborn_tai_family_son add_courtier = scope:lowborn_tai_family_daughter culture = { change_cultural_acceptance = { target = culture:tai value = 4 desc = cultural_acceptance_gain_event } } reverse_add_opinion = { modifier = loyalty_opinion target = scope:lowborn_tai_family_husband } add_hook = { type = loyalty_hook target = scope:lowborn_tai_family_husband } add_piety = medium_piety_gain stress_impact = { cynical = medium_stress_impact_gain compassionate = medium_stress_impact_loss generous = medium_stress_impact_loss } } option = { name = tgp_tai_migration_event.4000.b # reject show_as_tooltip = { remove_courtier_or_guest = scope:lowborn_tai_family_husband remove_courtier_or_guest = scope:lowborn_tai_family_wife remove_courtier_or_guest = scope:lowborn_tai_family_son remove_courtier_or_guest = scope:lowborn_tai_family_daughter } hidden_effect = { if = { # make characters disappear only if they are not recruited with character interaction limit = { scope:lowborn_tai_family_husband = { NOT = { is_courtier_of = root } } } scope:lowborn_tai_family_husband = { silent_disappearance_effect = yes } } if = { limit = { scope:lowborn_tai_family_wife = { NOT = { is_courtier_of = root } } } scope:lowborn_tai_family_wife = { silent_disappearance_effect = yes } } if = { limit = { scope:lowborn_tai_family_son = { NOT = { is_courtier_of = root } } } scope:lowborn_tai_family_son = { silent_disappearance_effect = yes } } if = { limit = { scope:lowborn_tai_family_daughter = { NOT = { is_courtier_of = root } } } scope:lowborn_tai_family_daughter = { silent_disappearance_effect = yes } } } stress_impact = { compassionate = medium_stress_impact_gain generous = medium_stress_impact_gain cynical = medium_stress_impact_loss } } after = { } } tgp_tai_migration_event.5000 = { # Spawn guests to migration target courts hidden = yes cooldown = { years = 20 } immediate = { random_county_in_region = { region = custom_tai_migration_origin limit = { culture = { has_cultural_pillar = heritage_tai } } culture = { save_scope_as = migration_origin_culture } faith = { save_scope_as = migration_origin_faith } } hidden_effect = { random_list = { 1 = { create_character = { template = beautiful_peasant_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith gender = female after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = witchy_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = merchant_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = hunter_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = very_good_eunuch_character location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = tgp_warrior_monk_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = tgp_court_brahmin_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } 1 = { create_character = { template = tgp_poet_lover_template location = root.capital_province dynasty = none culture = scope:migration_origin_culture faith = scope:migration_origin_faith after_creation = { set_to_lowborn = yes } save_scope_as = guest_tai_character } add_visiting_courtier = scope:guest_tai_character } } } } }