# -*- ck2.cb_types -*- ## normal scopes(including posttitle scopes) ## #ROOT = receiver #FROM = giver # = attacker or receiver ## title scopes ## # ROOT = receiver # FROM = giver # = thirdparty landed title # # the following effects/triggers exists (example execution order: on_success->on_success_title->on_success_posttitle): # is_valid, is_valid_title, on_add, on_add_title, on_add_posttitle, on_success, on_success_title, on_success_posttitle, on_fail, on_fail_title, on_fail_posttitle, on_reverse_demand, on_reverse_demand_title, on_reverse_demand_posttitle # # Added on_attacker_leader_death, on_defender_leader_death and on_thirdparty_death, which all trigger when corresponding character dies # These three all have war scopes, which currently has the following scope changes: # attacker, defender, thirdparty(only valid if thirdparty character is involved), thirdparty_title(only valid if thirdparty title is involved) # # ai_will_do: modifies value AI places on the CB compared to other CBs (default: 1) # can_use_gui: If otherwise valid, the CB is listed in the Diplo View, but you can't declare war unless 'can_use_gui' is also valid (also shows a trigger tooltip.) claim = { name = CB_NAME_CLAIM war_name = WAR_NAME_CLAIM sprite = 1 truce_days = 1825 hostile_against_others = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no press_claim = yes infamy_modifier = 0.85 can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes OR = { ROOT = { is_female = no } NOT = { ROOT = { religion_group = muslim } } } } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { ROOT = { has_strong_claim = PREV } ROOT = { has_character_flag = claimant_adventurer } AND = { ROOT = { has_weak_claim = PREV } OR = { is_pretender = yes # Checks vs ROOT character holder_scope = { has_regent = yes } holder_scope = { trait = uncrowned } AND = { ROOT = { is_female = no } holder_scope = { is_female = yes } } is_contested = yes # Is already being contested in some form of Claim or Succession War } } } emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } ROOT = { has_claim = PREV } } on_add_title = { log = "CB(claim): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes } on_success_title = { log = "CB(claim): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } hidden_tooltip = { ROOT = { if = { limit = { has_nickname = no lower_tier_than = PREV } random = { chance = 50 give_nickname = nick_the_usurper } } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { prestige = -100 } if = { limit = { ROOT = { has_character_flag = claimant_adventurer } } ROOT = { clr_character_flag = claimant_adventurer emf_check_adventurer_government_effect = yes } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail_title = { log = "CB(claim): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 hidden_tooltip = { disband_event_forces = yes clr_character_flag = claimant_adventurer } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand = { emf_cb_defeat_effect = yes ROOT = { prestige = -150 transfer_scaled_wealth = { to = FROM value = 4.0 } } if = { limit = { ROOT = { has_character_flag = claimant_adventurer } } ROOT = { imprison = FROM } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 150 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 150 } } } on_reverse_demand_title = { log = "CB(claim): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" remove_claim = ROOT ROOT = { hidden_tooltip = { disband_event_forces = yes clr_character_flag = claimant_adventurer } } } on_attacker_leader_death = { if = { limit = { ROOT = { has_character_flag = claimant_adventurer } } ROOT = { hidden_tooltip = { disband_event_forces = yes clr_character_flag = claimant_adventurer } } end_war = invalid } } on_invalidation = { log = "CB(claim): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #2 other_claim = { name = CB_NAME_CLAIM war_name = WAR_NAME_OTHER_CLAIM sprite = 2 truce_days = 1825 hostile_against_others = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no press_claim = yes infamy_modifier = 0.5 can_use_gui = { emf_cb_thirdparty_can_use_gui_trigger = yes } can_use = { emf_cb_thirdparty_can_use_trigger = yes FROMFROM = { mercenary = no } } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { ROOT = { is_female = no } AND = { NOT = { ROOT = { religion_group = muslim } } NOT = { succ_law_title = { has_law = agnatic_succession } } } } FROMFROM = { religion_group = ROOT OR = { ai = no FROM = { ai = no } lower_tier_than = EMPEROR is_close_relative = ROOT has_non_aggression_pact_with = ROOT is_friend = ROOT dynasty = ROOT any_spouse = { character = ROOT } } } OR = { # AI will only press something that will gain it territory, unless target is player FROMFROM = { ai = no } # Player pressers can do whatever they want # AI can always press an anti-pope's claim title = k_papal_state title = d_fraticelli AND = { FROMFROM = { primary_title = { higher_tier_than = PREVPREV } # Presser can bind target title } OR = { ROOT = { # Claimant is vassal ruler of presser is_ruler = yes is_liege_or_above = FROMFROM } FROMFROM = { OR = { any_demesne_title = { # Presser is de jure liege of target title, or... de_jure_vassal_or_below = PREVPREV } dynasty = ROOT # Presser is same dynasty as claimant } } } } # Don't care if we'll gain territory if the target is a player FROM = { ai = no } holder_scope = { ai = no } any_playable_ruler = { # Player is an ally that can be called into the war ai = no NOT = { character = FROM } OR = { AND = { independent = yes FROM = { independent = yes } } same_liege = FROM } is_allied_with = FROM } } NOT = { any_war = { # when used in title scope, checks all wars for that title attacker = { character = ROOT } } } OR = { ROOT = { has_strong_claim = PREV } AND = { ROOT = { has_weak_claim = PREV } OR = { is_pretender = yes # Checks vs ROOT character holder_scope = { has_regent = yes } holder_scope = { trait = uncrowned } AND = { ROOT = { is_female = no } holder_scope = { is_female = yes } } is_contested = yes # Is already being contested in some form of Claim or Succession War } } } # Cannot press others' claims for holy orders holy_order = no emf_cb_thirdparty_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } ROOT = { has_claim = PREV } } on_add = { log = "CB(other_claim): START: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" } on_success = { log = "CB(other_claim): VICTORY: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_victory_other_effect = yes hidden_tooltip = { ROOT = { opinion = { modifier = pressed_my_claim who = PREV multiplier = 2 } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { prestige = -100 } } on_success_title = { if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } hidden_tooltip = { ROOT = { if = { limit = { has_nickname = no lower_tier_than = PREV } random = { chance = 50 give_nickname = nick_the_usurper } } } } # Anti-Popes take all the gold of the Vatican if = { limit = { OR = { title = k_papal_state title = d_fraticelli } } FROM = { transfer_scaled_wealth = { to = ROOT value = all } } } if = { limit = { controls_religion = yes holder_scope = { OR = { religion = catholic religion = fraticelli } } } holder_scope = { abdicate_to = ROOT } if = { limit = { FROMFROM = { higher_tier_than = PREV } } ROOT = { set_defacto_liege = FROMFROM emf_liege_change_effect = yes } } } if = { limit = { OR = { controls_religion = no NOT = { holder_scope = { OR = { religion = catholic religion = fraticelli } } } } } if = { limit = { FROMFROM = { primary_title = { higher_tier_than = PREVPREV } # Presser can bind target title } OR = { ROOT = { # Claimant is vassal ruler of presser is_ruler = yes is_liege_or_above = FROMFROM } FROMFROM = { OR = { any_demesne_title = { # Presser is de jure liege of target title, or... de_jure_vassal_or_below = PREVPREV } dynasty = ROOT # Presser is same dynasty as claimant } } } } # Claimant will stay in presser's realm ROOT = { set_character_flag = emf_presser_vassal } if = { limit = { ROOT = { # Claimant is vassal ruler of presser is_ruler = yes is_liege_or_above = FROMFROM } } custom_tooltip = { text = emf_cb_ctt_other_claim_remain_presser_vassal } } if = { limit = { NOT = { # Claimant is not yet a vassal ruler of presser ROOT = { is_ruler = yes is_liege_or_above = FROMFROM } } } custom_tooltip = { text = emf_cb_ctt_other_claim_become_presser_vassal } } } if = { limit = { NOT = { AND = { FROMFROM = { primary_title = { higher_tier_than = PREVPREV } # Presser can bind target title } OR = { ROOT = { # Claimant is vassal ruler of presser is_ruler = yes is_liege_or_above = FROMFROM } FROMFROM = { OR = { any_demesne_title = { # Presser is de jure liege of target title, or... de_jure_vassal_or_below = PREVPREV } dynasty = ROOT # Presser is same dynasty as claimant } } } } } } custom_tooltip = { text = emf_cb_ctt_other_claim_not_presser_vassal } if = { limit = { holder_scope = { liege = { NOT = { character = PREV } higher_tier_than = ROOT } } } holder_scope = { liege = { save_event_target_as = emf_cb_new_liege custom_tooltip = { text = emf_cb_ctt_other_claim_new_liege } } } } if = { limit = { NOT = { holder_scope = { liege = { NOT = { character = PREV } higher_tier_than = ROOT } } } FROM = { liege = { NOT = { character = PREV } } } } FROM = { liege = { save_event_target_as = emf_cb_new_liege custom_tooltip = { text = emf_cb_ctt_other_claim_new_liege } } } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } hidden_tooltip = { ROOT = { if = { limit = { has_character_flag = emf_presser_vassal } if = { limit = { NOT = { is_liege_or_above = FROMFROM } } FROMFROM = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = FROMFROM } } if = { limit = { NOT = { has_character_flag = emf_presser_vassal } } if = { limit = { event_target:emf_cb_new_liege = { always = yes } } event_target:emf_cb_new_liege = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = event_target:emf_cb_new_liege } if = { limit = { NOT = { event_target:emf_cb_new_liege = { always = yes } } } ROOT = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = ROOT } } clr_character_flag = emf_presser_vassal clear_event_target = emf_cb_new_liege emf_liege_change_effect = yes } } } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } } on_success_posttitle = { emf_cb_thirdparty_on_success_posttitle_effect = yes } on_fail = { log = "CB(other_claim): WHITEPEACE: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" } on_fail_title = { ROOT = { prestige = -100 } FROM = { FROM = { prestige = -100 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand = { log = "CB(other_claim): DEFEAT: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_defeat_other_effect = yes prestige = -150 transfer_scaled_wealth = { to = FROM value = 4.0 } ROOT = { prestige = -150 imprison = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 150 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 150 } } } on_reverse_demand_title = { remove_claim = ROOT } on_invalidation = { log = "CB(other_claim): INVALIDATED: [FromFrom.GetTitledFirstName] of [FromFrom.PrimaryTitle.GetBaseName] ([FromFrom.GetID]/[FromFrom.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } # 3 claim_on_liege = { name = CB_NAME_CLAIM war_name = WAR_NAME_CLAIM_LIEGE sprite = 3 truce_days = 1825 hostile_against_others = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no press_claim = yes can_call_vassals = no #attacker_can_call_allies = no major_revolt = yes infamy_modifier = 0.85 can_use = { emf_cb_can_use_trigger = yes } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { ROOT = { has_strong_claim = PREV } ROOT = { has_character_flag = faction_claimant_ultimatum_taken } # Faction war. Ignore claim strength. AND = { ROOT = { has_weak_claim = PREV } OR = { is_pretender = yes # Checks vs ROOT character holder_scope = { has_regent = yes } AND = { ROOT = { is_female = no } holder_scope = { is_female = yes } } is_contested = yes # Is already being contested in some form of Claim or Succession War } } } NOR = { FROM = { is_patrician = yes OR = { capital_holding = { title = PREVPREV } PREV = { is_primary_holder_title_tier = yes } } } ROOT = { is_patrician = yes } } emf_cb_can_use_title_trigger = yes } is_valid = { FROM = { in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } } is_valid_title = { NOT = { holder_scope = { character = ROOT } } OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { has_law = succ_feudal_elective ROOT = { has_claim = PREV } } } on_add = { emf_cb_dynlevy_begin_effect = yes } on_add_title = { log = "CB(claim_on_liege): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } hidden_tooltip = { disband_event_forces = faction_revolters } } } on_success_title = { log = "CB(claim_on_liege): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } any_demesne_title = { limit = { higher_tier_than = DUKE NOT = { title = PREVPREV } } if = { limit = { has_law = crown_authority_1 } add_law = crown_authority_0 } if = { limit = { has_law = crown_authority_2 } add_law = crown_authority_1 } if = { limit = { has_law = crown_authority_3 } add_law = crown_authority_2 } if = { limit = { has_law = crown_authority_4 } add_law = crown_authority_3 } } } # In EMF, all title usurpations drop CA, so just show a tooltip and # don't really do it here (or else we'd drop it twice). if = { limit = { has_law = crown_authority_1 } tooltip = { add_law = crown_authority_0 } } if = { limit = { has_law = crown_authority_2 } tooltip = { add_law = crown_authority_1 } } if = { limit = { has_law = crown_authority_3 } tooltip = { add_law = crown_authority_2 } } if = { limit = { has_law = crown_authority_4 } tooltip = { add_law = crown_authority_3 } } if = { limit = { ROOT = { prisoner = yes host = { character = FROM } } } ROOT = { prisoner = no } } if = { limit = { is_primary_holder_title = yes } FROM = { imprison = ROOT } } usurp_title_plus_barony_if_unlanded_and_vassals_no_adj = { target = ROOT type = claim } ROOT = { emf_dynlevy_update_effect = yes } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } if = { limit = { higher_tier_than = FROM } FROM = { set_defacto_liege = ROOT emf_liege_change_effect = yes } } hidden_tooltip = { ROOT = { if = { limit = { has_nickname = no PREV = { higher_tier_than = COUNT } } random = { chance = 50 give_nickname = nick_the_usurper } } } } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } hidden_tooltip = { any_attacker = { limit = { liege = { character = FROM } } disband_event_forces = faction_revolters } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_fail_title = { log = "CB(claim_on_liege): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -150 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } hidden_tooltip = { any_attacker = { limit = { liege = { character = FROM } } disband_event_forces = faction_revolters prisoner = FROM } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_reverse_demand_title = { log = "CB(claim_on_liege): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = invalid } on_invalidation = { log = "CB(claim_on_liege): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #4 claim_on_liege_plot = { name = CB_NAME_CLAIM war_name = WAR_NAME_CLAIM_LIEGE sprite = 3 truce_days = 1825 hostile_against_others = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no press_claim = yes major_revolt = yes attacker_can_call_allies = no can_ask_to_join_war = no infamy_modifier = 0.85 can_use = { emf_cb_can_use_trigger = yes } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } emf_cb_can_use_title_trigger = yes } is_valid = { FROM = { in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { emf_cb_dynlevy_begin_effect = yes } on_add_title = { log = "CB(claim_on_liege_plot): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } hidden_tooltip = { disband_event_forces = faction_revolters } } } on_success_title = { log = "CB(claim_on_liege_plot): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } any_demesne_title = { limit = { higher_tier_than = DUKE NOT = { title = PREVPREV } } if = { limit = { has_law = crown_authority_1 } add_law = crown_authority_0 } if = { limit = { has_law = crown_authority_2 } add_law = crown_authority_1 } if = { limit = { has_law = crown_authority_3 } add_law = crown_authority_2 } if = { limit = { has_law = crown_authority_4 } add_law = crown_authority_3 } } } # In EMF, all title usurpations drop CA, so just show a tooltip and # don't really do it here (or else we'd drop it twice). if = { limit = { has_law = crown_authority_1 } tooltip = { add_law = crown_authority_0 } } if = { limit = { has_law = crown_authority_2 } tooltip = { add_law = crown_authority_1 } } if = { limit = { has_law = crown_authority_3 } tooltip = { add_law = crown_authority_2 } } if = { limit = { has_law = crown_authority_4 } tooltip = { add_law = crown_authority_3 } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } ROOT = { emf_dynlevy_update_effect = yes } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } ROOT = { plot_succeeds = yes } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 hidden_tooltip = { disband_event_forces = faction_revolters } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } hidden_tooltip = { disband_event_forces = faction_revolters } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_fail_title = { log = "CB(claim_on_liege_plot): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -200 imprison = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 hidden_tooltip = { disband_event_forces = faction_revolters } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } hidden_tooltip = { disband_event_forces = faction_revolters } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_reverse_demand_title = { log = "CB(claim_on_liege_plot): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = invalid } on_invalidation = { log = "CB(claim_on_liege_plot): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #5 claim_on_vassal_plot = { name = CB_NAME_CLAIM_VASSAL war_name = WAR_NAME_CLAIM_VASSAL sprite = 3 truce_days = 3650 hostile_against_others = yes reflect_titleholder_change = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no press_claim = yes attacker_can_call_allies = no can_attack_vassals = yes infamy_modifier = 0.85 can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { de_facto_liege = ROOT } } emf_cb_can_use_title_trigger = yes } is_valid_title = { FROM = { has_landed_title = PREV } ROOT = { has_plot = plot_gain_vassal_title } } on_add_title = { log = "CB(claim_on_vassal_plot): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes ROOT = { prestige = 50 } } on_success_title = { log = "CB(claim_on_vassal_plot): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } ROOT = { plot_succeeds = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { prestige = -100 cancel_plot = plot_gain_vassal_title } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_fail_title = { log = "CB(claim_on_vassal_plot): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes ROOT = { prestige = -200 cancel_plot = plot_gain_vassal_title } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand_title = { log = "CB(claim_on_vassal_plot): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(claim_on_vassal_plot): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { cancel_plot = plot_gain_vassal_title } } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = invalid } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } on_defender_leader_death = { ROOT = { cancel_plot = plot_gain_vassal_title } } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #6 other_claim_on_liege = { name = CB_NAME_CLAIM war_name = WAR_NAME_OTHER_CLAIM sprite = 4 truce_days = 1825 hostile_against_others = yes can_ask_to_join_war = no press_claim = yes can_call_vassals = no #attacker_can_call_allies = no major_revolt = yes infamy_modifier = 0.5 can_use = { emf_cb_thirdparty_can_use_trigger = yes } can_use_title = { FROM = { has_landed_title = PREV } OR = { ROOT = { is_female = no } NOT = { has_law = agnatic_succession } AND = { lower_tier_than = KING is_primary_holder_title = no } FROMFROM = { has_character_flag = faction_claimant_ultimatum_taken } # Faction war. Ignore claim strength. } OR = { ROOT = { has_strong_claim = PREV } FROMFROM = { has_character_flag = faction_claimant_ultimatum_taken } # Faction war. Ignore claim strength. AND = { ROOT = { has_weak_claim = PREV } OR = { is_pretender = yes # Checks vs ROOT character holder_scope = { has_regent = yes } AND = { ROOT = { is_female = no } holder_scope = { is_female = yes } } is_contested = yes # Is already being contested in some form of Claim or Succession War } } } emf_cb_thirdparty_can_use_title_trigger = yes } is_valid = { FROM = { in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } is_valid_title = { NOT = { holder_scope = { character = ROOT } } OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { has_law = succ_feudal_elective ROOT = { has_claim = PREV } } NOT = { any_war = { # when used in title scope, checks all wars for that title attacker = { character = ROOT } } } } on_add = { log = "CB(other_claim_on_liege): START: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_dynlevy_other_begin_effect = yes } on_success = { log = "CB(other_claim_on_liege): VICTORY: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_victory_other_effect = yes any_attacker = { limit = { OR = { character = ROOT character = PREV } } participation_scaled_prestige = 100 hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { NOT = { character = ROOT } NOT = { character = PREV } } hidden_tooltip = { participation_scaled_prestige = 100 disband_event_forces = faction_revolters } } ROOT = { opinion = { modifier = pressed_my_claim who = PREV } } } on_success_title = { if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } # In EMF, all title usurpations drop CA, so just show a tooltip and # don't really do it here (or else we'd drop it twice). if = { limit = { has_law = crown_authority_1 } tooltip = { add_law = crown_authority_0 } } if = { limit = { has_law = crown_authority_2 } tooltip = { add_law = crown_authority_1 } } if = { limit = { has_law = crown_authority_3 } tooltip = { add_law = crown_authority_2 } } if = { limit = { has_law = crown_authority_4 } tooltip = { add_law = crown_authority_3 } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } any_demesne_title = { limit = { higher_tier_than = DUKE NOT = { title = PREVPREV } } if = { limit = { has_law = crown_authority_1 } add_law = crown_authority_0 } if = { limit = { has_law = crown_authority_2 } add_law = crown_authority_1 } if = { limit = { has_law = crown_authority_3 } add_law = crown_authority_2 } if = { limit = { has_law = crown_authority_4 } add_law = crown_authority_3 } } } if = { limit = { ROOT = { prisoner = yes host = { character = FROM } } } ROOT = { prisoner = no } } if = { limit = { is_primary_holder_title = yes } hidden_tooltip = { FROM = { set_character_flag = temp_other_claim_on_liege_prison } } } hidden_tooltip = { ROOT = { if = { limit = { has_nickname = no lower_tier_than = PREV } random = { chance = 50 give_nickname = nick_the_usurper } } } } # If the claimant has the wrong government type, take care of that first. if = { limit = { higher_tier_than = ROOT holder_scope = { is_feudal = yes } ROOT = { is_ruler = yes OR = { is_theocracy = yes is_republic = yes } } } ROOT = { abdicate = yes } } usurp_title_plus_barony_if_unlanded_and_vassals_no_adj = { target = ROOT type = claim } ROOT = { emf_dynlevy_update_effect = yes } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } } on_success_posttitle = { hidden_tooltip = { if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } } ROOT = { set_defacto_liege = PREV emf_liege_change_effect = yes } } if = { limit = { top_liege = { ROOT = { NOT = { top_liege = { character = PREVPREV } } } } } ROOT = { set_defacto_liege = ROOT emf_liege_change_effect = yes } } if = { limit = { FROM = { has_character_flag = temp_other_claim_on_liege_prison lower_tier_than = PREV } } FROM = { imprison = ROOT } } FROM = { clr_character_flag = temp_other_claim_on_liege_prison } } emf_cb_dynlevy_other_end_effect = yes emf_cb_thirdparty_on_success_posttitle_effect = yes } on_fail = { log = "CB(other_claim_on_liege): WHITEPEACE: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_dynlevy_other_end_effect = yes prestige = -100 imprison = FROM #if = { # Issue CKTWO-233 # limit = { # OR = { # is_liege_of = ROOT # ROOT = { is_liege_or_above = FROM } # } # } # ROOT = { imprison = FROM } #} any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } hidden_tooltip = { any_attacker = { disband_event_forces = faction_revolters } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_reverse_demand = { log = "CB(other_claim_on_liege): DEFEAT: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_defeat_other_effect = yes emf_imperial_decay_loss_effect = yes emf_cb_dynlevy_other_end_effect = yes prestige = -200 imprison = FROM #if = { # Issue CKTWO-233 # limit = { # OR = { # is_liege_of = ROOT # ROOT = { is_liege_or_above = FROM } # } # } # ROOT = { imprison = FROM } #} any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } hidden_tooltip = { any_attacker = { limit = { liege = { character = FROM } } disband_event_forces = faction_revolters prisoner = FROM } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_invalidation = { log = "CB(other_claim_on_liege): INVALIDATED: [FromFrom.GetTitledFirstName] of [FromFrom.PrimaryTitle.GetBaseName] ([FromFrom.GetID]/[FromFrom.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_dynlevy_other_end_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #7 claim_all = { name = CB_NAME_CLAIM_ALL war_name = WAR_NAME_CLAIM_ALL sprite = 5 truce_days = 1825 is_permanent = yes can_ask_to_join_war = no is_claim_all = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { total_claims = { who = FROM strong = yes # Count only strong claims value = 2 } } } is_valid = { ROOT = { total_claims = { who = FROM strong = yes # Count only strong claims value = 1 # must have at least one claim left } } } on_add = { log = "CB(claim_all): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { any_claim = { limit = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } ROOT = { has_strong_claim = PREV } } log = "CB(claim_all): ADD_TITLE: [This.GetID]" press_claim = ROOT } } } on_success = { log = "CB(claim_all): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { any_claim = { limit = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } ROOT = { has_strong_claim = PREV } } if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } } } hidden_tooltip = { ROOT = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } character_event = { id = LoR.30 days = 12 } } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(claim_all): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -150 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 75 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 75 } } } on_reverse_demand = { log = "CB(claim_all): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } any_claim = { limit = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } ROOT = { has_strong_claim = PREV } } remove_claim = ROOT } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(claim_all): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 1.5 # Prefer claim_all to claim } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #8 change_seniority_succession_law = { name = CB_NAME_SENIORITY_SUCCESSION_LAW war_name = WAR_NAME_SENIORITY_SUCCESSION_LAW sprite = 6 truce_days = 1825 attacker_can_call_allies = no can_ask_to_join_war = no major_revolt = yes can_use = { always = no } is_valid = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #9 change_primogeniture_succession_law = { name = CB_NAME_PRIMOGENITURE_SUCCESSION_LAW war_name = WAR_NAME_PRIOGENITURE_SUCCESSION_LAW sprite = 6 truce_days = 1825 attacker_can_call_allies = no can_ask_to_join_war = no major_revolt = yes can_use = { always = no } is_valid = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #10 change_feudal_elective_succession_law = { name = CB_NAME_FEUDAL_ELECTIVE_SUCCESSION_LAW war_name = WAR_NAME_FEUDAL_ELECTIVE_SUCCESSION_LAW sprite = 6 truce_days = 1825 attacker_can_call_allies = no can_ask_to_join_war = no major_revolt = yes is_permanent = no can_use = { always = no } is_valid = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #11 invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 7 truce_days = 1825 hostile_against_others = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { mercenary = no } } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add_title = { log = "CB(invasion): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { prestige = 200 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } hidden_tooltip = { ROOT = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = invasion } clr_global_flag = emf_latb_upon_gain if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_victorious } 10 = { give_nickname = nick_the_bold } 10 = { give_nickname = nick_the_conqueror } } } if = { limit = { has_nickname = nick_the_bastard } give_nickname = nick_the_conqueror } if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } character_event = { id = LoR.30 days = 12 } } } } FROM = { prestige = -200 } } on_success_title = { log = "CB(invasion): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes custom_tooltip = { text = emf_cb_ctt_invasion_success hidden_tooltip = { usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } FROM = { ROOT = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = ROOT emf_liege_change_effect = yes } if = { limit = { FROM = { is_liege_or_above = ROOT } } FROM = { imprison = ROOT } } } if = { limit = { higher_tier_than = BARON NOT = { culture = ROOT } } hidden_tooltip = { conquest_culture = ROOT } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { prestige = -200 } FROM = { prestige = 100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_fail_title = { log = "CB(invasion): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 8.0 } } FROM = { prestige = 200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_reverse_demand_title = { log = "CB(invasion): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" remove_claim = ROOT } on_invalidation = { log = "CB(invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = whitepeace } attacker_ai_victory_worth = { factor = 150 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #12 tribal_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 1825 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { has_horde_culture = yes custom_tooltip = { text = emf_ctt_no_cooldowns_enabled hidden_tooltip = { has_global_flag = emf_no_cooldowns } } custom_tooltip = { text = tribal_invasion_done_ctt hidden_tooltip = { NOT = { has_character_flag = subjugation_done } } } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { is_nomadic = no OR = { AND = { has_dlc = "Horse Lords" higher_tier_than = COUNT OR = { has_character_flag = horde_invader AND = { independent = yes religion_group = pagan_group OR = { culture_group = altaic culture_group = magyar culture_group = mesoamerican } FROM = { NOT = { religion_group = pagan_group } # Should subjugate these instead } } } } AND = { NOT = { has_dlc = "Horse Lords" } NAND = { # Should use emf_horde_invasion instead has_landed_title = e_mongol_empire ai = yes } independent = yes higher_tier_than = COUNT OR = { religion_group = pagan_group AND = { OR = { has_horde_culture = yes has_character_flag = horde_invader } NOT = { religion_group = christian } } } OR = { culture_group = altaic culture_group = magyar culture_group = mesoamerican } OR = { has_horde_culture = yes has_character_flag = horde_invader FROM = { NOT = { religion_group = pagan_group } # Should subjugate these instead } } } AND = { mercenary = yes NOT = { num_of_titles = 2 } } # Blank check has_character_flag = tribal_inv_requirements_bypass } } ROOT = { NOT = { same_realm = FROM } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # Vanilla no longer requires ROOT to border the target kingdom. # For the AI, we will allow this, because they don't target non-neighbors # unless they truly must (perhaps the mongols?). For players, we # will still require either a border or simply a county within the target kingdom. OR = { ROOT = { ai = yes } any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { OR = { holder_scope = { OR = { character = ROOT is_liege_or_above = ROOT } } location = { owner = { OR = { character = FROM is_liege_or_above = FROM } } any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { ROOT = { if = { limit = { has_horde_culture = no NOT = { has_global_flag = emf_no_cooldowns } } custom_tooltip = { text = tribal_invasion_launch_ctt hidden_tooltip = { set_character_flag = subjugation_done } } } } } on_add_title = { log = "CB(tribal_invasion): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { prestige = 200 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } FROM = { prestige = -200 } hidden_tooltip = { ROOT = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = invasion } clr_global_flag = emf_latb_upon_gain if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_victorious } 10 = { give_nickname = nick_the_conqueror } 10 = { give_nickname = nick_the_brave } 10 = { give_nickname = nick_the_dragon } 10 = { give_nickname = nick_the_terrible } } } } } } on_success_title = { log = "CB(tribal_invasion): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes custom_tooltip = { text = emf_cb_ctt_tribal_invasion_success hidden_tooltip = { pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = invasion } } pf_liege_change_under_title_end_effect = yes if = { limit = { e_mexikha = { holder = ROOT } } ROOT = { any_realm_province = { limit = { OR = { has_province_flag = aztec_explorers has_province_flag = aztec_second_wave } } culture = nahuatl religion = aztec clr_province_flag = aztec_explorers clr_province_flag = aztec_second_wave } } } # Scripted case where this war is invoked by meneth.400 if = { limit = { title = k_anatolia ROOT = { has_landed_title = e_persia } FROM = { has_landed_title = e_byzantium } } ROOT = { character_event = { id = meneth.401 } } # Form Rum } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { FROM = { prestige = 100 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -200 } } on_fail_title = { log = "CB(tribal_invasion): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_reverse_demand_title = { log = "CB(tribal_invasion): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(tribal_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 ROOT = { has_horde_culture = no } FROM = { ai = no } } # Try to guide the Hordes in the right direction modifier = { factor = 0.1 ROOT = { OR = { dynasty = 613 # Seljuks dynasty = 800 # Timurids primary_title = { title = e_il-khanate } } } OR = { AND = { empire = { NOT = { title = e_persia title = e_byzantium title = e_arabia } } NOT = { # SWMH kingdom titles that have no empire but should be conquered title = k_aljazira title = k_armenia title = k_syria title = k_antioch title = k_jerusalem } } FROM = { primary_title = { title = e_golden_horde } NOT = { year = 1300 } } } } modifier = { factor = 0.1 ROOT = { primary_title = { title = e_golden_horde } } OR = { empire = { OR = { title = e_persia title = e_byzantium title = e_arabia } } title = k_aljazira title = k_armenia title = k_syria title = k_antioch title = k_jerusalem FROM = { primary_title = { title = e_il-khanate } NOT = { year = 1300 } } } } modifier = { factor = 0.1 ROOT = { culture = hungarian primary_title = { OR = { title = k_hungary title = e_carpathia } } } OR = { empire = { OR = { title = e_tartaria title = e_russia } } title = k_crimea title = k_taurica title = k_galicia title = k_poland } } } } #13 crusade = { name = CB_NAME_CRUSADE war_name = WAR_NAME_CRUSADE sprite = 9 truce_days = 3650 is_permanent = yes is_holy_war = yes battle_warscore_mult = 0.375 check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes apply_short_occ_mod = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { has_called_crusade = no OR = { religion_authority = 0.04 AND = { religion_group = muslim religion_authority = 0.03 } } OR = { has_character_flag = reclaim_heresy_crusade religion_group = zoroastrian_group religion_group = jewish_group AND = { religion_group = pagan_group custom_tooltip = { text = CTT_PAGAN_GHWS_UNLOCKED has_global_flag = pagan_ghws_unlocked } } AND = { religion_group = christian custom_tooltip = { text = CTT_CHRISTIAN_CRUSADES_UNLOCKED has_global_flag = christian_crusades_unlocked } } AND = { religion_group = muslim custom_tooltip = { text = CTT_MUSLIM_JIHADS_UNLOCKED has_global_flag = muslim_jihads_unlocked } } } custom_tooltip = { text = cathar_holy_war_enabled_ctt hidden_tooltip = { OR = { NOT = { religion = cathar } has_global_flag = cathar_holy_war_enabled has_character_flag = reclaim_heresy_crusade } } } mercenary = no } } can_use = { emf_cb_can_use_trigger = yes ROOT = { can_call_crusade = yes any_demesne_title = { is_titular = no } } FROM = { OR = { NOT = { religion_group = ROOT } is_heresy_of = ROOT is_parent_religion = ROOT AND = { religion = messalian FROM = { OR = { religion = catholic religion = cathar religion = fraticelli religion = waldensian religion = lollard religion = miaphysite religion = monophysite religion = orthodox religion = bogomilist religion = paulician religion = monothelite religion = iconoclast religion = nestorian religion = adoptionist religion = arian religion = maronite religion = apostolic religion = tondrakian } } } AND = { OR = { religion = catholic religion = cathar religion = fraticelli religion = waldensian religion = lollard religion = miaphysite religion = monophysite religion = orthodox religion = bogomilist religion = paulician religion = monothelite religion = iconoclast religion = nestorian religion = adoptionist religion = arian religion = maronite religion = apostolic religion = tondrakian } FROM = { religion = messalian } } AND = { religion_group = pagan_group NOT = { religion = ROOT } } AND = { ROOT = { religion = paulician } NOT = { religion = ROOT } } AND = { ROOT = { religion = kharijite } NOT = { religion = ROOT } } } } NOT = { # Not if the Schism has been mended AND = { OR = { religion = catholic religion = fraticelli } has_global_flag = schism_mended NOT = { has_global_flag = cath_schism_mended } NOT = { has_character_flag = reclaim_heresy_crusade } } } # Showdown timers ROOT = { OR = { ai = no has_character_flag = reclaim_heresy_crusade NOR = { religion_group = christian religion_group = muslim } AND = { religion_group = christian has_global_flag = emf_catholic_crusades_unlocked } AND = { religion_group = muslim has_global_flag = emf_muslim_crusades_unlocked } } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } independent = yes # Don't declare Crusades on revolters - chances are high the war will invalidate OR = { num_of_realm_counties = { value = 6 title = PREV } ROOT = { has_character_flag = reclaim_heresy_crusade } } } # Restrictions on crusade targets for AI religion heads OR = { # Religion head is a player ROOT = { ai = no } # This is a special chain ROOT = { has_character_flag = reclaim_heresy_crusade } # The target owns a holy site within that kingdom title FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV is_holy_site = ROOT } } # The target owns a province of the religion within that kingdom title FROM = { any_realm_title = { tier = COUNT de_jure_liege_or_above = PREVPREV location = { religion = ROOT } } } # A ruler of the religion either owns a province in that kingdom or is neighboring any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { location = { OR = { owner = { religion = ROOT } any_neighbor_province = { owner = { religion = ROOT } } } } } } } } is_valid = { ROOT = { can_call_crusade = yes } FROM = { OR = { NOT = { religion_group = ROOT } is_heresy_of = ROOT is_parent_religion = ROOT AND = { religion = messalian FROM = { OR = { religion = catholic religion = cathar religion = fraticelli religion = waldensian religion = lollard religion = miaphysite religion = monophysite religion = orthodox religion = bogomilist religion = paulician religion = monothelite religion = iconoclast religion = nestorian religion = adoptionist religion = arian religion = maronite religion = apostolic religion = tondrakian } } } AND = { OR = { religion = catholic religion = cathar religion = fraticelli religion = waldensian religion = lollard religion = miaphysite religion = monophysite religion = orthodox religion = bogomilist religion = paulician religion = monothelite religion = iconoclast religion = nestorian religion = adoptionist religion = arian religion = maronite religion = apostolic religion = tondrakian } } AND = { religion_group = pagan_group NOT = { religion = ROOT } } AND = { ROOT = { religion = paulician } NOT = { religion = ROOT } } AND = { ROOT = { religion = kharijite } NOT = { religion = ROOT } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add_title = { log = "CB(crusade): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_add = { ROOT = { set_variable = { which = "crusader_adventurers" value = 0 } } } on_success = { emf_cb_holy_victory_effect = yes emf_imperial_decay_major_victory_effect = yes ROOT = { clr_character_flag = reclaim_heresy_crusade } hidden_tooltip = { any_attacker = { limit = { NOT = { character = ROOT } } pf_tradition_plus4_effect = yes } } } on_success_title = { log = "CB(crusade): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes save_event_target_as = crusade_title # First give it to the kingdom title's current holder, if they're of ROOT's religion if = { limit = { has_holder = yes holder_scope = { religion = ROOT } } holder_scope = { gain_settlements_under_title = { title = PREV enemy = FROM is_crusade = yes type = holy_war } hidden_tooltip = { emf_usurp_revolter_titles_effect = yes # Handle revolters [immediately] } } } # Then give it to the kingdom's de jure liege, if they're of ROOT's religion if = { limit = { OR = { has_holder = no NOT = { holder_scope = { religion = ROOT } } } dejure_liege_title = { has_holder = yes holder_scope = { religion = ROOT } } } dejure_liege_title = { holder_scope = { gain_settlements_under_title = { title = PREVPREV enemy = FROM is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = holy_war } hidden_tooltip = { emf_usurp_revolter_titles_effect = yes # Handle revolters [immediately] } } } } # Then give it to the most participating attacker if = { limit = { OR = { has_holder = no NOT = { holder_scope = { religion = ROOT } } } NOT = { dejure_liege_title = { has_holder = yes holder_scope = { religion = ROOT } } } } hidden_tooltip = { most_participating_crusader = { save_event_target_as = crusade_victor } # Other crusaders will request fiefs any_attacker = { limit = { ai = yes NOT = { character = event_target:crusade_victor } } character_event = { id = emf_crusades.4 } } any_attacker = { limit = { ai = no NOT = { character = event_target:crusade_victor } } character_event = { id = emf_crusades.4 days = 1 } } # Add a strong claim to the best_crusade_claimant if not also the most_participating_attacker best_crusade_claimant = { if = { limit = { NOT = { character = event_target:crusade_victor } } event_target:crusade_title = { add_pressed_claim = PREV } } } conquest_culture = event_target:crusade_victor } most_participating_crusader = { any_demesne_title = { set_title_flag = previous_holding } any_vassal = { set_character_flag = previous_vassal } primary_title = { save_event_target_as = current_title } pf_tradition_plus4_effect = yes gain_settlements_under_title = { title = PREV enemy = FROM type = holy_war } hidden_tooltip = { emf_usurp_revolter_titles_effect = yes # Handle revolters [immediately] } # To whom should the crusade kingdom go? hidden_tooltip = { character_event = { id = emf_crusades.2 } } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 500 participation_scaled_piety = 1000 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -100 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 500 participation_scaled_piety = 1000 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -100 } } } any_attacker = { limit = { ai = no NOT = { has_character_flag = achievement_crusader } } set_character_flag = achievement_crusader } ROOT = { religion_authority = { modifier = won_crusade years = 20 } } FROM = { piety = -100 religion_authority = { modifier = lost_crusade years = 20 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { if = { limit = { ROOT = { has_character_flag = reclaim_heresy_crusade } } set_parent_religion = { religion = FROM parent = 0 } ROOT = { clr_character_flag = reclaim_heresy_crusade religion_authority = { modifier = lost_crusade years = 20 } } } ROOT = { piety = -100 } hidden_tooltip = { # Deal with crusader adventurers any_character = { limit = { religion = ROOT has_character_flag = crusader_adventurer } character_event = { id = emf_crusades.24 } } } any_defender = { limit = { character = FROM } participation_scaled_piety = 200 participation_scaled_prestige = 100 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -50 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 200 participation_scaled_prestige = 100 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -50 } } } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_holy } 10 = { give_nickname = nick_the_glorious } 10 = { give_nickname = nick_the_lionheart } 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 20 = { modifier = { factor = 0 religion_group = christian } give_nickname = nick_the_sword_of_god } } } } } } on_fail_title = { log = "CB(crusade): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_holy_defeat_effect = yes emf_imperial_decay_major_loss_effect = yes hidden_tooltip = { # Deal with crusader adventurers any_character = { limit = { religion = ROOT has_character_flag = crusader_adventurer } character_event = { id = emf_crusades.24 } } } if = { limit = { ROOT = { has_character_flag = reclaim_heresy_crusade } } set_parent_religion = { religion = FROM parent = 0 } ROOT = { clr_character_flag = reclaim_heresy_crusade } } ROOT = { piety = -200 religion_authority = { modifier = lost_crusade years = 20 } } FROM = { piety = 100 religion_authority = { modifier = won_crusade years = 20 } } any_defender = { limit = { character = FROM } participation_scaled_piety = 300 participation_scaled_prestige = 150 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -100 } } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_holy } 10 = { give_nickname = nick_the_glorious } 10 = { give_nickname = nick_the_lionheart } 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 20 = { modifier = { factor = 0 religion_group = christian } give_nickname = nick_the_sword_of_god } } } } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 300 participation_scaled_prestige = 150 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -100 } } } } on_reverse_demand_title = { log = "CB(crusade): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(crusade): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { clr_character_flag = reclaim_heresy_crusade } hidden_tooltip = { # Deal with crusader adventurers any_character = { limit = { religion = ROOT has_character_flag = crusader_adventurer } character_event = { id = emf_crusades.24 } } } } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #14 religious = { name = CB_NAME_RELIGIOUS war_name = WAR_NAME_RELIGIOUS sprite = 9 truce_days = 3650 is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_holy_war_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_holy_war_cooldown } } } } custom_tooltip = { text = holy_war_piety_cost_ctt hidden_tooltip = { OR = { piety = 300 AND = { NOT = { has_character_flag = emf_holy_warred } piety = 200 } } } } custom_tooltip = { text = cathar_holy_war_enabled_ctt hidden_tooltip = { OR = { NOT = { religion = cathar } has_global_flag = cathar_holy_war_enabled } } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { is_nomadic = no NOT = { same_realm = FROM } NOR = { mercenary = yes pacifist = yes religion = buddhist } OR = { # Allow reformed pagans NOT = { religion_group = pagan_group } is_reformed_religion = yes } OR = { # Hindus can only wage holy war on non-Indian rulers NOT = { religion = hindu } FROM = { NOT = { religion_group = indian_group } } } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { religion = messalian FROM = { OR = { religion = catholic religion = cathar religion = fraticelli religion = waldensian religion = lollard religion = miaphysite religion = monophysite religion = orthodox religion = bogomilist religion = paulician religion = monothelite religion = iconoclast religion = nestorian religion = adoptionist religion = arian religion = maronite religion = apostolic religion = tondrakian } } } AND = { OR = { religion = catholic religion = cathar religion = fraticelli religion = waldensian religion = lollard religion = miaphysite religion = monophysite religion = orthodox religion = bogomilist religion = paulician religion = monothelite religion = iconoclast religion = nestorian religion = adoptionist religion = arian religion = maronite religion = apostolic religion = tondrakian } FROM = { religion = messalian } } AND = { OR = { religion_group = muslim religion_group = pagan_group } NOT = { religion = FROM } } AND = { FROM = { religion = paulician } NOT = { religion = FROM } } } NOT = { is_reformed_religion = FROM } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } OR = { NOT = { religion_group = pagan_group } religion = ROOT } } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # Can't holy war a duchy without at least one non-nomadic province in it any_direct_de_jure_vassal_title = { location = { any_province_holding = { NOT = { holding_type = nomad } } } } # Prefer 'Special Holy War' CB NOR = { ROOT = { holy_order = yes NOT = { religion_group = FROM } } AND = { de_jure_liege = k_jerusalem ROOT = { has_landed_title = k_jerusalem NOT = { religion_group = FROM } } } } # Prefer 'Religious Reconquest' CB NAND = { # Muslim reconquest does not make much sense NAND = { FROM = { religion_group = muslim } ROOT = { religion_group = muslim } } any_direct_de_jure_vassal_title = { owner_under_FROM = yes location = { religion = ROOT any_province_holding = { NOT = { holding_type = nomad } } } } } # The attacker needs at least one county in the target duchy, or a land # border, or to be within two sea zones from one of your counties (if # crossing seazones is allowed) OR = { any_direct_de_jure_vassal_title = { OR = { owner_under_ROOT = yes location = { owner_under_FROM = yes any_neighbor_province = { owner_under_ROOT = yes } } } } AND = { OR = { # Can they cross sea zones? FROM = { religion_group = muslim } ROOT = { religion_group = muslim } AND = { ROOT = { religion_group = pagan_group } has_global_flag = pagan_ghws_unlocked } AND = { ROOT = { religion_group = christian } has_global_flag = christian_crusades_unlocked } } any_direct_de_jure_vassal_title = { owner_under_FROM = yes location = { any_neighbor_province = { is_land = no any_neighbor_province = { OR = { owner_under_ROOT = yes AND = { is_land = no any_neighbor_province = { owner_under_ROOT = yes } } } } } } } } } } is_valid = { ROOT = { NOT = { same_realm = FROM } NOR = { mercenary = yes pacifist = yes religion = buddhist } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { OR = { religion_group = muslim religion_group = pagan_group } NOT = { religion = FROM } } AND = { FROM = { religion = paulician } NOT = { religion = FROM } } NOT = { is_reformed_religion = FROM } } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } } } } is_valid_title = { any_de_jure_vassal_title = { owner_under_FROM = yes } } on_add_title = { log = "CB(religious): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { if = { limit = { NOT = { any_demesne_title = { higher_tier_than = DUKE de_jure_vassal_or_below = PREVPREV } } } if = { limit = { has_character_flag = emf_holy_warred } piety = -300 } if = { limit = { NOT = { has_character_flag = emf_holy_warred } } piety = -200 set_character_flag = emf_holy_warred } } if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } custom_tooltip = { text = emf_cb_ctt_holy_war_cooldown hidden_tooltip = { add_character_modifier = { name = emf_cb_mod_holy_war_cooldown duration = 1825 } } } } } } on_success = { emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_piety = 50 participation_scaled_prestige = 150 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 100 participation_scaled_prestige = 150 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } } ROOT = { religion_authority = { modifier = won_holy_war years = 20 } } FROM = { religion_authority = { modifier = lost_holy_war years = 20 } } FROM = { piety = -100 } FROM = { prestige = -150 } } on_success_title = { log = "CB(religious): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = religious_cb_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM same_religion = yes # Only vassalize rulers of my religion is_religious = yes type = holy_war } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { piety = -50 prestige = -100 } } on_fail_title = { log = "CB(religious): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } piety = -100 prestige = -150 } any_defender = { limit = { character = FROM } participation_scaled_piety = 200 participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 200 participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } } ROOT = { religion_authority = { modifier = lost_holy_war years = 20 } } FROM = { religion_authority = { modifier = won_holy_war years = 20 } } } on_reverse_demand_title = { log = "CB(religious): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(religious): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 2 modifier = { # Prefer direct land borders factor = 1.5 any_direct_de_jure_vassal_title = { owner_under_FROM = yes location = { any_neighbor_province = { owner_under_ROOT = yes } } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #15 excommunicated_ruler = { name = CB_NAME_EXCOMMUNICATED_RULER war_name = WAR_NAME_EXCOMMUNICATED_RULER sprite = 11 truce_days = 3650 allowed_to_target_tributaries = no allowed_to_target_suzerains = no is_permanent = yes can_ask_to_join_war = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes FROM = { excommunicated_for = ROOT in_revolt = no NOT = { any_current_enemy = { NOT = { religion_group = ROOT } } } } ROOT = { mercenary = no } } is_valid = { FROM = { excommunicated_for = ROOT } } on_add = { log = "CB(excommunicated_ruler): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(excommunicated_ruler): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes ROOT = { if = { limit = { FROM = { primary_title = { tier = BARON } } } ROOT = { piety = 30 prestige = 50 } } if = { limit = { FROM = { primary_title = { tier = COUNT } } } ROOT = { piety = 60 prestige = 100 } } if = { limit = { FROM = { primary_title = { tier = DUKE } } } ROOT = { piety = 90 prestige = 150 } } if = { limit = { FROM = { primary_title = { tier = KING } } } ROOT = { piety = 120 prestige = 200 } } if = { limit = { FROM = { primary_title = { tier = EMPEROR } } } ROOT = { piety = 250 prestige = 400 } } } FROM = { excommunicate = no prestige = -200 rightful_religious_head_scope = { opinion = { who = PREV modifier = opinion_repented_sins } } abdicate = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(excommunicated_ruler): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -50 prestige = -100 } } on_reverse_demand = { log = "CB(excommunicated_ruler): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes ROOT = { piety = -100 prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 } } on_invalidation = { log = "CB(excommunicated_ruler): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #16 bid_for_independence = { name = CB_NAME_INDEPENDENCE war_name = WAR_NAME_INDEPENDENCE sprite = 12 truce_days = 3650 is_permanent = yes is_independence = yes can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { de_facto_liege = FROM higher_tier_than = BARON OR = { is_feudal = yes is_tribal = yes higher_tier_than = COUNT } mercenary = no NAND = { FROM = { is_merchant_republic = yes } is_patrician = yes } OR = { is_nomadic = no NOT = { clan_opinion = { who = FROM value = 0 } } } } FROM = { #NOT = { # any_war = { # attacker = { character = PREVPREV } # OR = { # using_cb = bid_for_independence # using_cb = depose_liege # } # } #} any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } # No independence factions in merchant republics OR = { is_merchant_republic = no ROOT = { is_patrician = no } } } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } # No independence factions in merchant republics NOT = { AND = { is_merchant_republic = yes liege_before_war = { is_merchant_republic = yes } } } } } on_add = { log = "CB(bid_for_independence): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(bid_for_independence): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes if = { limit = { FROM = { independent = no } } FROM = { if = { limit = { in_revolt = yes } liege_before_war = { ROOT = { set_defacto_liege = PREV emf_liege_change_effect = yes } } } if = { limit = { in_revolt = no } liege = { ROOT = { set_defacto_liege = PREV emf_liege_change_effect = yes } } } } } if = { limit = { FROM = { independent = yes } } ROOT = { set_defacto_liege = ROOT emf_liege_change_effect = yes } } hidden_tooltip = { ROOT = { prestige = 100 any_demesne_title = { limit = { controls_religion = no } add_pressed_claim = FROM } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { pf_lower_CA_effect = yes pf_lower_TO_effect = yes } FROM = { emf_dynlevy_update_effect = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(bid_for_independence): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -50 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = -50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = -50 } } } on_reverse_demand = { log = "CB(bid_for_independence): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -100 prisoner = FROM } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = -100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = -100 } } FROM = { prestige = 50 } } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = invalid } on_invalidation = { log = "CB(bid_for_independence): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 150 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #17 depose_liege = { name = CB_NAME_DEPOSE_LIEGE war_name = WAR_NAME_DEPOSE_LIEGE sprite = 12 truce_days = 3650 is_permanent = yes can_call_vassals = no major_revolt = no can_use = { always = no # v2.21 - Disabled - not working well ROOT = { de_facto_liege = FROM } FROM = { is_feudal = yes NOT = { any_war = { OR = { AND = { # Cannot depose liege when our liege is currently involved in such a war attacker = { character = PREVPREV } OR = { using_cb = bid_for_independence using_cb = depose_liege } } AND = { # Cannot depose liege if someone else is already deposing liege defender = { character = PREVPREV } using_cb = depose_liege } } } } } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } } on_success = { emf_cb_victory_effect = yes # the defender loses 10 Imperial Decadence ("out with the old, in with the new") if = { limit = { FROM = { emf_uses_imperial_decay_trigger = yes } } FROM = { custom_tooltip = { text = IMPERIAL_DECAY_MINUS_10 } hidden_tooltip = { primary_title = { change_variable = { which = "imperial_decay" value = -10 } set_title_flag = skip_decay_gain } } } } FROM = { prestige = -500 pf_lower_CA_effect = yes abdicate_to_most_liked_by = ROOT } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 250 } } } on_fail = { ROOT = { prestige = -100 } } on_reverse_demand = { emf_cb_defeat_effect = yes ROOT = { prestige = -200 prisoner = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } FROM = { clr_character_flag = autonomy_faction_revolt } } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 150 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #18 overthrow_ruler = { name = CB_NAME_OVERTHROWRULER war_name = WAR_NAME_OVERTHROWRULER sprite = 12 truce_days = 3650 is_revolt_cb = yes can_call_vassals = yes can_ask_to_join_war = yes major_revolt = yes is_tyranny_cb = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { de_facto_liege = FROM } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } } } on_add = { log = "CB(overthrow_ruler): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(overthrow_ruler): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes # the defender loses 10 Imperial Decadence ("out with the old, in with the new") if = { limit = { FROM = { emf_uses_imperial_decay_trigger = yes } } FROM = { custom_tooltip = { text = IMPERIAL_DECAY_MINUS_10 } hidden_tooltip = { primary_title = { change_variable = { which = "imperial_decay" value = -10 } set_title_flag = skip_decay_gain } } } } FROM = { current_heir = { save_event_target_as = heir } } ROOT = { primary_title = { add_pressed_claim = FROM } } FROM = { prestige = -500 remove_opinion = { who = ROOT modifier = declared_war } pf_lower_CA_effect = yes pf_lower_TO_effect = yes abdicate = yes emf_liege_change_effect = yes } event_target:heir = { emf_liege_change_effect = yes emf_dynlevy_update_effect = yes } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 250 } } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(overthrow_ruler): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -100 } FROM = { remove_opinion = { who = ROOT modifier = declared_war } } } on_reverse_demand = { log = "CB(overthrow_ruler): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -200 prisoner = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_invalidation = { log = "CB(overthrow_ruler): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } on_defender_leader_death = { hidden_tooltip = { any_attacker = { letter_event = { id = 251 } } } end_war = invalid } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #19 overthrow_ruler_no_calls = { name = CB_NAME_OVERTHROWRULER_NC war_name = WAR_NAME_OVERTHROWRULER_NC sprite = 12 truce_days = 3650 is_revolt_cb = yes can_call_vassals = no can_ask_to_join_war = no can_use = { emf_cb_can_use_trigger = yes ROOT = { de_facto_liege = FROM } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } FROM = { higher_tier_than = ROOT } } on_add = { log = "CB(overthrow_ruler_no_calls): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(overthrow_ruler_no_calls): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes # the defender loses 10 Imperial Decadence ("out with the old, in with the new") if = { limit = { FROM = { emf_uses_imperial_decay_trigger = yes } } FROM = { custom_tooltip = { text = IMPERIAL_DECAY_MINUS_10 } hidden_tooltip = { primary_title = { change_variable = { which = "imperial_decay" value = -10 } set_title_flag = skip_decay_gain } } } } ROOT = { prestige = 200 primary_title = { add_pressed_claim = FROM } } FROM = { prestige = -500 remove_opinion = { who = ROOT modifier = declared_war } pf_lower_CA_effect = yes current_heir = { save_event_target_as = heir } abdicate = yes emf_liege_change_effect = yes event_target:heir = { emf_liege_change_effect = yes } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(overthrow_ruler_no_calls): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } FROM = { prestige = -100 remove_opinion = { who = ROOT modifier = declared_war } } } on_reverse_demand = { log = "CB(overthrow_ruler_no_calls): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 prisoner = FROM } FROM = { prestige = 50 } } on_invalidation = { log = "CB(overthrow_ruler_no_calls): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #20 change_gavelkind_succession_law = { name = CB_NAME_GAVELKIND_SUCCESSION_LAW war_name = WAR_NAME_GAVELKIND_SUCCESSION_LAW sprite = 6 truce_days = 1825 attacker_can_call_allies = no can_ask_to_join_war = no major_revolt = yes can_use = { always = no } is_valid = { always = no } on_success = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #21 lower_crown_authority_law = { name = CB_NAME_LOWER_CROWN_AUTHORITY_LAW war_name = WAR_NAME_LOWER_CROWN_AUTHORITY_LAW sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no major_revolt = yes can_use = { always = no } is_valid = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #22 lower_tribal_organization_law = { name = CB_NAME_LOWER_TRIBAL_ORGANIZATION_LAW war_name = WAR_NAME_LOWER_TRIBAL_ORGANIZATION_LAW sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no #major_revolt = yes is_permanent = no can_use = { always = no } is_valid = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #23 coastal_republic = { name = CB_NAME_COASTAL_REPUBLIC war_name = WAR_NAME_COASTAL_REPUBLIC sprite = 1 truce_days = 3650 is_permanent = yes check_all_titles = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no allow_distant = yes # AI parameter can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_coastal_republic_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_republic_cooldown } } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { OR = { is_merchant_republic = yes is_patrician = yes } NOT = { is_liege_or_above = FROM } NOT = { is_vassal_or_below = FROM } NOT = { same_liege = FROM } mercenary = no } } can_use_title = { tier = BARON is_capital = no # Minor Holding holding_type = city location = { port = yes # Must have a trade post there already OR = { PREV = { holder_scope = { NOT = { same_realm = ROOT } OR = { is_patrician = yes is_merchant_republic = yes } } } trade_post_owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } # EMF: Restrict bird's eye distance for city seizure ROOT = { OR = { AND = { # For vassal patricians liege = { is_merchant_republic = yes NOT = { character = PREV } } liege = { any_realm_title = { tier = COUNT location = { NOT = { distance = { where = PREVPREVPREVPREV distance = 250 } } } } } } AND = { # For doges is_merchant_republic = yes any_realm_title = { tier = COUNT location = { NOT = { distance = { where = PREVPREVPREV distance = 250 } } } } } } } # Not allowed to use this CB to take cities in the capital province of a rival merchant republic FROM = { OR = { is_merchant_republic = no capital_scope = { NOT = { province_id = PREVPREV } } } } } emf_cb_can_use_title_trigger = yes } is_valid = { ROOT = { OR = { is_merchant_republic = yes is_patrician = yes } } } on_add = { log = "CB(coastal_republic): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } # FIXME: Give this a polished custom_tooltip ROOT = { add_character_modifier = { name = emf_cb_mod_republic_cooldown duration = 1825 } } } } on_success = { log = "CB(coastal_republic): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { pf_prosperity_plus2_effect = yes } } on_success_title = { if = { limit = { NOT = { location = { trade_post_owner = { is_liege_or_above = ROOT } } } } usurp_title = { target = ROOT type = invasion } } if = { limit = { location = { trade_post_owner = { is_liege_or_above = ROOT } } } location = { trade_post_owner = { usurp_title = { target = PREVPREV type = invasion } } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(coastal_republic): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(coastal_republic): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { pf_prosperity_minus2_effect = yes } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(coastal_republic): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 50 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 50 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #24 coastal_county_republic = { name = CB_NAME_COASTAL_COUNTY_REPUBLIC war_name = WAR_NAME_COASTAL_COUNTY_REPUBLIC sprite = 1 truce_days = 3650 is_permanent = yes check_all_titles = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no allow_distant = yes # AI parameter can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_coastal_republic_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_republic_cooldown } } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { OR = { is_merchant_republic = yes is_patrician = yes } NOT = { is_liege_or_above = FROM } NOT = { is_vassal_or_below = FROM } NOT = { same_liege = FROM } mercenary = no } } can_use_title = { tier = COUNT location = { port = yes county = { any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } emf_cb_can_use_title_trigger = yes } is_valid = { ROOT = { OR = { is_merchant_republic = yes is_patrician = yes } } } is_valid_title = { tier = COUNT location = { port = yes county = { any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } on_add = { log = "CB(coastal_county_republic): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } # FIXME: Give this a polished custom_tooltip ROOT = { add_character_modifier = { name = emf_cb_mod_republic_cooldown duration = 1825 } } } } on_success = { log = "CB(coastal_county_republic): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { pf_prosperity_plus2_effect = yes } } on_success_title = { if = { limit = { location = { any_province_holding = { holder_scope = { character = ROOT } } } } usurp_title = ROOT } if = { limit = { NOT = { location = { any_province_holding = { holder_scope = { character = ROOT } } } } } any_de_jure_vassal_title = { limit = { holder_scope = { is_liege_or_above = ROOT } } holder_scope = { usurp_title = PREVPREV set_defacto_liege = ROOT emf_liege_change_effect = yes } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(coastal_county_republic): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(coastal_county_republic): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { pf_prosperity_minus2_effect = yes } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(coastal_county_republic): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #25 weaken_vassal_plot = { name = CB_NAME_WEAKEN_VASSAL war_name = WAR_NAME_WEAKEN_VASSAL sprite = 3 truce_days = 3650 hostile_against_others = yes press_claim = yes attacker_can_call_allies = no can_ask_to_join_war = no can_use = { emf_cb_can_use_trigger = yes } can_use_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(weaken_vassal_plot): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(weaken_vassal_plot): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes any_attacker = { participation_scaled_prestige = 100 } FROM = { pf_lower_CA_effect = yes } } on_success_title = { emf_cb_latb_effect = yes FROM = { random_vassal = { limit = { tier = COUNT any_demesne_title = { tier = COUNT dejure_liege_title = { ROOT = { plot_target_title = { title = PREVPREV } } } } } grant_title = PREVPREV } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(weaken_vassal_plot): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 cancel_plot = plot_weaken_fellow_vassal } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(weaken_vassal_plot): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 imprison = FROM cancel_plot = plot_weaken_fellow_vassal } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = invalid } on_invalidation = { log = "CB(weaken_vassal_plot): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { cancel_plot = plot_weaken_fellow_vassal } } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #26 decadence_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_DEC_INVASION sprite = 7 truce_days = 3650 hostile_against_others = yes can_ask_to_join_war = no can_use = { always = no } is_valid = { always = no } on_success = { } on_fail = { } on_reverse_demand = { } on_invalidation = { log = "CB(decadence_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 100 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 150 } } #27 muslim_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 3650 hostile_against_others = yes is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_holy_war_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_holy_war_cooldown } } } } piety = 1000 OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = muslim # These use 'tribal_invasion' instead: NOR = { is_nomadic = yes AND = { primary_title = { is_tribal_type_title = yes } has_horde_culture = yes } AND = { mercenary = yes NOT = { num_of_titles = 2 } } } } FROM = { NOT = { religion = ROOT } } ROOT = { NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # Muslims require the target to have at least 5 counties within the target kingdom FROM = { num_of_realm_counties = { value = 5 title = PREV } } # The attacker needs a border inside the kingdom any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { owner_under_FROM = yes location = { any_neighbor_province = { owner_under_ROOT = yes } } } } } is_valid = { ROOT = { religion_group = muslim } FROM = { NOT = { religion = ROOT } } } is_valid_title = { any_de_jure_vassal_title = { owner_under_FROM = yes } } on_add = { log = "CB(muslim_invasion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -1000 } if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } ROOT = { custom_tooltip = { text = emf_cb_ctt_holy_war_cooldown hidden_tooltip = { add_character_modifier = { name = emf_cb_mod_holy_war_cooldown duration = 1825 } } } } } } on_success = { log = "CB(muslim_invasion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { prestige = 200 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes FROM = { NOT = { uses_decadence = yes } } } participation_scaled_decadence = -20 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes FROM = { NOT = { uses_decadence = yes } } } participation_scaled_decadence = -20 } } } FROM = { prestige = -200 } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = other_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM is_crusade = no # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = invasion } if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_holy } 10 = { give_nickname = nick_the_glorious } 10 = { give_nickname = nick_the_lionheart } 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_magnificent } } } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(muslim_invasion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 100 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_holy } 10 = { give_nickname = nick_the_glorious } 10 = { give_nickname = nick_the_lionheart } 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_magnificent } 10 = { give_nickname = nick_the_avenger } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -200 } } on_reverse_demand = { log = "CB(muslim_invasion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } if = { limit = { uses_decadence = yes } decadence = 10 } } FROM = { prestige = 200 if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_holy } 10 = { give_nickname = nick_the_glorious } 10 = { give_nickname = nick_the_lionheart } 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_magnificent } 10 = { give_nickname = nick_the_avenger } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(muslim_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 100 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 150 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #28 cb_faction_independence = { name = CB_NAME_INDEPENDENCE war_name = WAR_NAME_FACTION_INDEPENDENCE sprite = 12 truce_days = 3650 major_revolt = yes attacker_can_call_allies = no can_ask_to_join_war = no is_independence = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { vassal_of = FROM mercenary = no } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } } on_add = { log = "CB(cb_faction_independence): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(cb_faction_independence): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes FROM = { pf_prosperity_minus2_effect = yes } if = { limit = { FROM = { independent = yes } } any_attacker = { limit = { OR = { vassal_of = FROM liege_before_war = { character = FROM } } } set_defacto_liege = THIS emf_liege_change_effect = yes hidden_tooltip = { prestige = 100 any_demesne_title = { limit = { controls_religion = no higher_tier_than = BARON FROM = { # If the old liege can use the subjugation CB, give no claims NOT = { religion_group = pagan_group } } } add_weak_pressed_claim = FROM } } } } if = { limit = { FROM = { independent = no } } any_attacker = { limit = { OR = { vassal_of = FROM liege_before_war = { character = FROM } } } FROM = { liege = { set_defacto_vassal = PREVPREV } } emf_liege_change_effect = yes hidden_tooltip = { prestige = 100 any_demesne_title = { limit = { controls_religion = no higher_tier_than = BARON } add_weak_pressed_claim = FROM } } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 disband_event_forces = faction_revolters } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } pf_lower_CA_effect = yes pf_lower_TO_effect = yes } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(cb_faction_independence): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -50 #prisoner = FROM add_character_modifier = { name = faction_independence_ultimatum_timer hidden = yes duration = 3650 } hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = -50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = -50 disband_event_forces = faction_revolters } add_character_modifier = { name = faction_independence_ultimatum_timer hidden = yes duration = 3650 } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } emf_cb_dynlevy_end_effect = yes } on_reverse_demand = { log = "CB(cb_faction_independence): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -100 prisoner = FROM add_character_modifier = { name = faction_independence_ultimatum_timer hidden = yes duration = 3650 } hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = -100 } any_attacker = { limit = { NOT = { character = ROOT } liege = { character = FROM } } prisoner = FROM participation_scaled_prestige = -100 hidden_tooltip = { disband_event_forces = faction_revolters add_character_modifier = { name = faction_independence_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { prestige = 50 hidden_tooltip = { disband_event_forces = faction_loyalists } } emf_cb_dynlevy_end_effect = yes } on_attacker_leader_death = { hidden_tooltip = { any_defender = { letter_event = { id = 251 } } } end_war = invalid } on_invalidation = { log = "CB(cb_faction_independence): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 150 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #29 # This casus belli replaces the vanilla one, and instead uses a tier system to determine what kingdoms are valid targets # To unlock a tier, all tiers before it have to be completely conquered # Tier 1: Byzantium # Tier 2: Balkans and Sicily # Tier 3: Italy, Levant, and Eastern/Central North Africa # Tier 4: Western North Africa and Iberia # Tier 5: France # Tier 6: England, Wales, and (southern) Germany imperial_reconquest = { name = CB_NAME_IMPERIAL war_name = WAR_NAME_IMPERIAL sprite = 17 truce_days = 1825 is_permanent = yes # this scans all de-jure duchies for the counties which are held by OR vassals (OR below) of selected character. # Only valid if is_permanent = yes check_de_jure_tier = DUKE allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { trait = strong_basileus AND = { prestige = 500 NOR = { religion = orthodox religion = iconoclast religion = bogomilist religion = monothelite } } } custom_tooltip = { text = emf_ctt_requires_150_prestige_cost hidden_tooltip = { prestige = 150 } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } independent = yes religion_group = christian NOT = { same_realm = FROM } mercenary = no } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes OR = { any_direct_de_jure_vassal_title = { region = emf_region_ir_tier_1 owner_under_FROM = yes } AND = { NOT = { any_province = { region = emf_region_ir_tier_1 owner_under_ROOT = no } } OR = { any_direct_de_jure_vassal_title = { region = emf_region_ir_tier_2 owner_under_FROM = yes } AND = { NOT = { any_province = { region = emf_region_ir_tier_2 owner_under_ROOT = no } } OR = { any_direct_de_jure_vassal_title = { region = emf_region_ir_tier_3 owner_under_FROM = yes } AND = { NOT = { any_province = { region = emf_region_ir_tier_3 owner_under_ROOT = no } } OR = { any_direct_de_jure_vassal_title = { region = emf_region_ir_tier_4 owner_under_FROM = yes } AND = { NOT = { any_province = { region = emf_region_ir_tier_4 owner_under_ROOT = no } } OR = { any_direct_de_jure_vassal_title = { region = emf_region_ir_tier_5 owner_under_FROM = yes } AND = { any_direct_de_jure_vassal_title = { region = emf_region_ir_tier_6 owner_under_FROM = yes } NOT = { any_province = { region = emf_region_ir_tier_5 owner_under_ROOT = no } } } } } } } } } } } } } is_valid = { ROOT = { OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } independent = yes religion_group = christian NOT = { same_realm = FROM } } } is_valid_title = { any_de_jure_vassal_title = { owner_under_FROM = yes } } on_add = { log = "CB(imperial_reconquest): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -150 } } on_success = { log = "CB(imperial_reconquest): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { prestige = -100 } } on_success_title = { emf_cb_latb_effect = yes hidden_tooltip = { if = { limit = { owner_under_FROM = yes } set_title_flag = can_be_usurped_tmp } } custom_tooltip = { text = other_invasion_succ_tip hidden_tooltip = { pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM type = invasion } } pf_liege_change_under_title_end_effect = yes } } hidden_tooltip = { if = { limit = { owner_under_ROOT = yes has_title_flag = can_be_usurped_tmp } usurp_title = { target = ROOT type = invasion } } clr_title_flag = can_be_usurped_tmp } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(imperial_reconquest): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -200 } } on_reverse_demand = { log = "CB(imperial_reconquest): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } ROOT = { prestige = -250 } } any_defender = { limit = { character = FROM } participation_scaled_piety = 100 participation_scaled_prestige = 250 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 100 participation_scaled_prestige = 250 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } } } on_invalidation = { log = "CB(imperial_reconquest): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 2 any_direct_de_jure_vassal_title = { owner_under_FROM = yes location = { any_neighbor_province = { owner_under_ROOT = yes } } } } modifier = { factor = 1.25 any_direct_de_jure_vassal_title = { owner_under_ROOT = yes } } modifier = { factor = 1.5 ROOT = { trait = lucky_ruler } } modifier = { factor = 0.5 # Keep normal preference order under holy war if that CB is available FROM = { OR = { NOT = { religion_group = ROOT } is_heresy_of = ROOT is_parent_religion = ROOT } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #30 embargo_cb = { name = CB_NAME_EMBARGO war_name = WAR_NAME_EMBARGO sprite = 11 truce_days = 3650 allowed_to_target_tributaries = no allowed_to_target_suzerains = no is_permanent = yes can_ask_to_join_war = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { independent = yes NOT = { has_embargo = FROM } mercenary = no } FROM = { OR = { AND = { is_merchant_republic = yes any_trade_post = { owner_under_ROOT = yes } } AND = { higher_tier_than = DUKE any_realm_lord = { is_merchant_republic = yes any_trade_post = { owner_under_ROOT = yes } } } } } } is_valid = { ROOT = { independent = yes NOT = { has_embargo = FROM } } FROM = { OR = { is_merchant_republic = yes AND = { higher_tier_than = DUKE any_realm_lord = { is_merchant_republic = yes } } } } } on_add = { log = "CB(embargo_cb): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(embargo_cb): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { pf_prosperity_minus4_effect = yes } FROM = { pf_prosperity_minus4_effect = yes } ROOT = { embargo = FROM } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(embargo_cb): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { NOT = { any_attacker = { NOT = { character = ROOT } is_merchant_republic = yes } } } ROOT = { prestige = -100 } } if = { limit = { any_attacker = { NOT = { character = ROOT } is_merchant_republic = yes } } any_attacker = { limit = { NOT = { character = ROOT } is_merchant_republic = yes } prestige = -100 } } FROM = { prestige = 50 } } on_reverse_demand = { log = "CB(embargo_cb): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes FROM = { pf_prosperity_plus4_effect = yes } if = { limit = { NOT = { any_attacker = { NOT = { character = ROOT } is_merchant_republic = yes } } } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } } if = { limit = { any_attacker = { NOT = { character = ROOT } is_merchant_republic = yes } } any_attacker = { limit = { NOT = { character = ROOT } is_merchant_republic = yes } prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } } FROM = { prestige = 100 } } on_invalidation = { log = "CB(embargo_cb): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 75 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 75 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0 ROOT = { opinion = { who = FROM value = 25 } } } modifier = { factor = 0.5 ROOT = { opinion = { who = FROM value = 0 } } } modifier = { factor = 0.5 ROOT = { opinion = { who = FROM value = -25 } } } } } #31 seize_trade_post = { name = CB_NAME_SEIZE_TRADE_POST war_name = WAR_NAME_SEIZE_TRADE_POST sprite = 1 truce_days = 1825 is_permanent = yes #check_all_titles = yes check_all_trade_posts = yes can_ask_to_join_war = no ticking_war_score_multiplier = 5.0 allow_distant = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { NOT = { same_realm = FROM } # We cannot overtly attack much weaker Patricians in the same republic NOT = { num_of_trade_post_diff = { character = FROM value = 3 } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { OR = { is_merchant_republic = yes is_patrician = yes } NOT = { is_liege_or_above = FROM } mercenary = no } FROM = { OR = { is_merchant_republic = yes is_patrician = yes } NOT = { is_liege_or_above = ROOT } } } can_use_title = { tier = COUNT location = { port = yes } has_trade_post = yes trade_post_owner = { OR = { character = FROM is_liege_or_above = FROM } } holder_scope = { NOT = { character = FROM } } emf_cb_can_use_title_trigger = yes } is_valid = { ROOT = { OR = { is_merchant_republic = yes is_patrician = yes } NOT = { is_liege_or_above = FROM } } FROM = { OR = { is_merchant_republic = yes is_patrician = yes } NOT = { is_liege_or_above = ROOT } } } is_valid_title = { has_trade_post = yes trade_post_owner = { OR = { character = FROM is_liege_or_above = FROM } } holder_scope = { NOT = { character = FROM } } } on_add = { log = "CB(seize_trade_post): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(seize_trade_post): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { pf_prosperity_plus2_effect = yes } FROM = { pf_prosperity_minus2_effect = yes } } on_success_title = { seize_trade_post = ROOT any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(seize_trade_post): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -50 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 25 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 25 } } } on_reverse_demand = { log = "CB(seize_trade_post): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes FROM = { pf_prosperity_plus2_effect = yes } ROOT = { prestige = -100 transfer_scaled_wealth = { to = FROM value = 2.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_invalidation = { log = "CB(seize_trade_post): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 25 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 25 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.25 ROOT = { NOT = { same_realm = FROM } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #32 viking_invasion = { name = CB_NAME_VIKING_INVASION war_name = WAR_NAME_VIKING_INVASION sprite = 8 truce_days = 365 hostile_against_others = no # Vikings share in the spoils... is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes apply_short_occ_mod = no # Do not apply the 'recently_conquered' modifier to Holdings allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { has_opinion_modifier = { who = FROM modifier = preparing_to_invade } NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes is_valid_viking_invasion_target = FROM # Checks that FROM holds the right amount of territory in the kingdom } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(viking_invasion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(viking_invasion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { prestige = 500 piety = 250 religion_authority = { modifier = won_viking_invasion } hidden_tooltip = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = invasion } clr_global_flag = emf_latb_upon_gain if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_victorious } 10 = { give_nickname = nick_the_fearless } 10 = { give_nickname = nick_the_brave } 10 = { give_nickname = nick_haardraade } 10 = { give_nickname = nick_the_viking } 10 = { give_nickname = nick_the_dragon } 10 = { give_nickname = nick_the_ironside } } } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 300 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 300 } } FROM = { prestige = -500 } } on_success_title = { emf_cb_latb_effect = yes custom_tooltip = { text = emf_cb_ctt_viking_invasion_success hidden_tooltip = { save_event_target_as = emf_cb_title pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM type = invasion } } pf_liege_change_under_title_end_effect = yes ROOT = { # Settle the special invasion forces disband_event_forces = prepared_invasion random_demesne_province = { limit = { de_jure_liege_or_above = PREVPREV OR = { NOT = { culture = ROOT } NOT = { religion = ROOT } } } culture = ROOT religion = ROOT } # Remove conquest modifiers and refill levies character_event = { id = emf_cb.10 } } if = { limit = { FROM = { is_liege_or_above = ROOT } } FROM = { imprison = ROOT } } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(viking_invasion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } ROOT = { prestige = -300 piety = -100 hidden_tooltip = { disband_event_forces = prepared_invasion } religion_authority = { modifier = lost_viking_invasion } } } on_reverse_demand = { log = "CB(viking_invasion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -500 piety = -250 transfer_scaled_wealth = { to = FROM value = 2.0 } hidden_tooltip = { disband_event_forces = prepared_invasion } religion_authority = { modifier = lost_viking_invasion } } FROM = { prestige = 300 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 250 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 250 } } } on_invalidation = { log = "CB(viking_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #33 pagan_subjugation = { name = CB_NAME_PAGAN_SUBJUGATION war_name = WAR_NAME_PAGAN_SUBJUGATION sprite = 8 truce_days = 365 is_permanent = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = pagan_group is_reformed_religion = no NOT = { same_realm = FROM } mercenary = no OR = { AND = { has_dlc = "Horse Lords" is_nomadic = no } AND = { NOT = { has_dlc = "Horse Lords" } has_horde_culture = no # Should use tribal invasion instead } } #NOT = { lower_tier_than = FROM } OR = { NOT = { has_character_modifier = launched_subjugation } AND = { has_ambition = obj_become_king capital_scope = { kingdom = { FROM = { any_realm_title = { kingdom = { title = PREVPREVPREV } } } } } } } OR = { NOT = { ROOT = { religion = aztec } } FROM = { religion = aztec } } } FROM = { in_revolt = no religion_group = pagan_group is_nomadic = no OR = { is_reformed_religion = no is_reformed_religion = ROOT } NOT = { any_war = { defender = { character = PREVPREV } OR = { using_cb = pagan_subjugation using_cb = nomad_subjugation } } } } } on_add = { log = "CB(pagan_subjugation): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { add_character_modifier = { name = launched_subjugation days = -1 hidden = yes } } } on_success = { log = "CB(pagan_subjugation): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { piety = 50 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { piety = -50 prestige = -100 if = { limit = { is_reformed_religion = ROOT controls_religion = no } religion = ROOT # Reformed pagans are forced to convert back } custom_tooltip = { text = tribal_subjugation_tip } hidden_tooltip = { ROOT = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = ROOT any_demesne_title = { limit = { higher_tier_than = ROOT NOT = { controls_religion = yes } } ROOT = { grant_title = { target = PREV type = invasion } } add_pressed_claim = PREV } any_demesne_title = { limit = { tier = ROOT NOT = { controls_religion = yes } } emf_cb_latb_effect = yes ROOT = { grant_title = { target = PREV type = invasion } } add_pressed_claim = PREV } if = { limit = { NOT = { any_demesne_title = { controls_religion = yes } } } ROOT = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = ROOT } if = { limit = { any_demesne_title = { controls_religion = yes } } any_vassal = { ROOT = { save_event_target_as = emf_cb_new_imperial_liege } emf_set_viceroy_exemption_effect = yes set_defacto_liege = ROOT emf_liege_change_effect = yes } any_demesne_title = { limit = { NOT = { controls_religion = yes } } emf_cb_latb_effect = yes ROOT = { grant_title = { target = PREV type = invasion } } } } emf_liege_change_effect = yes } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(pagan_subjugation): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { piety = 50 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } ROOT = { piety = -100 } } on_reverse_demand = { log = "CB(pagan_subjugation): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { piety = -200 transfer_scaled_wealth = { to = FROM value = 2.0 } } FROM = { piety = 50 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(pagan_subjugation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #34 peasant_revolt = { name = CB_NAME_PEASANT_CONQUEST war_name = WAR_NAME_PEASANT_CONQUEST sprite = 16 truce_days = 365 hostile_against_others = yes is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes attacker_can_call_allies = no defender_can_call_allies = no can_ask_to_join_war = no is_independence = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { primary_title = { temporary = yes } # Revolter or adventurer trigger war = no NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { tier = COUNT emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(peasant_revolt): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(peasant_revolt): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes usurp_title_plus_barony_if_unlanded = { target = ROOT type = revolt } ROOT = { set_defacto_liege = ROOT } FROM = { prestige = -100 } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(peasant_revolt): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 10 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } } ROOT = { clear_wealth = yes imprison = FROM hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } } on_reverse_demand = { log = "CB(peasant_revolt): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes FROM = { prestige = 20 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } add_character_modifier = { name = crushed_revolt days = 3650 } } } ROOT = { clear_wealth = yes imprison = FROM hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } } on_invalidation = { log = "CB(peasant_revolt): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #35 heretic_revolt = { name = CB_NAME_HERETIC_UPRISING war_name = WAR_NAME_HERETIC_UPRISING sprite = 7 truce_days = 365 hostile_against_others = yes attacker_can_call_allies = no defender_can_call_allies = no can_ask_to_join_war = no can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = heretic_revolter } } is_valid = { FROM = { NOT = { religion = ROOT } } } on_add = { log = "CB(heretic_revolt): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(heretic_revolt): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes ROOT = { prestige = 200 piety = 100 set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = revolt } clr_global_flag = emf_latb_upon_gain clr_character_flag = heretic_revolter } FROM = { prestige = -500 piety = -250 religion_authority = { modifier = lost_heretic_revolt } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(heretic_revolt): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = heretic_revolter hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } FROM = { prestige = 50 piety = 25 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } religion_authority = { modifier = won_heretic_revolt } } } on_reverse_demand = { log = "CB(heretic_revolt): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = heretic_revolter hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } FROM = { prestige = 100 piety = 50 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } add_character_modifier = { name = crushed_revolt days = 3650 } } religion_authority = { modifier = won_heretic_revolt } } } on_invalidation = { log = "CB(heretic_revolt): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 100 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 150 } } #36 religious_revolt = { name = CB_NAME_HERETIC_UPRISING war_name = WAR_NAME_HERETIC_UPRISING sprite = 7 truce_days = 365 hostile_against_others = yes attacker_can_call_allies = no defender_can_call_allies = no can_ask_to_join_war = no can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = religious_revolter } } is_valid = { FROM = { NOT = { religion = ROOT } } } on_add = { log = "CB(religious_revolt): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(religious_revolt): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes ROOT = { prestige = 200 piety = 100 set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = revolt } clr_global_flag = emf_latb_upon_gain clr_character_flag = religious_revolter } FROM = { prestige = -500 piety = -250 religion_authority = { modifier = lost_religious_revolt } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(religious_revolt): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = religious_revolter hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } FROM = { prestige = 50 piety = 25 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } religion_authority = { modifier = won_religious_revolt } } } on_reverse_demand = { log = "CB(religious_revolt): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = religious_revolter hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } FROM = { prestige = 100 piety = 50 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } add_character_modifier = { name = crushed_revolt days = 3650 } } religion_authority = { modifier = won_religious_revolt } } } on_invalidation = { log = "CB(religious_revolt): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 100 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 150 } } #37 liberation_revolt = { name = CB_NAME_LIBERATION_REVOLT war_name = WAR_NAME_LIBERATION_REVOLT sprite = 16 truce_days = 365 hostile_against_others = yes is_permanent = yes #check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles check_de_jure_tier = KING # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes press_claim = yes can_ask_to_join_war = no is_independence = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = nationalist_rebel } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes tier = KING has_holder = no } is_valid = { FROM = { NOT = { culture = ROOT } } } is_valid_title = { has_holder = no } on_add = { log = "CB(liberation_revolt): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(liberation_revolt): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { prestige = 1000 set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = revolt } clr_global_flag = emf_latb_upon_gain clr_character_flag = nationalist_rebel give_nickname = nick_the_liberator } FROM = { prestige = -500 } } on_success_title = { emf_cb_latb_effect = yes custom_tooltip = { text = tribal_invasion_succ_tip hidden_tooltip = { pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM is_revolt = yes type = revolt } if = { limit = { num_of_count_titles = 5 PREV = { OR = { has_holder = no holder_scope = { character = FROM } } } } usurp_title = { target = PREV type = revolt } } } pf_liege_change_under_title_end_effect = yes } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(liberation_revolt): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 100 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } } ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = nationalist_rebel hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } remove_trait = inspiring_leader } } } on_reverse_demand = { log = "CB(liberation_revolt): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes FROM = { prestige = 200 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } add_character_modifier = { name = crushed_major_revolt days = 3650 } } } ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = nationalist_rebel hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } remove_trait = inspiring_leader } } } on_invalidation = { log = "CB(liberation_revolt): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 100 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #38 duchy_adventure = { name = CB_NAME_DUCHY_ADVENTURE war_name = WAR_DUCHY_ADVENTURE sprite = 9 truce_days = 3650 is_permanent = yes hostile_against_others = yes check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = duchy_adventurer } } is_valid = { always = yes } on_add = { log = "CB(duchy_adventure): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(duchy_adventure): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { prestige = 250 hidden_tooltip = { clr_character_flag = duchy_adventurer give_nickname = nick_the_conqueror } } FROM = { prestige = -250 } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = other_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM type = host } } } } pf_liege_change_under_title_end_effect = yes ROOT = { hidden_tooltip = { # Special case: Seljuk succeeds in his first conquest if = { limit = { has_character_flag = seljuk_himself } narrative_event = { id = 60206 days = 1 } } # Special case: Timur succeeds in his first conquest if = { limit = { has_character_flag = timur_himself } narrative_event = { id = 60306 days = 1 } } # Special case: Sabuktigin succeeds in his first conquest if = { limit = { has_character_flag = sabuktigin_himself } narrative_event = { id = 60406 days = 1 } } } emf_check_adventurer_government_effect = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(duchy_adventure): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 100 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } } ROOT = { clear_wealth = yes imprison = FROM hidden_tooltip = { disband_event_forces = yes clr_character_flag = duchy_adventurer } } ROOT = { prestige = -100 } } on_reverse_demand = { log = "CB(duchy_adventure): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 } ROOT = { clear_wealth = yes imprison = FROM prestige = -200 hidden_tooltip = { disband_event_forces = yes clr_character_flag = duchy_adventurer } } } on_attacker_leader_death = { ROOT = { hidden_tooltip = { disband_event_forces = yes clr_character_flag = duchy_adventurer } } end_war = invalid } on_invalidation = { log = "CB(duchy_adventure): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #39 pagan_holy_war = { name = CB_NAME_RELIGIOUS war_name = WAR_NAME_RELIGIOUS sprite = 9 truce_days = 1825 is_permanent = no can_use = { always = no } can_use_title = { always = no } is_valid_title = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #40 caliphal_subjugation = { name = CB_NAME_PAGAN_SUBJUGATION war_name = WAR_NAME_PAGAN_SUBJUGATION sprite = 8 truce_days = 365 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { piety = 200 } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = muslim OR = { has_landed_title = d_sunni has_landed_title = d_shiite has_landed_title = d_yazidi has_landed_title = d_ibadi has_landed_title = d_kharijite has_landed_title = d_hurufi } is_nomadic = no OR = { has_horde_culture = no # Should use tribal invasion instead has_dlc = "Horse Lords" } NOT = { has_character_modifier = launched_subjugation } mercenary = no } FROM = { religion = ROOT } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(caliphal_subjugation): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -200 add_character_modifier = { name = launched_subjugation days = 3650 hidden = yes } } } on_success = { log = "CB(caliphal_subjugation): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { pf_tradition_plus4_effect = yes } ROOT = { prestige = 100 decadence = -5 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { prestige = -200 } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = pagan_subjugation_tip hidden_tooltip = { ROOT = { subjugate_or_take_under_title = { # If the target only has territory within the kingdom, he is simply vassalized title = PREV enemy = FROM } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(caliphal_subjugation): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 50 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } ROOT = { prestige = -100 } } on_reverse_demand = { log = "CB(caliphal_subjugation): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { pf_tradition_minus4_effect = yes } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 2.0 } } FROM = { prestige = 100 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(caliphal_subjugation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #41 muslim_county_conquest = { name = CB_NAME_COUNTY_CONQUEST war_name = WAR_NAME_COUNTY_CONQUEST sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { piety = 50 OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = muslim religion_group = FROM NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { tier = COUNT emf_cb_can_use_sahara_title_trigger = yes OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM NOT = { same_realm = ROOT } } } NOT = { OR = { ROOT = { has_landed_title = PREV } holder_scope = { is_liege_or_above = ROOT } } } location = { any_neighbor_province = { owner_under_ROOT = yes } } emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(muslim_county_conquest): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -50 } } on_success = { log = "CB(muslim_county_conquest): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes if = { limit = { holder_scope = { tier = COUNT NOT = { num_of_count_titles = 2 } lower_tier_than = ROOT } } holder_scope = { emf_ROOT_subjugate_ruler_effect = yes } } if = { limit = { holder_scope = { OR = { higher_tier_than = COUNT num_of_count_titles = 2 NOT = { lower_tier_than = ROOT } } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } any_de_jure_vassal_title = { # take all baronies under the one we're fighting for limit = { has_holder = yes NOT = { de_facto_liege = PREV } holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(muslim_county_conquest): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(muslim_county_conquest): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(muslim_county_conquest): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #42 pagan_county_conquest = { name = CB_NAME_COUNTY_CONQUEST war_name = WAR_NAME_COUNTY_CONQUEST sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes is_holy_war = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no allow_distant = yes can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_holy_war_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_holy_war_cooldown } } } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = pagan_group OR = { AND = { is_nomadic = yes FROM = { OR = { is_nomadic = yes is_tribal = yes } } } NOT = { religion = FROM } } NOT = { same_realm = FROM } mercenary = no } } can_use_title = { tier = COUNT OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM NOT = { same_realm = ROOT } } } NOT = { OR = { ROOT = { has_landed_title = PREV } holder_scope = { is_liege_or_above = ROOT } } } OR = { AND = { OR = { ROOT = { religion = norse_pagan } ROOT = { religion = norse_pagan_reformed } } FROM = { NOT = { religion_group = pagan_group } } location = { port = yes } has_global_flag = viking_age_started } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { ROOT = { is_nomadic = yes } AND = { ROOT = { religion_group = pagan_group NOT = { same_realm = FROM } } FROM = { NOT = { religion = ROOT } } } } OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(pagan_county_conquest): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } ROOT = { custom_tooltip = { text = emf_cb_ctt_holy_war_cooldown hidden_tooltip = { add_character_modifier = { name = emf_cb_mod_holy_war_cooldown duration = 1825 } } } } } } on_success = { log = "CB(pagan_county_conquest): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } any_de_jure_vassal_title = { # take all baronies too limit = { has_holder = yes holder_scope = { OR = { character = FROM is_liege_or_above = FROM AND = { is_liege_or_above = ROOT NOT = { culture = ROOT } NOT = { religion = ROOT } } } } } usurp_title = ROOT } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 participation_scaled_piety = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 participation_scaled_piety = 50 } } if = { limit = { NOT = { FROM = { religion = ROOT } } } ROOT = { religion_authority = { modifier = won_county_conquest } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(pagan_county_conquest): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } if = { limit = { NOT = { FROM = { religion = ROOT } } } ROOT = { religion_authority = { modifier = lost_county_conquest } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(pagan_county_conquest): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } if = { limit = { NOT = { FROM = { religion = ROOT } } } ROOT = { religion_authority = { modifier = lost_county_conquest } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 participation_scaled_piety = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 participation_scaled_piety = 50 } } } on_invalidation = { log = "CB(pagan_county_conquest): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #43 dejure_county_claim = { name = CB_NAME_DEJURECLAIM war_name = WAR_NAME_DEJURECLAIM sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.5 can_use_gui = { emf_cb_can_use_gui_trigger = yes FROM = { OR = { is_merchant_republic = no NOT = { same_realm = ROOT } } OR = { NOT = { has_dlc = "Sons of Abraham" } emf_cb_unexpelled_holy_order_trigger = no NOT = { religion = ROOT } } } } can_use = { emf_cb_can_use_trigger = yes } can_use_title = { tier = COUNT OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } OR = { kingdom = { holder = ROOT } empire = { holder = ROOT } dejure_liege_title = { holder = ROOT } } NOT = { OR = { ROOT = { has_landed_title = PREV } holder_scope = { is_liege_or_above = ROOT } } } NAND = { ROOT = { rightful_religious_head = FROM } title = c_roma } # Disable if emf_dejure_duchy_claim would be valid for the duchy that this county is within # That is, use emf_dejure_duchy_claim wherever possible instead of dejure_county_claim OR = { NOR = { kingdom = { holder = ROOT OR = { ROOT = { ai = yes } has_law = crown_authority_2 has_law = crown_authority_3 has_law = crown_authority_4 } } empire = { holder = ROOT OR = { ROOT = { ai = yes } has_law = crown_authority_2 has_law = crown_authority_3 has_law = crown_authority_4 } } } dejure_liege_title = { FROM = { NOT = { num_of_realm_counties = { value = 2 title = PREV } } } } } # Don't show this when the [rare] emf_dejure_kingdom_claim could be used NOT = { AND = { ROOT = { tier = EMPEROR religion_group = FROM # No infidels (except heretics)! } empire = { holder = ROOT OR = { has_law = crown_authority_4 # Always available at Absolute CA # Also available on any [de jure] held empire when CB granted by event/decision ROOT = { has_character_modifier = emf_cb_mod_dejure_kingdom_claim } } } kingdom = { any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { # County-level holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } FROM = { num_of_realm_counties = { value = 2 title = PREV } } } } } emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(dejure_county_claim): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(dejure_county_claim): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes if = { limit = { empire = { holder = ROOT } } emf_imperial_decay_victory_effect = yes } if = { limit = { holder_scope = { tier = COUNT is_patrician = no NOT = { num_of_count_titles = 2 } } } holder_scope = { emf_ROOT_subjugate_ruler_effect = yes } } if = { limit = { holder_scope = { OR = { higher_tier_than = COUNT num_of_count_titles = 2 is_patrician = yes } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } any_de_jure_vassal_title = { # take all baronies under the one we're fighting for limit = { has_holder = yes NOT = { de_facto_liege = PREV } holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(dejure_county_claim): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(dejure_county_claim): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand_title = { if = { limit = { empire = { holder = ROOT } } emf_imperial_decay_loss_effect = yes } } on_invalidation = { log = "CB(dejure_county_claim): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #44 dejure_barony_claim = { name = CB_NAME_DEJUREBARONYCLAIM war_name = WAR_NAME_DEJUREBARONYCLAIM sprite = 16 truce_days = 730 hostile_against_others = yes is_permanent = yes check_de_jure_tier = COUNT can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.5 can_use_gui = { emf_cb_can_use_gui_trigger = yes OR = { NOT = { has_dlc = "Sons of Abraham" } FROMFROM = { location = { any_province_holding = { holder_scope = { OR = { character = ROOT_FROM is_liege_or_above = ROOT_FROM } OR = { NOT = { religion = ROOT } emf_cb_unexpelled_holy_order_trigger = no } NOT = { any_liege = { religion = ROOT emf_cb_unexpelled_holy_order_trigger = yes } } } } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { NOT = { is_liege_or_above = FROM } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes owner_under_ROOT = yes any_direct_de_jure_vassal_title = { owner_under_FROM = yes } } on_add = { log = "CB(dejure_barony_claim): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(dejure_barony_claim): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { holder_scope = { save_event_target_as = target_taker } any_direct_de_jure_vassal_title = { limit = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } OR = { NOT = { religion = ROOT } emf_cb_unexpelled_holy_order_trigger = no } NOT = { any_liege = { religion = ROOT emf_cb_unexpelled_holy_order_trigger = yes } } NOR = { character = event_target:target_taker is_liege_or_above = event_target:target_taker is_liege_or_above = ROOT } } } usurp_title_plus_barony_if_unlanded = { target = event_target:target_taker type = claim } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(dejure_barony_claim): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -50 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 25 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 25 } } } on_reverse_demand = { log = "CB(dejure_barony_claim): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -100 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_invalidation = { log = "CB(dejure_barony_claim): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 75 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 75 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #45 other_dejure_barony_claim = { name = CB_NAME_DEJUREBARONYCLAIM war_name = WAR_NAME_OTHER_DEJUREBARONYCLAIM sprite = 16 truce_days = 730 is_permanent = no can_use = { always = no } is_valid_title = { always = no } on_success = {} on_success_title = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #46 other_dejure_county_claim = { name = CB_NAME_DEJURECLAIM war_name = WAR_NAME_OTHER_DEJURECLAIM sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes other_de_jure_claim = yes # Optimization for de jure claims of vassals press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.3 can_use_gui = { emf_cb_thirdparty_can_use_gui_trigger = yes OR = { NOT = { has_dlc = "Sons of Abraham" } NOT = { religion = FROM } FROM = { emf_cb_unexpelled_holy_order_trigger = no } } } can_use = { emf_cb_thirdparty_can_use_trigger = yes NOT = { character = ROOT } mercenary = no } can_use_title = { tier = COUNT dejure_liege_title = { has_holder = yes ROOT = { has_landed_title = PREV } } NAND = { FROMFROM = { rightful_religious_head = FROM } title = c_roma } holder_scope = { NOR = { character = ROOT character = FROMFROM is_liege_or_above = ROOT is_liege_or_above = FROMFROM } } NOT = { OR = { ROOT = { has_landed_title = PREV } holder_scope = { is_liege_or_above = ROOT } } } OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } emf_cb_thirdparty_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(other_dejure_county_claim): START: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" } on_success = { log = "CB(other_dejure_county_claim): VICTORY: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_victory_other_effect = yes ROOT = { opinion = { modifier = pressed_my_claim who = PREV } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_title = { emf_cb_latb_effect = yes if = { limit = { holder_scope = { tier = COUNT NOT = { num_of_count_titles = 2 } } } holder_scope = { emf_ROOT_subjugate_ruler_effect = yes } } if = { limit = { holder_scope = { OR = { higher_tier_than = COUNT num_of_count_titles = 2 } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } any_de_jure_vassal_title = { # take all baronies under the one we're fighting for limit = { has_holder = yes NOT = { de_facto_liege = PREV } holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } } } } on_success_posttitle = { emf_cb_thirdparty_on_success_posttitle_effect = yes } on_fail = { log = "CB(other_dejure_county_claim): WHITEPEACE: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" prestige = -50 ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(other_dejure_county_claim): DEFEAT: title=[FromFrom.GetID]: [This.GetTitledFirstName] of [This.PrimaryTitle.GetBaseName] ([This.GetID]/[This.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" emf_cb_defeat_other_effect = yes prestige = -100 transfer_scaled_wealth = { to = FROM value = 4.0 } ROOT = { prestige = -200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(other_dejure_county_claim): INVALIDATED: [FromFrom.GetTitledFirstName] of [FromFrom.PrimaryTitle.GetBaseName] ([FromFrom.GetID]/[FromFrom.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID]) on behalf of [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #47 shia_caliphate_rising = { name = CB_NAME_SHIA_CALIPHATE_RISING war_name = WAR_NAME_SHIA_CALIPHATE_RISING sprite = 8 truce_days = 365 hostile_against_others = no is_permanent = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes apply_short_occ_mod = no # Do not apply the 'recently_conquered' modifier to Holdings can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = shia_caliphate_pretender } } is_valid = { ROOT = { has_character_flag = shia_caliphate_pretender } d_shiite = { has_holder = no } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(shia_caliphate_rising): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(shia_caliphate_rising): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes clr_global_flag = shia_caliphate_revolt_ongoing ROOT = { piety = 500 religion_authority = { modifier = rise_of_the_shia_caliphate } clr_character_flag = shia_caliphate_pretender } FROM = { piety = -500 } } on_success_title = { emf_cb_latb_effect = yes custom_tooltip = { text = tribal_invasion_succ_tip hidden_tooltip = { d_shiite = { usurp_title = { target = ROOT type = holy_war } } FROM = { random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } } pf_liege_change_under_title_begin_effect = yes ROOT = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = revolt } clr_global_flag = emf_latb_upon_gain vassalize_or_take_under_title = { title = PREV enemy = FROM is_religious = yes type = revolt } any_demesne_title = { limit = { tier = BARON } remove_holding_modifier = recently_conquered refill_holding_levy = yes } usurp_title = { target = PREV type = revolt } } pf_liege_change_under_title_end_effect = yes if = { limit = { FROM = { is_liege_or_above = ROOT } } FROM = { imprison = ROOT } } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(shia_caliphate_rising): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" clr_global_flag = shia_caliphate_revolt_ongoing FROM = { piety = 250 } ROOT = { piety = -250 clr_character_flag = shia_caliphate_pretender } } on_reverse_demand = { log = "CB(shia_caliphate_rising): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes clr_global_flag = shia_caliphate_revolt_ongoing ROOT = { piety = -500 clr_character_flag = shia_caliphate_pretender imprison = FROM } FROM = { piety = 250 } any_defender = { limit = { character = FROM } participation_scaled_piety = 250 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 250 } } } on_attacker_leader_death = { clr_global_flag = shia_caliphate_revolt_ongoing ROOT = { clr_character_flag = shia_caliphate_pretender } end_war = invalid } on_invalidation = { log = "CB(shia_caliphate_rising): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" clr_global_flag = shia_caliphate_revolt_ongoing } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #48 depose_antipope = { name = CB_NAME_DEPOSE_ANTIPOPE war_name = WAR_NAME_DEPOSE_ANTIPOPE sprite = 11 truce_days = 3650 is_permanent = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no attacker_rel_head_is_ally = yes # The attacker can call his (main) Pope into the war can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion = FROM OR = { religion = catholic religion = fraticelli } rightful_religious_head_scope = { NOT = { has_claim = k_papal_state } NOT = { has_claim = d_fraticelli } } mercenary = no } FROM = { rightful_religious_head_scope = { is_liege_or_above = PREV OR = { has_claim = k_papal_state has_claim = d_fraticelli } } } } is_valid = { ROOT = { religion = FROM OR = { religion = catholic religion = fraticelli } rightful_religious_head_scope = { NOT = { has_claim = k_papal_state } NOT = { has_claim = d_fraticelli } } } FROM = { rightful_religious_head_scope = { is_liege_or_above = PREV OR = { has_claim = k_papal_state has_claim = d_fraticelli } } } } on_add = { log = "CB(depose_antipope): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(depose_antipope): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_piety = 500 participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 500 participation_scaled_prestige = 250 } } ROOT = { religion_authority = { modifier = deposed_antipope years = 50 } if = { limit = { rightful_religious_head_scope = { ROOT = { excommunicated_for = PREV } } } excommunicate = no } rightful_religious_head_scope = { opinion = { who = ROOT modifier = opinion_deposed_antipope } } } FROM = { piety = -500 prestige = -250 rightful_religious_head_scope = { remove_claim = k_papal_state remove_claim = d_fraticelli } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(depose_antipope): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -250 prestige = -125 } FROM = { piety = 100 prestige = 50 } } on_reverse_demand = { log = "CB(depose_antipope): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } piety = -500 prestige = -250 } FROM = { piety = 500 prestige = 250 } } on_invalidation = { log = "CB(depose_antipope): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #49 cb_install_antiking = { name = CB_NAME_INSTALL_ANTIKING war_name = WAR_NAME_INSTALL_ANTIKING sprite = 11 truce_days = 3650 major_revolt = yes attacker_can_call_allies = no attacker_rel_head_is_ally = yes # The attacker can call his (main) Pope into the war can_use = { emf_cb_can_use_trigger = yes ROOT = { vassal_of = FROM religion = FROM OR = { religion = catholic religion = fraticelli } } } is_valid_title = { NOT = { holder_scope = { character = ROOT } } } is_valid = { ROOT = { religion = FROM OR = { religion = catholic religion = fraticelli } } ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } } on_add = { log = "CB(cb_install_antiking): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(cb_install_antiking): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes # the defender loses 10 Imperial Decadence ("out with the old, in with the new") if = { limit = { FROM = { emf_uses_imperial_decay_trigger = yes } } FROM = { custom_tooltip = { text = IMPERIAL_DECAY_MINUS_10 } hidden_tooltip = { primary_title = { change_variable = { which = "imperial_decay" value = -10 } set_title_flag = skip_decay_gain } } } } any_attacker = { limit = { character = ROOT } participation_scaled_piety = 500 participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 500 participation_scaled_prestige = 250 } } ROOT = { religion_authority = { modifier = deposed_antipope years = 50 } if = { limit = { religion = catholic } k_papal_state = { holder_scope = { opinion = { who = ROOT modifier = opinion_deposed_antipope } } } } if = { limit = { religion = fraticelli } d_fraticelli = { holder_scope = { opinion = { who = ROOT modifier = opinion_deposed_antipope } } } } } FROM = { piety = -500 prestige = -250 hidden_tooltip = { rightful_religious_head_scope = { remove_claim = k_papal_state remove_claim = d_fraticelli } } primary_title = { usurp_title = { target = ROOT type = revolt } } } if = { limit = { primary_title = { has_law = investiture_law_1 } } primary_title = { add_law_w_cooldown = investiture_law_0 } } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(cb_install_antiking): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes ROOT = { piety = -250 prestige = -125 cancel_plot = plot_gain_title } FROM = { piety = 100 prestige = 50 } } on_reverse_demand = { log = "CB(cb_install_antiking): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } piety = -500 prestige = -250 prisoner = FROM cancel_plot = plot_gain_title } FROM = { piety = 500 prestige = 250 } } on_invalidation = { log = "CB(cb_install_antiking): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes ROOT = { cancel_plot = plot_gain_title } } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #50 buddhist_holy_war = { name = CB_NAME_RELIGIOUS war_name = WAR_NAME_RELIGIOUS sprite = 9 truce_days = 1825 hostile_against_others = yes is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { piety = 100 } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion = buddhist NOT = { same_realm = FROM } NOT = { religion_group = FROM } top_liege = { religion_group = ROOT NOT = { religion = FROM } } mercenary = no is_nomadic = no } } can_use_title = { tier = COUNT OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } # Prevents duplicate CBs (religious reconquest) OR = { has_global_flag = rapid_conquest NOT = { AND = { NOT = { FROM = { has_landed_title = k_pechenegs } # Need help surviving } any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { ROOT = { religion = PREV } } } } } } # The attacker needs a border or be at the most two sea zones away location = { any_neighbor_province = { OR = { AND = { has_owner = yes owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } AND = { is_land = no any_neighbor_province = { OR = { AND = { has_owner = yes owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } AND = { is_land = no any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } } } } emf_cb_can_use_title_trigger = yes } is_valid = { ROOT = { religion = buddhist NOT = { same_realm = FROM } NOT = { religion_group = FROM } top_liege = { NOT = { religion = FROM } } } } on_add = { log = "CB(buddhist_holy_war): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -100 } } on_success = { log = "CB(buddhist_holy_war): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes if = { limit = { holder_scope = { tier = COUNT NOT = { num_of_count_titles = 2 } lower_tier_than = ROOT } } holder_scope = { emf_ROOT_subjugate_ruler_effect = yes } } if = { limit = { holder_scope = { OR = { higher_tier_than = COUNT num_of_count_titles = 2 NOT = { lower_tier_than = ROOT } } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = holy_war } any_de_jure_vassal_title = { # take all baronies under the one we're fighting for limit = { has_holder = yes NOT = { de_facto_liege = PREV } holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = holy_war } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(buddhist_holy_war): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(buddhist_holy_war): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(buddhist_holy_war): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #51 indian_subjugation = { name = CB_NAME_PAGAN_SUBJUGATION war_name = WAR_NAME_PAGAN_SUBJUGATION sprite = 8 truce_days = 365 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { piety = 500 OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = indian_group NOT = { same_realm = FROM } NOT = { is_liege_or_above = FROM } has_horde_culture = no # Should use tribal invasion instead is_nomadic = no mercenary = no } FROM = { religion_group = indian_group culture_group = ROOT NOT = { any_war = { defender = { character = PREVPREV } using_cb = indian_subjugation } } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes ROOT = { OR = { NOT = { has_character_modifier = launched_subjugation } AND = { has_ambition = obj_become_king capital_scope = { kingdom = { title = PREVPREVPREV } } } } } FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(indian_subjugation): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -500 } } on_add_title = { ROOT = { if = { limit = { OR = { NOT = { has_ambition = obj_become_king } capital_scope = { kingdom = { NOT = { title = PREVPREVPREV } } } } } add_character_modifier = { name = launched_subjugation days = -1 hidden = yes } } } } on_success = { log = "CB(indian_subjugation): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } FROM = { prestige = -200 } } on_success_title = { emf_cb_latb_effect = yes # Usurp the target kingdom itself, if the enemy holds it if = { limit = { holder_scope = { character = FROM } NOT = { ROOT = { tier = EMPEROR } } } ROOT = { usurp_title = { target = PREV type = invasion } } } if = { # Take the enemy's duchies within the target kingdom, if we are the same or lower tier limit = { ROOT = { NOT = { higher_tier_than = FROM } } } FROM = { any_demesne_title = { limit = { tier = DUKE OR = { title = PREVPREV de_jure_liege_or_above = PREVPREV } } ROOT = { usurp_title = { target = PREV type = invasion } } } } } # Have I become the vassal of the loser due to taking a duchy or kingdom? if = { limit = { ROOT = { is_liege_or_above = FROM } } ROOT = { set_defacto_liege = ROOT emf_liege_change_effect = yes } } pf_liege_change_under_title_begin_effect = yes # Vassalize the rest custom_tooltip = { text = pagan_subjugation_tip hidden_tooltip = { ROOT = { subjugate_or_take_under_title = { # If the target only has territory within the kingdom, he is simply vassalized title = PREV enemy = FROM } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(indian_subjugation): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -100 } } on_reverse_demand = { log = "CB(indian_subjugation): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 2.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(indian_subjugation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #52 manifest_destiny_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 3650 hostile_against_others = yes is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { OR = { AND = { dynasty = 613 # Seljuks NOT = { year = 1200 } } dynasty = 800 # Timurids } } ROOT = { NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # Check vassal duchy titles against region due to possibility of DJ drift into a kingdom with foreign capital any_direct_de_jure_vassal_title = { region = emf_region_manifest_destiny } # The attacker needs at least one county in the target kingdom, or a border any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { OR = { owner_under_ROOT = yes location = { any_neighbor_province = { owner_under_ROOT = yes } } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(manifest_destiny_invasion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(manifest_destiny_invasion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { prestige = 200 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_magnificent } 10 = { give_nickname = nick_the_glorious } 10 = { give_nickname = nick_the_conqueror } } } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -20 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -20 } } } FROM = { prestige = -200 } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = other_invasion_succ_tip # tribal_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM is_crusade = yes # Even if the kingdom title holder is not participating in the war, gain holdings occupied by all participants type = invasion } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(manifest_destiny_invasion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 100 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -200 } } on_reverse_demand = { log = "CB(manifest_destiny_invasion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -400 transfer_scaled_wealth = { to = FROM value = 4.0 } if = { limit = { uses_decadence = yes } decadence = 10 } } FROM = { prestige = 200 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -20 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -20 } } } } on_invalidation = { log = "CB(manifest_destiny_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 100 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 150 } ai_will_do = { factor = 2 modifier = { factor = 1.5 FROM = { num_of_realm_counties = { value = 2 title = PREV } } } modifier = { factor = 1.667 FROM = { num_of_realm_counties = { value = 3 title = PREV } } } modifier = { factor = 2 FROM = { num_of_realm_counties = { value = 4 title = PREV } } } } } #53 cb_decadence_usurption = { name = CB_NAME_DECADENCE_USURPTION war_name = WAR_NAME_DECADENCE_USURPTION sprite = 11 truce_days = 1825 is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = muslim uses_decadence = yes mercenary = no } FROM = { religion_group = muslim uses_decadence = yes trait = decadent dynasty = ROOT OR = { liege = { character = PREV # either independent } liege = { ROOT = { is_liege_or_above = PREV # or have shared liege } } } primary_title = { is_primary_type_title = no is_landless_type_title = no } } } is_valid = { FROM = { OR = { liege = { character = PREV # either independent } liege = { ROOT = { is_liege_or_above = PREV # or have shared liege } } } } } on_add = { log = "CB(cb_decadence_usurption): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(cb_decadence_usurption): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_piety = 500 participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 500 participation_scaled_prestige = 250 } } FROM = { prisoner = ROOT } FROM = { primary_title = { if = { limit = { tier = COUNT } emf_cb_latb_effect = yes } usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(cb_decadence_usurption): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { piety = -100 prestige = -125 } FROM = { piety = 100 prestige = 125 } } on_reverse_demand = { log = "CB(cb_decadence_usurption): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 2.0 } piety = -200 prestige = -250 } FROM = { piety = 200 prestige = 250 } } on_invalidation = { log = "CB(cb_decadence_usurption): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #54 rivalry_cb = { name = CB_NAME_RIVALRY war_name = WAR_NAME_RIVALRY sprite = 7 truce_days = 1825 is_permanent = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { is_rival = FROM } FROM = { NOT = { has_opinion_modifier = { who = ROOT modifier = opinion_humiliated_rival } } } } is_valid = { ROOT = { is_rival = FROM } } on_add = { log = "CB(rivalry_cb): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(rivalry_cb): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 250 add_character_modifier = { name = emf_victory_timer duration = 1 hidden = yes } } } ROOT = { if = { limit = { ai = no FROM = { any_sibling = { character = ROOT } } } set_character_flag = achievement_sibling_rival_war } remove_opinion = { who = FROM modifier = opinion_humiliated_rival } } FROM = { prestige = -250 imprison = ROOT opinion = { modifier = opinion_humiliated_rival who = ROOT years = 150 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(rivalry_cb): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -125 } FROM = { prestige = 50 } } on_reverse_demand = { log = "CB(rivalry_cb): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes any_defender = { limit = { character = FROM } participation_scaled_prestige = 250 hidden_tooltip = { add_character_modifier = { name = emf_victory_timer duration = 1 hidden = yes } } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 250 add_character_modifier = { name = emf_victory_timer duration = 1 hidden = yes } } } ROOT = { prestige = -250 imprison = FROM opinion = { modifier = opinion_humiliated_rival who = FROM years = 150 } } FROM = { remove_opinion = { who = ROOT modifier = opinion_humiliated_rival } if = { limit = { ai = no ROOT = { any_sibling = { character = PREVPREV } } } set_character_flag = achievement_sibling_rival_war } } } on_invalidation = { log = "CB(rivalry_cb): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 1 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #55 tributary_cb = { name = CB_NAME_TRIBUTARY war_name = WAR_NAME_TRIBUTARY sprite = 1 truce_days = 365 is_permanent = yes hostile_against_others = yes can_ask_to_join_war = no display_on_map = no coalition_threat = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes has_dlc = "Horse Lords" ROOT = { independent = yes NOT = { same_realm = FROM } mercenary = no is_tributary = no NOT = { rightful_religious_head_scope = { character = FROM } } NAND = { holy_order = yes religion = FROM } } FROM = { NAND = { holy_order = yes religion = ROOT } } # The attacker needs a direct border FROM = { any_realm_province = { any_neighbor_province = { owner_under_ROOT = yes } } } # The defender is not in any tributary war FROM = { NOT = { any_war = { defender = { character = PREV } using_cb = tributary_cb } } } } is_valid = { NOT = { ROOT = { rightful_religious_head_scope = { character = FROM } } } } on_add = { log = "CB(tributary_cb): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(tributary_cb): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes FROM = { save_event_target_as = target_loser prestige = -100 custom_tooltip = { text = REMOVE_PREVIOUS_SUZERAIN hidden_tooltip = { any_suzerain = { event_target:target_loser = { remove_tributary = PREV } } } } } ROOT = { prestige = 200 make_tributary = { who = FROM percentage = 0.4 } } if = { limit = { ROOT = { uses_decadence = yes } } ROOT = { decadence = -10 } } if = { limit = { ROOT = { is_nomadic = yes } } ROOT = { clan_title = { save_event_target_as = liege_clan } any_vassal = { limit = { is_nomadic = yes } clan_title = { clan_opinion = { who = event_target:liege_clan modifier = won_tributary_war years = 5 } } } } } if = { limit = { ROOT = { is_tribal = yes } } ROOT = { any_vassal = { limit = { is_tribal = yes } opinion = { who = PREV modifier = won_tributary_war years = 5 } } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(tributary_cb): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } FROM = { prestige = 100 } } on_reverse_demand = { log = "CB(tributary_cb): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 } } on_attacker_leader_death = { end_war = invalid } on_invalidation = { log = "CB(tributary_cb): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 modifier = { factor = 2 FROM = { trait = proud } } modifier = { factor = 2 FROM = { trait = brave } } modifier = { factor = 2 FROM = { trait = greedy } } modifier = { factor = 3 FROM = { higher_tier_than = DUKE } } modifier = { factor = 0.85 ROOT = { relative_power = { who = FROM power = 1.2 } } } modifier = { factor = 0.85 ROOT = { relative_power = { who = FROM power = 1.5 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 2.0 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 2.5 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 3 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 4 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 5 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 6 } } } modifier = { factor = 0.5 ROOT = { relative_power = { who = FROM power = 8 } } } modifier = { factor = 0.25 ROOT = { relative_power = { who = FROM power = 10 } } } modifier = { factor = 2 ROOT = { distance_from_realm = { who = FROM value = 20 } } } modifier = { factor = 2 ROOT = { distance_from_realm = { who = FROM value = 40 } } } modifier = { factor = 3 ROOT = { distance_from_realm = { who = FROM value = 80 } } } modifier = { factor = 4 ROOT = { distance_from_realm = { who = FROM value = 120 } } } } ai_will_do = { factor = 1 modifier = { factor = 0.1 # Low prio CB } modifier = { factor = 0.1 # Nomads are the only ones who like using the CB ROOT = { is_nomadic = no } } modifier = { factor = 0.1 # Target has almost no money FROM = { OR = { is_nomadic = yes is_tribal = yes } } } modifier = { factor = 4 ROOT = { trait = greedy } } modifier = { factor = 0 ROOT = { is_feudal = yes NOT = { religion_group = muslim } } FROM = { is_feudal = yes NOT = { religion_group = muslim } } } } } #56 free_tributary_cb = { name = CB_NAME_FREE_TRIBUTARY war_name = WAR_NAME_FREE_TRIBUTARY sprite = 1 truce_days = 365 is_permanent = yes hostile_against_others = yes can_ask_to_join_war = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes has_dlc = "Horse Lords" ROOT = { OR = { AND = { is_tributary = yes suzerain = { OR = { character = FROM any_liege = { character = FROM } } } } any_vassal = { is_tributary = yes suzerain = { OR = { character = FROM any_liege = { character = FROM } } } } } } } is_valid = { ROOT = { OR = { AND = { is_tributary = yes suzerain = { OR = { character = FROM any_liege = { character = FROM } } } } any_vassal = { is_tributary = yes suzerain = { OR = { character = FROM any_liege = { character = FROM } } } } } } } on_add = { log = "CB(free_tributary_cb): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(free_tributary_cb): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes FROM = { prestige = -100 } ROOT = { prestige = 100 if = { limit = { is_tributary = yes suzerain = { OR = { character = FROM any_liege = { character = FROM } } } } suzerain = { remove_tributary = PREV } } any_vassal = { limit = { is_tributary = yes suzerain = { OR = { character = FROM any_liege = { character = FROM } } } } suzerain = { remove_tributary = PREV } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(free_tributary_cb): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } FROM = { prestige = 100 } } on_reverse_demand = { log = "CB(free_tributary_cb): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -100 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 100 } } on_invalidation = { log = "CB(free_tributary_cb): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_attacker_leader_death = { end_war = invalid } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 modifier = { factor = 1.5 FROM = { trait = proud } } modifier = { factor = 1.5 FROM = { trait = brave } } modifier = { factor = 1.5 FROM = { trait = greedy } } modifier = { factor = 2 FROM = { tier = KING } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 1.2 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 1.5 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 2.0 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 2.5 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 3 } } } modifier = { factor = 0.7 ROOT = { relative_power = { who = FROM power = 4 } } } modifier = { factor = 0.7 ROOT = { relative_power = { who = FROM power = 5 } } } modifier = { factor = 0.7 ROOT = { relative_power = { who = FROM power = 6 } } } modifier = { factor = 0.4 ROOT = { relative_power = { who = FROM power = 8 } } } modifier = { factor = 0.1 ROOT = { relative_power = { who = FROM power = 10 } } } modifier = { factor = 5 ROOT = { distance_from_realm = { who = FROM value = 20 } } } modifier = { factor = 5 ROOT = { distance_from_realm = { who = FROM value = 40 } } } modifier = { factor = 5 ROOT = { distance_from_realm = { who = FROM value = 80 } } } modifier = { factor = 5 ROOT = { distance_from_realm = { who = FROM value = 120 } } } } ai_will_do = { factor = 1 modifier = { factor = 1.5 } modifier = { factor = 4 ROOT = { trait = greedy } } modifier = { factor = 2 OR = { ROOT = { is_nomadic = yes } FROM = { is_nomadic = no } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #57 cb_install_khan = { name = CB_NAME_INSTALLKHAN war_name = WAR_NAME_INSTALLKHAN sprite = 12 truce_days = 3650 is_revolt_cb = no can_call_vassals = yes attacker_can_call_allies = no major_revolt = yes can_use = { emf_cb_can_use_trigger = yes has_dlc = "Horse Lords" ROOT = { is_nomadic = yes } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } num_of_count_titles = 1 } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } } } on_add = { log = "CB(cb_install_khan): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(cb_install_khan): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes FROM = { any_demesne_title = { limit = { tier = EMPEROR } gain_title = { target = ROOT type = faction_demand } } death = { death_reason = death_execution killer = ROOT } } emf_cb_dynlevy_end_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 250 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(cb_install_khan): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -100 } } on_reverse_demand = { log = "CB(cb_install_khan): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -200 prisoner = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } on_defender_leader_death = { hidden_tooltip = { any_attacker = { letter_event = { id = 251 } } } end_war = invalid } on_invalidation = { log = "CB(cb_install_khan): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #58 nomad_dispute = { name = CB_NAME_DISPUTE war_name = CB_NAME_DISPUTE sprite = 16 truce_days = 1095 hostile_against_others = yes is_permanent = yes check_all_titles = yes press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no allow_distant = yes can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes has_dlc = "Horse Lords" ROOT = { is_nomadic = yes same_realm = FROM has_feud_with = FROM } FROM = { is_nomadic = yes } ROOT = { mercenary = no } } can_use_title = { tier = COUNT location = { NOT = { num_of_settlements = 1 } } FROM = { has_landed_title = PREV } emf_cb_can_use_title_trigger = yes } is_valid_title = { location = { NOT = { num_of_settlements = 1 } } FROM = { has_landed_title = PREV } } on_add = { log = "CB(nomad_dispute): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(nomad_dispute): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 participation_scaled_piety = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 participation_scaled_piety = 50 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(nomad_dispute): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { log = "CB(nomad_dispute): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 participation_scaled_piety = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 participation_scaled_piety = 50 } } } on_invalidation = { log = "CB(nomad_dispute): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 2 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #59 cb_liberate_nomad_duchy = { name = CB_NAME_LIBERATE_NOMAD war_name = WAR_NAME_LIBERATE_NOMAD sprite = 8 truce_days = 1825 is_permanent = no can_use = { always = no # Use emf_liberate_nomad_county instead } is_valid = { always = no } on_success = {} on_fail = {} on_reverse_demand = {} attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #60 cb_minor_clan_revolt = { name = CB_NAME_MINOR_CLAN_REVOLT war_name = WAR_NAME_MINOR_CLAN_REVOLT sprite = 16 truce_days = 365 hostile_against_others = no is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes attacker_can_call_allies = no defender_can_call_allies = no can_ask_to_join_war = no is_independence = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { primary_title = { temporary = yes } # Revolter or adventurer trigger war = no NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { tier = COUNT emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(cb_minor_clan_revolt): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(cb_minor_clan_revolt): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { # No emf_cb_latb_effect here for good reason usurp_title_plus_barony_if_unlanded = { target = ROOT type = revolt } ROOT = { primary_title = { set_title_nomad = { title = THIS status = no } } set_government_type = feudal_government } ROOT = { set_government_type = nomadic_government set_defacto_liege = FROM hidden_tooltip = { remove_opinion = { who = FROM modifier = opinion_evil_tyrant } } } FROM = { prestige = -100 } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(cb_minor_clan_revolt): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 10 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } } ROOT = { clear_wealth = yes imprison = FROM hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } } on_reverse_demand = { log = "CB(cb_minor_clan_revolt): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes FROM = { prestige = 20 hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } add_character_modifier = { name = crushed_revolt days = 3650 } } } ROOT = { clear_wealth = yes imprison = FROM hidden_tooltip = { add_character_modifier = { name = broken_spirit days = -1 } } } } on_attacker_leader_death = { end_war = invalid } on_invalidation = { log = "CB(cb_minor_clan_revolt): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #61 nomad_subjugation = { name = CB_NAME_PAGAN_SUBJUGATION war_name = WAR_NAME_PAGAN_SUBJUGATION sprite = 8 truce_days = 365 is_permanent = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes OR = { ROOT = { higher_tier_than = KING } NOT = { FROM = { tier = EMPEROR } } } FROM = { is_nomadic = no OR = { AND = { is_tribal = yes ROOT = { population = 2500 } } ROOT = { population = 10000 } } } ROOT = { prestige = 500 } } can_use = { emf_cb_can_use_trigger = yes ROOT = { is_nomadic = yes NOT = { same_realm = FROM } NOT = { is_liege_or_above = FROM } mercenary = no NOT = { has_character_modifier = launched_subjugation } } FROM = { in_revolt = no is_nomadic = no # Nomads cannot be subjugated NOT = { higher_tier_than = ROOT } NOT = { any_war = { defender = { character = PREVPREV } OR = { using_cb = nomad_subjugation using_cb = pagan_subjugation } } } } # EMF: only if ROOT borders FROM ROOT = { any_realm_province = { any_neighbor_province = { owner = { OR = { character = FROM is_liege_or_above = FROM } } } } } } on_add = { log = "CB(nomad_subjugation): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { add_character_modifier = { name = launched_subjugation days = -1 hidden = yes } prestige = -500 } } on_success = { log = "CB(nomad_subjugation): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { piety = 100 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } FROM = { piety = -100 prestige = -100 if = { limit = { is_reformed_religion = ROOT controls_religion = no } religion = ROOT # Reformed pagans are forced to convert back } custom_tooltip = { text = tribal_subjugation_tip } hidden_tooltip = { set_defacto_liege = ROOT any_demesne_title = { limit = { higher_tier_than = ROOT NOT = { controls_religion = yes } } ROOT = { grant_title = { target = PREV type = invasion } } add_pressed_claim = PREV } if = { limit = { any_demesne_title = { tier = ROOT higher_tier_than = DUKE NOT = { controls_religion = yes } } } any_vassal = { set_character_flag = emf_prior_vassal set_defacto_liege = ROOT } any_demesne_title = { limit = { tier = ROOT higher_tier_than = DUKE NOT = { controls_religion = yes } } emf_destroy_title_effect = yes } ROOT = { any_vassal = { limit = { has_character_flag = emf_prior_vassal lower_tier_than = PREVPREV } set_defacto_liege = PREVPREV } any_vassal = { limit = { has_character_flag = emf_prior_vassal } clr_character_flag = emf_prior_vassal emf_liege_change_effect = yes } } } any_demesne_title = { limit = { tier = ROOT NOT = { controls_religion = yes } } emf_cb_latb_effect = yes ROOT = { grant_title = { target = PREV type = invasion } } add_pressed_claim = PREV } if = { limit = { NOT = { any_demesne_title = { controls_religion = yes } } } set_defacto_liege = ROOT } if = { limit = { any_demesne_title = { controls_religion = yes } } any_vassal = { set_defacto_liege = ROOT emf_liege_change_effect = yes } any_demesne_title = { limit = { NOT = { controls_religion = yes } } emf_cb_latb_effect = yes ROOT = { grant_title = { target = PREV type = invasion } } } } emf_liege_change_effect = yes } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(nomad_subjugation): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { piety = 50 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } ROOT = { piety = -100 } } on_reverse_demand = { log = "CB(nomad_subjugation): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { piety = -200 transfer_scaled_wealth = { to = FROM value = 2.0 } } FROM = { piety = 100 } FROM = { if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_invalidation = { log = "CB(nomad_subjugation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 10 modifier = { factor = 2 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #62 nomad_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 1825 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { prestige = 100 population = 30000 population_factor = 0.75 # 75% of max } } can_use = { emf_cb_can_use_trigger = yes ROOT = { is_nomadic = yes } ROOT = { NOT = { same_realm = FROM } NAND = { # Should use emf_horde_invasion instead has_landed_title = e_mongol_empire ai = yes } } } can_use_title = { # EMF: only if ROOT has a border with one of FROM's provinces within the kingdom emf_cb_can_use_de_jure_title_trigger = yes any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(nomad_invasion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } } on_success = { log = "CB(nomad_invasion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } FROM = { prestige = -200 } hidden_tooltip = { ROOT = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = invasion } clr_global_flag = emf_latb_upon_gain if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_victorious } 10 = { give_nickname = nick_the_conqueror } 10 = { give_nickname = nick_the_brave } 10 = { give_nickname = nick_the_dragon } 10 = { give_nickname = nick_the_terrible } } } } } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = tribal_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = invasion } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(nomad_invasion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 100 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -200 } } on_reverse_demand = { log = "CB(nomad_invasion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(nomad_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = 200 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 8 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #63 nomad_expansion = { name = CB_NAME_NOMAD_EXPANSION war_name = WAR_NAME_NOMAD_EXPANSION sprite = 8 truce_days = 1825 is_permanent = yes is_holy_war = yes check_de_jure_tier = DUKE # this scans all de jure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { prestige = 300 population_factor = 0.5 } FROM = { OR = { is_nomadic = yes # Nomads no population requirement AND = { is_tribal = yes ROOT = { population = 5000 } # Tribals need 5k } ROOT = { population = 15000 } # Everyone else needs 15k } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { is_nomadic = yes NOT = { same_realm = FROM } mercenary = no } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # EMF: only if ROOT has a border with one of FROM's provinces within the duchy OR = { ROOT = { ai = yes } any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } is_valid = { ROOT = { is_nomadic = yes NOT = { same_realm = FROM } } } on_add = { log = "CB(nomad_expansion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -300 } } on_success = { log = "CB(nomad_expansion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } } FROM = { prestige = -200 } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = pagan_subjugation_tip hidden_tooltip = { ROOT = { subjugate_or_take_under_title = { title = PREV enemy = FROM #same_religion = yes # Only vassalize rulers of my religion } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(nomad_expansion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -200 } } on_reverse_demand = { log = "CB(nomad_expansion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } prestige = -200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 300 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 300 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -10 } } } } on_invalidation = { log = "CB(nomad_expansion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 2 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } #64 increase_council_power_war = { # Started from faction name = CB_NAME_INCREASE_COUNCIL_POWER war_name = WAR_NAME_INCREASE_COUNCIL_POWER sprite = 6 truce_days = 3650 can_call_allies = no can_ask_to_join_war = no major_revolt = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { vassal_of = FROM } } can_use_title = { higher_tier_than = BARON is_primary_holder_title = yes OR = { has_law = law_voting_power_0 has_law = banish_voting_power_0 has_law = execution_voting_power_0 has_law = revoke_title_voting_power_0 has_law = grant_title_voting_power_0 has_law = imprison_voting_power_0 has_law = war_voting_power_0 } emf_cb_can_use_title_trigger = yes } is_valid = { FROM = { in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } } on_add = { log = "CB(increase_council_power_war): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(increase_council_power_war): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { opinion = { modifier = opinion_increased_council_power who = FROM months = 12 } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 hidden_tooltip = { disband_event_forces = faction_revolters } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } hidden_tooltip = { disband_event_forces = faction_revolters } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_success_title = { if = { limit = { has_law = law_voting_power_0 } add_law_w_cooldown = law_voting_power_1 break = yes } if = { limit = { has_law = war_voting_power_0 } add_law_w_cooldown = war_voting_power_1 break = yes } if = { limit = { has_law = revoke_title_voting_power_0 } add_law_w_cooldown = revoke_title_voting_power_1 break = yes } if = { limit = { has_law = imprison_voting_power_0 } add_law_w_cooldown = imprison_voting_power_1 break = yes } if = { limit = { has_law = grant_title_voting_power_0 } add_law_w_cooldown = grant_title_voting_power_1 break = yes } if = { limit = { has_law = banish_voting_power_0 } add_law_w_cooldown = banish_voting_power_1 break = yes } if = { limit = { has_law = execution_voting_power_0 } add_law_w_cooldown = execution_voting_power_1 break = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(increase_council_power_war): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } hidden_tooltip = { any_attacker = { disband_event_forces = faction_revolters add_character_modifier = { name = faction_council_power_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_reverse_demand = { log = "CB(increase_council_power_war): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -200 prisoner = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } hidden_tooltip = { any_attacker = { limit = { liege = { character = FROM } } prisoner = FROM disband_event_forces = faction_revolters add_character_modifier = { name = faction_council_power_ultimatum_timer hidden = yes duration = 3650 } } } FROM = { hidden_tooltip = { disband_event_forces = faction_loyalists } } } on_invalidation = { log = "CB(increase_council_power_war): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } #65 nomad_humiliate_cb = { name = CB_NAME_HUMILIATE war_name = WAR_NAME_HUMILIATE sprite = 1 truce_days = 3650 is_permanent = yes hostile_against_others = yes can_ask_to_join_war = no display_on_map = no coalition_threat = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes has_dlc = "Horse Lords" ROOT = { is_nomadic = yes mercenary = no OR = { AND = { same_realm = FROM has_feud_with = FROM } FROM = { is_nomadic = yes independent = yes } } } # The attacker needs a border, or be at most two sea zones away from one of the target's counties FROM = { any_realm_province = { any_neighbor_province = { OR = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } AND = { is_land = no any_neighbor_province = { OR = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } AND = { is_land = no any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } } } } } } on_add = { log = "CB(nomad_humiliate_cb): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(nomad_humiliate_cb): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { prestige = 300 steal_population_scaled = { target = FROM percentage = 0.1 } } FROM = { prestige = -300 } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(nomad_humiliate_cb): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } FROM = { prestige = 100 } } on_reverse_demand = { log = "CB(nomad_humiliate_cb): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 } } on_invalidation = { log = "CB(nomad_humiliate_cb): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_attacker_leader_death = { end_war = invalid } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 modifier = { factor = 2 FROM = { trait = proud } } modifier = { factor = 2 FROM = { trait = brave } } modifier = { factor = 2 FROM = { trait = greedy } } modifier = { factor = 3 FROM = { tier = KING } } modifier = { factor = 0.85 ROOT = { relative_power = { who = FROM power = 1.2 } } } modifier = { factor = 0.85 ROOT = { relative_power = { who = FROM power = 1.5 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 2.0 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 2.5 } } } modifier = { factor = 0.8 ROOT = { relative_power = { who = FROM power = 3 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 4 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 5 } } } modifier = { factor = 0.75 ROOT = { relative_power = { who = FROM power = 6 } } } modifier = { factor = 0.5 ROOT = { relative_power = { who = FROM power = 8 } } } modifier = { factor = 0.25 ROOT = { relative_power = { who = FROM power = 10 } } } modifier = { factor = 2 ROOT = { distance_from_realm = { who = FROM value = 20 } } } modifier = { factor = 2 ROOT = { distance_from_realm = { who = FROM value = 40 } } } modifier = { factor = 3 ROOT = { distance_from_realm = { who = FROM value = 80 } } } modifier = { factor = 4 ROOT = { distance_from_realm = { who = FROM value = 120 } } } } ai_will_do = { factor = 1 modifier = { factor = 0.1 # Low prio CB } modifier = { factor = 0.1 # Target has almost no money FROM = { OR = { is_nomadic = yes is_tribal = yes } } } modifier = { factor = 4 ROOT = { trait = greedy } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } ### EMF STUFF FROM HERE ### cb_faction_overthrow_ruler = { name = CB_NAME_OVERTHROWRULER war_name = WAR_NAME_FACTION_DEPOSE sprite = 12 truce_days = 3650 major_revolt = yes attacker_can_call_allies = no defender_can_call_allies = no can_ask_to_join_war = no infamy_modifier = 0.01 can_use = { emf_cb_can_use_trigger = yes ROOT = { vassal_of = FROM has_opinion_modifier = { who = FROM modifier = revolting_against } } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } has_opinion_modifier = { who = FROM modifier = revolting_against } } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } in_revolt = no liege_before_war = { in_revolt = no liege_before_war = { in_revolt = no } } } OR = { # Never invalidate the revolt due to demands being impossible to fulfill if still the original liege ROOT = { has_character_flag = original_war_liege } # Succession law wars are invalid if the non-original liege doesn't hold the succession title NOT = { FROM = { has_character_flag = faction_succession_war } } AND = { ROOT = { has_character_flag = demands_seniority } FROM = { any_demesne_title = { higher_tier_than = COUNT has_title_flag = change_seniority } } } AND = { ROOT = { has_character_flag = demands_primogeniture } FROM = { any_demesne_title = { higher_tier_than = COUNT has_title_flag = change_primogeniture } } } AND = { ROOT = { has_character_flag = demands_gavelkind } FROM = { any_demesne_title = { higher_tier_than = COUNT has_title_flag = change_gavelkind } } } AND = { ROOT = { has_character_flag = demands_feudal_elective } FROM = { any_demesne_title = { higher_tier_than = COUNT has_title_flag = change_feudal_elective } } } } } on_add = { log = "CB(cb_faction_overthrow_ruler): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { pf_log_state_effect = yes } emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(cb_faction_overthrow_ruler): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" # the defender loses 10 Imperial Decadence ("out with the old, in with the new") if = { limit = { FROM = { emf_uses_imperial_decay_trigger = yes } } FROM = { custom_tooltip = { text = IMPERIAL_DECAY_MINUS_10 } hidden_tooltip = { primary_title = { change_variable = { which = "imperial_decay" value = -10 } set_title_flag = skip_decay_gain } } } } emf_cb_obj_win_war_effect = yes # apply immediate effects to the revolters hidden_tooltip = { any_attacker = { limit = { has_opinion_modifier = { who = FROM modifier = revolting_against } } # the revolters remember who they overthrew opinion = { modifier = overthrown_ruler who = FROM } reverse_opinion = { modifier = overthrew_me who = FROM } # and also are grateful to each other for their victory FROM = { any_opinion_modifier_target = { limit = { reverse_has_opinion_modifier = { who = PREV modifier = revolting_against_me } NOT = { character = PREVPREV } } reverse_opinion = { who = PREVPREV modifier = opinion_very_grateful years = 10 } } } } } # apply revolt effects to the defender FROM = { prestige = -500 # existing vassals may declare independence # if = { # limit = { independent = yes } # hidden_tooltip = { any_vassal = { character_event = { id = Plus.430 days = 3 } } } # } ## check whether title will be destroyed (CK2Plus only) # any_demesne_title = { # limit = { can_destroy_title_trigger = yes } # custom_tooltip = { text = TITLE_ENDANGERED_NO_NAME } # log = "[This.GetFullName] should be destroyed as a result of the revolt" # set_title_flag = destroy_title # } # always lower CA/TO, even if it wasn't a revolt demand pf_lower_CA_effect = yes # lower Crown Authority pf_lower_TO_effect = yes # lower Tribal Organization # enforce any rebel demands that prompted the civil war if = { limit = { ROOT = { has_character_flag = demands_revert_succession } } primary_title = { pf_revert_succession_law_effect = yes } } if = { limit = { ROOT = { has_character_flag = demands_lower_feudal_obligations } } pf_lower_feudal_obligations_effect = yes } if = { limit = { ROOT = { has_character_flag = demands_lower_tribal_obligations } } pf_lower_tribal_obligations_effect = yes } if = { limit = { ROOT = { has_character_flag = demands_lower_city_obligations } } pf_lower_city_obligations_effect = yes } if = { limit = { ROOT = { has_character_flag = demands_lower_temple_obligations } } pf_lower_temple_obligations_effect = yes } #if = { # limit = { ROOT = { has_character_flag = demands_council_life_terms } } # primary_title = { add_law_w_cooldown = council_privileges_1 } #} if = { limit = { ROOT = { has_character_flag = demands_seniority } } random_demesne_title = { limit = { has_title_flag = change_seniority } succession_w_cooldown = seniority clr_title_flag = change_seniority } recalc_succession = yes } if = { limit = { ROOT = { has_character_flag = demands_primogeniture } } random_demesne_title = { limit = { has_title_flag = change_primogeniture } succession_w_cooldown = primogeniture clr_title_flag = change_primogeniture } recalc_succession = yes } if = { limit = { ROOT = { has_character_flag = demands_gavelkind } } random_demesne_title = { limit = { has_title_flag = change_gavelkind } succession_w_cooldown = gavelkind clr_title_flag = change_gavelkind } recalc_succession = yes } if = { limit = { ROOT = { has_character_flag = demands_feudal_elective } } random_demesne_title = { limit = { has_title_flag = change_feudal_elective } succession_w_cooldown = feudal_elective clr_title_flag = change_feudal_elective } recalc_succession = yes } # Prevent on_new_holder / on_unlanded edge case handlers from tearing-down any civil war state while the CB # completes due to, e.g., liege changes or gained titles. set_global_flag = pf_teardown_lock # surrender any non-capital counties to rebels with claims save_event_target_as = current_holder any_demesne_title = { limit = { tier = COUNT location = { is_capital = no } can_be_given_away = yes } # give the county to de jure lieges if no rebels with claims exist if = { limit = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes any_demesne_title = { tier = DUKE de_jure_vassal_or_below = PREVPREVPREV } } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_claim = PREVPREV } } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes any_demesne_title = { tier = DUKE de_jure_vassal_or_below = PREVPREVPREV } } usurp_title_plus_barony_if_unlanded = { target = PREVPREV type = faction_demand } } } } # give the county to rebels with a weak claim if no rebels with strong claims exist if = { limit = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_weak_claim = PREVPREV emf_can_inherit_trigger = yes } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_strong_claim = PREVPREV emf_can_inherit_trigger = yes } } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes has_weak_claim = PREVPREV emf_can_inherit_trigger = yes } usurp_title_plus_barony_if_unlanded = { target = PREVPREV type = faction_demand } } } } # give the county to rebels with a strong claim if = { limit = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_strong_claim = PREVPREV emf_can_inherit_trigger = yes } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes has_strong_claim = PREVPREV emf_can_inherit_trigger = yes } usurp_title_plus_barony_if_unlanded = { target = PREVPREV type = faction_demand } } } } } # transfer vassals to their de jure lieges, giving preference to the # rebels with the lowest-tier held titles that are de jure liege to # each vassal (prefer most specific de jure liege) ... # king-tier de jure liege title vassal transfer to rebels any_vassal = { limit = { pf_part_of_this_revolt_trigger = no capital_holding = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { tier = KING de_jure_vassal_or_below = PREVPREVPREV } } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { lower_tier_than = KING de_jure_vassal_or_below = PREVPREVPREV } } } } } } capital_holding = { event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { tier = KING de_jure_vassal_or_below = PREVPREVPREV } } set_defacto_vassal = PREVPREVPREV emf_dynlevy_update_effect = yes } } } } # duke-tier de jure liege title vassal transfer to rebels any_vassal = { limit = { pf_part_of_this_revolt_trigger = no capital_holding = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { tier = DUKE de_jure_vassal_or_below = PREVPREVPREV } } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { lower_tier_than = DUKE de_jure_vassal_or_below = PREVPREVPREV } } } } } } capital_holding = { event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { tier = DUKE de_jure_vassal_or_below = PREVPREVPREV } } set_defacto_vassal = PREVPREVPREV # any_vassal emf_dynlevy_update_effect = yes } } } } # count-tier de jure liege title vassal transfer to rebels any_vassal = { limit = { pf_part_of_this_revolt_trigger = no capital_holding = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { tier = COUNT de_jure_vassal_or_below = PREVPREVPREV } } } } } capital_holding = { event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes higher_real_tier_than = PREVPREVPREV any_demesne_title = { tier = COUNT de_jure_vassal_or_below = PREVPREVPREV } } set_defacto_vassal = PREVPREVPREV } } } } # save event targets for primary title and current liege primary_title = { save_event_target_as = former_primary_title } if = { limit = { independent = no } liege = { save_event_target_as = current_liege } } # check whether defender should have titles usurped if = { limit = { # this is not a succession law revolt NOT = { has_character_flag = faction_succession_war } OR = { # or the current ruler is not an adult is_adult = no # or this is the original liege and the current heir is not an adult AND = { ROOT = { has_character_flag = original_war_liege } current_heir = { is_adult = no } } # or a rebel has a claim on the primary title or is a pretender/heir any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { has_claim = event_target:former_primary_title any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } } } } # grant non-primary same-tier titles to rebels with claims any_demesne_title = { limit = { can_be_given_away = yes is_primary_holder_title_tier = yes is_primary_holder_title = no } # give the title to rebel with a weak claim if none with a strong claim exists if = { limit = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_weak_claim = PREVPREV emf_can_inherit_trigger = yes } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { has_strong_claim = PREVPREV any_pretender_title = { title = PREVPREVPREV } any_heir_title = { title = PREVPREVPREV } } emf_can_inherit_trigger = yes } } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes has_weak_claim = PREVPREV emf_can_inherit_trigger = yes } usurp_title_plus_barony_if_unlanded = { target = PREVPREV type = faction_demand } emf_dynlevy_update_effect = yes } if = { limit = { event_target:current_liege = { always = yes } } hidden_tooltip = { set_defacto_liege = event_target:current_liege } } } } # give the title to rebel with a strong claim or is a pretender/heir if = { limit = { event_target:current_holder = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { has_strong_claim = PREVPREV any_pretender_title = { title = PREVPREVPREV } any_heir_title = { title = PREVPREVPREV } } emf_can_inherit_trigger = yes } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes OR = { has_strong_claim = PREVPREV any_pretender_title = { title = PREVPREVPREV } any_heir_title = { title = PREVPREVPREV } } emf_can_inherit_trigger = yes } usurp_title_plus_barony_if_unlanded = { target = PREVPREV type = faction_demand } emf_dynlevy_update_effect = yes } if = { limit = { event_target:current_liege = { always = yes } } hidden_tooltip = { set_defacto_liege = event_target:current_liege } } } } } # just abdicate if there is no rebel with a claim or a pretender/heir to primary title if = { limit = { event_target:current_holder = { has_landed_title = event_target:former_primary_title NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { has_claim = event_target:former_primary_title any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } emf_can_inherit_trigger = yes } } } } #hidden_tooltip = { character_event = { id = Plus.306 } } # pass on tyrant/dishonorable traits abdicate = yes } # give primary title to rebel with weak claim if none with a strong claim or pretender/heir exists if = { limit = { event_target:current_holder = { has_landed_title = event_target:former_primary_title any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_weak_claim = event_target:former_primary_title emf_can_inherit_trigger = yes } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { has_strong_claim = event_target:former_primary_title any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } emf_can_inherit_trigger = yes } } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes has_weak_claim = event_target:former_primary_title emf_can_inherit_trigger = yes } event_target:former_primary_title = { usurp_title_plus_barony_if_unlanded = { target = PREV type = faction_demand } } if = { limit = { event_target:current_liege = { always = yes } } hidden_tooltip = { set_defacto_liege = event_target:current_liege } } } } } # give primary title to rebel with a strong claim if no rebel pretender/heir exists if = { limit = { event_target:current_holder = { has_landed_title = event_target:former_primary_title any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes has_strong_claim = event_target:former_primary_title emf_can_inherit_trigger = yes } NOT = { any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } emf_can_inherit_trigger = yes } } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes has_strong_claim = event_target:former_primary_title emf_can_inherit_trigger = yes } event_target:former_primary_title = { usurp_title_plus_barony_if_unlanded = { target = PREV type = faction_demand } } if = { limit = { event_target:current_liege = { always = yes } } hidden_tooltip = { set_defacto_liege = event_target:current_liege } } } } } # give primary title to rebel who is a pretender/heir if = { limit = { event_target:current_holder = { has_landed_title = event_target:former_primary_title any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } emf_can_inherit_trigger = yes # Presumably redundant here } } } event_target:current_holder = { random_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes OR = { any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } emf_can_inherit_trigger = yes } event_target:former_primary_title = { usurp_title_plus_barony_if_unlanded = { target = PREV type = faction_demand } } if = { limit = { event_target:current_liege = { always = yes } } hidden_tooltip = { set_defacto_liege = event_target:current_liege } } } } } } # check whether defender should simply abdicate if = { limit = { event_target:current_holder = { has_landed_title = event_target:former_primary_title } NAND = { # this is not a succession law revolt NOT = { has_character_flag = faction_succession_war } OR = { # or the current ruler is not an adult is_adult = no # or this is the original liege and the current heir is not an adult AND = { ROOT = { has_character_flag = original_war_liege } current_heir = { is_adult = no } } # or a rebel has a claim on the primary title or is a pretender/heir any_opinion_modifier_target = { pf_part_of_this_revolt_trigger = yes OR = { has_claim = event_target:former_primary_title any_pretender_title = { title = event_target:former_primary_title } any_heir_title = { title = event_target:former_primary_title } } emf_can_inherit_trigger = yes } } } } #hidden_tooltip = { character_event = { id = Plus.306 } } # pass on tyrant/dishonorable traits abdicate = yes } } clr_global_flag = pf_teardown_lock # figure out who are the supporters, losers, and neutrals if = { # primary title has changed hands limit = { event_target:former_primary_title = { holder_scope = { NOT = { character = FROM } } } } hidden_tooltip = { event_target:former_primary_title = { holder_scope = { # clear previous civil war opinions pf_civil_war_clear_old_opinions_effect = yes # mark rebels as supporters event_target:current_holder = { any_opinion_modifier_target = { limit = { pf_part_of_this_revolt_trigger = yes NOT = { character = PREVPREV } } reverse_opinion = { who = PREVPREV modifier = opinion_civil_war_supporter months = 60 } } } # mark former liege and loyalists as losers any_vassal = { limit = { has_opinion_modifier = { who = event_target:current_holder modifier = pf_loyal_toward } } reverse_opinion = { who = LIEGE modifier = opinion_civil_war_loser months = 60 } } event_target:current_holder = { reverse_opinion = { who = PREV modifier = opinion_civil_war_loser months = 60 } } # remember those who chose to be neutral any_vassal = { limit = { has_opinion_modifier = { who = event_target:current_holder modifier = pf_neutral_toward } } reverse_opinion = { who = LIEGE modifier = opinion_civil_war_neutral months = 60 } } } } } } ## check whether the primary title should be destroyed due to CA loss #if = { # limit = { event_target:former_primary_title = { has_title_flag = destroy_title } } # hidden_tooltip = { # event_target:former_primary_title = { # holder_scope = { # character_event = { # id = Plus.1620 # days = 4 # } # destroy title # } # } # } #} # clean up remaining civil war state pf_civil_war_cleanup_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 250 } } # post-civil war event to reward allies (if title has changed hands) if = { limit = { event_target:former_primary_title = { holder_scope = { NOT = { character = FROM } } } } event_target:former_primary_title = { holder_scope = { emf_dynlevy_update_effect = yes hidden_tooltip = { character_event = { id = PlusFaction.450 } } } } } # change faction moods FROM = { hidden_tooltip = { character_event = { id = PlusFaction.200 days = 1 } } } ROOT = { hidden_tooltip = { character_event = { id = PlusFaction.200 days = 1 } } } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(cb_faction_overthrow_ruler): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes # clean up remaining civil war state pf_civil_war_cleanup_effect = yes ROOT = { prestige = -100 } hidden_tooltip = { FROM = { remove_opinion = { who = ROOT modifier = declared_war } } } } on_reverse_demand = { log = "CB(cb_faction_overthrow_ruler): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_obj_win_war_reverse_effect = yes emf_cb_dynlevy_end_effect = yes emf_imperial_decay_loss_effect = yes FROM = { ## add victory modifier for the 'Win a War' ambition #add_character_modifier = { # name = victory_timer # duration = 1 # hidden = yes #} pf_civil_war_clear_old_opinions_effect = yes } # apply immediate effects to the revolters any_attacker = { limit = { has_opinion_modifier = { who = FROM modifier = revolting_against } } imprison = FROM hidden_tooltip = { reverse_opinion = { who = FROM modifier = opinion_civil_war_loser months = 60 } opinion = { who = FROM modifier = opinion_coerced_into_leaving_faction months = 60 } } } # mark loyalists and neutrals for the reward event hidden_tooltip = { FROM = { any_vassal = { limit = { reverse_has_opinion_modifier = { who = PREV modifier = pf_loyal_to_me } } reverse_opinion = { who = PREV modifier = opinion_civil_war_supporter months = 60 } } any_vassal = { limit = { reverse_has_opinion_modifier = { who = PREV modifier = pf_neutral_to_me } } reverse_opinion = { who = PREV modifier = opinion_civil_war_neutral months = 60 } } } } # clean up remaining civil war state pf_civil_war_cleanup_effect = yes ROOT = { prestige = -250 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } # post-civil war event to reward allies FROM = { hidden_tooltip = { character_event = { id = PlusFaction.450 } } } # change faction moods hidden_tooltip = { FROM = { character_event = { id = PlusFaction.200 days = 1 } } ROOT = { character_event = { id = PlusFaction.200 days = 1 } } } } on_invalidation = { log = "CB(cb_faction_overthrow_ruler): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes # clean up remaining civil war state pf_civil_war_cleanup_effect = yes } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } emf_decadence_revolt = { name = CB_NAME_DECADENCE_UPRISING war_name = WAR_NAME_DECADENCE_UPRISING sprite = 11 truce_days = 365 hostile_against_others = yes is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes attacker_can_call_allies = no defender_can_call_allies = no can_ask_to_join_war = no is_independence = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = decadence_revolter } } can_use_title = { tier = count } is_valid = { FROM = { religion_group = muslim religion_group = ROOT } } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } } on_add = { log = "CB(emf_decadence_revolt): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(emf_decadence_revolt): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes ROOT = { hidden_tooltip = { if = { limit = { dynasty = none } dynasty = father_bastard } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = revolt } ROOT = { prestige = 200 piety = 100 occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = revolt } set_defacto_liege = ROOT clr_character_flag = decadence_revolter } FROM = { imprison = ROOT prestige = -500 piety = -500 clr_character_flag = has_current_revolt } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_decadence_revolt): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = decadence_revolter hidden_tooltip = { add_character_modifier = { name = broken_spirit days = 3650 } } } FROM = { prestige = 25 clr_character_flag = has_current_revolt hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } } } } on_reverse_demand = { log = "CB(emf_decadence_revolt): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { clear_wealth = yes imprison = FROM clr_character_flag = decadence_revolter hidden_tooltip = { add_character_modifier = { name = broken_spirit days = 3650 } } } FROM = { prestige = 100 piety = 100 clr_character_flag = has_current_revolt hidden_tooltip = { opinion = { modifier = opinion_rebel_traitor who = ROOT months = 1200 } add_character_modifier = { name = crushed_revolt days = 3650 } } } } on_invalidation = { log = "CB(emf_decadence_revolt): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 150 } } emf_dejure_duchy_claim = { name = CB_NAME_EMF_DEJURE_DUCHY_CLAIM war_name = WAR_NAME_EMF_DEJURE_DUCHY_CLAIM sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes check_de_jure_tier = DUKE can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.5 can_use_gui = { emf_cb_can_use_gui_trigger = yes FROM = { OR = { is_merchant_republic = no NOT = { same_realm = ROOT } } OR = { NOT = { has_dlc = "Sons of Abraham" } holy_order = no NOT = { religion = ROOT } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { higher_real_tier_than = DUKE NOT = { is_liege_or_above = FROM } OR = { NOT = { religion_group = pagan_group } is_reformed_religion = yes ai = no NOT = { religion = FROM } } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes NAND = { ROOT = { rightful_religious_head = FROM } title = d_latium } # ROOT holds the de jure kingdom, empire, OR both of the duchy # and at least one of the de jure liege titles has at least # Medium CA. OR = { kingdom = { holder = ROOT OR = { ROOT = { ai = yes } has_law = crown_authority_2 has_law = crown_authority_3 has_law = crown_authority_4 } } empire = { holder = ROOT OR = { ROOT = { ai = yes } has_law = crown_authority_2 has_law = crown_authority_3 has_law = crown_authority_4 } } } # FROM controls at least 2 counties in this duchy # Otherwise, use de_jure_county_claim. FROM = { num_of_realm_counties = { value = 2 title = PREV } } # Don't show this when the [rare] emf_dejure_kingdom_claim could be used NOT = { AND = { ROOT = { tier = EMPEROR religion_group = FROM # No infidels (except heretics)! } empire = { holder = ROOT OR = { has_law = crown_authority_4 # Always available at Absolute CA # Also available on any [de jure] held empire when CB granted by event/decision ROOT = { has_character_modifier = emf_cb_mod_dejure_kingdom_claim } } } kingdom = { any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { # County-level holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } } } } is_valid_title = { # FROM continues to at least have a title to be taken in this duchy FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } OR = { kingdom = { holder = ROOT } empire = { holder = ROOT } } } on_add_title = { log = "CB(emf_dejure_duchy_claim): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes } on_success_title = { log = "CB(emf_dejure_duchy_claim): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes if = { limit = { empire = { holder = ROOT } } emf_imperial_decay_victory_effect = yes } FROM = { prestige = -150 } pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM } } pf_liege_change_under_title_end_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 150 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 150 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { prestige = -150 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 75 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 75 } } } on_fail_title = { log = "CB(emf_dejure_duchy_claim): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes ROOT = { prestige = -300 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 150 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 150 } } } on_reverse_demand_title = { log = "CB(emf_dejure_duchy_claim): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { empire = { holder = ROOT } } emf_imperial_decay_loss_effect = yes } } on_invalidation = { log = "CB(emf_dejure_duchy_claim): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 1.1 always = yes } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_dejure_kingdom_claim = { name = CB_NAME_EMF_DEJURE_KINGDOM_CLAIM war_name = WAR_NAME_EMF_DEJURE_KINGDOM_CLAIM sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes check_de_jure_tier = KING can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.5 can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes ROOT = { tier = EMPEROR NOT = { is_liege_or_above = FROM } religion_group = FROM # No infidels (except heretics)! } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes empire = { holder = ROOT OR = { has_law = crown_authority_4 # Always available at Absolute CA # Also available on any [de jure] held empire when CB granted by event/decision ROOT = { has_character_modifier = emf_cb_mod_dejure_kingdom_claim } } } # FROM controls at least 2 counties in this kingdom # Otherwise, use de_jure_county_claim. FROM = { num_of_realm_counties = { value = 2 title = PREV } } # Unlike the other de jure claim CBs, this one actually requires a border. # Borders within/with the target kingdom, specifically. any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { # County-level holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } empire = { holder = ROOT } } on_add_title = { log = "CB(emf_dejure_kingdom_claim): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes } on_success_title = { log = "CB(emf_dejure_kingdom_claim): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes if = { limit = { empire = { holder = ROOT } } emf_imperial_decay_major_victory_effect = yes } FROM = { prestige = -200 } pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM } } pf_liege_change_under_title_end_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail_title = { log = "CB(emf_dejure_kingdom_claim): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_fail = { ROOT = { prestige = -200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand_title = { log = "CB(emf_dejure_kingdom_claim): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { empire = { holder = ROOT } } emf_imperial_decay_major_loss_effect = yes } } on_reverse_demand = { emf_cb_defeat_effect = yes ROOT = { prestige = -400 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(emf_dejure_kingdom_claim): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 1.2 always = yes } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_druze_invasion = { name = CB_NAME_VIKING_INVASION war_name = WAR_NAME_VIKING_INVASION sprite = 8 truce_days = 365 hostile_against_others = yes is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes apply_short_occ_mod = no # Do not apply the 'recently_conquered' modifier to Holdings allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { trait = druze_ajawid piety = 1000 AND = { martial = 15 diplomacy = 15 } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes FROM = { religion_group = muslim NOT = { religion = ROOT } } ROOT = { religion = druze NOT = { is_liege_or_above = FROM } NOT = { realm_size = 41 } mercenary = no } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes is_valid_viking_invasion_target = FROM # Checks that FROM holds the right amount of territory in the kingdom } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(emf_druze_invasion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(emf_druze_invasion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { prestige = 500 piety = 250 religion_authority = { modifier = won_viking_invasion } hidden_tooltip = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = invasion } clr_global_flag = emf_latb_upon_gain } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 300 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 300 } } FROM = { prestige = -500 } } on_success_title = { emf_cb_latb_effect = yes custom_tooltip = { text = emf_cb_ctt_viking_invasion_success hidden_tooltip = { save_event_target_as = emf_cb_title pf_liege_change_under_title_begin_effect = yes ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM type = invasion } } pf_liege_change_under_title_end_effect = yes ROOT = { random_demesne_province = { limit = { de_jure_liege_or_above = PREVPREV OR = { NOT = { culture = ROOT } NOT = { religion = ROOT } } } culture = ROOT religion = ROOT } # Remove conquest modifiers and refill levies character_event = { id = emf_cb.10 } } if = { limit = { FROM = { is_liege_or_above = ROOT } } FROM = { imprison = ROOT } } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_druze_invasion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } ROOT = { prestige = -300 piety = -100 religion_authority = { modifier = lost_viking_invasion } } } on_reverse_demand = { log = "CB(emf_druze_invasion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -500 piety = -250 transfer_scaled_wealth = { to = FROM value = 2.0 } religion_authority = { modifier = lost_viking_invasion } } FROM = { prestige = 300 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 250 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 250 } } } on_invalidation = { log = "CB(viking_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } emf_horde_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 1095 hostile_against_others = yes can_ask_to_join_war = yes is_holy_war = yes is_permanent = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = yes allowed_to_target_suzerains = yes # Raise effective BATTLE_WARSCORE_WORTH to 125 (vanilla base is 75, EMF base is 100) # This encourages faster resolution of these wars with fewer characters actually # unlanded by the horde invaders, due to the gain_all_occupied_titles in the CB. battle_warscore_mult = 1.25 infamy_modifier = 0.0 can_use = { emf_cb_can_use_trigger = yes ROOT = { independent = yes NOT = { same_realm = FROM } OR = { # AI Mongol Empire can use this like a normal CB ... AND = { has_landed_title = e_mongol_empire ai = yes } # Or, a scripted requirements pass is required has_character_flag = emf_horde_invasion_pass } } } can_use_title = { OR = { ROOT = { NOT = { num_of_count_titles = 1 } } any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { OR = { owner_under_ROOT = yes location = { any_neighbor_province = { owner_under_ROOT = yes } } } } } } any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { owner_under_FROM = yes } } } is_valid = { ROOT = { NOT = { same_realm = FROM } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { log = "CB(emf_horde_invasion): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { clr_character_flag = emf_horde_invasion_pass } FROM = { emf_remove_suzerain_under_ROOT = yes } } on_success = { log = "CB(emf_horde_invasion): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes ROOT = { clr_character_flag = emf_horde_invasion set_character_flag = emf_horde_invasion prestige = 200 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } FROM = { prestige = -200 } ROOT = { emf_remove_suzerain_under_FROM = yes } hidden_tooltip = { ROOT = { set_global_flag = emf_latb_upon_gain occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = invasion } clr_global_flag = emf_latb_upon_gain if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_victorious } 10 = { give_nickname = nick_the_conqueror } 10 = { give_nickname = nick_the_brave } 10 = { give_nickname = nick_the_dragon } 10 = { give_nickname = nick_the_terrible } } } } } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = tribal_invasion_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title_destroy_duchies = { title = PREV enemy = FROM is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = invasion } } } } pf_liege_change_under_title_end_effect = yes hidden_tooltip = { save_event_target_as = emf_king_title FROM = { save_event_target_as = emf_defender } ROOT = { character_event = { id = emf_empires.13 } } clear_event_target = emf_king_title clear_event_target = emf_defender } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_horde_invasion): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" hidden_tooltip = { ROOT = { character_event = { id = emf_empires.10 } } # Notify failure } FROM = { prestige = 100 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -200 } } on_reverse_demand = { log = "CB(emf_horde_invasion): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes hidden_tooltip = { ROOT = { character_event = { id = emf_empires.10 } } # Notify failure } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } if = { limit = { has_dlc = "Legacy of Rome" OR = { has_landed_title = e_byzantium has_landed_title = e_roman_empire } religion_group = christian } hidden_tooltip = { character_event = { id = LoR.30 days = 12 } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(emf_horde_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept (note that this differs from the 200 of most invasion CBs) } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 4 } } emf_ismaili_caliphate_rising = { name = CB_NAME_ISMAILI_CALIPHATE_RISING war_name = WAR_NAME_ISMAILI_CALIPHATE_RISING sprite = 8 truce_days = 365 hostile_against_others = no is_permanent = yes check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes apply_short_occ_mod = no # Do not apply the 'recently_conquered' modifier to Holdings can_use = { emf_cb_can_use_trigger = yes ROOT = { has_character_flag = ismaili_caliphate_pretender } } is_valid_title = { ROOT = { has_character_flag = ismaili_caliphate_pretender } FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } d_ismaili = { has_holder = no } } on_add = { log = "CB(emf_ismaili_caliphate_rising): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(emf_ismaili_caliphate_rising): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" clr_global_flag = ismaili_caliphate_revolt_ongoing emf_cb_holy_victory_effect = yes set_parent_religion = { religion = ismaili parent = 0 } ROOT = { piety = 500 religion_authority = { modifier = rise_of_the_ismaili_caliphate } clr_character_flag = ismaili_caliphate_pretender } FROM = { piety = -500 religion_authority = { modifier = ismaili_victorious1 } } } on_success_title = { hidden_tooltip = { set_parent_religion = { religion = qarmatian parent = ismaili } set_global_flag = druze_activated set_global_flag = qarmatian_activated save_event_target_as = conquered_title ROOT = { narrative_event = { id = emf_heresy.1977 } } } emf_cb_latb_effect = yes emf_imperial_decay_major_victory_effect = yes custom_tooltip = { text = other_invasion_succ_tip hidden_tooltip = { d_ismaili = { usurp_title = { target = ROOT type = holy_war } } FROM = { random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV any_neighbor_province = { religion = ROOT } NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV any_neighbor_province = { religion = ROOT } NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV any_neighbor_province = { religion = ROOT } NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } random_realm_province = { limit = { de_jure_liege_or_above = PREVPREV any_neighbor_province = { religion = ROOT } NOT = { religion = ROOT } religion_group = muslim } religion = ROOT } } pf_liege_change_under_title_begin_effect = yes ROOT = { remove_trait = imamah_claimant clr_character_flag = is_imamah_claimant occupy_minors_of_occupied_settlements = FROM gain_all_occupied_titles = { who = FROM type = revolt } clr_global_flag = emf_latb_upon_gain vassalize_or_take_under_title = { title = PREV enemy = FROM is_religious = yes type = revolt } any_demesne_title = { limit = { tier = BARON } remove_holding_modifier = recently_conquered refill_holding_levy = yes } usurp_title = { target = PREV type = revolt } } pf_liege_change_under_title_end_effect = yes if = { limit = { FROM = { is_liege_or_above = ROOT } } FROM = { imprison = ROOT } } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_ismaili_caliphate_rising): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" clr_global_flag = ismaili_caliphate_revolt_ongoing FROM = { piety = 250 } ROOT = { piety = -250 clr_character_flag = ismaili_caliphate_pretender } } on_reverse_demand = { log = "CB(emf_ismaili_caliphate_rising): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" clr_global_flag = ismaili_caliphate_revolt_ongoing emf_cb_holy_defeat_effect = yes emf_imperial_decay_major_loss_effect = yes ROOT = { piety = -500 clr_character_flag = ismaili_caliphate_pretender imprison = FROM } FROM = { piety = 250 } any_defender = { limit = { character = FROM } participation_scaled_piety = 250 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 250 } } } on_attacker_leader_death = { clr_global_flag = ismaili_caliphate_revolt_ongoing clr_global_flag = ismaili_caliphate_revolt ROOT = { clr_character_flag = ismaili_caliphate_pretender } end_war = invalid } on_invalidation = { log = "CB(emf_ismaili_caliphate_rising): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" clr_global_flag = ismaili_caliphate_revolt_ongoing clr_global_flag = ismaili_caliphate_revolt ROOT = { clr_character_flag = ismaili_caliphate_pretender } } attacker_ai_victory_worth = { factor = -1 } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } emf_liberate_nomad_county = { name = CB_NAME_LIBERATE_NOMAD war_name = WAR_NAME_LIBERATE_NOMAD sprite = 8 truce_days = 1095 is_permanent = yes check_all_titles = yes press_claim = yes battle_warscore_mult = 1.25 allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.75 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes FROM = { is_nomadic = yes } ROOT = { is_nomadic = no NOT = { pacifist = yes } mercenary = no NOT = { same_realm = FROM } # Prefer pagan_county_conquest NAND = { religion_group = pagan_group NOT = { religion = FROM } } # Prefer emf_pagan_county_conquest_nonholy NAND = { religion_group = pagan_group is_reformed_religion = no religion = FROM } # Prefer muslim_county_conquest | emf_muslim_county_conquest_religious NOT = { religion_group = muslim } } } can_use_title = { tier = COUNT OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } location = { # The attacker needs a direct border any_neighbor_province = { owner_under_ROOT = yes } } emf_cb_can_use_sahara_title_trigger = yes emf_cb_can_use_title_trigger = yes } is_valid = { FROM = { is_nomadic = yes } ROOT = { is_nomadic = no mercenary = no NOT = { same_realm = FROM } } } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } location = { any_neighbor_province = { owner_under_ROOT = yes } } } on_add_title = { log = "CB(emf_liberate_nomad_county): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -5 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -5 } } } FROM = { prestige = -200 } } on_success_title = { log = "CB(emf_liberate_nomad_county): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = liberate_nomad_cb_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM anti_nomad = yes # Vassalize non-nomadic rulers type = invasion } } } } pf_liege_change_under_title_end_effect = yes usurp_title = { target = ROOT type = invasion } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { prestige = -100 } } on_fail_title = { log = "CB(emf_liberate_nomad_county): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 2.0 } prestige = -200 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -5 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { uses_decadence = yes } participation_scaled_decadence = -5 } } } } on_reverse_demand_title = { log = "CB(emf_liberate_nomad_county): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(emf_liberate_nomad_county): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } ai_will_do = { factor = 1 modifier = { factor = 0.1 ROOT = { is_tribal = no } NOT = { any_direct_de_jure_vassal_title = { has_holder = yes OR = { holding_type = castle holding_type = city } } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_magyar867_invasion = { name = CB_NAME_INVASION war_name = WAR_NAME_INVASION sprite = 8 truce_days = 1825 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = no attacker_can_call_allies = yes defender_can_call_allies = no apply_short_occ_mod = no check_de_jure_tier = KING # this scans all de jure kingdoms for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes infamy_modifier = 0 can_use = { always = no } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add_title = { log = "CB(emf_magyar867_invasion): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_victory_effect = yes ROOT = { prestige = 200 } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } FROM = { prestige = -200 } } on_success_title = { log = "CB(emf_magyar867_invasion): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes custom_tooltip = { text = emf_cb_ctt_magyar867_invasion_success hidden_tooltip = { ROOT = { gain_settlements_under_title = { title = PREV enemy = FROM is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = invasion } } # Handle revolters ... (note that if any of these hold nomadic provinces, we're not converting them to tribal) save_event_target_as = emf_title any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { limit = { holder_scope = { top_liege = { liege_before_war = { character = FROM } } } } holder_scope = { top_liege = { ROOT = { gain_settlements_under_title = { title = event_target:emf_title enemy = PREV is_crusade = yes # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants type = invasion } } } } } } clear_event_target = emf_title if = { limit = { has_dlc = "Horse Lords" } ROOT = { character_event = { id = emf_historical.0 } } } } } } on_fail = { FROM = { prestige = 100 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } ROOT = { prestige = -200 } hidden_tooltip = { if = { limit = { has_dlc = "Horse Lords" } ROOT = { disband_event_forces = start_troops } } } } on_fail_title = { log = "CB(emf_magyar867_invasion): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } FROM = { prestige = 200 hidden_tooltip = { if = { limit = { has_nickname = no } random_list = { 10 = { give_nickname = nick_the_great } 10 = { give_nickname = nick_the_hammer } 10 = { give_nickname = nick_the_avenger } 10 = { give_nickname = nick_the_lion } 10 = { give_nickname = nick_the_bold } } } } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } hidden_tooltip = { if = { limit = { has_dlc = "Horse Lords" } ROOT = { disband_event_forces = start_troops } } } } on_reverse_demand_title = { log = "CB(emf_magyar867_invasion): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(emf_magyar867_invasion): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" hidden_tooltip = { if = { limit = { has_dlc = "Horse Lords" } ROOT = { disband_event_forces = start_troops } } } } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } emf_muslim_county_conquest_religious = { name = CB_NAME_COUNTY_CONQUEST war_name = WAR_NAME_COUNTY_CONQUEST sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes is_holy_war = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes can_ask_to_join_war = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { piety = 50 custom_tooltip = { text = emf_ctt_no_holy_war_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_holy_war_cooldown } } } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = muslim NOT = { religion_group = FROM } NOT = { is_liege_or_above = FROM } mercenary = no } } can_use_title = { tier = COUNT OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } location = { any_neighbor_province = { owner_under_ROOT = yes } } emf_cb_can_use_sahara_title_trigger = yes emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM } } location = { any_neighbor_province = { owner_under_ROOT = yes } } } on_add = { ROOT = { piety = -50 } if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } ROOT = { custom_tooltip = { text = emf_cb_ctt_holy_war_cooldown hidden_tooltip = { add_character_modifier = { name = emf_cb_mod_holy_war_cooldown duration = 1825 } } } } } } on_add_title = { log = "CB(emf_muslim_county_conquest_religious): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes } on_success_title = { log = "CB(emf_muslim_county_conquest_religious): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" if = { limit = { holder_scope = { tier = COUNT NOT = { num_of_count_titles = 2 } lower_tier_than = ROOT } } holder_scope = { emf_ROOT_subjugate_ruler_effect = yes } } if = { limit = { holder_scope = { OR = { higher_tier_than = COUNT num_of_count_titles = 2 NOT = { lower_tier_than = ROOT } } } } emf_cb_latb_effect = yes usurp_title_plus_barony_if_unlanded = { target = ROOT type = holy_war } any_de_jure_vassal_title = { # take all baronies under the one we're fighting for limit = { has_holder = yes NOT = { de_facto_liege = PREV } holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = holy_war } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail_title = { log = "CB(emf_muslim_county_conquest_religious): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_reverse_demand = { emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand_title = { log = "CB(emf_muslim_county_conquest_religious): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(emf_muslim_county_conquest_religious): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_pagan_county_conquest_nonholy = { name = CB_NAME_COUNTY_CONQUEST war_name = WAR_NAME_COUNTY_CONQUEST sprite = 16 truce_days = 1825 hostile_against_others = yes is_permanent = yes check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles press_claim = yes can_ask_to_join_war = no allowed_to_target_tributaries = no allowed_to_target_suzerains = no battle_warscore_mult = 0.75 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { prestige = 200 OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { religion_group = pagan_group is_reformed_religion = no OR = { religion = FROM FROM = { is_reformed_religion = ROOT } } NOT = { is_liege_or_above = FROM } NOT = { is_vassal_or_below = FROM } is_nomadic = no mercenary = no } } can_use_title = { tier = COUNT OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM NOT = { same_realm = ROOT } } } location = { any_neighbor_province = { owner_under_ROOT = yes } } emf_cb_can_use_sahara_title_trigger = yes emf_cb_can_use_title_trigger = yes } is_valid_title = { OR = { FROM = { has_landed_title = PREV } holder_scope = { is_liege_or_above = FROM NOT = { same_realm = ROOT } } } location = { any_neighbor_province = { owner_under_ROOT = yes } } } on_add = { log = "CB(emf_pagan_county_conquest_nonholy): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -200 } } on_success = { log = "CB(emf_pagan_county_conquest_nonholy): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes } on_success_title = { emf_cb_latb_effect = yes if = { limit = { holder_scope = { tier = COUNT NOT = { num_of_count_titles = 2 } lower_tier_than = ROOT } } holder_scope = { emf_ROOT_subjugate_ruler_effect = yes } } if = { limit = { holder_scope = { NAND = { tier = COUNT NOT = { num_of_count_titles = 2 } lower_tier_than = ROOT } } } usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } any_de_jure_vassal_title = { # take all baronies under the one we're fighting for limit = { NOT = { de_facto_liege = PREV } owner_under_FROM = yes } usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion } } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_pagan_county_conquest_nonholy): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand = { log = "CB(emf_pagan_county_conquest_nonholy): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(emf_pagan_county_conquest_nonholy): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 0.9 # Prefer using CB's without on_add costs } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 1825 } } } } emf_reclaim_byz = { name = CB_NAME_EMF_RECLAIM_BYZ war_name = WAR_NAME_EMF_RECLAIM_BYZ sprite = 17 truce_days = 1825 is_permanent = yes # is_holy_war = yes can_ask_to_join_war = yes hostile_against_others = yes check_de_jure_tier = DUKE allowed_to_target_tributaries = yes allowed_to_target_suzerains = yes infamy_modifier = 0.1 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_cb_ctt_capital_is_constantinople hidden_tooltip = { OR = { ai = yes capital_scope = { c_byzantion = { location = { province = PREVPREV } } } } } } } } can_use = { emf_cb_can_use_trigger = yes c_byzantion = { owner_under_ROOT = yes } ROOT = { NOT = { same_realm = FROM } emf_empires_byz_restorer_potential_trigger = yes emf_empires_byz_restorer_culrel_allow_trigger = yes } emf_empires_byz_restoration_potential_trigger = yes } can_use_title = { OR = { de_jure_liege = k_byzantium AND = { # Second tier of conquest in case it's necessary for reaching enough realm_size or w/e OR = { de_jure_liege = k_achaea de_jure_liege = k_nikaea } any_direct_de_jure_vassal_title = { # Must have a direct realm border owner_under_FROM = yes location = { any_neighbor_province = { owner_under_ROOT = yes } } } k_byzantium = { emf_ROOT_completely_controls_counties_trigger = yes } } } any_direct_de_jure_vassal_title = { owner_under_FROM = yes } emf_cb_can_use_de_jure_title_trigger = yes } is_valid = { c_byzantion = { owner_under_ROOT = yes } ROOT = { emf_empires_byz_restorer_potential_trigger = yes emf_empires_byz_restorer_culrel_allow_trigger = yes } emf_empires_byz_restoration_potential_trigger = yes } is_valid_title = { any_de_jure_vassal_title = { owner_under_FROM = yes } } on_add = { log = "CB(emf_reclaim_byz): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { emf_remove_suzerain_under_ROOT = yes } } on_success = { log = "CB(emf_reclaim_byz): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 if = { limit = { NOT = { religion = FROM } } participation_scaled_piety = 80 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { NOT = { religion = FROM } } participation_scaled_piety = 80 } } } ROOT = { emf_remove_suzerain_under_FROM = yes } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = emf_cb_ctt_vassalize_or_take_under_title_same_religion hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM is_religious = yes same_religion = yes type = invasion } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_reclaim_byz): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 50 } } on_reverse_demand = { log = "CB(emf_reclaim_byz): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -200 } FROM = { prestige = 100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 if = { limit = { NOT = { religion = ROOT } } participation_scaled_piety = 80 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 if = { limit = { NOT = { religion = ROOT } } participation_scaled_piety = 80 } } } } on_invalidation = { log = "CB(emf_reclaim_byz): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 4 modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_reclaim_byz_capital = { name = CB_NAME_EMF_RECLAIM_BYZ_CAPITAL war_name = WAR_NAME_EMF_RECLAIM_BYZ_CAPITAL sprite = 17 truce_days = 1825 is_permanent = yes can_ask_to_join_war = yes # hostile_against_others = yes check_de_jure_tier = DUKE apply_short_occ_mod = no ticking_war_score_multiplier = 2.0 allow_distant = yes allowed_to_target_tributaries = yes allowed_to_target_suzerains = yes infamy_modifier = 0.05 can_use_gui = { emf_cb_can_use_gui_trigger = yes custom_tooltip = { text = emf_cb_ctt_reclaim_byz_capital_never_been_used_unless_success_within_last_50yr hidden_tooltip = { NOT = { had_global_flag = { flag = emf_reclaim_byz_capital_success days = 18250 # 50yr } } } } } can_use = { emf_cb_can_use_trigger = yes c_byzantion = { owner_under_FROM = yes } ROOT = { NOT = { same_realm = FROM } emf_empires_byz_restorer_potential_trigger = yes emf_empires_byz_restorer_culrel_allow_trigger = yes } emf_empires_byz_restoration_potential_trigger = yes } can_use_title = { title = d_thrace emf_cb_can_use_de_jure_title_trigger = yes } is_valid = { c_byzantion = { owner_under_FROM = yes } ROOT = { emf_empires_byz_restorer_potential_trigger = yes } emf_empires_byz_restoration_potential_trigger = yes } on_add = { log = "CB(emf_reclaim_byz_capital): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { emf_remove_suzerain_under_ROOT = yes } } on_success = { log = "CB(emf_reclaim_byz_capital): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 300 if = { limit = { NOT = { religion = FROM } } participation_scaled_piety = 120 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 300 if = { limit = { NOT = { religion = FROM } } participation_scaled_piety = 120 } } } ROOT = { emf_remove_suzerain_under_FROM = yes } c_byzantion = { emf_cb_latb_effect = yes # Since our vassalize_or_take_under_title(d_thrace) happens after we take c_byzantion, we must emulate # its same_religion = yes subjugation behavior under c_byzantion ourselves (except w/ tweaks). hidden_tooltip = { pf_liege_change_under_title_begin_effect = yes any_direct_de_jure_vassal_title = { limit = { owner = { under_FROM = yes OR = { PREV = { holding_type = castle } # Always take castles NOT = { religion = ROOT } # Purge if diff-religion character = FROM # Purge if FROM any_realm_title = { # Purge if has land outside title tier = BARON NOT = { de_jure_liege_or_above = PREVPREVPREV } } NOT = { lower_tier_than = ROOT } # Purge if can't subjugate } } } grant_title = { target = ROOT type = invasion } } # Anyone remaining under FROM should be subjugated any_de_jure_vassal = { limit = { under_FROM = yes } emf_ROOT_subjugate_ruler_effect = yes } grant_title = { target = ROOT type = invasion } pf_liege_change_under_title_end_effect = yes } tooltip = { gain_title = ROOT } # Take all castles under c_byzantion. Purely for tooltip purposes, as this was taken care of by the # above, hidden "vassalize_or_take_under_title(same_religion - castles)" effect location = { any_province_holding = { limit = { holding_type = castle owner_under_FROM = yes # still under FROM when tooltip is shown } tooltip = { gain_title = ROOT } } } } } on_success_title = { emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = emf_cb_ctt_vassalize_or_take_under_title_same_religion hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM is_religious = yes same_religion = yes type = invasion } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { c_byzantion = { emf_make_location_ROOT_capital_effect = yes } hidden_tooltip = { # Reset global CB usage success flag timer clr_global_flag = emf_reclaim_byz_capital_success set_global_flag = emf_reclaim_byz_capital_success # Set internal cheevo & handle AI wins w/ special afterwork ROOT = { clr_character_flag = emf_context_reclaimed_byz_capital set_character_flag = emf_context_reclaimed_byz_capital character_event = { id = emf_empires.30 } } } emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_reclaim_byz_capital): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" FROM = { prestige = 50 } } on_reverse_demand = { log = "CB(emf_reclaim_byz_capital): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } prestige = -100 } FROM = { prestige = 100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 300 if = { limit = { NOT = { religion = ROOT } } participation_scaled_piety = 120 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 300 if = { limit = { NOT = { religion = ROOT } } participation_scaled_piety = 120 } } } } on_invalidation = { log = "CB(emf_reclaim_byz_capital): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 1 modifier = { factor = 2.2 } modifier = { factor = 2.0 ROOT = { capital_scope = { empire = { title = e_byzantium } } } } modifier = { factor = 2.0 ROOT = { has_landed_title = k_byzantium } } modifier = { factor = 1.5 ROOT = { has_character_flag = emf_context_reclaimed_byz_capital NOT = { had_character_flag = { flag = emf_context_reclaimed_byz_capital days = 3650 } } #10yr } } modifier = { factor = 1.5 ROOT = { has_character_flag = emf_context_reclaimed_byz_capital NOT = { had_character_flag = { flag = emf_context_reclaimed_byz_capital days = 5475 } } #15yr } } modifier = { factor = 1.25 ROOT = { has_character_flag = emf_context_reclaimed_byz_capital NOT = { had_character_flag = { flag = emf_context_reclaimed_byz_capital days = 7300 } } #20yr } } modifier = { factor = 1.5 FROM = { NOT = { religion_group = ROOT } } } modifier = { factor = 1.25 FROM = { religion_group = ROOT NOT = { religion = ROOT } } } modifier = { factor = 0.5 ROOT = { capital_scope = { distance = { where = 496 value = 200 } } } } modifier = { factor = 0.5 ROOT = { capital_scope = { distance = { where = 496 value = 300 } } } } modifier = { factor = 0.1 ROOT = { capital_scope = { distance = { where = 496 value = 400 } } } } modifier = { factor = 5.0 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_religious_reconquest = { name = CB_NAME_EMF_RELIGIOUS_RECONQUEST war_name = WAR_NAME_EMF_RELIGIOUS_RECONQUEST sprite = 9 truce_days = 3650 is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.8 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_holy_war_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_holy_war_cooldown } } } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes # Muslim reconquest does not make much sense NAND = { FROM = { religion_group = muslim } ROOT = { religion_group = muslim } } ROOT = { is_nomadic = no NOT = { same_realm = FROM } NOR = { mercenary = yes pacifist = yes religion = buddhist } OR = { # Allow reformed pagans NOT = { religion_group = pagan_group } is_reformed_religion = yes } OR = { # Hindus can only wage holy war on non-Indian rulers NOT = { religion = hindu } FROM = { NOT = { religion_group = indian_group } } } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { OR = { religion_group = muslim religion_group = pagan_group } NOT = { religion = FROM } } AND = { FROM = { religion = paulician } NOT = { religion = FROM } } } NOT = { is_reformed_religion = FROM } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } OR = { NOT = { religion_group = pagan_group } religion = ROOT } } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # Target must have at least one non-nomadic province of attacker's religion any_direct_de_jure_vassal_title = { owner_under_FROM = yes location = { religion = ROOT any_province_holding = { NOT = { holding_type = nomad } } } } # Prefer 'Special Holy War' CB NOR = { ROOT = { holy_order = yes NOT = { religion_group = FROM } } AND = { de_jure_liege = k_jerusalem ROOT = { has_landed_title = k_jerusalem NOT = { religion_group = FROM } } } } # The attacker needs at least one county in the target duchy, or a land # border, or to be within two sea zones from one of your counties (if # crossing seazones is allowed) OR = { any_direct_de_jure_vassal_title = { OR = { holder_scope = { OR = { character = ROOT is_liege_or_above = ROOT } } location = { owner = { OR = { character = FROM is_liege_or_above = FROM } } any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } AND = { OR = { # Can they cross sea zones? FROM = { religion_group = muslim } ROOT = { religion_group = muslim } AND = { ROOT = { religion_group = pagan_group } has_global_flag = pagan_ghws_unlocked } AND = { ROOT = { religion_group = christian } has_global_flag = christian_crusades_unlocked } } any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { is_land = no any_neighbor_province = { OR = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } AND = { is_land = no any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } } } } } } is_valid = { ROOT = { NOT = { same_realm = FROM } NOR = { mercenary = yes pacifist = yes religion = buddhist } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { OR = { religion_group = muslim religion_group = pagan_group } NOT = { religion = FROM } } AND = { FROM = { religion = paulician } NOT = { religion = FROM } } NOT = { is_reformed_religion = FROM } } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } ROOT = { custom_tooltip = { text = emf_cb_ctt_holy_war_cooldown hidden_tooltip = { add_character_modifier = { name = emf_cb_mod_holy_war_cooldown duration = 1825 } } } } } } on_add_title = { log = "CB(emf_religious_reconquest): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_piety = 50 participation_scaled_prestige = 150 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 100 participation_scaled_prestige = 150 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } } ROOT = { religion_authority = { modifier = won_holy_war years = 20 } } FROM = { religion_authority = { modifier = lost_holy_war years = 20 } } FROM = { piety = -100 } FROM = { prestige = -150 } } on_success_title = { log = "CB(emf_religious_reconquest): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = religious_cb_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM same_religion = yes # Only vassalize rulers of my religion is_religious = yes type = holy_war } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { piety = -50 prestige = -100 } } on_reverse_demand = { emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } piety = -100 prestige = -150 } any_defender = { limit = { character = FROM } participation_scaled_piety = 200 participation_scaled_prestige = 200 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 200 participation_scaled_prestige = 200 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } } ROOT = { religion_authority = { modifier = lost_holy_war years = 20 } } FROM = { religion_authority = { modifier = won_holy_war years = 20 } } } on_reverse_demand_title = { log = "CB(emf_religious_reconquest): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(emf_religious_reconquest): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 2 modifier = { # Prefer direct land borders factor = 1.5 any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_resist_viceroy_revocation = { name = CB_NAME_OVERTHROWRULER war_name = WAR_NAME_OVERTHROWRULER sprite = 12 truce_days = 3650 is_revolt_cb = yes can_call_vassals = yes can_ask_to_join_war = yes major_revolt = yes is_tyranny_cb = yes can_use = { emf_cb_can_use_trigger = yes ROOT = { de_facto_liege = FROM } } is_valid = { ROOT = { OR = { liege = { character = PREV # either independent } liege = { FROM = { is_liege_or_above = PREV # or have shared liege } } } } FROM = { any_demesne_title = { NOT = { lower_tier_than = ROOT } temporary = no } } } on_add = { log = "CB(emf_resist_viceroy_revocation): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_begin_effect = yes } on_success = { log = "CB(emf_resist_viceroy_revocation): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { primary_title = { set_title_flag = viceroy_exemption } emf_switch_to_feudal_gov_effect = yes } FROM = { prestige = -500 remove_opinion = { who = ROOT modifier = declared_war } pf_lower_CA_effect = yes pf_lower_TO_effect = yes } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 250 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 250 } } emf_cb_dynlevy_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_resist_viceroy_revocation): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -100 } FROM = { prestige = -100 remove_opinion = { who = ROOT modifier = declared_war } } } on_reverse_demand = { log = "CB(emf_resist_viceroy_revocation): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes emf_cb_dynlevy_end_effect = yes ROOT = { prestige = -200 prisoner = FROM } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } on_invalidation = { log = "CB(emf_resist_viceroy_revocation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_dynlevy_end_effect = yes } on_defender_leader_death = { hidden_tooltip = { any_attacker = { letter_event = { id = 251 } } } end_war = invalid } on_attacker_leader_death = { end_war = invalid } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } emf_restore_hre = { name = CB_NAME_EMF_RESTORE_HRE war_name = WAR_NAME_EMF_RESTORE_HRE sprite = 17 truce_days = 1825 is_permanent = yes check_all_titles = yes hostile_against_others = yes attacker_can_call_allies = yes defender_can_call_allies = no can_ask_to_join_war = no apply_short_occ_mod = no press_claim = yes battle_warscore_mult = 1.25 infamy_modifier = 0.01 can_use_gui = { emf_cb_can_use_gui_trigger = yes } can_use = { emf_cb_can_use_trigger = yes # Notion of the Holy Roman Emperor and the 'Frankish Realm' has # not yet faded into history, while the HRE is yet to be formed # via decision and also doesn't exist, and finally, in this campaign, # Charlemagne did indeed actually become the HRE and traditional # Carolingien Empire (i.e., we didn't start in 769)... OR = { NOT = { year = 967 } AND = { has_global_flag = emf_restore_hre_war_won NOT = { had_global_flag = { flag = emf_restore_hre_war_won days = 10950 # 30yr since last succesful use } } } } e_hre = { has_holder = no } e_hre_french = { has_holder = no } NOT = { has_global_flag = emf_hre_formed } has_global_flag = charlemagne_hre ROOT = { ai = yes # AI-only version of this CB independent = yes # Must be independent, crimony! has_regent = no prestige = 100 # These guys are allowed to be reunification aggressors: OR = { has_landed_title = k_italy has_landed_title = k_lotharingia has_landed_title = k_burgundy has_landed_title = k_france has_landed_title = k_aquitaine has_landed_title = k_germany has_landed_title = k_bavaria } # Must be the right religion for the HRE OR = { religion = catholic AND = { religion = fraticelli is_heretic = no } } # Must be one of the HRE cultures OR = { culture_group = latin culture = occitan culture_group = central_germanic culture = italian culture_group = italian_group } } } can_use_title = { FROM = { has_landed_title = PREV } tier = KING custom_tooltip = { text = emf_cb_debug_restore_hre_is_a_core_title hidden_tooltip = { OR = { title = k_italy title = k_lotharingia title = k_burgundy # ... toward a potential french HRE AND = { ROOT = { NOR = { has_landed_title = k_germany has_landed_title = k_bavaria } } OR = { title = k_france title = k_aquitaine } } # ... or toward a standard german HRE AND = { ROOT = { NOR = { has_landed_title = k_france has_landed_title = k_aquitaine } } OR = { title = k_germany title = k_bavaria } } } } } # Don't attack your children NOT = { holder_scope = { is_child_of = ROOT } } # If you're the heir to this title and the defender is your parent, # don't attack them either. NOT = { AND = { current_heir = { character = ROOT } holder_scope = { any_child = { character = ROOT } } } } OR = { AND = { # AI vs. AI always has a virtual weak claim, but AI vs. player # requires a claim to use standard claim conditions OR = { ROOT = { has_claim = PREV } holder_scope = { ai = yes } } OR = { ROOT = { has_strong_claim = PREV } is_pretender = yes # Checks vs ROOT character: Attacker is pretender holder_scope = { has_regent = yes } AND = { OR = { ROOT = { is_female = no } holder_scope = { ai = yes } } holder_scope = { is_female = yes } } is_contested = yes # Is already being contested in some form of Claim or Succession War # Extended "weakness" conditions... current_heir = { character = ROOT } holder_scope = { is_rival = ROOT } ROOT = { any_pretender_title = { title = PREVPREV } } ROOT = { trait = lucky_ruler } holder_scope = { ai = yes OR = { trait = in_hiding trait = excommunicated trait = slow trait = imbecile trait = inbred trait = weak trait = lunatic trait = possessed trait = infirm trait = deaf trait = blinded trait = peasant_leader trait = heresiarch NOT = { reverse_opinion = { who = ROOT value = -35 } } } } holder_scope = { OR = { is_theocracy = yes is_republic = yes } } } } AND = { # If attacker has a claim on the title and owns at least 2 HRE # kingdoms while the defender is also AI and only owns the target # kingdom, we've got CB. Essentially, the conditions for pressing a # weak claim can be bypassed when might makes right-- but only vs. # AI targets. ROOT = { has_claim = PREV custom_tooltip = { text = emf_cb_debug_restore_hre_has_2plus_hre_titles hidden_tooltip = { any_demesne_title = { count = 2 tier = KING OR = { title = k_germany title = k_lotharingia title = k_france title = k_italy title = k_bavaria title = k_burgundy title = k_aquitaine } } } } } holder_scope = { ai = yes NOT = { any_demesne_title = { higher_tier_than = DUKE is_titular = no NOT = { title = PREVPREV } } } } } holder_scope = { # For AI targets, merely not being of the proper culture or # religion and holding this HRE kingdom is CB. For the # different-religion case, this is preferred to holy war, # because we'd rather take the kingdom whole and preserve its # vassals. ai = yes OR = { custom_tooltip = { text = emf_cb_debug_restore_hre_not_proper_religion hidden_tooltip = { NOR = { # Target not of proper HRE religion religion = catholic AND = { religion = fraticelli is_heretic = no } } } } custom_tooltip = { text = emf_cb_debug_restore_hre_not_proper_culture hidden_tooltip = { NOR = { # Target not of proper HRE culture culture_group = latin culture = occitan culture_group = central_germanic culture = italian culture_group = italian_group } } } } } AND = { # Target title has zero CA, attacker has medium CA in at least # one of their held HRE kingdoms. has_law = crown_authority_0 ROOT = { custom_tooltip = { text = emf_cb_debug_restore_hre_core_title_w_medium_ca_plus hidden_tooltip = { any_demesne_title = { tier = KING OR = { title = k_germany title = k_lotharingia title = k_france title = k_italy title = k_bavaria title = k_burgundy title = k_aquitaine } OR = { has_law = crown_authority_2 has_law = crown_authority_3 has_law = crown_authority_4 } } } } } } } # And, finally, do not try to take target titles whose # de jure borders are not "roughly" adjacent to your # de facto realm borders. Note that there's an ai_will_do # rule to prefer a perfect border condition that's # also not just via an isolated province. custom_tooltip = { text = emf_cb_debug_fuzzy_de_jure_adjacent_to_realm # FIXME: slightly incorrect tooltip hidden_tooltip = { any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { OR = { holder_scope = { # Inside target kingdom already same_realm = ROOT } location = { any_neighbor_province = { is_land = yes OR = { owner = { # Borders target kingdom directly same_realm = ROOT } any_neighbor_province = { owner = { # Is a land province away same_realm = ROOT } } } } } } } } } } emf_cb_can_use_title_trigger = yes } is_valid_title = { FROM = { has_landed_title = PREV } } on_add = { log = "CB(emf_restore_hre): START: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(emf_restore_hre): VICTORY: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes hidden_tooltip = { ROOT = { clr_character_flag = emf_cb_restore_hre set_character_flag = emf_cb_restore_hre clr_global_flag = emf_restore_hre_war_won set_global_flag = emf_restore_hre_war_won } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } FROM = { prestige = -200 } } on_success_title = { usurp_title_plus_barony_if_unlanded = { target = ROOT type = claim } FROM = { if = { limit = { any_realm_title = { lower_tier_than = DUKE NOT = { de_jure_liege_or_above = PREVPREV } } } any_demesne_title = { limit = { lower_tier_than = DUKE de_jure_liege_or_above = PREVPREV } emf_cb_latb_effect = yes usurp_title = { target = ROOT type = claim } } } } #if = { # limit = { not = { culture = ROOT } } # hidden_tooltip = { conquest_culture = ROOT } #} } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_restore_hre): WHITEPEACE: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" hidden_tooltip = { ROOT = { clr_character_flag = emf_cb_restore_hre set_character_flag = emf_cb_restore_hre } } ROOT = { prestige = -100 } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } on_reverse_demand = { log = "CB(emf_restore_hre): DEFEAT: title=[FromFrom.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes hidden_tooltip = { ROOT = { clr_character_flag = emf_cb_restore_hre set_character_flag = emf_cb_restore_hre } } ROOT = { prestige = -200 transfer_scaled_wealth = { to = FROM value = 4.0 } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } on_invalidation = { log = "CB(emf_restore_hre): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 4 modifier = { # Focus on the most core kingdom titles for traditional HRE formation factor = 1.25 OR = { title = k_italy AND = { ROOT = { has_landed_title = k_germany } title = k_lotharingia } } } modifier = { # The Karlings should gang-up on non-Karling title holders factor = 1.25 FROM = { NOT = { dynasty = 25061 } # not a Karling } ROOT = { dynasty = 25061 # a Karling } } modifier = { factor = 1.5 any_direct_de_jure_vassal_title = { any_direct_de_jure_vassal_title = { holder_scope = { same_realm = FROM } location = { any_neighbor_province = { owner = { same_realm = ROOT } any_neighbor_province = { owner = { same_realm = ROOT } } } } } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_special_religious = { name = CB_NAME_RELIGIOUS war_name = WAR_NAME_RELIGIOUS sprite = 9 truce_days = 3650 is_permanent = yes is_holy_war = yes can_ask_to_join_war = yes check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes allowed_to_target_tributaries = no allowed_to_target_suzerains = no infamy_modifier = 0.6 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { custom_tooltip = { text = emf_ctt_no_holy_war_cooldown hidden_tooltip = { OR = { has_global_flag = emf_no_cooldowns NOT = { has_character_modifier = emf_cb_mod_holy_war_cooldown } } } } OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes ROOT = { # All cases currently require different religion_group, but this may change NOT = { religion_group = FROM } } # Standard religious can_use: ROOT = { is_nomadic = no NOT = { same_realm = FROM } NOR = { mercenary = yes pacifist = yes religion = buddhist } OR = { # Allow reformed pagans NOT = { religion_group = pagan_group } is_reformed_religion = yes } OR = { # Hindus can only wage holy war on non-Indian rulers NOT = { religion = hindu } FROM = { NOT = { religion_group = indian_group } } } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { OR = { religion_group = muslim religion_group = pagan_group } NOT = { religion = FROM } } AND = { FROM = { religion = paulician } NOT = { religion = FROM } } } NOT = { is_reformed_religion = FROM } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } OR = { NOT = { religion_group = pagan_group } religion = ROOT } } } } can_use_title = { emf_cb_can_use_de_jure_title_trigger = yes # Can't holy war a duchy without at least one non-nomadic province in it any_direct_de_jure_vassal_title = { location = { any_province_holding = { NOT = { holding_type = nomad } } } } OR = { ROOT = { holy_order = yes } AND = { de_jure_liege = k_jerusalem ROOT = { has_landed_title = k_jerusalem } } } # The attacker needs at least one county in the target duchy, or a land # border, or to be within two sea zones from one of your counties (if # crossing seazones is allowed) OR = { any_direct_de_jure_vassal_title = { OR = { holder_scope = { OR = { character = ROOT is_liege_or_above = ROOT } } location = { owner = { OR = { character = FROM is_liege_or_above = FROM } } any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } AND = { OR = { # Can they cross sea zones? FROM = { religion_group = muslim } ROOT = { religion_group = muslim } AND = { ROOT = { religion_group = pagan_group } has_global_flag = pagan_ghws_unlocked } AND = { ROOT = { religion_group = christian } has_global_flag = christian_crusades_unlocked } } any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { is_land = no any_neighbor_province = { OR = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } AND = { is_land = no any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } } } } } } } is_valid = { ROOT = { NOT = { same_realm = FROM } NOR = { mercenary = yes pacifist = yes religion = buddhist } OR = { NOT = { religion_group = FROM } is_heresy_of = FROM is_parent_religion = FROM AND = { OR = { religion_group = muslim religion_group = pagan_group } NOT = { religion = FROM } } AND = { FROM = { religion = paulician } NOT = { religion = FROM } } NOT = { is_reformed_religion = FROM } } top_liege = { religion_group = ROOT NOT = { religion = FROM } OR = { religion = ROOT AND = { is_heretic = no ROOT = { is_heretic = no } } } } } } is_valid_title = { FROM = { any_realm_title = { de_jure_liege_or_above = PREVPREV } } } on_add = { if = { limit = { NOT = { has_global_flag = emf_no_cooldowns } } ROOT = { custom_tooltip = { text = emf_cb_ctt_holy_war_cooldown hidden_tooltip = { add_character_modifier = { name = emf_cb_mod_holy_war_cooldown duration = 1825 } } } } } } on_add_title = { log = "CB(emf_special_religious): START: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { emf_cb_holy_victory_effect = yes emf_imperial_decay_victory_effect = yes any_attacker = { limit = { character = ROOT } participation_scaled_piety = 50 participation_scaled_prestige = 150 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_piety = 100 participation_scaled_prestige = 150 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } } ROOT = { religion_authority = { modifier = won_holy_war years = 20 } } FROM = { religion_authority = { modifier = lost_holy_war years = 20 } } FROM = { piety = -100 } FROM = { prestige = -150 } } on_success_title = { log = "CB(emf_special_religious): VICTORY: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_latb_effect = yes pf_liege_change_under_title_begin_effect = yes custom_tooltip = { text = religious_cb_succ_tip hidden_tooltip = { ROOT = { vassalize_or_take_under_title = { title = PREV enemy = FROM same_religion = yes # Only vassalize rulers of my religion is_religious = yes } } } } pf_liege_change_under_title_end_effect = yes } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { ROOT = { piety = -50 prestige = -100 } } on_fail_title = { log = "CB(emf_special_religious): WHITEPEACE: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_reverse_demand = { emf_cb_holy_defeat_effect = yes emf_imperial_decay_loss_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } piety = -100 prestige = -150 } any_defender = { limit = { character = FROM } participation_scaled_piety = 200 participation_scaled_prestige = 200 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_piety = 200 participation_scaled_prestige = 200 if = { limit = { religion_group = muslim } participation_scaled_decadence = -10 } } } ROOT = { religion_authority = { modifier = lost_holy_war years = 20 } } FROM = { religion_authority = { modifier = won_holy_war years = 20 } } } on_reverse_demand_title = { log = "CB(emf_special_religious): DEFEAT: title=[This.GetID]: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_invalidation = { log = "CB(emf_special_religious): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } # ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character ai_will_do = { factor = 2 modifier = { # Prefer direct land borders factor = 1.5 any_direct_de_jure_vassal_title = { holder_scope = { OR = { character = FROM is_liege_or_above = FROM } } location = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } } } modifier = { factor = 10 FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } emf_subjugation = { name = CB_NAME_EMF_SUBJUGATION war_name = WAR_NAME_EMF_SUBJUGATION sprite = 16 truce_days = 1825 is_permanent = yes can_ask_to_join_war = yes allowed_to_target_tributaries = yes # Upon success, tributary relations are nullified allowed_to_target_suzerains = no # really not a very big deal-- defender's entire realm is already a rightful part of the attacker realm. also, usage # of the CB to increase infamy_modifier = 0.15 can_use_gui = { emf_cb_can_use_gui_trigger = yes } # Cannot seem to get even a ROOT = { always = no } # can_use_gui to prevent war declaration, even though # tooltip shows that the conditions are not met. # # Truly mysterious, but there's probably something weird about this CB and can_use_gui that I do not understand. # # FIXME: Retry can_use_gui. Above note was from patch 2.3. Stuff gets fixed. can_use = { emf_cb_can_use_trigger = yes # BEGIN: what should ideally go in can_use_gui (well, with some updated CTTs, as this has aged a bit now) ROOT = { # Tribal/nomadic rulers do not recognize the notion of de jure vassalage, so they don't get to use # this force-de-jure-fealty CB. is_tribal = no is_nomadic = no religion_group = FROM # This does indeed mean pagans may use this CB on unrelated-religion pagans NOR = { is_heresy_of = FROM is_parent_religion = FROM } } FROM = { in_revolt = no OR = { lower_tier_than = DUKE AND = { tier = DUKE custom_tooltip = { text = emf_cb_ctt_defender_affected_by_your_medium_ca hidden_tooltip = { crownlaw_title = { owner_under_ROOT = yes OR = { has_law = crown_authority_2 has_law = crown_authority_3 has_law = crown_authority_4 } } } } } AND = { tier = KING custom_tooltip = { text = emf_cb_ctt_defender_affected_by_your_high_ca hidden_tooltip = { crownlaw_title = { owner_under_ROOT = yes OR = { has_law = crown_authority_3 has_law = crown_authority_4 } } } } } } } # END: what should ideally go in can_use_gui ROOT = { higher_tier_than = FROM OR = { independent = yes AND = { same_liege = FROM FROM = { OR = { higher_tier_than = COUNT NOT = { primary_title = { dejure_liege_title = { owner = { OR = { is_liege_or_above = ROOT is_vassal_or_below = ROOT } } } } } } } } } mercenary = no } FROM = { # Nomads cannot be [safely] vassalized (and an appropriate such war target could never arise) is_nomadic = no # Can use this on MRs but not regular patricians (can't vassalize regular patricians) OR = { is_merchant_republic = yes is_patrician = no } # Not possible to [safely] vassalize revolters in_revolt = no # Cannot target rebels (i.e., provincial rebels or e_rebels/e_pirates-- not same as *revolters*) rebel = no # No temporary titles (cannot be vassalized, IIRC, but in any case, we also don't want to allow it) NOT = { any_demesne_title = { temporary = yes } } # NOTE: All other types of landless-type title holders are fine if ROOT is actually de jure liege to # their entire realm, including said landless titles (see magic below). } FROM = { # All of FROM's realm counties must be de jure vassal to some title under ROOT, and all of FROM's # realm settlements/baronies must be the same, unless those titles happen to be under an MR or an HO. NOT = { any_realm_title = { OR = { tier = COUNT AND = { tier = BARON owner = { NOR = { is_merchant_republic = yes any_liege = { is_merchant_republic = yes } holy_order = yes any_liege = { holy_order = yes } } } } } NOT = { any_de_jure_liege_title = { owner_under_ROOT = yes } } } } # All of FROM's held DUKE+ landless-type titles must be de jure vassal to some title under ROOT. # Allows the subjugation of *de jure vassal* holy orders, mercenaries, religious heads, and such # without worrying about landless-type titles that are below DUKE-tier (e.g., family palaces) being # de jure. NOT = { any_demesne_title = { is_landless_type_title = yes higher_tier_than = COUNT NOT = { any_de_jure_liege_title = { owner_under_ROOT = yes } } } } } } is_valid = { # + If the religious relations required for DoW change during the war, it shall not invalidate the war. # + While we do not require the entire realm of FROM to remain de jure vassal to ROOT after war has # been declared, we do still enforce the invariants regarding de jure vassal landless-type titles. ROOT = { OR = { independent = yes same_liege = FROM } higher_tier_than = FROM } FROM = { is_nomadic = no OR = { is_merchant_republic = yes is_patrician = no } in_revolt = no rebel = no NOT = { any_demesne_title = { temporary = yes } } NOT = { any_demesne_title = { is_landless_type_title = yes higher_tier_than = COUNT NOT = { any_de_jure_liege_title = { owner_under_ROOT = yes } } } } } } on_add = { log = "CB(emf_subjugation): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" # Cancel any suzerainty status, as this CB allows targeting tributaries. FROM = { emf_remove_suzerain_under_ROOT = yes } } on_success = { log = "CB(emf_subjugation): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes if = { limit = { FROM = { tier = BARON } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 25 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 25 } } } if = { limit = { FROM = { tier = COUNT } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 50 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 50 } } } if = { limit = { FROM = { tier = DUKE } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 100 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 100 } } } if = { limit = { FROM = { tier = KING } } any_attacker = { limit = { character = ROOT } participation_scaled_prestige = 200 } any_attacker = { limit = { NOT = { character = ROOT } } hidden_tooltip = { participation_scaled_prestige = 200 } } } FROM = { emf_ROOT_subjugate_ruler_effect = yes # IDEA: actually make the subjugation event-based, to allow the subjugated to choose a reaction and # flavorfully reflect the fact that this CB, by its nature, is merely forcing a rightful vassal # (from the perspective of the subjugator) to swear fealty. indeed, it may even be appropriate for # the subjugator to potentially choose to pay some portion of war reparations. if the subjugated # ruler reacts poorly to the forced oath of fealty (and potential lack of reparations), then we can # give them an inherited TOM which makes them far more likely to seek independence at their next # opportunity (and other such things). oh, another thing that ROOT might choose to do here is to # renounce any claims he may have upon the titles of FROM. # # while I'm tossing around ideas in the comments here, it's worth noting that I'd eventually like # to replace the 'Offer Vassalization' diplo-action with a targeted_decision and then only allow use # of this CB if a diplomatic vassalization attempt has already been recently made and rejected. # however, comprehensive gating of all CBs while the AI is attempting the 'mission' to diplo- # vassalize a de jure vassal would also be required (quite easy with our current CB infrastructure). } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(emf_subjugation): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -25 } FROM = { prestige = 25 } } on_reverse_demand = { log = "CB(emf_subjugation): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { transfer_scaled_wealth = { to = FROM value = 4.0 } } if = { limit = { ROOT = { tier = COUNT } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 50 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 50 } } } if = { limit = { ROOT = { tier = DUKE } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 100 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 100 } } } if = { limit = { ROOT = { tier = KING } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 200 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 200 } } } if = { limit = { ROOT = { tier = EMPEROR } } any_defender = { limit = { character = FROM } participation_scaled_prestige = 400 } any_defender = { limit = { NOT = { character = FROM } } hidden_tooltip = { participation_scaled_prestige = 400 } } } } on_invalidation = { log = "CB(emf_subjugation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 modifier = { factor = 0.75 # Defender respects the notion of rightful de jure vassalage FROM = { is_feudal = yes } } } ai_will_do = { factor = 1 # Prefer using this [essentially peaceful] CB generally modifier = { factor = 1.1 always = yes } # Greatly prefer to use this CB rather than alternatives # (which likely will usurp titles) when the attacker # and defender both do not dislike each other modifier = { factor = 4 # FIXME: check whether `as_if_liege = yes` works with regular `opinion` and not just `opinion_diff` FROM = { opinion = { who = ROOT value = 0 } } ROOT = { opinion = { who = FROM value = 0 } } } # If ROOT likes FROM a LOT, you'd think: definitely _do not_ use the CB, but lack of such modifiers in other # CBs would make this incoherent, because then ROOT'll just likely use a CB upon FROM which will usurp # at least some of their titles). # If ROOT likes FROM, prefer to use this CB (and if FROM doesn't dislike ROOT, *definitely* prefer it -- 6.6) modifier = { factor = 1.5 ROOT = { opinion = { who = FROM value = 20 } } } modifier = { factor = 10 # Could reach 66, which is perfectly fine FROM = { ai = no } had_global_flag = { flag = EMF days = 730 } } } } ### PB STUFF FROM HERE ### minor_conquest = { name = CB_NAME_MINOR_CONQUEST war_name = WAR_NAME_MINOR_CONQUEST sprite = 8 truce_days = 1825 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = no can_call_allies = no coalition_threat = no #check_de_jure_tier = COUNT # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes infamy_modifier = 0 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes has_global_flag = emf_rapid_conquest ROOT = { primary_title = { is_primary_type_title = no } # EMF: k_orthodox and k_papal_state, e.g., can't use this NOT = { num_of_count_titles = 8 } OR = { NOT = { num_of_count_titles = 5 } AND = { capital_scope = { any_neighbor_province = { owner = { OR = { character = FROM is_liege_or_above = FROM } } } } lower_tier_than = DUKE } } independent = yes OR = { NOT = { any_vassal = { tier = COUNT } } capital_scope = { any_neighbor_province = { owner = { OR = { character = FROM is_liege_or_above = FROM } } } } } } FROM = { NOT = { num_of_count_titles = 3 } any_realm_province = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } NOT = { any_demesne_title = { temporary = yes } } } } on_add = { log = "CB(minor_conquest): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(minor_conquest): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { prestige = 100 } FROM = { prestige = -100 any_demesne_title = { limit = { tier = COUNT } emf_cb_latb_effect = yes usurp_title = { target = ROOT type = invasion } } any_realm_lord = { any_demesne_title = { limit = { tier = COUNT } emf_cb_latb_effect = yes usurp_title = { target = ROOT type = invasion } } } } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(minor_conquest): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -25 } } on_reverse_demand = { log = "CB(minor_conquest): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -50 transfer_scaled_wealth = { to = FROM value = 2.0 } } FROM = { prestige = 50 } } on_invalidation = { log = "CB(minor_conquest): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } subjugation = { name = CB_NAME_SUBJUGATION war_name = WAR_NAME_SUBJUGATION sprite = 8 truce_days = 1825 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = no can_call_allies = no coalition_threat = no infamy_modifier = 0 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes has_global_flag = emf_rapid_conquest ROOT = { independent = yes higher_tier_than = COUNT primary_title = { is_primary_type_title = no } # EMF: e.g., k_orthodox can't use this } FROM = { OR = { tier = COUNT NOT = { realm_size = 10 } } any_realm_province = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } NOT = { # EMF: Can't subjugate higher-tier landless characters (k_orthodox, etc.) or revolters primary_title = { is_primary_type_title = yes } any_demesne_title = { temporary = yes } is_nomadic = yes } } } on_add = { log = "CB(subjugation): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(subjugation): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { prestige = 100 } FROM = { prestige = -100 any_demesne_title = { limit = { NOT = { lower_tier_than = ROOT } } usurp_title = { target = ROOT type = invasion } } emf_ROOT_subjugate_ruler_effect = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(subjugation): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -25 } } on_reverse_demand = { log = "CB(subjugation): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -50 transfer_scaled_wealth = { to = FROM value = 2.0 } } FROM = { prestige = 50 } } on_invalidation = { log = "CB(subjugation): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } } subjugation_duke = { name = CB_NAME_SUBJUGATION war_name = WAR_NAME_SUBJUGATION sprite = 8 truce_days = 1825 hostile_against_others = yes is_permanent = yes can_ask_to_join_war = no can_call_allies = no coalition_threat = no infamy_modifier = 0 can_use_gui = { emf_cb_can_use_gui_trigger = yes ROOT = { OR = { is_patrician = no custom_tooltip = { text = emf_mr_ctt_extended_cbs_unlocked hidden_tooltip = { has_global_flag = emf_mr_cbs_unlocked } } } } } can_use = { emf_cb_can_use_trigger = yes has_global_flag = emf_rapid_conquest ROOT = { higher_tier_than = DUKE independent = yes } FROM = { tier = DUKE any_realm_province = { any_neighbor_province = { owner = { OR = { character = ROOT is_liege_or_above = ROOT } } } } NOT = { realm_size = 20 } NOT = { primary_title = { is_primary_type_title = yes } any_demesne_title = { temporary = yes } } } } on_add = { log = "CB(subjugation_duke): START: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } on_success = { log = "CB(subjugation_duke): VICTORY: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_victory_effect = yes ROOT = { prestige = 100 } FROM = { prestige = -100 emf_ROOT_subjugate_ruler_effect = yes } } on_success_posttitle = { emf_cb_on_success_posttitle_effect = yes } on_fail = { log = "CB(subjugation_duke): WHITEPEACE: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" ROOT = { prestige = -25 } } on_reverse_demand = { log = "CB(subjugation_duke): DEFEAT: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" emf_cb_defeat_effect = yes ROOT = { prestige = -50 transfer_scaled_wealth = { to = FROM value = 2.0 } } FROM = { prestige = 50 } } on_invalidation = { log = "CB(subjugation_duke): INVALIDATED: [Root.GetTitledFirstName] of [Root.PrimaryTitle.GetBaseName] ([Root.GetID]/[Root.PrimaryTitle.GetID]) vs. [From.GetTitledFirstName] of [From.PrimaryTitle.GetBaseName] ([From.GetID]/[From.PrimaryTitle.GetID])" } attacker_ai_victory_worth = { factor = -1 # always accept } attacker_ai_defeat_worth = { factor = 100 } defender_ai_victory_worth = { factor = -1 # always accept } defender_ai_defeat_worth = { factor = 100 } }