• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Zenith77

Recruit
43 Badges
Nov 21, 2019
1
2
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Ancient Relics
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Lithoids
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: La Resistance
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Federations
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Crusader Kings III
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Megacorp
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris - Path to Destruction bundle
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV

Information​

I have verifed my game files (Steam only)​

Yes

I have disabled all mods​

Yes

I am running the latest game update​

Yes

Required​

Summary​

Invade Kingdom is completely broken

Description​

Selecting Invade Kingdom for Asatru characters is broken

Steps to reproduce​

1) Start a new game
2) Select any Norse / Asatru character
3) Select another character and declare war
4) Select "Invade Kingdom"
5) System does show Kingdom selected
6) Can't switch between different Kingdoms

Also included my save game that shows the error.

Holy War for Kingdom is okay.

Game Version​

1.10.1

Platform​

Windows

Additional Information​

Affected Feature​

  • Gameplay

Save Game​

View attachment Yngling_867_01_01.ck3

Other Attachments​

ck3-bug.png

 
  • 2Like
Reactions:
Upvote 0
You can switch.
If you expand the list below, "If you enforce your Demands", you'll see that the results change with different kingdoms.
I just tested with yesmen command, enforcing demands gives me the kingdom I declared for.
I think the map highlight doesn't change because technically it lets you take any county outside of the target kingdom too, if you occupy it. All of them are up for grabs. So it's a visual issue with the way the system works, but it does work.
 
invasion_war = {
icon = invasion
group = invasion

combine_into_one = yes
should_show_war_goal_subview = yes
mutually_exclusive_titles = { always = yes }
allow_hostages = no

allowed_for_character = {
OR = {
government_has_flag = government_is_tribal
faith = {
has_doctrine_parameter = invasion_cb_enabled
}
has_character_flag = bp2_inspired_culture_for_conquest
}
NOT = {
has_character_flag = used_lifetime_invasion
}
}

allowed_for_character_display_regardless = {
trigger_if = {
limit = {
has_character_flag = bp2_inspired_culture_for_conquest
}
prestige_level >= 0
}
trigger_else_if = {
limit = {
culture = {
has_cultural_parameter = cb_lower_prestige_level_requirement
}
}
prestige_level >= 3
}
trigger_else = {
prestige_level >= 4
}
}

allowed_against_character = {
scope:attacker = {
ALL_FALSE = {
top_liege = scope:defender.top_liege
liege = scope:defender
}
}
}
target_titles = all
target_title_tier = kingdom
target_de_jure_regions_above = yes
ignore_effect = change_title_holder

ai_can_target_all_titles = {
can_use_viking_invasion_cbs_trigger = yes
}
ai_score_mult = {
value = viking_conquest_ai_score_value

# AI in struggles act insularly for wars that don't have a familial or legal basis.
multiply = struggle_wars_prioritise_struggle_targets_value
}

valid_to_start = {
scope:target = {
any_in_de_jure_hierarchy = {
tier = tier_county
neighboring_county_or_viking_conquest_trigger = { CHARACTER = root }
}
}
# Struggle constraint
struggle_blocks_invasion_conquest_cb_trigger = yes
}

should_invalidate = {
NOT = {
any_in_list = {
list = target_titles
any_in_de_jure_hierarchy = {
tier = tier_county
holder = {
target_is_same_character_or_above = scope:defender
}
}
}
}
}

on_invalidated_desc = msg_invasion_war_invalidated_message

on_invalidated = {
scope:attacker = {
if = {
limit = {
is_alive = yes
}
remove_character_flag = used_lifetime_invasion # If the war is invalidated, you should be permitted to try again
}
}
}

cost = {
piety = {
value = 0
add = common_cb_impious_piety_cost
}
prestige = {
add = {
value = 2000
desc = CB_BASE_COST
}

multiply = common_cb_prestige_cost_multiplier
}
}

on_declaration = {
on_declared_war = yes
scope:attacker = {
add_character_flag = used_lifetime_invasion
}
}

on_victory_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:attacker = { is_local_player = yes } }
desc = invasion_war_victory_desc_attacker
}
desc = invasion_war_victory_desc
}
triggered_desc = {
trigger = { scope:attacker = { is_local_player = yes } }
desc = invasion_war_warning_desc
}
}

on_victory = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes }

create_title_and_vassal_change = {
type = conquest
save_scope_as = change
add_claim_on_loss = yes
}

hidden_effect = {
scope:defender = {
# Title transfer tooltip for display
every_held_county = {
limit = {
duchy.kingdom = { is_in_list = target_titles }
}
custom_tooltip = invasion_title_transfer_tt
}
# Vassal transfer tooltip for display
every_vassal = {
custom = invasion_vassal_transfer_tt
show_as_tooltip = {
change_liege = {
liege = scope:attacker
change = scope:change
}
}
}
}
}

#hidden_effect = {
setup_invasion_cb = {
titles = target_titles
attacker = scope:attacker
defender = scope:defender
change = scope:change
take_occupied = yes
}
resolve_title_and_vassal_change = scope:change
#}

# Attacker gets Prestige Experience, Defender loses Prestige, all other participants gain Prestige based on their war contribution.
modify_all_participants_fame_values = {
WINNER = scope:attacker
LOSER = scope:defender
FAME_BASE = scope:cb_prestige_factor # Set by 'setup_invasion_cb'
IS_RELIGIOUS_WAR = no
WINNER_FAME_SCALE = 10
LOSER_FAME_SCALE = -10
WINNER_ALLY_FAME_SCALE = 10
LOSER_ALLY_FAME_SCALE = 10
}

# Truce
add_truce_attacker_victory_effect = yes

# FP1: note the victory for future memorialisation via stele (if applicable).
scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes }
}

on_white_peace_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_white_peace = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for doing ok against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes }
scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker # Not important as the scales are identical
FAME_BASE = major_prestige_value
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Truce
add_truce_white_peace_effect = yes

scope:attacker = {
add_prestige = mongol_invasion_cb_prestige_white_peace
stress_impact = {
ambitious = medium_stress_impact_gain
arrogant = medium_stress_impact_gain
}
}

scope:defender = {
stress_impact = {
arrogant = medium_stress_impact_gain
}
}
}

on_defeat_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_defeat = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:defender = { accolade_defender_war_end_glory_gain_high_effect = yes }

# Prestige loss for the attacker
scope:attacker = {
pay_short_term_gold_reparations_effect = {
GOLD_VALUE = 5
}
add_prestige = {
value = massive_prestige_value
multiply = -1.0
}
}

setup_invasion_cb = {
titles = target_titles
attacker = scope:attacker
defender = scope:defender
claimant = scope:claimant
victory = no
}

# Attacker loses Prestige, all other war participants gain Prestige (Defender gains full prestige, all allies on both sides gain based on war contribution).
modify_all_participants_fame_values = {
WINNER = scope:defender
LOSER = scope:attacker
FAME_BASE = scope:cb_prestige_factor # Set by 'setup_claim_cb'
IS_RELIGIOUS_WAR = no
WINNER_FAME_SCALE = scale_10_war_defender_win
LOSER_FAME_SCALE = -10
WINNER_ALLY_FAME_SCALE = 10
LOSER_ALLY_FAME_SCALE = 10
}

add_truce_attacker_defeat_effect = yes

scope:attacker = {
save_temporary_scope_as = loser
}
on_lost_aggression_war_discontent_loss = yes
}

transfer_behavior = transfer

on_primary_attacker_death = inherit
on_primary_defender_death = inherit

attacker_allies_inherit = yes
defender_allies_inherit = yes

war_name = "INVASION_WAR_NAME"
war_name_base = "INVASION_WAR_NAME_BASE"
cb_name = "INVASION_CB_NAME"

interface_priority = 100

use_de_jure_wargoal_only = yes

attacker_wargoal_percentage = 0.8

max_defender_score_from_occupation = 150
max_attacker_score_from_occupation = 150
}

clan_invasion_war = {
icon = invasion
group = invasion

combine_into_one = yes
should_show_war_goal_subview = yes
mutually_exclusive_titles = { always = yes }

allow_hostages = no
allowed_for_character = {
government_has_flag = government_is_clan
NOR = {
has_character_flag = used_lifetime_invasion
faith = { has_doctrine_parameter = invasion_cb_enabled }
}
}

allowed_for_character_display_regardless = {
trigger_if = {
limit = {
culture = {
has_cultural_parameter = cb_lower_prestige_level_requirement
}
}
prestige_level >= 3
}
trigger_else = {
prestige_level >= 4
}
}

allowed_against_character = {
scope:attacker = {
ALL_FALSE = {
top_liege = scope:defender.top_liege
liege = scope:defender
}
}
}
target_titles = all
target_title_tier = all
target_de_jure_regions_above = yes
ignore_effect = change_title_holder
ai_only_against_neighbors = yes

ai_score_mult = {
value = 1

# AI in struggles act insularly for wars that don't have a familial or legal basis.
multiply = struggle_wars_prioritise_struggle_targets_value
}

valid_to_start = {
scope:target = {
tier = tier_kingdom
}
# Struggle constraint
struggle_blocks_invasion_conquest_cb_trigger = yes
}

should_invalidate = {
NOT = {
any_in_list = {
list = target_titles
any_in_de_jure_hierarchy = {
tier = tier_county
holder = {
OR = {
this = scope:defender
target_is_liege_or_above = scope:defender
}
}
}
}
}
}

on_invalidated_desc = msg_invasion_war_invalidated_message

on_invalidated = {
scope:attacker = {
remove_character_flag = used_lifetime_invasion # If the war is invalidated, you should be permitted to try again
}
}

cost = {
piety = {
value = 0
add = common_cb_impious_piety_cost
}
prestige = {
add = {
value = 2000
desc = CB_BASE_COST
}

multiply = common_cb_prestige_cost_multiplier
}
}

on_declaration = {
on_declared_war = yes
scope:attacker = {
add_character_flag = used_lifetime_invasion
}
}

on_victory_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:attacker = { is_local_player = yes } }
desc = clan_invasion_war_victory_desc_attacker
}
desc = clan_invasion_war_victory_desc
}
triggered_desc = {
trigger = { scope:attacker = { is_local_player = yes } }
desc = invasion_war_warning_desc
}
}

on_victory = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes }

create_title_and_vassal_change = {
type = conquest
save_scope_as = change
add_claim_on_loss = yes
}

#hidden_effect = {
setup_invasion_cb = {
titles = target_titles
attacker = scope:attacker
defender = scope:defender
change = scope:change
take_occupied = yes
}
#}

hidden_effect = {
scope:defender = {
# Vassal transfer tooltip for display
every_vassal = {
custom = invasion_vassal_transfer_tt
show_as_tooltip = {
change_liege = {
liege = scope:attacker
change = scope:change
}
}
}
}
}

#If target is lower tier, vassalise them.
if = {
limit = {
scope:defender.primary_title.tier < scope:attacker.primary_title.tier
}
scope:defender = {
change_liege = {
liege = scope:attacker
change = scope:change
}
}
}

#If target has any personally-held titles of equal tier, excepting empires take them.
#If target is equal tier,
if = {
limit = {
#Conquering, or indirectly butchering, an entire empire in one war is a bit much.
NOT = { scope:defender.primary_title.tier = tier_empire }
scope:defender.primary_title.tier = scope:attacker.primary_title.tier
}
every_in_list = {
list = target_titles
change_title_holder = {
holder = scope:attacker
change = scope:change
}
}
}

hidden_effect = { resolve_title_and_vassal_change = scope:change }

# Attacker gets Prestige Experience, Defender loses Prestige, all other participants gain Prestige based on their war contribution.
# Prestige level progress for the attacker
scope:attacker = {
add_prestige_experience = {
value = major_prestige_value
}
}

# Prestige loss for the defender
scope:defender = {
add_prestige = {
value = major_prestige_value
multiply = -1.0
}
}

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker
FAME_BASE = major_prestige_value
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Truce
add_truce_attacker_victory_effect = yes

# FP1: note the victory for future memorialisation via stele (if applicable).
scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes }
}

on_white_peace_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_white_peace = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for doing ok against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes }
scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker # Not important as the scales are identical
FAME_BASE = major_prestige_value
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Truce
add_truce_white_peace_effect = yes

scope:attacker = {
add_prestige = mongol_invasion_cb_prestige_white_peace
stress_impact = {
ambitious = medium_stress_impact_gain
arrogant = medium_stress_impact_gain
}
}

scope:defender = {
stress_impact = {
arrogant = medium_stress_impact_gain
}
}
}

on_defeat_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_defeat = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:defender = { accolade_defender_war_end_glory_gain_high_effect = yes }

# Prestige loss for the attacker
scope:attacker = {
pay_short_term_gold_reparations_effect = {
GOLD_VALUE = 5
}
add_prestige = {
value = massive_prestige_value
multiply = -1.0
}
}

setup_invasion_cb = {
titles = target_titles
attacker = scope:attacker
defender = scope:defender
claimant = scope:claimant
victory = no
}

# Attacker loses Prestige, all other war participants gain Prestige (Defender gains full prestige, all allies on both sides gain based on war contribution).
modify_all_participants_fame_values = {
WINNER = scope:defender
LOSER = scope:attacker
FAME_BASE = scope:cb_prestige_factor # Set by 'setup_claim_cb'
IS_RELIGIOUS_WAR = no
WINNER_FAME_SCALE = scale_10_war_defender_win
LOSER_FAME_SCALE = -10
WINNER_ALLY_FAME_SCALE = 10
LOSER_ALLY_FAME_SCALE = 10
}

add_truce_attacker_defeat_effect = yes

scope:attacker = {
save_temporary_scope_as = loser
}
on_lost_aggression_war_discontent_loss = yes
}

transfer_behavior = transfer

on_primary_attacker_death = inherit
on_primary_defender_death = inherit

attacker_allies_inherit = yes
defender_allies_inherit = yes

war_name = "INVASION_WAR_NAME"
war_name_base = "INVASION_WAR_NAME_BASE"
cb_name = "INVASION_CB_NAME"

interface_priority = 100

use_de_jure_wargoal_only = yes

attacker_wargoal_percentage = 0.8
max_defender_score_from_occupation = 150
max_attacker_score_from_occupation = 150

max_ai_diplo_distance_to_title = 500
}

mongol_invasion_war = {
icon = invasion
group = invasion

combine_into_one = yes
should_show_war_goal_subview = yes
mutually_exclusive_titles = { always = yes }

allow_hostages = no
allowed_for_character = {
this = title:e_mongol_empire.holder
government_has_flag = government_is_tribal
prestige_level >= 1
}

allowed_against_character = {
scope:attacker = {
ALL_FALSE = {
top_liege = scope:defender.top_liege
liege = scope:defender
}
}
}
target_titles = neighbor_land_or_water
target_title_tier = all
target_de_jure_regions_above = yes
ignore_effect = change_title_holder

valid_to_start = {
scope:target = {
tier = tier_kingdom
}
}

should_invalidate = {
NOT = {
any_in_list = {
list = target_titles
any_in_de_jure_hierarchy = {
tier = tier_county
holder = {
OR = {
this = scope:defender
target_is_liege_or_above = scope:defender
}
}
}
}
}
}

on_invalidated_desc = msg_mongol_invasion_war_invalidated_message

on_invalidated = {
}

cost = {
piety = {
value = 0
add = common_cb_impious_piety_cost
}
prestige = {
add = {
value = 200
desc = CB_BASE_COST
}

multiply = common_cb_prestige_cost_multiplier

# Genghis Khan gets it for free
if = {
limit = { scope:attacker = { has_character_flag = is_temujin } }
multiply = 0
}
}
}

on_declaration = {
on_declared_war = yes
}

on_victory_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:attacker = { is_local_player = yes } }
desc = mongol_invasion_war_victory_desc_attacker
}
desc = mongol_invasion_war_victory_desc
}
}

on_victory = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_high_effect = yes }

create_title_and_vassal_change = {
type = conquest
save_scope_as = change
add_claim_on_loss = yes
}


# go through the dejure hierarchy under target titles, transfer titles with same or worse tolerance holders (their religion equaly or less tolerated than the defender's),
# take the holder as vassal otherwise and don't go deeper
every_in_list = {
list = target_titles
custom_tooltip = CONQUEST_CB_TITLE
every_in_de_jure_hierarchy = {
continue = {
OR = {
NOT = {
exists = holder
}
NOT = {
holder = {
target_is_liege_or_above = scope:defender
}
}
AND = {
scope:attacker.faith = {
faith_hostility_level_comparison = {
prev.holder.faith <= scope:defender.faith
}
}
holder = {
OR = {
this = scope:defender
target_is_liege_or_above = scope:defender
}
}
}
}
tier > tier_county
}
limit = {
#tier = tier_county
exists = holder
holder = {
OR = {
this = scope:defender
target_is_liege_or_above = scope:defender
}
}
}

if = {
limit = {
OR = {
scope:attacker.faith = {
faith_hostility_level_comparison = {
prev.holder.faith >= scope:defender.faith
}
}
holder.primary_title.tier >= scope:attacker.primary_title.tier
}
}
add_to_temporary_list = titles_taken
}
else = {
holder = {
add_to_temporary_list = vassals_taken
}
}
}
}

hidden_effect = {
scope:defender = {
# Title transfer tooltip for display
every_held_county = {
limit = {
OR = {
duchy.kingdom.empire = { is_in_list = target_titles }
county_controller = scope:attacker
}
}
custom_tooltip = invasion_title_transfer_tt
}
custom_tooltip = invasion_title_transfer_2_tt
# Vassal transfer tooltip for display
every_vassal = {
custom = invasion_vassal_transfer_tt
show_as_tooltip = {
change_liege = {
liege = scope:attacker
change = scope:change
}
}
}
}
}

every_in_list = {
list = titles_taken
change_title_holder = {
holder = scope:attacker
change = scope:change
take_baronies = yes
}
}

every_in_list = {
list = vassals_taken
change_liege = {
liege = scope:attacker
change = scope:change
}
}

hidden_effect = { resolve_title_and_vassal_change = scope:change }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker
FAME_BASE = mongol_invasion_cb_ally_prestige
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Prestige level progress for the attacker
scope:attacker = {
add_prestige_experience = {
value = mongol_invasion_cb_prestige_experience_gain
}
}

# Truce
add_truce_attacker_victory_effect = yes

# FP1: note the victory for future memorialisation via stele (if applicable).
scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes }
}

on_white_peace_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_white_peace = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for doing ok against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_low_effect = yes }
scope:defender = { accolade_defender_war_end_glory_gain_med_effect = yes }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker # Not important as the scales are identical
FAME_BASE = mongol_invasion_cb_ally_prestige
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

add_truce_white_peace_effect = yes

scope:attacker = {
add_prestige = mongol_invasion_cb_prestige_white_peace
stress_impact = {
ambitious = medium_stress_impact_gain
arrogant = medium_stress_impact_gain
}
}

scope:defender = {
stress_impact = {
arrogant = medium_stress_impact_gain
}
}
}

on_defeat_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_defeat = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:defender = { accolade_defender_war_end_glory_gain_high_effect = yes }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:defender # Not important as the scales are identical
FAME_BASE = mongol_invasion_cb_ally_prestige
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Truce
add_truce_attacker_defeat_effect = yes

# piety change
every_in_list = {
list = target_titles

scope:defender = {
add_prestige = mongol_invasion_cb_prestige_gain
}

scope:attacker = {
if = {
limit = {
scope:defender = { is_ai = no }
}
if = {
limit = {
monthly_character_income > 0
}
pay_short_term_income = {
years = 3
target = scope:defender
}
}
else = {
pay_short_term_gold = {
target = scope:defender
gold = medium_gold_value
}
}
}
}
}

scope:attacker = {
every_vassal = {
custom = custom.every_vassal
add_opinion = {
modifier = liege_lost_mongol_invasion_war
target = prev
}
}
}

scope:attacker = {
save_temporary_scope_as = loser
}
on_lost_aggression_war_discontent_loss = yes
}

transfer_behavior = transfer

on_primary_attacker_death = inherit
on_primary_defender_death = inherit

attacker_allies_inherit = yes
defender_allies_inherit = yes

war_name = "MONGOL_INVASION_WAR_NAME"
cb_name = "MONGOL_INVASION_KINGDOM_CB_NAME"

interface_priority = 100

use_de_jure_wargoal_only = yes

attacker_wargoal_percentage = 0.8
max_defender_score_from_occupation = 150
max_attacker_score_from_occupation = 150

max_ai_diplo_distance_to_title = 500
}

mongol_realm_invasion_war = {
icon = invasion
group = invasion

combine_into_one = yes
should_show_war_goal_subview = yes
mutually_exclusive_titles = { always = yes }

allow_hostages = no
allowed_for_character = {
this = title:e_mongol_empire.holder
is_ai = yes # To keep it clean and simple for players
prestige_level >= 1
}

allowed_against_character = {
NOT = { scope:defender.top_liege = scope:attacker }
scope:attacker = {
ALL_FALSE = {
top_liege = scope:defender.top_liege
liege = scope:defender
}
}
}
target_titles = neighbor_land_or_water
target_title_tier = all
target_de_jure_regions_above = yes
use_de_jure_wargoal_only = yes
ignore_effect = change_title_holder

valid_to_start = {
scope:target = {
tier = tier_empire
}
}

should_invalidate = {
NOT = {
any_in_list = {
list = target_titles
any_in_de_jure_hierarchy = {
tier = tier_county
holder = {
OR = {
this = scope:defender
target_is_liege_or_above = scope:defender
}
}
}
}
}
}

on_invalidated_desc = msg_mongol_invasion_war_invalidated_message

on_invalidated = {
}

cost = {
piety = {
value = 0
add = common_cb_impious_piety_cost
}
prestige = {
add = {
value = 200
desc = CB_BASE_COST
}

multiply = common_cb_prestige_cost_multiplier

# Genghis Khan gets it for free
if = {
limit = { scope:attacker = { has_character_flag = is_temujin } }
multiply = {
value = 0
desc = CB_GENGHIS_KHAN_COST
}
}

# If fired by the Mongol Invasion story, don't charge a cost
if = {
limit = { scope:attacker = { has_character_flag = free_mongol_cb } }
multiply = {
value = 0
desc = CB_MONGOL_INVASIONS_COST
}
}
}
}

on_declaration = {
on_declared_war = yes
}

on_victory_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:attacker = { is_local_player = yes } }
desc = invasion_war_victory_desc_attacker
}
desc = invasion_war_victory_desc
}
}

on_victory = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_very_high_effect = yes }

create_title_and_vassal_change = {
type = conquest
save_scope_as = change
add_claim_on_loss = yes
}

# Target titles + dominant empires only
scope:defender = {
# Check whether any additional empires should be considered target titles
# First check for the primary defender
every_realm_de_jure_empire = {
limit = {
any_in_de_jure_hierarchy = { # Then check how many de jure counties are in the Mongol Emperor's realm
count >= 8 # This number determines how many counties activates the threshold for taking these titles
continue = {
tier > tier_county
}
exists = this
tier = tier_county
exists = holder
holder.top_liege = scope:attacker
}
}
add_to_temporary_list = target_titles
}
# Mark any empire-level titles for destruction after transfer
every_realm_de_jure_empire = {
limit = {
holder = scope:defender
is_in_list = target_titles
}
add_to_list = titles_to_destroy
}
}

hidden_effect = {
scope:defender = {
# Title transfer tooltip for display
every_held_county = {
limit = {
OR = {
duchy.kingdom.empire = { is_in_list = target_titles }
county_controller = scope:attacker
}
}
custom_tooltip = invasion_title_transfer_tt
}
custom_tooltip = invasion_title_transfer_2_tt
# Vassal transfer tooltip for display
every_vassal = {
custom = invasion_vassal_transfer_tt
show_as_tooltip = {
change_liege = {
liege = scope:attacker
change = scope:change
}
}
}
}
}

# Most of the title transfers are handled here
#hidden_effect = {
setup_invasion_cb = {
titles = target_titles
attacker = scope:attacker
defender = scope:defender
change = scope:change
take_occupied = yes
}
#}

scope:defender = {
# Loot tooltip for display
every_held_county = {
custom = mongol_invasion_loot_county_tt
random = {
chance = scope:attacker.martial
custom_tooltip = mongol_invasion_loot_gold_tt
custom_tooltip = mongol_invasion_loot_development_tt
custom_tooltip = mongol_invasion_loot_dread_tt
}
}
hidden_effect = {
# Sub realm looting
every_sub_realm_county = {
custom = mongol_invasion_loot_chance_tt
limit = {
duchy.kingdom.empire = { is_in_list = target_titles }
}
mongol_invasion_county_looting_chance_effect = yes
}
# Vassal sub realm looting
every_vassal_or_below = {
every_sub_realm_county = {
limit = {
holder = { is_ai = yes }
duchy.kingdom.empire = { is_in_list = target_titles }
}
mongol_invasion_county_looting_chance_effect = yes
}
}
}
}

resolve_title_and_vassal_change = scope:change

# Destroy any titles that should be destroyed
every_in_list = {
list = titles_to_destroy
custom = invasion_titles_destroyed_tt
save_scope_as = title_to_destroy
scope:attacker = { destroy_title = scope:title_to_destroy }
}
# If the defender was vassalised, take any Kingdom title they hold
scope:defender = {
if = {
limit = {
target_is_liege_or_above = scope:attacker
any_held_title = {
tier = tier_kingdom
}
}
create_title_and_vassal_change = {
type = conquest
save_scope_as = change_two
add_claim_on_loss = yes
}
every_held_title = {
limit = {
tier = tier_kingdom
}
change_title_holder = {
holder = scope:attacker
change = scope:change_two
}
}
resolve_title_and_vassal_change = scope:change_two
}
}

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker
FAME_BASE = mongol_invasion_cb_ally_prestige
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Prestige level progress for the attacker
scope:attacker = {
add_prestige_experience = {
value = mongol_invasion_cb_prestige_experience_gain
}
}

# Truce
add_truce_attacker_victory_effect = yes

# FP1: note the victory for future memorialisation via stele (if applicable).
scope:attacker = { fp1_remember_recent_conquest_victory_effect = yes }
}

on_white_peace_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_white_peace = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for doing ok against higher ranked enemy
scope:attacker = { accolade_attacker_war_end_glory_gain_med_effect = yes }
scope:defender = { accolade_defender_war_end_glory_gain_high_effect = yes }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:attacker # Not important as the scales are identical
FAME_BASE = mongol_invasion_cb_ally_prestige
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

add_truce_white_peace_effect = yes

scope:attacker = {
add_prestige = mongol_invasion_cb_prestige_white_peace
stress_impact = {
ambitious = medium_stress_impact_gain
arrogant = medium_stress_impact_gain
}
}

scope:defender = {
stress_impact = {
arrogant = medium_stress_impact_gain
}
}
}

on_defeat_desc = {
first_valid = {
triggered_desc = {
trigger = { scope:defender = { is_local_player = yes } }
desc = invasion_war_white_peace_desc_defender
}
desc = invasion_war_white_peace_desc
}
}

on_defeat = {
scope:attacker = { show_pow_release_message_effect = yes }

#EP2 accolade glory gain for winning against higher ranked enemy
scope:defender = { accolade_defender_war_end_glory_gain_very_high_effect = yes }

# Allies on both sides get full prestige value for helping in the war, based on their war participation.
modify_allies_of_participants_fame_values = {
WINNER = scope:defender
FAME_BASE = mongol_invasion_cb_ally_prestige
IS_RELIGIOUS_WAR = no
WINNER_ALLY_FAME_SCALE = 1
LOSER_ALLY_FAME_SCALE = 1
}

# Truce
add_truce_attacker_defeat_effect = yes

# piety change
every_in_list = {
list = target_titles

scope:defender = {
add_prestige = mongol_invasion_cb_prestige_gain
}

scope:attacker = {
if = {
limit = {
scope:defender = { is_ai = no }
}
if = {
limit = {
monthly_character_income > 0
}
pay_short_term_income = {
years = 3
target = scope:defender
}
}
else = {
pay_short_term_gold = {
target = scope:defender
gold = medium_gold_value
}
}
}
}
}

scope:attacker = {
custom_tooltip = {
text = mongol_invasion_vassal_disapproves_defeat


every_vassal = {
custom = custom.every_vassal
add_opinion = {
modifier = liege_lost_mongol_invasion_war
target = prev
}
}
}
}

scope:attacker = {
save_temporary_scope_as = loser
}
on_lost_aggression_war_discontent_loss = yes
}

transfer_behavior = transfer

on_primary_attacker_death = inherit
on_primary_defender_death = inherit

attacker_allies_inherit = yes
defender_allies_inherit = yes

war_name = "MONGOL_INVASION_WAR_NAME"
cb_name = "MONGOL_INVASION_EMPIRE_CB_NAME"

interface_priority = 100

use_de_jure_wargoal_only = yes

attacker_wargoal_percentage = 0.8
max_defender_score_from_occupation = 150
max_attacker_score_from_occupation = 150

max_ai_diplo_distance_to_title = 500
}